diff mbox series

[FFmpeg-devel,14/36] fftools/ffmpeg: move ifilter_has_all_input_formats() to ffmpeg_filter

Message ID 20230517102029.541-14-anton@khirnov.net
State Accepted
Commit 82c75ddfade1f69e4743ce07d9d22882512d7137
Headers show
Series [FFmpeg-devel,01/36] fftools/ffmpeg: shorten a variable name | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 fail Make fate failed

Commit Message

Anton Khirnov May 17, 2023, 10:20 a.m. UTC
That is a more appropriate place for that function.
---
 fftools/ffmpeg.c        | 12 ------------
 fftools/ffmpeg_filter.c | 12 ++++++++++++
 2 files changed, 12 insertions(+), 12 deletions(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index e368f5a148..9d554e2fb0 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -787,18 +787,6 @@  static void check_decode_result(InputStream *ist, int *got_output, int ret)
     }
 }
 
-// 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;
-}
-
 // This does not quite work like avcodec_decode_audio4/avcodec_decode_video2.
 // There is the following difference: if you got a frame, you must call
 // it again with pkt=NULL. pkt==NULL is treated differently from pkt->size==0
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);