tag demos requiring ffmpeg

pull/327/head
nick black 4 years ago
parent 959b2b8d70
commit 01bc543399
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -61,6 +61,7 @@ At any time, press 'q' to quit. The demo is best run in at least a 80x45 termina
demospec: Select which demos to run, and what order to run them in. The default is **ixetbcgpwuvlfsjo**. See above for a list of demos. demospec: Select which demos to run, and what order to run them in. The default is **ixetbcgpwuvlfsjo**. See above for a list of demos.
# NOTES # NOTES
Proper display requires: Proper display requires:
* A terminal advertising the **rgb** terminfo(5) capability, or that the environment variable **COLORTERM** is defined to **24bit** (and that the terminal honors this variable), * A terminal advertising the **rgb** terminfo(5) capability, or that the environment variable **COLORTERM** is defined to **24bit** (and that the terminal honors this variable),
@ -72,10 +73,10 @@ non-free under the Debian Free Software Guidelines. As a result, the
**chunli**, **eagle**, **fallin'**, **jungle**, **luigi**, and **view** demos **chunli**, **eagle**, **fallin'**, **jungle**, **luigi**, and **view** demos
are unavailable through the Debian package. are unavailable through the Debian package.
# BUGS If notcurses is built without FFmpeg, the **chunli**, **eagle**, **fallin'**,
**outro**, **view**, and **xray** demos will be unavailable.
If notcurses is built without FFmpeg, the following demos will fail immedaitely when specified: **xray**, # BUGS
**eagle**, **chunli**, **fallin'**, **view**, **outro**.
# AUTHORS # AUTHORS
@ -83,7 +84,8 @@ If notcurses is built without FFmpeg, the following demos will fail immedaitely
* Images from Street Fighter II and Mega Man 2 copyright Capcom of America. * Images from Street Fighter II and Mega Man 2 copyright Capcom of America.
* Images from Super Mario Bros. copyright Nintendo of America. * Images from Super Mario Bros. copyright Nintendo of America.
* Images from Ninja Gaiden copyright Koei Tecmo America. * Images from Ninja Gaiden copyright Koei Tecmo America.
* "Jungle with Rain" and "Ruins with Rain" copyright Mark Ferrari. * Images from Final Fantasy copyright Square Enix Co Ltd.
* "Jungle with Rain" and "Ruins with Rain" copyright Mark Ferrari/Living Worlds.
# SEE ALSO # SEE ALSO
notcurses(3notcurses), ncurses(3ncurses), terminfo(5) notcurses(3notcurses), ncurses(3ncurses), terminfo(5)

