History

avfilter/f_graphmonitor: show also current timeline status of filter

Paul B Mahol committed 3 years ago

Commit b528e091 parent fcabfcb2 files · +26 −5Browse files

Unified · Split

2 files
  1. doc/filters.texi +5 −0
  2. libavfilter/f_graphmonitor.c +21 −5
doc/filters.texi+5−0
@@ -14651,6 +14651,8 @@ Show only filters with queued frames. · 14650 unmodified lines
14651Show only filters with non-zero stats.14651Show only filters with non-zero stats.
14652@item noeof14652@item noeof
14653Show only filters with non-eof stat.14653Show only filters with non-eof stat.
14654@item nodisabled
14655Show only filters that are enabled in timeline.
14654@end table14656@end table
14655 14657
14656@item flags, f14658@item flags, f
@@ -14705,6 +14707,9 @@ Display number of samples given out from filter. · 48 unmodified lines
14705 14707
14706@item sample_count_delta14708@item sample_count_delta
14707Display delta number of samples between above two values.14709Display delta number of samples between above two values.
14710
14711@item disabled
14712Show the timeline filter status.
14708@end table14713@end table
14709 14714
14710@item rate, r14715@item rate, r
libavfilter/f_graphmonitor.c+21−5
@@ -54,6 +54,7 @@ typedef struct GraphMonitorContext { · 53 unmodified lines
54 uint8_t red[4];54 uint8_t red[4];
55 uint8_t green[4];55 uint8_t green[4];
56 uint8_t blue[4];56 uint8_t blue[4];
57 uint8_t gray[4];
57 uint8_t bg[4];58 uint8_t bg[4];
58 59
59 CacheItem *cache;60 CacheItem *cache;
@@ -66,7 +67,8 @@ enum { · 6 unmodified lines
66 MODE_COMPACT = 1,67 MODE_COMPACT = 1,
67 MODE_NOZERO = 2,68 MODE_NOZERO = 2,
68 MODE_NOEOF = 4,69 MODE_NOEOF = 4,
69 MODE_MAX = 770 MODE_NODISABLED = 8,
71 MODE_MAX = 15
70};72};
71 73
72enum {74enum {
@@ -86,6 +88,7 @@ enum { · 13 unmodified lines
86 FLAG_TIME_DELTA = 1 << 13,88 FLAG_TIME_DELTA = 1 << 13,
87 FLAG_FC_DELTA = 1 << 14,89 FLAG_FC_DELTA = 1 << 14,
88 FLAG_SC_DELTA = 1 << 15,90 FLAG_SC_DELTA = 1 << 15,
91 FLAG_DISABLED = 1 << 16,
89};92};
90 93
91#define OFFSET(x) offsetof(GraphMonitorContext, x)94#define OFFSET(x) offsetof(GraphMonitorContext, x)
@@ -103,6 +106,7 @@ static const AVOption graphmonitor_options[] = { · 11 unmodified lines
103 { "compact", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_COMPACT},0, 0, VFR, "mode" },106 { "compact", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_COMPACT},0, 0, VFR, "mode" },
104 { "nozero", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_NOZERO}, 0, 0, VFR, "mode" },107 { "nozero", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_NOZERO}, 0, 0, VFR, "mode" },
105 { "noeof", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_NOEOF}, 0, 0, VFR, "mode" },108 { "noeof", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_NOEOF}, 0, 0, VFR, "mode" },
109 { "nodisabled",NULL,0,AV_OPT_TYPE_CONST, {.i64=MODE_NODISABLED},0,0,VFR,"mode" },
106 { "flags", "set flags", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64=FLAG_QUEUE}, 0, INT_MAX, VFR, "flags" },110 { "flags", "set flags", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64=FLAG_QUEUE}, 0, INT_MAX, VFR, "flags" },
107 { "f", "set flags", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64=FLAG_QUEUE}, 0, INT_MAX, VFR, "flags" },111 { "f", "set flags", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64=FLAG_QUEUE}, 0, INT_MAX, VFR, "flags" },
108 { "queue", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_QUEUE}, 0, 0, VFR, "flags" },112 { "queue", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_QUEUE}, 0, 0, VFR, "flags" },
@@ -121,6 +125,7 @@ static const AVOption graphmonitor_options[] = { · 12 unmodified lines
121 { "sample_count_in", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_SCOUT}, 0, 0, VFR, "flags" },125 { "sample_count_in", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_SCOUT}, 0, 0, VFR, "flags" },
122 { "sample_count_out", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_SCIN}, 0, 0, VFR, "flags" },126 { "sample_count_out", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_SCIN}, 0, 0, VFR, "flags" },
123 { "sample_count_delta",NULL,0, AV_OPT_TYPE_CONST, {.i64=FLAG_SC_DELTA},0, 0, VFR, "flags" },127 { "sample_count_delta",NULL,0, AV_OPT_TYPE_CONST, {.i64=FLAG_SC_DELTA},0, 0, VFR, "flags" },
128 { "disabled", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_DISABLED},0, 0, VFR, "flags" },
124 { "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, VF },129 { "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, VF },
125 { "r", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, VF },130 { "r", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, VF },
126 { NULL }131 { NULL }
@@ -233,7 +238,9 @@ static int filter_have_queued(AVFilterContext *filter) · 106 unmodified lines
233 return 0;238 return 0;
234}239}
235 240
236static int draw_items(AVFilterContext *ctx, AVFrame *out,241static int draw_items(AVFilterContext *ctx,
242 AVFilterContext *filter,
243 AVFrame *out,
237 int xpos, int ypos,244 int xpos, int ypos,
238 AVFilterLink *l,245 AVFilterLink *l,
239 size_t frames)246 size_t frames)
@@ -335,11 +342,16 @@ static int draw_items(AVFilterContext *ctx, AVFrame *out, · 95 unmodified lines
335 drawtext(out, xpos, ypos, buffer, s->white);342 drawtext(out, xpos, ypos, buffer, s->white);
336 xpos += strlen(buffer) * 8;343 xpos += strlen(buffer) * 8;
337 }344 }
338 if (s->flags & FLAG_EOF && ff_outlink_get_status(l)) {345 if ((s->flags & FLAG_EOF) && ff_outlink_get_status(l)) {
339 snprintf(buffer, sizeof(buffer)-1, " | eof");346 snprintf(buffer, sizeof(buffer)-1, " | eof");
340 drawtext(out, xpos, ypos, buffer, s->blue);347 drawtext(out, xpos, ypos, buffer, s->blue);
341 xpos += strlen(buffer) * 8;348 xpos += strlen(buffer) * 8;
342 }349 }
350 if ((s->flags & FLAG_DISABLED) && filter->is_disabled) {
351 snprintf(buffer, sizeof(buffer)-1, " | off");
352 drawtext(out, xpos, ypos, buffer, s->gray);
353 xpos += strlen(buffer) * 8;
354 }
343 355
344 s->cache[s->cache_index].previous_pts_us = l->current_pts_us;356 s->cache[s->cache_index].previous_pts_us = l->current_pts_us;
345 357
@@ -380,6 +392,9 @@ static int create_frame(AVFilterContext *ctx, int64_t pts) · 34 unmodified lines
380 if ((s->mode & MODE_NOEOF) && filter_have_eof(filter))392 if ((s->mode & MODE_NOEOF) && filter_have_eof(filter))
381 continue;393 continue;
382 394
395 if ((s->mode & MODE_NODISABLED) && filter->is_disabled)
396 continue;
397
383 xpos = 0;398 xpos = 0;
384 drawtext(out, xpos, ypos, filter->name, s->white);399 drawtext(out, xpos, ypos, filter->name, s->white);
385 xpos += strlen(filter->name) * 8 + 10;400 xpos += strlen(filter->name) * 8 + 10;
@@ -401,7 +416,7 @@ static int create_frame(AVFilterContext *ctx, int64_t pts) · 15 unmodified lines
401 xpos += strlen(buffer) * 8;416 xpos += strlen(buffer) * 8;
402 drawtext(out, xpos, ypos, l->src->name, s->white);417 drawtext(out, xpos, ypos, l->src->name, s->white);
403 xpos += strlen(l->src->name) * 8 + 10;418 xpos += strlen(l->src->name) * 8 + 10;
404 ret = draw_items(ctx, out, xpos, ypos, l, frames);419 ret = draw_items(ctx, filter, out, xpos, ypos, l, frames);
405 if (ret < 0)420 if (ret < 0)
406 goto error;421 goto error;
407 ypos += 10;422 ypos += 10;
@@ -424,7 +439,7 @@ static int create_frame(AVFilterContext *ctx, int64_t pts) · 16 unmodified lines
424 xpos += strlen(buffer) * 8;439 xpos += strlen(buffer) * 8;
425 drawtext(out, xpos, ypos, l->dst->name, s->white);440 drawtext(out, xpos, ypos, l->dst->name, s->white);
426 xpos += strlen(l->dst->name) * 8 + 10;441 xpos += strlen(l->dst->name) * 8 + 10;
427 ret = draw_items(ctx, out, xpos, ypos, l, frames);442 ret = draw_items(ctx, filter, out, xpos, ypos, l, frames);
428 if (ret < 0)443 if (ret < 0)
429 goto error;444 goto error;
430 ypos += 10;445 ypos += 10;
@@ -489,6 +504,7 @@ static int config_output(AVFilterLink *outlink) · 58 unmodified lines
489 s->red[0] = 255;504 s->red[0] = 255;
490 s->green[1] = 255;505 s->green[1] = 255;
491 s->blue[2] = 255;506 s->blue[2] = 255;
507 s->gray[0] = s->gray[1] = s->gray[2] = 128;
492 s->pts = AV_NOPTS_VALUE;508 s->pts = AV_NOPTS_VALUE;
493 s->next_pts = AV_NOPTS_VALUE;509 s->next_pts = AV_NOPTS_VALUE;
494 outlink->w = s->w;510 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