From bc1a985ba030e9861d24965d42792850b43a43ea Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 31 Mar 2013 08:28:11 +0200 Subject: lavfi: replace avfilter_open() with avfilter_graph_alloc_filter(). Since we do not support "standalone" filters not attached to an AVFilterGraph, we should not have a public function to create such filters. In addition that function is horribly named, the action it does cannot be possibly described as "opening" a filter. --- libavfilter/avfilter.h | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'libavfilter/avfilter.h') diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h index 6416e579bf..abc4eae11b 100644 --- a/libavfilter/avfilter.h +++ b/libavfilter/avfilter.h @@ -602,8 +602,8 @@ void avfilter_uninit(void); /** * Register a filter. This is only needed if you plan to use * avfilter_get_by_name later to lookup the AVFilter structure by name. A - * filter can still by instantiated with avfilter_open even if it is not - * registered. + * filter can still by instantiated with avfilter_graph_alloc_filter even if it + * is not registered. * * @param filter the filter to register * @return 0 if the registration was succesfull, a negative value @@ -628,6 +628,7 @@ AVFilter *avfilter_get_by_name(const char *name); */ AVFilter **av_filter_next(AVFilter **filter); +#if FF_API_AVFILTER_OPEN /** * Create a filter instance. * @@ -636,8 +637,11 @@ AVFilter **av_filter_next(AVFilter **filter); * @param filter the filter to create an instance of * @param inst_name Name to give to the new instance. Can be NULL for none. * @return >= 0 in case of success, a negative error code otherwise + * @deprecated use avfilter_graph_alloc_filter() instead */ +attribute_deprecated int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name); +#endif /** * Initialize a filter. @@ -720,6 +724,24 @@ typedef struct AVFilterGraph { */ AVFilterGraph *avfilter_graph_alloc(void); +/** + * Create a new filter instance in a filter graph. + * + * @param graph graph in which the new filter will be used + * @param filter the filter to create an instance of + * @param name Name to give to the new instance (will be copied to + * AVFilterContext.name). This may be used by the caller to identify + * different filters, libavfilter itself assigns no semantics to + * this parameter. May be NULL. + * + * @return the context of the newly created filter instance (note that it is + * also retrievable directly through AVFilterGraph.filters or with + * avfilter_graph_get_filter()) on success or NULL or failure. + */ +AVFilterContext *avfilter_graph_alloc_filter(AVFilterGraph *graph, + const AVFilter *filter, + const char *name); + /** * Get a filter instance with name name from graph. * -- cgit v1.2.3