Update USAGE for streaming API changes #604

pull/632/head
nick black 4 years ago
parent d1b5a39135
commit 168ec1e71d
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -2432,7 +2432,9 @@ typedef enum {
// Called for each frame rendered from 'ncv'. If anything but 0 is returned,
// the streaming operation ceases immediately, and that value is propagated out.
typedef int (*streamcb)(struct notcurses*, struct ncvisual*, void*);
// The recommended absolute display time target is passed in 'tspec'.
typedef int (*streamcb)(struct notcurses*, struct ncvisual*,
const struct timespec* tspec, void*);
// Can we load images/videos? This requires being built against FFmpeg.
bool notcurses_canopen(const struct notcurses* nc);
@ -2471,7 +2473,8 @@ int ncvisual_render(const struct ncvisual* ncv, int begy, int begx, int leny, in
// If you'd like subtitles to be decoded, provide an ncplane as the curry. If the
// curry is NULL, subtitles will not be displayed.
static inline int
ncvisual_simple_streamer(struct notcurses* nc, struct ncvisual* ncv, void* curry){
ncvisual_simple_streamer(struct notcurses* nc, struct ncvisual* ncv,
const struct timespec* tspec void* curry){
if(notcurses_render(nc)){
return -1;
}
@ -2487,6 +2490,7 @@ ncvisual_simple_streamer(struct notcurses* nc, struct ncvisual* ncv, void* curry
free(subtitle);
}
}
clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, tspec, NULL);
return ret;
}

@ -2151,9 +2151,9 @@ API char* ncvisual_subtitle(const struct ncvisual* ncv);
// Called for each frame rendered from 'ncv'. If anything but 0 is returned,
// the streaming operation ceases immediately, and that value is propagated out.
// The recommended display time is passed in 'tspec'.
typedef int (*streamcb)
(struct notcurses*, struct ncvisual*, const struct timespec*, void*);
// The recommended absolute display time target is passed in 'tspec'.
typedef int (*streamcb)(struct notcurses*, struct ncvisual*,
const struct timespec*, void*);
// Shut up and display my frames! Provide as an argument to ncvisual_stream().
// If you'd like subtitles to be decoded, provide an ncplane as the curry. If the

Loading…
Cancel
Save