@ -21,10 +21,14 @@ static demoresult* results;
static char datadir[PATH_MAX]; static char datadir[PATH_MAX];
static atomic_bool interrupted = ATOMIC_VAR_INIT(false); static atomic_bool interrupted = ATOMIC_VAR_INIT(false);
#ifndef DFSG_BUILD #ifdef DISABLE_FFMPEG
static const char DEFAULT_DEMO[] = "ixetbcgpwuvlfsjo"; static const char DEFAULT_DEMO[] = "itbgpwus";
#else #else
#ifdef DFSG_BUILD
static const char DEFAULT_DEMO[] = "ixtbgpwuso"; static const char DEFAULT_DEMO[] = "ixtbgpwuso";
#else
static const char DEFAULT_DEMO[] = "ixetbcgpwuvlfsjo";
#endif
#endif #endif
void interrupt_demo(void){ void interrupt_demo(void){
@ -71,40 +75,53 @@ struct timespec demodelay = {
.tv_nsec = 0, .tv_nsec = 0,
}; };
// anything that's dfsg non-free requires ncvisual (i.e. it's all multimedia),
// so also check for FFMPEG_DISABLE here in DFSG_BUILD
#ifndef DFSG_BUILD #ifndef DFSG_BUILD
#define NONFREE(name, fxn) { name, fxn, }, #ifndef DISABLE_FFMPEG
#define NONFREE(name, fxn) { name, fxn, }
#endif
#endif
#ifndef NONFREE
#define NONFREE(name, fxn) { NULL, NULL, }
#endif
#ifndef DISABLE_FFMPEG
#define FREEFFMPEG(name, fxn) { name, fxn, }
#else #else
#define NONFREE(name, fxn) { NULL, NULL, }, #define FREEFFMPEG(name, fxn) { NULL, NULL, }
#endif #endif
// define with NONFREE() to exempt from any DFSG or non-FFmpeg build. define
// with FREEFFMPEG() to exempt from any non-FFmpeg build.
static struct { static struct {
const char* name; const char* name;
int (*fxn)(struct notcurses*); int (*fxn)(struct notcurses*);
} demos[26] = { } demos[26] = {
{ NULL, NULL, }, { NULL, NULL, },
{ "box", box_demo, }, { "box", box_demo, },
NONFREE("chunli", chunli_demo) NONFREE("chunli", chunli_demo),
{ NULL, NULL, }, { NULL, NULL, },
NONFREE("eagle", eagle_demo) NONFREE("eagle", eagle_demo),
NONFREE("fallin'", fallin_demo) NONFREE("fallin'", fallin_demo),
{ "grid", grid_demo, }, { "grid", grid_demo, },
{ NULL, NULL, }, { NULL, NULL, },
{ "intro", intro, }, { "intro", intro, },
NONFREE("jungle", jungle_demo) NONFREE("jungle", jungle_demo),
{ NULL, NULL, }, { NULL, NULL, },
NONFREE("luigi", luigi_demo) NONFREE("luigi", luigi_demo),
{ NULL, NULL, }, { NULL, NULL, },
{ NULL, NULL, }, { NULL, NULL, },
{ "outro", outro, }, FREEFFMPEG("outro", outro),
{ "panelreel", panelreel_demo, }, { "panelreel", panelreel_demo, },
{ NULL, NULL, }, { NULL, NULL, },
{ NULL, NULL, }, { NULL, NULL, },
{ "sliders", sliding_puzzle_demo, }, { "sliders", sliding_puzzle_demo, },
{ "trans", trans_demo, }, { "trans", trans_demo, },
{ "uniblock", unicodeblocks_demo, }, { "uniblock", unicodeblocks_demo, },
NONFREE("view", view_demo) NONFREE("view", view_demo),
{ "whiteout", witherworm_demo, }, { "whiteout", witherworm_demo, },
{ "xray", xray_demo, }, FREEFFMPEG("xray", xray_demo),
{ NULL, NULL, }, { NULL, NULL, },
{ NULL, NULL, }, { NULL, NULL, },
}; };
@ -359,7 +376,9 @@ summary_table(struct ncdirect* nc, const char* spec){
fprintf(stderr, "\nError running demo. Is \"%s\" the correct data path?\n", datadir); fprintf(stderr, "\nError running demo. Is \"%s\" the correct data path?\n", datadir);
} }
#ifdef DFSG_BUILD #ifdef DFSG_BUILD
fprintf(stderr, "DFSG version. Some demos are missing.\n"); ncdirect_fg_rgb8(nc, 0xfe, 0x20, 0x76); // PANTONE Strong Red C + 3x0x20
fflush(stdout); // in case we print to stderr below, we want color from above
fprintf(stderr, "\nDFSG version. Some demos are missing.\n");
#endif #endif
return failed; return failed;
} }

@ -94,7 +94,9 @@ typedef struct ncvisual {
int placex, placey; int placex, placey;
ncscale_e style; // none, scale, or stretch ncscale_e style; // none, scale, or stretch
struct notcurses* ncobj; // set iff this ncvisual "owns" its ncplane struct notcurses* ncobj; // set iff this ncvisual "owns" its ncplane
#ifndef DISABLE_FFMPEG
AVSubtitle subtitle; AVSubtitle subtitle;
#endif
} ncvisual; } ncvisual;
// current presentation state of the terminal. it is carried across render // current presentation state of the terminal. it is carried across render

@ -570,11 +570,12 @@ int ncvisual_render(const ncvisual* ncv, int begy, int begx, int leny, int lenx)
return -1; return -1;
} }
int ncvisual_stream(notcurses* nc, ncvisual* ncv, int* averr, int ncvisual_stream(struct notcurses* nc, struct ncvisual* ncv, int* averr,
streamcb streamer, void* curry){ float timespec, streamcb streamer, void* curry){
(void)nc; (void)nc;
(void)ncv; (void)ncv;
(void)averr; (void)averr;
(void)timespec;
(void)streamer; (void)streamer;
(void)curry; (void)curry;
return -1; return -1;

@ -744,6 +744,7 @@ void notcurses_reset_stats(notcurses* nc, ncstats* stats){
// Convert a notcurses log level to its ffmpeg equivalent. // Convert a notcurses log level to its ffmpeg equivalent.
static int static int
ffmpeg_log_level(ncloglevel_e level){ ffmpeg_log_level(ncloglevel_e level){
#ifndef DISABLE_FFMPEG
switch(level){ switch(level){
case NCLOGLEVEL_SILENT: return AV_LOG_QUIET; case NCLOGLEVEL_SILENT: return AV_LOG_QUIET;
case NCLOGLEVEL_PANIC: return AV_LOG_PANIC; case NCLOGLEVEL_PANIC: return AV_LOG_PANIC;
@ -758,6 +759,9 @@ ffmpeg_log_level(ncloglevel_e level){
} }
fprintf(stderr, "Invalid log level: %d\n", level); fprintf(stderr, "Invalid log level: %d\n", level);
return AV_LOG_TRACE; return AV_LOG_TRACE;
#else
return level;
#endif
} }
ncdirect* notcurses_directmode(const char* termtype, FILE* outfp){ ncdirect* notcurses_directmode(const char* termtype, FILE* outfp){

Loading…
Cancel
Save