Drop the unused opaque parameter from its signature.
Unified · Split
| @@ -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 the | 21 | 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 | ||
| 24 | 2013-xx-xx - lavfi 3.7.0 - avfilter.h | 25 | 2013-xx-xx - lavfi 3.7.0 - avfilter.h |
| 25 | Add AVFilter.priv_class for exporting filter options through the AVOptions API | 26 | Add AVFilter.priv_class for exporting filter options through the AVOptions API |
| @@ -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 | ||
| 511 | int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque) | 512 | 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) | ||
| 512 | { | 519 | { |
| 513 | AVDictionary *options = NULL; | 520 | AVDictionary *options = NULL; |
| 514 | AVDictionaryEntry *e; | 521 | AVDictionaryEntry *e; |
| @@ -645,6 +645,8 @@ attribute_deprecated · 644 unmodified lines | |||
| 645 | int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name); | 645 | int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name); |
| 646 | #endif | 646 | #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 success | 658 | * @return zero on success |
| 657 | */ | 659 | */ |
| 660 | attribute_deprecated | ||
| 658 | int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque); | 661 | 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); | ||
| 659 | 675 | ||
| 660 | /** | 676 | /** |
| 661 | * Free a filter context. This will also remove the filter from its | 677 | * Free a filter context. This will also remove the filter from its |
| @@ -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; |
| @@ -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; |
| @@ -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; |
| @@ -61,5 +61,8 @@ · 60 unmodified lines | |||
| 61 | #ifndef FF_API_AVFILTER_OPEN | 61 | #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 | #endif | 63 | #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 */ |