15. H264 Video
15.1. Worgle Code Blocks
<<gfx_scheme_functions>>=
#ifdef MONOLITH_H264
<<h264_scheme_functions>>
#endif
<<gfx_scheme_entries>>=
#ifdef MONOLITH_H264
<<h264_scheme_entries>>
#endif
<<gfx_janet>>=
#ifdef MONOLITH_H264
<<h264_janet_functions>>
#endif
<<gfx_janet_entries>>=
#ifdef MONOLITH_H264
<<h264_janet_entries>>
#endif
15.2. Interface
15.2.1. Begin
15.2.1.1. begin in scheme
<<h264_scheme_entries>>=
{"monolith:h264-begin", pp_h264_begin, 2, 2, {STR,INT,___}},
<<h264_scheme_functions>>=
static cell pp_h264_begin(cell p)
{
int fps;
const char *filename;
monolith_d *m;
monolith_h264 *vid;
monolith_framebuffer *fb;
char *name = "monolith:gfx-setsize";
filename = string(car(p));
p = cdr(p);
fps = integer_value(name, car(p));
m = monolith_data_get();
fb = monolith_fb_get(m);
vid = monolith_h264_get(m);
if(fb != NULL) {
monolith_h264_begin(vid, fb, filename, fps);
}
return UNSPECIFIC;
}
15.2.1.2. begin in janet
<<h264_janet_functions>>=
static Janet j_h264_begin(int32_t argc, Janet *argv)
{
int fps;
const char *filename;
monolith_d *m;
monolith_h264 *vid;
monolith_framebuffer *fb;
janet_fixarity(argc, 2);
filename = (const char *)janet_unwrap_string(argv[0]);
fps = janet_unwrap_integer(argv[1]);
m = monolith_data_get();
fb = monolith_fb_get(m);
vid = monolith_h264_get(m);
if(fb != NULL) {
monolith_h264_begin(vid, fb, filename, fps);
}
return janet_wrap_nil();
}
<<h264_janet_entries>>=
{
"monolith/h264-begin",
j_h264_begin,
"begin h264 video."
},
15.2.2. Append
15.2.2.1. append in scheme
<<h264_scheme_entries>>=
{"monolith:h264-append", pp_h264_append, 0, 0, {___,___,___}},
<<h264_scheme_functions>>=
static cell pp_h264_append(cell p)
{
monolith_d *m;
monolith_h264 *vid;
monolith_framebuffer *fb;
m = monolith_data_get();
fb = monolith_fb_get(m);
vid = monolith_h264_get(m);
if(fb != NULL) {
monolith_h264_append(vid, fb);
}
return UNSPECIFIC;
}
15.2.2.2. append in janet
<<h264_janet_functions>>=
static Janet j_h264_append(int32_t argc, Janet *argv)
{
monolith_d *m;
monolith_h264 *vid;
monolith_framebuffer *fb;
janet_fixarity(argc, 0);
m = monolith_data_get();
fb = monolith_fb_get(m);
vid = monolith_h264_get(m);
monolith_h264_append(vid, fb);
return janet_wrap_nil();
}
<<h264_janet_entries>>=
{
"monolith/h264-append",
j_h264_append,
"h264 frame."
},
15.2.3. End
15.2.3.1. end in scheme
<<h264_scheme_entries>>=
{"monolith:h264-end", pp_h264_end, 0, 0, {___,___,___}},
<<h264_scheme_functions>>=
static cell pp_h264_end(cell p)
{
monolith_d *m;
monolith_h264 *vid;
m = monolith_data_get();
vid = monolith_h264_get(m);
monolith_h264_end(vid);
return UNSPECIFIC;
}
15.2.3.2. end in janet
<<h264_janet_functions>>=
static Janet j_h264_end(int32_t argc, Janet *argv)
{
monolith_d *m;
monolith_h264 *vid;
janet_fixarity(argc, 0);
m = monolith_data_get();
vid = monolith_h264_get(m);
monolith_h264_end(vid);
return janet_wrap_nil();
}
<<h264_janet_entries>>=
{
"monolith/h264-end",
j_h264_end,
"ends h264 video."
},
prev | home | next