aboutsummaryrefslogtreecommitdiffstats
path: root/fftools/ffmpeg_filter.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-05-13 09:58:43 +0200
committerAnton Khirnov <anton@khirnov.net>2023-05-22 17:10:44 +0200
commit82c75ddfade1f69e4743ce07d9d22882512d7137 (patch)
tree3455693b258fc00a2892d9dbdc94c1f7a051cd3d /fftools/ffmpeg_filter.c
parent2628c7049ec15e52f267a1a019f7cf38a6cd87b4 (diff)
downloadffmpeg-82c75ddfade1f69e4743ce07d9d22882512d7137.tar.gz
fftools/ffmpeg: move ifilter_has_all_input_formats() to ffmpeg_filter
That is a more appropriate place for that function.
Diffstat (limited to 'fftools/ffmpeg_filter.c')
-rw-r--r--fftools/ffmpeg_filter.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 6323278d15..d85d9e2c67 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -1445,6 +1445,18 @@ static int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *fr
return 0;
}
+// Filters can be configured only if the formats of all inputs are known.
+int ifilter_has_all_input_formats(FilterGraph *fg)
+{
+ int i;
+ for (i = 0; i < fg->nb_inputs; i++) {
+ if (fg->inputs[i]->format < 0 && (fg->inputs[i]->type == AVMEDIA_TYPE_AUDIO ||
+ fg->inputs[i]->type == AVMEDIA_TYPE_VIDEO))
+ return 0;
+ }
+ return 1;
+}
+
int filtergraph_is_simple(FilterGraph *fg)
{
FilterGraphPriv *fgp = fgp_from_fg(fg);