[FFmpeg-cvslog] lavfi: clarify the behaviour of avfilter_graph_create_filter()

Anton Khirnov git at videolan.org
Sat Sep 28 18:13:24 EEST 2024


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Wed Sep 25 15:21:44 2024 +0200| [ca860d8d07f159ddcefc4ec0289a46cfdeee9150] | committer: Anton Khirnov

lavfi: clarify the behaviour of avfilter_graph_create_filter()

Mention explicitly that no options can be set manually when using this
function.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ca860d8d07f159ddcefc4ec0289a46cfdeee9150
---

 libavfilter/avfilter.h | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index 1401577c50..f2c4a64004 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -845,9 +845,9 @@ AVFilterContext *avfilter_graph_alloc_filter(AVFilterGraph *graph,
 AVFilterContext *avfilter_graph_get_filter(AVFilterGraph *graph, const char *name);
 
 /**
- * Create and add a filter instance into an existing graph.
- * The filter instance is created from the filter filt and inited
- * with the parameter args. opaque is currently ignored.
+ * A convenience wrapper that allocates and initializes a filter in a single
+ * step. The filter instance is created from the filter filt and inited with the
+ * parameter args. opaque is currently ignored.
  *
  * In case of success put in *filt_ctx the pointer to the created
  * filter instance, otherwise set *filt_ctx to NULL.
@@ -856,6 +856,12 @@ AVFilterContext *avfilter_graph_get_filter(AVFilterGraph *graph, const char *nam
  * @param graph_ctx the filter graph
  * @return a negative AVERROR error code in case of failure, a non
  * negative value otherwise
+ *
+ * @warning Since the filter is initialized after this function successfully
+ *          returns, you MUST NOT set any further options on it. If you need to
+ *          do that, call ::avfilter_graph_alloc_filter(), followed by setting
+ *          the options, followed by ::avfilter_init_dict() instead of this
+ *          function.
  */
 int avfilter_graph_create_filter(AVFilterContext **filt_ctx, const AVFilter *filt,
                                  const char *name, const char *args, void *opaque,



More information about the ffmpeg-cvslog mailing list