[FFmpeg-devel] [PATCH 22/24] fftools/ffmpeg_filter: constify the argument of filtergraph_is_simple()

Anton Khirnov anton at khirnov.net
Sun May 28 12:14:14 EEST 2023


---
 fftools/ffmpeg.h        | 2 +-
 fftools/ffmpeg_filter.c | 9 +++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index 655b5c7ec5..966397270d 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -731,7 +731,7 @@ int parse_and_set_vsync(const char *arg, int *vsync_var, int file_idx, int st_id
 
 int configure_filtergraph(FilterGraph *fg);
 void check_filter_outputs(void);
-int filtergraph_is_simple(FilterGraph *fg);
+int filtergraph_is_simple(const FilterGraph *fg);
 int init_simple_filtergraph(InputStream *ist, OutputStream *ost,
                             char *graph_desc);
 int init_complex_filtergraph(FilterGraph *fg);
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 0bd0593724..62ba27e559 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -54,6 +54,11 @@ static FilterGraphPriv *fgp_from_fg(FilterGraph *fg)
     return (FilterGraphPriv*)fg;
 }
 
+static const FilterGraphPriv *cfgp_from_cfg(const FilterGraph *fg)
+{
+    return (const FilterGraphPriv*)fg;
+}
+
 typedef struct InputFilterPriv {
     InputFilter ifilter;
 
@@ -1674,9 +1679,9 @@ static int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *fr
     return 0;
 }
 
-int filtergraph_is_simple(FilterGraph *fg)
+int filtergraph_is_simple(const FilterGraph *fg)
 {
-    FilterGraphPriv *fgp = fgp_from_fg(fg);
+    const FilterGraphPriv *fgp = cfgp_from_cfg(fg);
     return fgp->is_simple;
 }
 
-- 
2.40.1



More information about the ffmpeg-devel mailing list