History

avfilter/f_graphmonitor: use sample_count_in/out

Paul B Mahol committed 5 years ago

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

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

Unified · Split

libavfilter/f_graphmonitor.c+14−0
@@ -62,6 +62,8 @@ enum { · 61 unmodified lines
6262 MODE_SIZE = 1 << 7,
6363 MODE_RATE = 1 << 8,
6464 MODE_EOF = 1 << 9,
65+ MODE_SCIN = 1 << 10,
66+ MODE_SCOUT = 1 << 11,
6567 };
6668
6769 #define OFFSET(x) offsetof(GraphMonitorContext, x)
@@ -88,6 +90,8 @@ static const AVOption graphmonitor_options[] = { · 20 unmodified lines
8890 { "size", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_SIZE}, 0, 0, VF, "flags" },
8991 { "rate", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_RATE}, 0, 0, VF, "flags" },
9092 { "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" },
9195 { "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, VF },
9296 { "r", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, VF },
9397 { NULL }
@@ -229,6 +233,16 @@ static void draw_items(AVFilterContext *ctx, AVFrame *out, · 135 unmodified lines
229233 drawtext(out, xpos, ypos, buffer, s->white);
230234 xpos += strlen(buffer) * 8;
231235 }
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+ }
232246 if (s->flags & MODE_PTS) {
233247 snprintf(buffer, sizeof(buffer)-1, " | pts: %s", av_ts2str(l->current_pts_us));
234248 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