History

avfilter/f_graphmonitor: rename enums

Paul B Mahol committed 3 years ago

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

Unified · Split

libavfilter/f_graphmonitor.c+53−52
@@ -62,22 +62,22 @@ typedef struct GraphMonitorContext { · 61 unmodified lines
62} GraphMonitorContext;62} GraphMonitorContext;
63 63
64enum {64enum {
65 MODE_QUEUE = 1 << 0,65 FLAG_QUEUE = 1 << 0,
66 MODE_FCIN = 1 << 1,66 FLAG_FCIN = 1 << 1,
67 MODE_FCOUT = 1 << 2,67 FLAG_FCOUT = 1 << 2,
68 MODE_PTS = 1 << 3,68 FLAG_PTS = 1 << 3,
69 MODE_TIME = 1 << 4,69 FLAG_TIME = 1 << 4,
70 MODE_TB = 1 << 5,70 FLAG_TB = 1 << 5,
71 MODE_FMT = 1 << 6,71 FLAG_FMT = 1 << 6,
72 MODE_SIZE = 1 << 7,72 FLAG_SIZE = 1 << 7,
73 MODE_RATE = 1 << 8,73 FLAG_RATE = 1 << 8,
74 MODE_EOF = 1 << 9,74 FLAG_EOF = 1 << 9,
75 MODE_SCIN = 1 << 10,75 FLAG_SCIN = 1 << 10,
76 MODE_SCOUT = 1 << 11,76 FLAG_SCOUT = 1 << 11,
77 MODE_PTS_DELTA = 1 << 12,77 FLAG_PTS_DELTA = 1 << 12,
78 MODE_TIME_DELTA = 1 << 13,78 FLAG_TIME_DELTA = 1 << 13,
79 MODE_FC_DELTA = 1 << 14,79 FLAG_FC_DELTA = 1 << 14,
80 MODE_SC_DELTA = 1 << 15,80 FLAG_SC_DELTA = 1 << 15,
81};81};
82 82
83#define OFFSET(x) offsetof(GraphMonitorContext, x)83#define OFFSET(x) offsetof(GraphMonitorContext, x)
@@ -88,28 +88,29 @@ static const AVOption graphmonitor_options[] = { · 4 unmodified lines
88 { "s", "set monitor size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"}, 0, 0, VF },88 { "s", "set monitor size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"}, 0, 0, VF },
89 { "opacity", "set video opacity", OFFSET(opacity), AV_OPT_TYPE_FLOAT, {.dbl=.9}, 0, 1, VF },89 { "opacity", "set video opacity", OFFSET(opacity), AV_OPT_TYPE_FLOAT, {.dbl=.9}, 0, 1, VF },
90 { "o", "set video opacity", OFFSET(opacity), AV_OPT_TYPE_FLOAT, {.dbl=.9}, 0, 1, VF },90 { "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" },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, 1, VF, "mode" },92 { "m", "set mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 2, VF, "mode" },
93 { "full", NULL, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, VF, "mode" },93 { "full", NULL, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, VF, "mode" },
94 { "compact", NULL, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, VF, "mode" },94 { "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" },95 { "nozero", NULL, 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, VF, "mode" },
96 { "f", "set flags", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64=MODE_QUEUE}, 0, INT_MAX, VF, "flags" },96 { "flags", "set flags", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64=FLAG_QUEUE}, 0, INT_MAX, VF, "flags" },
97 { "queue", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_QUEUE}, 0, 0, VF, "flags" },97 { "f", "set flags", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64=FLAG_QUEUE}, 0, INT_MAX, VF, "flags" },
98 { "frame_count_in", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_FCOUT}, 0, 0, VF, "flags" },98 { "queue", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_QUEUE}, 0, 0, VF, "flags" },
99 { "frame_count_out", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_FCIN}, 0, 0, VF, "flags" },99 { "frame_count_in", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_FCOUT}, 0, 0, VF, "flags" },
100 { "frame_count_delta",NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_FC_DELTA},0, 0, VF, "flags" },100 { "frame_count_out", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_FCIN}, 0, 0, VF, "flags" },
101 { "pts", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_PTS}, 0, 0, VF, "flags" },101 { "frame_count_delta",NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_FC_DELTA},0, 0, VF, "flags" },
102 { "pts_delta", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_PTS_DELTA},0,0, VF, "flags" },102 { "pts", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_PTS}, 0, 0, VF, "flags" },
103 { "time", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_TIME}, 0, 0, VF, "flags" },103 { "pts_delta", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_PTS_DELTA},0,0, VF, "flags" },
104 { "time_delta", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_TIME_DELTA},0,0,VF, "flags" },104 { "time", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_TIME}, 0, 0, VF, "flags" },
105 { "timebase", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_TB}, 0, 0, VF, "flags" },105 { "time_delta", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_TIME_DELTA},0,0,VF, "flags" },
106 { "format", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_FMT}, 0, 0, VF, "flags" },106 { "timebase", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_TB}, 0, 0, VF, "flags" },
107 { "size", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_SIZE}, 0, 0, VF, "flags" },107 { "format", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_FMT}, 0, 0, VF, "flags" },
108 { "rate", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_RATE}, 0, 0, VF, "flags" },108 { "size", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_SIZE}, 0, 0, VF, "flags" },
109 { "eof", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_EOF}, 0, 0, VF, "flags" },109 { "rate", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_RATE}, 0, 0, VF, "flags" },
110 { "sample_count_in", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_SCOUT}, 0, 0, VF, "flags" },110 { "eof", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_EOF}, 0, 0, VF, "flags" },
111 { "sample_count_out", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_SCIN}, 0, 0, VF, "flags" },111 { "sample_count_in", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FLAG_SCOUT}, 0, 0, VF, "flags" },
112 { "sample_count_delta",NULL,0, AV_OPT_TYPE_CONST, {.i64=MODE_SC_DELTA},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" },
113 { "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, VF },114 { "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, VF },
114 { "r", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, VF },115 { "r", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, VF },
115 { NULL }116 { NULL }
@@ -213,7 +214,7 @@ static int draw_items(AVFilterContext *ctx, AVFrame *out, · 97 unmodified lines
213 int64_t current_pts_us = l->current_pts_us;214 int64_t current_pts_us = l->current_pts_us;
214 char buffer[1024] = { 0 };215 char buffer[1024] = { 0 };
215 216
216 if (s->flags & MODE_FMT) {217 if (s->flags & FLAG_FMT) {
217 if (l->type == AVMEDIA_TYPE_VIDEO) {218 if (l->type == AVMEDIA_TYPE_VIDEO) {
218 snprintf(buffer, sizeof(buffer)-1, " | format: %s",219 snprintf(buffer, sizeof(buffer)-1, " | format: %s",
219 av_get_pix_fmt_name(l->format));220 av_get_pix_fmt_name(l->format));
@@ -224,7 +225,7 @@ static int draw_items(AVFilterContext *ctx, AVFrame *out, · 4 unmodified lines
224 drawtext(out, xpos, ypos, buffer, s->white);225 drawtext(out, xpos, ypos, buffer, s->white);
225 xpos += strlen(buffer) * 8;226 xpos += strlen(buffer) * 8;
226 }227 }
227 if (s->flags & MODE_SIZE) {228 if (s->flags & FLAG_SIZE) {
228 if (l->type == AVMEDIA_TYPE_VIDEO) {229 if (l->type == AVMEDIA_TYPE_VIDEO) {
229 snprintf(buffer, sizeof(buffer)-1, " | size: %dx%d", l->w, l->h);230 snprintf(buffer, sizeof(buffer)-1, " | size: %dx%d", l->w, l->h);
230 } else if (l->type == AVMEDIA_TYPE_AUDIO) {231 } else if (l->type == AVMEDIA_TYPE_AUDIO) {
@@ -233,7 +234,7 @@ static int draw_items(AVFilterContext *ctx, AVFrame *out, · 2 unmodified lines
233 drawtext(out, xpos, ypos, buffer, s->white);234 drawtext(out, xpos, ypos, buffer, s->white);
234 xpos += strlen(buffer) * 8;235 xpos += strlen(buffer) * 8;
235 }236 }
236 if (s->flags & MODE_RATE) {237 if (s->flags & FLAG_RATE) {
237 if (l->type == AVMEDIA_TYPE_VIDEO) {238 if (l->type == AVMEDIA_TYPE_VIDEO) {
238 snprintf(buffer, sizeof(buffer)-1, " | fps: %d/%d", l->frame_rate.num, l->frame_rate.den);239 snprintf(buffer, sizeof(buffer)-1, " | fps: %d/%d", l->frame_rate.num, l->frame_rate.den);
239 } else if (l->type == AVMEDIA_TYPE_AUDIO) {240 } else if (l->type == AVMEDIA_TYPE_AUDIO) {
@@ -242,12 +243,12 @@ static int draw_items(AVFilterContext *ctx, AVFrame *out, · 2 unmodified lines
242 drawtext(out, xpos, ypos, buffer, s->white);243 drawtext(out, xpos, ypos, buffer, s->white);
243 xpos += strlen(buffer) * 8;244 xpos += strlen(buffer) * 8;
244 }245 }
245 if (s->flags & MODE_TB) {246 if (s->flags & FLAG_TB) {
246 snprintf(buffer, sizeof(buffer)-1, " | tb: %d/%d", l->time_base.num, l->time_base.den);247 snprintf(buffer, sizeof(buffer)-1, " | tb: %d/%d", l->time_base.num, l->time_base.den);
247 drawtext(out, xpos, ypos, buffer, s->white);248 drawtext(out, xpos, ypos, buffer, s->white);
248 xpos += strlen(buffer) * 8;249 xpos += strlen(buffer) * 8;
249 }250 }
250 if (s->flags & MODE_QUEUE) {251 if (s->flags & FLAG_QUEUE) {
251 snprintf(buffer, sizeof(buffer)-1, " | queue: ");252 snprintf(buffer, sizeof(buffer)-1, " | queue: ");
252 drawtext(out, xpos, ypos, buffer, s->white);253 drawtext(out, xpos, ypos, buffer, s->white);
253 xpos += strlen(buffer) * 8;254 xpos += strlen(buffer) * 8;
@@ -255,57 +256,57 @@ static int draw_items(AVFilterContext *ctx, AVFrame *out, · 1 unmodified line
255 drawtext(out, xpos, ypos, buffer, frames > 0 ? frames >= 10 ? frames >= 50 ? s->red : s->yellow : s->green : s->white);256 drawtext(out, xpos, ypos, buffer, frames > 0 ? frames >= 10 ? frames >= 50 ? s->red : s->yellow : s->green : s->white);
256 xpos += strlen(buffer) * 8;257 xpos += strlen(buffer) * 8;
257 }258 }
258 if (s->flags & MODE_FCIN) {259 if (s->flags & FLAG_FCIN) {
259 snprintf(buffer, sizeof(buffer)-1, " | in: %"PRId64, l->frame_count_in);260 snprintf(buffer, sizeof(buffer)-1, " | in: %"PRId64, l->frame_count_in);
260 drawtext(out, xpos, ypos, buffer, s->white);261 drawtext(out, xpos, ypos, buffer, s->white);
261 xpos += strlen(buffer) * 8;262 xpos += strlen(buffer) * 8;
262 }263 }
263 if (s->flags & MODE_FCOUT) {264 if (s->flags & FLAG_FCOUT) {
264 snprintf(buffer, sizeof(buffer)-1, " | out: %"PRId64, l->frame_count_out);265 snprintf(buffer, sizeof(buffer)-1, " | out: %"PRId64, l->frame_count_out);
265 drawtext(out, xpos, ypos, buffer, s->white);266 drawtext(out, xpos, ypos, buffer, s->white);
266 xpos += strlen(buffer) * 8;267 xpos += strlen(buffer) * 8;
267 }268 }
268 if (s->flags & MODE_FC_DELTA) {269 if (s->flags & FLAG_FC_DELTA) {
269 snprintf(buffer, sizeof(buffer)-1, " | delta: %"PRId64, l->frame_count_in - l->frame_count_out);270 snprintf(buffer, sizeof(buffer)-1, " | delta: %"PRId64, l->frame_count_in - l->frame_count_out);
270 drawtext(out, xpos, ypos, buffer, s->white);271 drawtext(out, xpos, ypos, buffer, s->white);
271 xpos += strlen(buffer) * 8;272 xpos += strlen(buffer) * 8;
272 }273 }
273 if (s->flags & MODE_SCIN) {274 if (s->flags & FLAG_SCIN) {
274 snprintf(buffer, sizeof(buffer)-1, " | sin: %"PRId64, l->sample_count_in);275 snprintf(buffer, sizeof(buffer)-1, " | sin: %"PRId64, l->sample_count_in);
275 drawtext(out, xpos, ypos, buffer, s->white);276 drawtext(out, xpos, ypos, buffer, s->white);
276 xpos += strlen(buffer) * 8;277 xpos += strlen(buffer) * 8;
277 }278 }
278 if (s->flags & MODE_SCOUT) {279 if (s->flags & FLAG_SCOUT) {
279 snprintf(buffer, sizeof(buffer)-1, " | sout: %"PRId64, l->sample_count_out);280 snprintf(buffer, sizeof(buffer)-1, " | sout: %"PRId64, l->sample_count_out);
280 drawtext(out, xpos, ypos, buffer, s->white);281 drawtext(out, xpos, ypos, buffer, s->white);
281 xpos += strlen(buffer) * 8;282 xpos += strlen(buffer) * 8;
282 }283 }
283 if (s->flags & MODE_SC_DELTA) {284 if (s->flags & FLAG_SC_DELTA) {
284 snprintf(buffer, sizeof(buffer)-1, " | sdelta: %"PRId64, l->sample_count_in - l->sample_count_out);285 snprintf(buffer, sizeof(buffer)-1, " | sdelta: %"PRId64, l->sample_count_in - l->sample_count_out);
285 drawtext(out, xpos, ypos, buffer, s->white);286 drawtext(out, xpos, ypos, buffer, s->white);
286 xpos += strlen(buffer) * 8;287 xpos += strlen(buffer) * 8;
287 }288 }
288 if (s->flags & MODE_PTS) {289 if (s->flags & FLAG_PTS) {
289 snprintf(buffer, sizeof(buffer)-1, " | pts: %s", av_ts2str(current_pts_us));290 snprintf(buffer, sizeof(buffer)-1, " | pts: %s", av_ts2str(current_pts_us));
290 drawtext(out, xpos, ypos, buffer, s->white);291 drawtext(out, xpos, ypos, buffer, s->white);
291 xpos += strlen(buffer) * 8;292 xpos += strlen(buffer) * 8;
292 }293 }
293 if (s->flags & MODE_PTS_DELTA) {294 if (s->flags & FLAG_PTS_DELTA) {
294 snprintf(buffer, sizeof(buffer)-1, " | pts_delta: %s", av_ts2str(current_pts_us - previous_pts_us));295 snprintf(buffer, sizeof(buffer)-1, " | pts_delta: %s", av_ts2str(current_pts_us - previous_pts_us));
295 drawtext(out, xpos, ypos, buffer, s->white);296 drawtext(out, xpos, ypos, buffer, s->white);
296 xpos += strlen(buffer) * 8;297 xpos += strlen(buffer) * 8;
297 }298 }
298 if (s->flags & MODE_TIME) {299 if (s->flags & FLAG_TIME) {
299 snprintf(buffer, sizeof(buffer)-1, " | time: %s", av_ts2timestr(current_pts_us, &AV_TIME_BASE_Q));300 snprintf(buffer, sizeof(buffer)-1, " | time: %s", av_ts2timestr(current_pts_us, &AV_TIME_BASE_Q));
300 drawtext(out, xpos, ypos, buffer, s->white);301 drawtext(out, xpos, ypos, buffer, s->white);
301 xpos += strlen(buffer) * 8;302 xpos += strlen(buffer) * 8;
302 }303 }
303 if (s->flags & MODE_TIME_DELTA) {304 if (s->flags & FLAG_TIME_DELTA) {
304 snprintf(buffer, sizeof(buffer)-1, " | time_delta: %s", av_ts2timestr(current_pts_us - previous_pts_us, &AV_TIME_BASE_Q));305 snprintf(buffer, sizeof(buffer)-1, " | time_delta: %s", av_ts2timestr(current_pts_us - previous_pts_us, &AV_TIME_BASE_Q));
305 drawtext(out, xpos, ypos, buffer, s->white);306 drawtext(out, xpos, ypos, buffer, s->white);
306 xpos += strlen(buffer) * 8;307 xpos += strlen(buffer) * 8;
307 }308 }
308 if (s->flags & MODE_EOF && ff_outlink_get_status(l)) {309 if (s->flags & FLAG_EOF && ff_outlink_get_status(l)) {
309 snprintf(buffer, sizeof(buffer)-1, " | eof");310 snprintf(buffer, sizeof(buffer)-1, " | eof");
310 drawtext(out, xpos, ypos, buffer, s->blue);311 drawtext(out, xpos, ypos, buffer, s->blue);
311 xpos += strlen(buffer) * 8;312 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