History

lavfi: add avfilter_init_str() to replace avfilter_init_filter().

Drop the unused opaque parameter from its signature.

Anton Khirnov committed 13 years ago

Commit 48a5ada1 parent 1565cbc7 files · +33 −3Browse files

Unified · Split

7 files
  1. doc/APIchanges +1 −0
  2. libavfilter/avfilter.c +7 −0
  3. libavfilter/avfilter.h +16 −0
  4. libavfilter/avfiltergraph.c +3 −1
  5. libavfilter/filtfmts.c +1 −1
  6. libavfilter/graphparser.c +2 −1
  7. libavfilter/version.h +3 −0
doc/APIchanges+1−0
@@ -20,6 +20,7 @@ API changes, most recent first: · 19 unmodified lines
2020 avfilter_graph_add_filter().
2121 Add AVFilterContext.graph pointing to the AVFilterGraph that contains the
2222 filter.
23+ Add avfilter_init_str(), deprecate avfilter_init_filter().
2324
2425 2013-xx-xx - lavfi 3.7.0 - avfilter.h
2526 Add AVFilter.priv_class for exporting filter options through the AVOptions API
libavfilter/avfilter.c+7−0
@@ -508,7 +508,14 @@ static int process_unnamed_options(AVFilterContext *ctx, AVDictionary **options, · 507 unmodified lines
508508 return 0;
509509 }
510510
511+#if FF_API_AVFILTER_INIT_FILTER
511512 int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque)
513+{
514+ return avfilter_init_str(filter, args);
515+}
516+#endif
517+
518+int avfilter_init_str(AVFilterContext *filter, const char *args)
512519 {
513520 AVDictionary *options = NULL;
514521 AVDictionaryEntry *e;
libavfilter/avfilter.h+16−0
@@ -645,6 +645,8 @@ attribute_deprecated · 644 unmodified lines
645645 int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name);
646646 #endif
647647
648+
649+#if FF_API_AVFILTER_INIT_FILTER
648650 /**
649651 * Initialize a filter.
650652 *
@@ -655,7 +657,21 @@ int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *in · 4 unmodified lines
655657 * of this parameter varies by filter.
656658 * @return zero on success
657659 */
660+attribute_deprecated
658661 int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque);
662+#endif
663+
664+/**
665+ * Initialize a filter with the supplied parameters.
666+ *
667+ * @param ctx uninitialized filter context to initialize
668+ * @param args Options to initialize the filter with. This must be a
669+ * ':'-separated list of options in the 'key=value' form.
670+ * May be NULL if the options have been set directly using the
671+ * AVOptions API or there are no options that need to be set.
672+ * @return 0 on success, a negative AVERROR on failure
673+ */
674+int avfilter_init_str(AVFilterContext *ctx, const char *args);
659675
660676 /**
661677 * Free a filter context. This will also remove the filter from its
libavfilter/avfiltergraph.c+3−1
@@ -103,7 +103,9 @@ int avfilter_graph_create_filter(AVFilterContext **filt_ctx, AVFilter *filt, · 102 unmodified lines
103103 *filt_ctx = avfilter_graph_alloc_filter(graph_ctx, filt, name);
104104 if (!*filt_ctx)
105105 return AVERROR(ENOMEM);
106− if ((ret = avfilter_init_filter(*filt_ctx, args, opaque)) < 0)
106+
107+ ret = avfilter_init_str(*filt_ctx, args);
108+ if (ret < 0)
107109 goto fail;
108110
109111 return 0;
libavfilter/filtfmts.c+1−1
@@ -57,7 +57,7 @@ int main(int argc, char **argv) · 56 unmodified lines
5757 filter_name);
5858 return 1;
5959 }
60− if (avfilter_init_filter(filter_ctx, filter_args, NULL) < 0) {
60+ if (avfilter_init_str(filter_ctx, filter_args) < 0) {
6161 fprintf(stderr, "Impossible to init filter '%s' with arguments '%s'\n",
6262 filter_name, filter_args);
6363 return 1;
libavfilter/graphparser.c+2−1
@@ -123,7 +123,8 @@ static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int ind · 122 unmodified lines
123123 args = tmp_args;
124124 }
125125
126− if ((ret = avfilter_init_filter(*filt_ctx, args, NULL)) < 0) {
126+ ret = avfilter_init_str(*filt_ctx, args);
127+ if (ret < 0) {
127128 av_log(log_ctx, AV_LOG_ERROR,
128129 "Error initializing filter '%s' with args '%s'\n", filt_name, args);
129130 return ret;
libavfilter/version.h+3−0
@@ -61,5 +61,8 @@ · 60 unmodified lines
6161 #ifndef FF_API_AVFILTER_OPEN
6262 #define FF_API_AVFILTER_OPEN (LIBAVFILTER_VERSION_MAJOR < 4)
6363 #endif
64+#ifndef FF_API_AVFILTER_INIT_FILTER
65+#define FF_API_AVFILTER_INIT_FILTER (LIBAVFILTER_VERSION_MAJOR < 4)
66+#endif
6467
6568 #endif /* AVFILTER_VERSION_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t