History

avfilter/f_graphmonitor: rename enums

Paul B Mahol committed 3 years ago

Commit 6eecfc51 parent 8041d001 file · +53 −52Browse files

Showing the changes to libavfilter/f_graphmonitor.c (1 of 1 file). Show all

Unified · Split

libavfilter/f_graphmonitor.c+53−52
@@ -62,22 +62,22 @@ typedef struct GraphMonitorContext { · 61 unmodified lines
6262 } GraphMonitorContext;
6363
6464 enum {
65− MODE_QUEUE = 1 << 0,
66− MODE_FCIN = 1 << 1,
67− MODE_FCOUT = 1 << 2,
68− MODE_PTS = 1 << 3,
69− MODE_TIME = 1 << 4,
70− MODE_TB = 1 << 5,
71− MODE_FMT = 1 << 6,
72− MODE_SIZE = 1 << 7,
73− MODE_RATE = 1 << 8,
74− MODE_EOF = 1 << 9,
75− MODE_SCIN = 1 << 10,
76− MODE_SCOUT = 1 << 11,
77− MODE_PTS_DELTA = 1 << 12,
78− MODE_TIME_DELTA = 1 << 13,
79− MODE_FC_DELTA = 1 << 14,
80− MODE_SC_DELTA = 1 << 15,
65+ FLAG_QUEUE = 1 << 0,
66+ FLAG_FCIN = 1 << 1,
67+ FLAG_FCOUT = 1 << 2,
68+ FLAG_PTS = 1 << 3,
69+ FLAG_TIME = 1 << 4,
70+ FLAG_TB = 1 << 5,
71+ FLAG_FMT = 1 << 6,
72+ FLAG_SIZE = 1 << 7,
73+ FLAG_RATE = 1 << 8,
74+ FLAG_EOF = 1 << 9,
75+ FLAG_SCIN = 1 << 10,
76+ FLAG_SCOUT = 1 << 11,
77+ FLAG_PTS_DELTA = 1 << 12,
78+ FLAG_TIME_DELTA = 1 << 13,
79+ FLAG_FC_DELTA = 1 << 14,
80+ FLAG_SC_DELTA = 1 << 15,
8181 };
8282
8383 #define OFFSET(x) offsetof(GraphMonitorContext, x)
@@ -88,28 +88,29 @@ static const AVOption graphmonitor_options[] = { · 4 unmodified lines
8888 { "s", "set monitor size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"}, 0, 0, VF },
8989 { "opacity", "set video opacity", OFFSET(opacity), AV_OPT_TYPE_FLOAT, {.dbl=.9}, 0, 1, VF },
9090 { "o", "set video opacity", OFFSET(opacity), AV_OPT_TYPE_FLOAT, {.dbl=.9}, 0, 1, VF },
91− { "mode", "set mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, VF, "mode" },
92− { "m", "set mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, VF, "mode" },
91+ { "mode", "set mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 2, VF, "mode" },
92+ { "m", "set mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 2, VF, "mode" },
9393 { "full", NULL, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, VF, "mode" },
9494 { "compact", NULL, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, VF, "mode" },
95− { "flags", "set flags", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64=MODE_QUEUE}, 0, INT_MAX, VF, "flags" },
96− { "f", "set flags", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64=MODE_QUEUE}, 0, INT_MAX, VF, "flags" },
97− { "queue", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_QUEUE}, 0, 0, VF, "flags" },
98− { "frame_count_in", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_FCOUT}, 0, 0, VF, "flags" },
99− { "frame_count_out", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_FCIN}, 0, 0, VF, "flags" },
100− { "frame_count_delta",NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_FC_DELTA},0, 0, VF, "flags" },
101− { "pts", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_PTS}, 0, 0, VF, "flags" },
102− { "pts_delta", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_PTS_DELTA},0,0, VF, "flags" },
103− { "time", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_TIME}, 0, 0, VF, "flags" },
104− { "time_delta", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_TIME_DELTA},0,0,VF, "flags" },
105− { "timebase", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_TB}, 0, 0, VF, "flags" },
106− { "format", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_FMT}, 0, 0, VF, "flags" },
107− { "size", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_SIZE}, 0, 0, VF, "flags" },
108− { "rate", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_RATE}, 0, 0, VF, "flags" },
109− { "eof", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_EOF}, 0, 0, VF, "flags" },
110− { "sample_count_in", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_SCOUT}, 0, 0, VF, "flags" },
111− { "sample_count_out", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_SCIN}, 0, 0, VF, "flags" },
112− { "sample_count_delta",NULL,0, AV_OPT_TYPE_CONST, {.i64=MODE_SC_DELTA},0, 0, VF, "flags" },
95+ { "nozero", NULL, 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, VF, "mode" },
96+ { "flags", "set flags", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64=FLAG_QUEUE}, 0, INT_MAX, VF, "flags" },
97+ { "f", "set flags", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64=FLAG_QUEUE}, 0, INT_MAX, VF, "flags" },
98+ { "queue", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_QUEUE}, 0, 0, VF, "flags" },
99+ { "frame_count_in", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_FCOUT}, 0, 0, VF, "flags" },
100+ { "frame_count_out", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_FCIN}, 0, 0, VF, "flags" },
101+ { "frame_count_delta",NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_FC_DELTA},0, 0, VF, "flags" },
102+ { "pts", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_PTS}, 0, 0, VF, "flags" },
103+ { "pts_delta", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_PTS_DELTA},0,0, VF, "flags" },
104+ { "time", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_TIME}, 0, 0, VF, "flags" },
105+ { "time_delta", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_TIME_DELTA},0,0,VF, "flags" },
106+ { "timebase", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_TB}, 0, 0, VF, "flags" },
107+ { "format", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_FMT}, 0, 0, VF, "flags" },
108+ { "size", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_SIZE}, 0, 0, VF, "flags" },
109+ { "rate", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_RATE}, 0, 0, VF, "flags" },
110+ { "eof", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_EOF}, 0, 0, VF, "flags" },
111+ { "sample_count_in", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_SCOUT}, 0, 0, VF, "flags" },
112+ { "sample_count_out", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_SCIN}, 0, 0, VF, "flags" },
113+ { "sample_count_delta",NULL,0, AV_OPT_TYPE_CONST, {.i64=FLAG_SC_DELTA},0, 0, VF, "flags" },
113114 { "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, VF },
114115 { "r", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, VF },
115116 { NULL }
@@ -213,7 +214,7 @@ static int draw_items(AVFilterContext *ctx, AVFrame *out, · 97 unmodified lines
213214 int64_t current_pts_us = l->current_pts_us;
214215 char buffer[1024] = { 0 };
215216
216− if (s->flags & MODE_FMT) {
217+ if (s->flags & FLAG_FMT) {
217218 if (l->type == AVMEDIA_TYPE_VIDEO) {
218219 snprintf(buffer, sizeof(buffer)-1, " | format: %s",
219220 av_get_pix_fmt_name(l->format));
@@ -224,7 +225,7 @@ static int draw_items(AVFilterContext *ctx, AVFrame *out, · 4 unmodified lines
224225 drawtext(out, xpos, ypos, buffer, s->white);
225226 xpos += strlen(buffer) * 8;
226227 }
227− if (s->flags & MODE_SIZE) {
228+ if (s->flags & FLAG_SIZE) {
228229 if (l->type == AVMEDIA_TYPE_VIDEO) {
229230 snprintf(buffer, sizeof(buffer)-1, " | size: %dx%d", l->w, l->h);
230231 } else if (l->type == AVMEDIA_TYPE_AUDIO) {
@@ -233,7 +234,7 @@ static int draw_items(AVFilterContext *ctx, AVFrame *out, · 2 unmodified lines
233234 drawtext(out, xpos, ypos, buffer, s->white);
234235 xpos += strlen(buffer) * 8;
235236 }
236− if (s->flags & MODE_RATE) {
237+ if (s->flags & FLAG_RATE) {
237238 if (l->type == AVMEDIA_TYPE_VIDEO) {
238239 snprintf(buffer, sizeof(buffer)-1, " | fps: %d/%d", l->frame_rate.num, l->frame_rate.den);
239240 } else if (l->type == AVMEDIA_TYPE_AUDIO) {
@@ -242,12 +243,12 @@ static int draw_items(AVFilterContext *ctx, AVFrame *out, · 2 unmodified lines
242243 drawtext(out, xpos, ypos, buffer, s->white);
243244 xpos += strlen(buffer) * 8;
244245 }
245− if (s->flags & MODE_TB) {
246+ if (s->flags & FLAG_TB) {
246247 snprintf(buffer, sizeof(buffer)-1, " | tb: %d/%d", l->time_base.num, l->time_base.den);
247248 drawtext(out, xpos, ypos, buffer, s->white);
248249 xpos += strlen(buffer) * 8;
249250 }
250− if (s->flags & MODE_QUEUE) {
251+ if (s->flags & FLAG_QUEUE) {
251252 snprintf(buffer, sizeof(buffer)-1, " | queue: ");
252253 drawtext(out, xpos, ypos, buffer, s->white);
253254 xpos += strlen(buffer) * 8;
@@ -255,57 +256,57 @@ static int draw_items(AVFilterContext *ctx, AVFrame *out, · 1 unmodified line
255256 drawtext(out, xpos, ypos, buffer, frames > 0 ? frames >= 10 ? frames >= 50 ? s->red : s->yellow : s->green : s->white);
256257 xpos += strlen(buffer) * 8;
257258 }
258− if (s->flags & MODE_FCIN) {
259+ if (s->flags & FLAG_FCIN) {
259260 snprintf(buffer, sizeof(buffer)-1, " | in: %"PRId64, l->frame_count_in);
260261 drawtext(out, xpos, ypos, buffer, s->white);
261262 xpos += strlen(buffer) * 8;
262263 }
263− if (s->flags & MODE_FCOUT) {
264+ if (s->flags & FLAG_FCOUT) {
264265 snprintf(buffer, sizeof(buffer)-1, " | out: %"PRId64, l->frame_count_out);
265266 drawtext(out, xpos, ypos, buffer, s->white);
266267 xpos += strlen(buffer) * 8;
267268 }
268− if (s->flags & MODE_FC_DELTA) {
269+ if (s->flags & FLAG_FC_DELTA) {
269270 snprintf(buffer, sizeof(buffer)-1, " | delta: %"PRId64, l->frame_count_in - l->frame_count_out);
270271 drawtext(out, xpos, ypos, buffer, s->white);
271272 xpos += strlen(buffer) * 8;
272273 }
273− if (s->flags & MODE_SCIN) {
274+ if (s->flags & FLAG_SCIN) {
274275 snprintf(buffer, sizeof(buffer)-1, " | sin: %"PRId64, l->sample_count_in);
275276 drawtext(out, xpos, ypos, buffer, s->white);
276277 xpos += strlen(buffer) * 8;
277278 }
278− if (s->flags & MODE_SCOUT) {
279+ if (s->flags & FLAG_SCOUT) {
279280 snprintf(buffer, sizeof(buffer)-1, " | sout: %"PRId64, l->sample_count_out);
280281 drawtext(out, xpos, ypos, buffer, s->white);
281282 xpos += strlen(buffer) * 8;
282283 }
283− if (s->flags & MODE_SC_DELTA) {
284+ if (s->flags & FLAG_SC_DELTA) {
284285 snprintf(buffer, sizeof(buffer)-1, " | sdelta: %"PRId64, l->sample_count_in - l->sample_count_out);
285286 drawtext(out, xpos, ypos, buffer, s->white);
286287 xpos += strlen(buffer) * 8;
287288 }
288− if (s->flags & MODE_PTS) {
289+ if (s->flags & FLAG_PTS) {
289290 snprintf(buffer, sizeof(buffer)-1, " | pts: %s", av_ts2str(current_pts_us));
290291 drawtext(out, xpos, ypos, buffer, s->white);
291292 xpos += strlen(buffer) * 8;
292293 }
293− if (s->flags & MODE_PTS_DELTA) {
294+ if (s->flags & FLAG_PTS_DELTA) {
294295 snprintf(buffer, sizeof(buffer)-1, " | pts_delta: %s", av_ts2str(current_pts_us - previous_pts_us));
295296 drawtext(out, xpos, ypos, buffer, s->white);
296297 xpos += strlen(buffer) * 8;
297298 }
298− if (s->flags & MODE_TIME) {
299+ if (s->flags & FLAG_TIME) {
299300 snprintf(buffer, sizeof(buffer)-1, " | time: %s", av_ts2timestr(current_pts_us, &AV_TIME_BASE_Q));
300301 drawtext(out, xpos, ypos, buffer, s->white);
301302 xpos += strlen(buffer) * 8;
302303 }
303− if (s->flags & MODE_TIME_DELTA) {
304+ if (s->flags & FLAG_TIME_DELTA) {
304305 snprintf(buffer, sizeof(buffer)-1, " | time_delta: %s", av_ts2timestr(current_pts_us - previous_pts_us, &AV_TIME_BASE_Q));
305306 drawtext(out, xpos, ypos, buffer, s->white);
306307 xpos += strlen(buffer) * 8;
307308 }
308− if (s->flags & MODE_EOF && ff_outlink_get_status(l)) {
309+ if (s->flags & FLAG_EOF && ff_outlink_get_status(l)) {
309310 snprintf(buffer, sizeof(buffer)-1, " | eof");
310311 drawtext(out, xpos, ypos, buffer, s->blue);
311312 xpos += strlen(buffer) * 8;

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