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
20 avfilter_graph_add_filter().20 avfilter_graph_add_filter().
21 Add AVFilterContext.graph pointing to the AVFilterGraph that contains the21 Add AVFilterContext.graph pointing to the AVFilterGraph that contains the
22 filter.22 filter.
23 Add avfilter_init_str(), deprecate avfilter_init_filter().
23 24
242013-xx-xx - lavfi 3.7.0 - avfilter.h252013-xx-xx - lavfi 3.7.0 - avfilter.h
25 Add AVFilter.priv_class for exporting filter options through the AVOptions API26 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
508 return 0;508 return 0;
509}509}
510 510
511#if FF_API_AVFILTER_INIT_FILTER
511int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque)512int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque)
513{
514 return avfilter_init_str(filter, args);
515}
516#endif
517
518int avfilter_init_str(AVFilterContext *filter, const char *args)
512{519{
513 AVDictionary *options = NULL;520 AVDictionary *options = NULL;
514 AVDictionaryEntry *e;521 AVDictionaryEntry *e;
libavfilter/avfilter.h+16−0
@@ -645,6 +645,8 @@ attribute_deprecated · 644 unmodified lines
645int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name);645int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name);
646#endif646#endif
647 647
648
649#if FF_API_AVFILTER_INIT_FILTER
648/**650/**
649 * Initialize a filter.651 * Initialize a filter.
650 *652 *
@@ -655,7 +657,21 @@ int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *in · 4 unmodified lines
655 * of this parameter varies by filter.657 * of this parameter varies by filter.
656 * @return zero on success658 * @return zero on success
657 */659 */
660attribute_deprecated
658int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque);661int 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 */
674int avfilter_init_str(AVFilterContext *ctx, const char *args);
659 675
660/**676/**
661 * Free a filter context. This will also remove the filter from its677 * 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
103 *filt_ctx = avfilter_graph_alloc_filter(graph_ctx, filt, name);103 *filt_ctx = avfilter_graph_alloc_filter(graph_ctx, filt, name);
104 if (!*filt_ctx)104 if (!*filt_ctx)
105 return AVERROR(ENOMEM);105 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)
107 goto fail;109 goto fail;
108 110
109 return 0;111 return 0;
libavfilter/filtfmts.c+1−1
@@ -57,7 +57,7 @@ int main(int argc, char **argv) · 56 unmodified lines
57 filter_name);57 filter_name);
58 return 1;58 return 1;
59 }59 }
60 if (avfilter_init_filter(filter_ctx, filter_args, NULL) < 0) {60 if (avfilter_init_str(filter_ctx, filter_args) < 0) {
61 fprintf(stderr, "Impossible to init filter '%s' with arguments '%s'\n",61 fprintf(stderr, "Impossible to init filter '%s' with arguments '%s'\n",
62 filter_name, filter_args);62 filter_name, filter_args);
63 return 1;63 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
123 args = tmp_args;123 args = tmp_args;
124 }124 }
125 125
126 if ((ret = avfilter_init_filter(*filt_ctx, args, NULL)) < 0) {126 ret = avfilter_init_str(*filt_ctx, args);
127 if (ret < 0) {
127 av_log(log_ctx, AV_LOG_ERROR,128 av_log(log_ctx, AV_LOG_ERROR,
128 "Error initializing filter '%s' with args '%s'\n", filt_name, args);129 "Error initializing filter '%s' with args '%s'\n", filt_name, args);
129 return ret;130 return ret;
libavfilter/version.h+3−0
@@ -61,5 +61,8 @@ · 60 unmodified lines
61#ifndef FF_API_AVFILTER_OPEN61#ifndef FF_API_AVFILTER_OPEN
62#define FF_API_AVFILTER_OPEN (LIBAVFILTER_VERSION_MAJOR < 4)62#define FF_API_AVFILTER_OPEN (LIBAVFILTER_VERSION_MAJOR < 4)
63#endif63#endif
64#ifndef FF_API_AVFILTER_INIT_FILTER
65#define FF_API_AVFILTER_INIT_FILTER (LIBAVFILTER_VERSION_MAJOR < 4)
66#endif
64 67
65#endif /* AVFILTER_VERSION_H */68#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