summaryrefslogtreecommitdiff
path: root/taro/tests/notcurses_ffmpeg.c
blob: 342d115f19ff05715d053d6af6180bfa147fdb89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <al/types.h>
#include <nnwt/common.h>
#include <notcurses/notcurses.h>
#include <notcurses/nckeys.h>

s32 main(void)
{
    if (!nn_common_init(NULL)) return EXIT_FAILURE;

    struct notcurses *nc = notcurses_init(NULL, stdin);

    struct ncplane_options nopts = { 0 };
    nopts.cols = 25;
    nopts.rows = 15;
    nopts.x = 0;
    nopts.y = 0;
    struct ncplane *p = ncplane_create(notcurses_stdplane(nc), &nopts);

    //struct ncvisual *v = ncvisual_from_file("/home/andrew/c/mauri/workshop_wallpapers_11-8-21/2025095336/preview.gif");
    struct ncvisual *v = ncvisual_from_file("/home/andrew/dl/mp4/This is FRIED [svlczpgt2m3d1].mp4");
    if (!v) goto out;
    struct ncvisual_options vopts = { 0 };
    vopts.scaling = NCSCALE_SCALE;
    vopts.blitter = NCBLIT_PIXEL;
    vopts.n = p;

    ncvisual_stream(nc, v, 1.0f, NULL, &vopts, NULL);

out:
    notcurses_stop(nc);

    nn_common_close();

    return EXIT_SUCCESS;
}