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

Unified · Split

2 files
  1. doc/filters.texi +6 −0
  2. libavfilter/f_select.c +12 −0
doc/filters.texi+6−0
@@ -30882,6 +30882,12 @@ missing. · 30881 unmodified lines
30882That basically means that an input frame is selected if its pts is within the30882That basically means that an input frame is selected if its pts is within the
30883interval set by the concat demuxer.30883interval set by the concat demuxer.
30884 30884
30885@item iw @emph{(video only)}
30886Represents the width of the input video frame.
30887
30888@item ih @emph{(video only)}
30889Represents the height of the input video frame.
30890
30885@end table30891@end table
30886 30892
30887The default value of the select expression is "1".30893The default value of the select expression is "1".
libavfilter/f_select.c+12−0
@@ -90,6 +90,9 @@ static const char *const var_names[] = { · 89 unmodified lines
90 90
91 "concatdec_select", ///< frame is within the interval set by the concat demuxer91 "concatdec_select", ///< frame is within the interval set by the concat demuxer
92 92
93 "ih", ///< ih: Represents the height of the input video frame.
94 "iw", ///< iw: Represents the width of the input video frame.
95
93 NULL96 NULL
94};97};
95 98
@@ -144,6 +147,9 @@ enum var_name { · 48 unmodified lines
144 147
145 VAR_CONCATDEC_SELECT,148 VAR_CONCATDEC_SELECT,
146 149
150 VAR_IH,
151 VAR_IW,
152
147 VAR_VARS_NB153 VAR_VARS_NB
148};154};
149 155
@@ -264,6 +270,9 @@ static int config_input(AVFilterLink *inlink) · 114 unmodified lines
264 select->var_values[VAR_CONSUMED_SAMPLES_N] = NAN;270 select->var_values[VAR_CONSUMED_SAMPLES_N] = NAN;
265 select->var_values[VAR_SAMPLES_N] = NAN;271 select->var_values[VAR_SAMPLES_N] = NAN;
266 272
273 select->var_values[VAR_IH] = NAN;
274 select->var_values[VAR_IW] = NAN;
275
267 select->var_values[VAR_SAMPLE_RATE] =276 select->var_values[VAR_SAMPLE_RATE] =
268 inlink->type == AVMEDIA_TYPE_AUDIO ? inlink->sample_rate : NAN;277 inlink->type == AVMEDIA_TYPE_AUDIO ? inlink->sample_rate : NAN;
269 278
@@ -357,6 +366,9 @@ FF_ENABLE_DEPRECATION_WARNINGS · 87 unmodified lines
357 break;366 break;
358 367
359 case AVMEDIA_TYPE_VIDEO:368 case AVMEDIA_TYPE_VIDEO:
369 select->var_values[VAR_IH] = frame->height;
370 select->var_values[VAR_IW] = frame->width;
371
360 select->var_values[VAR_INTERLACE_TYPE] =372 select->var_values[VAR_INTERLACE_TYPE] =
361 !(frame->flags & AV_FRAME_FLAG_INTERLACED) ? INTERLACE_TYPE_P :373 !(frame->flags & AV_FRAME_FLAG_INTERLACED) ? INTERLACE_TYPE_P :
362 (frame->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST) ? INTERLACE_TYPE_T : INTERLACE_TYPE_B;374 (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