History

avfilter/f_select.c: add support for iw and ih variables

Fixes ticket #10509.

PoorvaGaikar committed 2 years ago

Commit 8b6e66d1 parent 9e674b32 files · +18 −0Browse files

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

Unified · Split

libavfilter/f_select.c+12−0
@@ -90,6 +90,9 @@ static const char *const var_names[] = { · 89 unmodified lines
9090
9191 "concatdec_select", ///< frame is within the interval set by the concat demuxer
9292
93+ "ih", ///< ih: Represents the height of the input video frame.
94+ "iw", ///< iw: Represents the width of the input video frame.
95+
9396 NULL
9497 };
9598
@@ -144,6 +147,9 @@ enum var_name { · 48 unmodified lines
144147
145148 VAR_CONCATDEC_SELECT,
146149
150+ VAR_IH,
151+ VAR_IW,
152+
147153 VAR_VARS_NB
148154 };
149155
@@ -264,6 +270,9 @@ static int config_input(AVFilterLink *inlink) · 114 unmodified lines
264270 select->var_values[VAR_CONSUMED_SAMPLES_N] = NAN;
265271 select->var_values[VAR_SAMPLES_N] = NAN;
266272
273+ select->var_values[VAR_IH] = NAN;
274+ select->var_values[VAR_IW] = NAN;
275+
267276 select->var_values[VAR_SAMPLE_RATE] =
268277 inlink->type == AVMEDIA_TYPE_AUDIO ? inlink->sample_rate : NAN;
269278
@@ -357,6 +366,9 @@ FF_ENABLE_DEPRECATION_WARNINGS · 87 unmodified lines
357366 break;
358367
359368 case AVMEDIA_TYPE_VIDEO:
369+ select->var_values[VAR_IH] = frame->height;
370+ select->var_values[VAR_IW] = frame->width;
371+
360372 select->var_values[VAR_INTERLACE_TYPE] =
361373 !(frame->flags & AV_FRAME_FLAG_INTERLACED) ? INTERLACE_TYPE_P :
362374 (frame->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST) ? INTERLACE_TYPE_T : INTERLACE_TYPE_B;

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