History

avfilter/f_graphmonitor: use sample_count_in/out

Paul B Mahol committed 5 years ago

Commit 9dbf95f1 parent c3178622 files · +20 −0Browse files

Unified · Split

2 files
  1. doc/filters.texi +6 −0
  2. libavfilter/f_graphmonitor.c +14 −0
doc/filters.texi+6−0
@@ -13020,6 +13020,12 @@ Display video frame rate or sample rate in case of audio used by filter link. · 13019 unmodified lines
13020 13020
13021@item eof13021@item eof
13022Display link output status.13022Display link output status.
13023
13024@item sample_count_in
13025Display number of samples taken from filter.
13026
13027@item sample_count_out
13028Display number of samples given out from filter.
13023@end table13029@end table
13024 13030
13025@item rate, r13031@item rate, r
libavfilter/f_graphmonitor.c+14−0
@@ -62,6 +62,8 @@ enum { · 61 unmodified lines
62 MODE_SIZE = 1 << 7,62 MODE_SIZE = 1 << 7,
63 MODE_RATE = 1 << 8,63 MODE_RATE = 1 << 8,
64 MODE_EOF = 1 << 9,64 MODE_EOF = 1 << 9,
65 MODE_SCIN = 1 << 10,
66 MODE_SCOUT = 1 << 11,
65};67};
66 68
67#define OFFSET(x) offsetof(GraphMonitorContext, x)69#define OFFSET(x) offsetof(GraphMonitorContext, x)
@@ -88,6 +90,8 @@ static const AVOption graphmonitor_options[] = { · 20 unmodified lines
88 { "size", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_SIZE}, 0, 0, VF, "flags" },90 { "size", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_SIZE}, 0, 0, VF, "flags" },
89 { "rate", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_RATE}, 0, 0, VF, "flags" },91 { "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" },92 { "eof", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_EOF}, 0, 0, VF, "flags" },
93 { "sample_count_in", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_SCOUT}, 0, 0, VF, "flags" },
94 { "sample_count_out", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_SCIN}, 0, 0, VF, "flags" },
91 { "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, VF },95 { "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, VF },
92 { "r", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, VF },96 { "r", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, VF },
93 { NULL }97 { NULL }
@@ -229,6 +233,16 @@ static void draw_items(AVFilterContext *ctx, AVFrame *out, · 135 unmodified lines
229 drawtext(out, xpos, ypos, buffer, s->white);233 drawtext(out, xpos, ypos, buffer, s->white);
230 xpos += strlen(buffer) * 8;234 xpos += strlen(buffer) * 8;
231 }235 }
236 if (s->flags & MODE_SCIN) {
237 snprintf(buffer, sizeof(buffer)-1, " | sin: %"PRId64, l->sample_count_in);
238 drawtext(out, xpos, ypos, buffer, s->white);
239 xpos += strlen(buffer) * 8;
240 }
241 if (s->flags & MODE_SCOUT) {
242 snprintf(buffer, sizeof(buffer)-1, " | sout: %"PRId64, l->sample_count_out);
243 drawtext(out, xpos, ypos, buffer, s->white);
244 xpos += strlen(buffer) * 8;
245 }
232 if (s->flags & MODE_PTS) {246 if (s->flags & MODE_PTS) {
233 snprintf(buffer, sizeof(buffer)-1, " | pts: %s", av_ts2str(l->current_pts_us));247 snprintf(buffer, sizeof(buffer)-1, " | pts: %s", av_ts2str(l->current_pts_us));
234 drawtext(out, xpos, ypos, buffer, s->white);248 drawtext(out, xpos, ypos, buffer, s->white);

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