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.
# NOTES
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),
@ -72,10 +73,10 @@ non-free under the Debian Free Software Guidelines. As a result, the
**chunli**, **eagle**, **fallin'**, **jungle**, **luigi**, and **view** demos
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**,
**eagle**, **chunli**, **fallin'**, **view**, **outro**.
# BUGS
# 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 Super Mario Bros. copyright Nintendo of 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
notcurses(3notcurses), ncurses(3ncurses), terminfo(5)

@ -21,10 +21,14 @@ static demoresult* results;
static char datadir[PATH_MAX];
static atomic_bool interrupted = ATOMIC_VAR_INIT(false);
#ifndef DFSG_BUILD
static const char DEFAULT_DEMO[] = "ixetbcgpwuvlfsjo";
#ifdef DISABLE_FFMPEG
static const char DEFAULT_DEMO[] = "itbgpwus";
#else
#ifdef DFSG_BUILD
static const char DEFAULT_DEMO[] = "ixtbgpwuso";
#else
static const char DEFAULT_DEMO[] = "ixetbcgpwuvlfsjo";
#endif
#endif
void interrupt_demo(void){
@ -71,40 +75,53 @@ struct timespec demodelay = {
.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
#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
#define NONFREE(name, fxn) { NULL, NULL, },
#define FREEFFMPEG(name, fxn) { NULL, NULL, }
#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 {
const char* name;
int (*fxn)(struct notcurses*);
} demos[26] = {
{ NULL, NULL, },
{ "box", box_demo, },
NONFREE("chunli", chunli_demo)
NONFREE("chunli", chunli_demo),
{ NULL, NULL, },
NONFREE("eagle", eagle_demo)
NONFREE("fallin'", fallin_demo)
NONFREE("eagle", eagle_demo),
NONFREE("fallin'", fallin_demo),
{ "grid", grid_demo, },
{ NULL, NULL, },
{ "intro", intro, },
NONFREE("jungle", jungle_demo)
NONFREE("jungle", jungle_demo),
{ NULL, NULL, },
NONFREE("luigi", luigi_demo)
NONFREE("luigi", luigi_demo),
{ NULL, NULL, },
{ NULL, NULL, },
{ "outro", outro, },
FREEFFMPEG("outro", outro),
{ "panelreel", panelreel_demo, },
{ NULL, NULL, },
{ NULL, NULL, },
{ "sliders", sliding_puzzle_demo, },
{ "trans", trans_demo, },
{ "uniblock", unicodeblocks_demo, },
NONFREE("view", view_demo)
NONFREE("view", view_demo),
{ "whiteout", witherworm_demo, },
{ "xray", xray_demo, },
FREEFFMPEG("xray", xray_demo),
{ 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);
}
#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
return failed;
}

@ -94,7 +94,9 @@ typedef struct ncvisual {
int placex, placey;
ncscale_e style; // none, scale, or stretch
struct notcurses* ncobj; // set iff this ncvisual "owns" its ncplane
#ifndef DISABLE_FFMPEG
AVSubtitle subtitle;
#endif
} ncvisual;
// 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;
}
int ncvisual_stream(notcurses* nc, ncvisual* ncv, int* averr,
streamcb streamer, void* curry){
int ncvisual_stream(struct notcurses* nc, struct ncvisual* ncv, int* averr,
float timespec, streamcb streamer, void* curry){
(void)nc;
(void)ncv;
(void)averr;
(void)timespec;
(void)streamer;
(void)curry;
return -1;

@ -744,6 +744,7 @@ void notcurses_reset_stats(notcurses* nc, ncstats* stats){
// Convert a notcurses log level to its ffmpeg equivalent.
static int
ffmpeg_log_level(ncloglevel_e level){
#ifndef DISABLE_FFMPEG
switch(level){
case NCLOGLEVEL_SILENT: return AV_LOG_QUIET;
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);
return AV_LOG_TRACE;
#else
return level;
#endif
}
ncdirect* notcurses_directmode(const char* termtype, FILE* outfp){

Loading…
Cancel
Save