History

avfilter/f_graphmonitor: also show link EOF status in blue

Paul B Mahol committed 6 years ago

Commit e417f841 parent 57915df2 files · +12 −0Browse files

Showing the changes to libavfilter (1 of 2 files). Show all

Unified · Split

libavfilter/f_graphmonitor.c+9−0
@@ -47,6 +47,7 @@ typedef struct GraphMonitorContext { · 46 unmodified lines
4747 uint8_t yellow[4];
4848 uint8_t red[4];
4949 uint8_t green[4];
50+ uint8_t blue[4];
5051 uint8_t bg[4];
5152 } GraphMonitorContext;
5253
@@ -60,6 +61,7 @@ enum { · 7 unmodified lines
6061 MODE_FMT = 1 << 6,
6162 MODE_SIZE = 1 << 7,
6263 MODE_RATE = 1 << 8,
64+ MODE_EOF = 1 << 9,
6365 };
6466
6567 #define OFFSET(x) offsetof(GraphMonitorContext, x)
@@ -85,6 +87,7 @@ static const AVOption graphmonitor_options[] = { · 19 unmodified lines
8587 { "format", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_FMT}, 0, 0, VF, "flags" },
8688 { "size", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_SIZE}, 0, 0, VF, "flags" },
8789 { "rate", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_RATE}, 0, 0, VF, "flags" },
90+ { "eof", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_EOF}, 0, 0, VF, "flags" },
8891 { "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, VF },
8992 { "r", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, VF },
9093 { NULL }
@@ -236,6 +239,11 @@ static void draw_items(AVFilterContext *ctx, AVFrame *out, · 145 unmodified lines
236239 drawtext(out, xpos, ypos, buffer, s->white);
237240 xpos += strlen(buffer) * 8;
238241 }
242+ if (s->flags & MODE_EOF && ff_outlink_get_status(l)) {
243+ snprintf(buffer, sizeof(buffer)-1, " | eof");
244+ drawtext(out, xpos, ypos, buffer, s->blue);
245+ xpos += strlen(buffer) * 8;
246+ }
239247 }
240248
241249 static int create_frame(AVFilterContext *ctx, int64_t pts)
@@ -352,6 +360,7 @@ static int config_output(AVFilterLink *outlink) · 110 unmodified lines
352360 s->yellow[0] = s->yellow[1] = 255;
353361 s->red[0] = 255;
354362 s->green[1] = 255;
363+ s->blue[2] = 255;
355364 s->pts = AV_NOPTS_VALUE;
356365 s->next_pts = AV_NOPTS_VALUE;
357366 outlink->w = s->w;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t