summaryrefslogtreecommitdiff
path: root/libavfilter/f_graphmonitor.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2020-08-31 18:06:54 +0200
committerPaul B Mahol <onemda@gmail.com>2020-08-31 19:59:35 +0200
commite417f84003d1dc62983024e902c9ebf306fdffe3 (patch)
treeb7777617a99fb62430a375dfe51ebbd09409af31 /libavfilter/f_graphmonitor.c
parent57915df230b8241cb3636041c4113a2e1f8fa92f (diff)
avfilter/f_graphmonitor: also show link EOF status in blue
Diffstat (limited to 'libavfilter/f_graphmonitor.c')
-rw-r--r--libavfilter/f_graphmonitor.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavfilter/f_graphmonitor.c b/libavfilter/f_graphmonitor.c
index a9c4ba42f5..535e52b48b 100644
--- a/libavfilter/f_graphmonitor.c
+++ b/libavfilter/f_graphmonitor.c
@@ -47,6 +47,7 @@ typedef struct GraphMonitorContext {
uint8_t yellow[4];
uint8_t red[4];
uint8_t green[4];
+ uint8_t blue[4];
uint8_t bg[4];
} GraphMonitorContext;
@@ -60,6 +61,7 @@ enum {
MODE_FMT = 1 << 6,
MODE_SIZE = 1 << 7,
MODE_RATE = 1 << 8,
+ MODE_EOF = 1 << 9,
};
#define OFFSET(x) offsetof(GraphMonitorContext, x)
@@ -85,6 +87,7 @@ static const AVOption graphmonitor_options[] = {
{ "format", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_FMT}, 0, 0, VF, "flags" },
{ "size", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_SIZE}, 0, 0, VF, "flags" },
{ "rate", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_RATE}, 0, 0, VF, "flags" },
+ { "eof", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_EOF}, 0, 0, VF, "flags" },
{ "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, VF },
{ "r", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, VF },
{ NULL }
@@ -236,6 +239,11 @@ static void draw_items(AVFilterContext *ctx, AVFrame *out,
drawtext(out, xpos, ypos, buffer, s->white);
xpos += strlen(buffer) * 8;
}
+ if (s->flags & MODE_EOF && ff_outlink_get_status(l)) {
+ snprintf(buffer, sizeof(buffer)-1, " | eof");
+ drawtext(out, xpos, ypos, buffer, s->blue);
+ xpos += strlen(buffer) * 8;
+ }
}
static int create_frame(AVFilterContext *ctx, int64_t pts)
@@ -352,6 +360,7 @@ static int config_output(AVFilterLink *outlink)
s->yellow[0] = s->yellow[1] = 255;
s->red[0] = 255;
s->green[1] = 255;
+ s->blue[2] = 255;
s->pts = AV_NOPTS_VALUE;
s->next_pts = AV_NOPTS_VALUE;
outlink->w = s->w;