It is only useful inside filters and we don't allow user filters for now.tags/n1.0
| @@ -105,8 +105,8 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) | |||
| } | |||
| PARSE_FORMATS(s->formats_str, enum AVSampleFormat, s->formats, | |||
| avfilter_add_format, av_get_sample_fmt, AV_SAMPLE_FMT_NONE, "sample format"); | |||
| PARSE_FORMATS(s->sample_rates_str, int, s->sample_rates, avfilter_add_format, | |||
| ff_add_format, av_get_sample_fmt, AV_SAMPLE_FMT_NONE, "sample format"); | |||
| PARSE_FORMATS(s->sample_rates_str, int, s->sample_rates, ff_add_format, | |||
| get_sample_rate, 0, "sample rate"); | |||
| PARSE_FORMATS(s->channel_layouts_str, uint64_t, s->channel_layouts, | |||
| ff_add_channel_layout, av_get_channel_layout, 0, | |||
| @@ -121,8 +121,8 @@ static int query_formats(AVFilterContext *ctx) | |||
| { | |||
| AFormatContext *s = ctx->priv; | |||
| avfilter_set_common_formats(ctx, s->formats ? s->formats : | |||
| avfilter_all_formats(AVMEDIA_TYPE_AUDIO)); | |||
| ff_set_common_formats(ctx, s->formats ? s->formats : | |||
| ff_all_formats(AVMEDIA_TYPE_AUDIO)); | |||
| ff_set_common_samplerates(ctx, s->sample_rates ? s->sample_rates : | |||
| ff_all_samplerates()); | |||
| ff_set_common_channel_layouts(ctx, s->channel_layouts ? s->channel_layouts : | |||
| @@ -525,8 +525,8 @@ static void uninit(AVFilterContext *ctx) | |||
| static int query_formats(AVFilterContext *ctx) | |||
| { | |||
| AVFilterFormats *formats = NULL; | |||
| avfilter_add_format(&formats, AV_SAMPLE_FMT_FLT); | |||
| avfilter_set_common_formats(ctx, formats); | |||
| ff_add_format(&formats, AV_SAMPLE_FMT_FLT); | |||
| ff_set_common_formats(ctx, formats); | |||
| ff_set_common_channel_layouts(ctx, ff_all_channel_layouts()); | |||
| ff_set_common_samplerates(ctx, ff_all_samplerates()); | |||
| return 0; | |||
| @@ -55,18 +55,18 @@ static int query_formats(AVFilterContext *ctx) | |||
| AVFilterLink *inlink = ctx->inputs[0]; | |||
| AVFilterLink *outlink = ctx->outputs[0]; | |||
| AVFilterFormats *in_formats = avfilter_all_formats(AVMEDIA_TYPE_AUDIO); | |||
| AVFilterFormats *out_formats = avfilter_all_formats(AVMEDIA_TYPE_AUDIO); | |||
| AVFilterFormats *in_formats = ff_all_formats(AVMEDIA_TYPE_AUDIO); | |||
| AVFilterFormats *out_formats = ff_all_formats(AVMEDIA_TYPE_AUDIO); | |||
| AVFilterFormats *in_samplerates = ff_all_samplerates(); | |||
| AVFilterFormats *out_samplerates = ff_all_samplerates(); | |||
| AVFilterChannelLayouts *in_layouts = ff_all_channel_layouts(); | |||
| AVFilterChannelLayouts *out_layouts = ff_all_channel_layouts(); | |||
| avfilter_formats_ref(in_formats, &inlink->out_formats); | |||
| avfilter_formats_ref(out_formats, &outlink->in_formats); | |||
| ff_formats_ref(in_formats, &inlink->out_formats); | |||
| ff_formats_ref(out_formats, &outlink->in_formats); | |||
| avfilter_formats_ref(in_samplerates, &inlink->out_samplerates); | |||
| avfilter_formats_ref(out_samplerates, &outlink->in_samplerates); | |||
| ff_formats_ref(in_samplerates, &inlink->out_samplerates); | |||
| ff_formats_ref(out_samplerates, &outlink->in_samplerates); | |||
| ff_channel_layouts_ref(in_layouts, &inlink->out_channel_layouts); | |||
| ff_channel_layouts_ref(out_layouts, &outlink->in_channel_layouts); | |||
| @@ -120,10 +120,10 @@ int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt, | |||
| /* if any information on supported media formats already exists on the | |||
| * link, we need to preserve that */ | |||
| if (link->out_formats) | |||
| avfilter_formats_changeref(&link->out_formats, | |||
| ff_formats_changeref(&link->out_formats, | |||
| &filt->outputs[filt_dstpad_idx]->out_formats); | |||
| if (link->out_samplerates) | |||
| avfilter_formats_changeref(&link->out_samplerates, | |||
| ff_formats_changeref(&link->out_samplerates, | |||
| &filt->outputs[filt_dstpad_idx]->out_samplerates); | |||
| if (link->out_channel_layouts) | |||
| ff_channel_layouts_changeref(&link->out_channel_layouts, | |||
| @@ -380,10 +380,10 @@ void avfilter_free(AVFilterContext *filter) | |||
| if ((link = filter->inputs[i])) { | |||
| if (link->src) | |||
| link->src->outputs[link->srcpad - link->src->output_pads] = NULL; | |||
| avfilter_formats_unref(&link->in_formats); | |||
| avfilter_formats_unref(&link->out_formats); | |||
| avfilter_formats_unref(&link->in_samplerates); | |||
| avfilter_formats_unref(&link->out_samplerates); | |||
| ff_formats_unref(&link->in_formats); | |||
| ff_formats_unref(&link->out_formats); | |||
| ff_formats_unref(&link->in_samplerates); | |||
| ff_formats_unref(&link->out_samplerates); | |||
| ff_channel_layouts_unref(&link->in_channel_layouts); | |||
| ff_channel_layouts_unref(&link->out_channel_layouts); | |||
| } | |||
| @@ -393,10 +393,10 @@ void avfilter_free(AVFilterContext *filter) | |||
| if ((link = filter->outputs[i])) { | |||
| if (link->dst) | |||
| link->dst->inputs[link->dstpad - link->dst->input_pads] = NULL; | |||
| avfilter_formats_unref(&link->in_formats); | |||
| avfilter_formats_unref(&link->out_formats); | |||
| avfilter_formats_unref(&link->in_samplerates); | |||
| avfilter_formats_unref(&link->out_samplerates); | |||
| ff_formats_unref(&link->in_formats); | |||
| ff_formats_unref(&link->out_formats); | |||
| ff_formats_unref(&link->in_samplerates); | |||
| ff_formats_unref(&link->out_samplerates); | |||
| ff_channel_layouts_unref(&link->in_channel_layouts); | |||
| ff_channel_layouts_unref(&link->out_channel_layouts); | |||
| } | |||
| @@ -52,6 +52,7 @@ const char *avfilter_license(void); | |||
| typedef struct AVFilterContext AVFilterContext; | |||
| typedef struct AVFilterLink AVFilterLink; | |||
| typedef struct AVFilterPad AVFilterPad; | |||
| typedef struct AVFilterFormats AVFilterFormats; | |||
| /** | |||
| * A reference-counted buffer data type used by the filter system. Filters | |||
| @@ -197,134 +198,42 @@ AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask); | |||
| */ | |||
| void avfilter_unref_buffer(AVFilterBufferRef *ref); | |||
| #if FF_API_FILTERS_PUBLIC | |||
| /** | |||
| * A list of supported formats for one end of a filter link. This is used | |||
| * during the format negotiation process to try to pick the best format to | |||
| * use to minimize the number of necessary conversions. Each filter gives a | |||
| * list of the formats supported by each input and output pad. The list | |||
| * given for each pad need not be distinct - they may be references to the | |||
| * same list of formats, as is often the case when a filter supports multiple | |||
| * formats, but will always output the same format as it is given in input. | |||
| * | |||
| * In this way, a list of possible input formats and a list of possible | |||
| * output formats are associated with each link. When a set of formats is | |||
| * negotiated over a link, the input and output lists are merged to form a | |||
| * new list containing only the common elements of each list. In the case | |||
| * that there were no common elements, a format conversion is necessary. | |||
| * Otherwise, the lists are merged, and all other links which reference | |||
| * either of the format lists involved in the merge are also affected. | |||
| * | |||
| * For example, consider the filter chain: | |||
| * filter (a) --> (b) filter (b) --> (c) filter | |||
| * | |||
| * where the letters in parenthesis indicate a list of formats supported on | |||
| * the input or output of the link. Suppose the lists are as follows: | |||
| * (a) = {A, B} | |||
| * (b) = {A, B, C} | |||
| * (c) = {B, C} | |||
| * | |||
| * First, the first link's lists are merged, yielding: | |||
| * filter (a) --> (a) filter (a) --> (c) filter | |||
| * | |||
| * Notice that format list (b) now refers to the same list as filter list (a). | |||
| * Next, the lists for the second link are merged, yielding: | |||
| * filter (a) --> (a) filter (a) --> (a) filter | |||
| * | |||
| * where (a) = {B}. | |||
| * | |||
| * Unfortunately, when the format lists at the two ends of a link are merged, | |||
| * we must ensure that all links which reference either pre-merge format list | |||
| * get updated as well. Therefore, we have the format list structure store a | |||
| * pointer to each of the pointers to itself. | |||
| * @addtogroup lavfi_deprecated | |||
| * @deprecated Those functions are only useful inside filters and | |||
| * user filters are not supported at this point. | |||
| * @{ | |||
| */ | |||
| typedef struct AVFilterFormats { | |||
| struct AVFilterFormats { | |||
| unsigned format_count; ///< number of formats | |||
| int *formats; ///< list of media formats | |||
| unsigned refcount; ///< number of references to this list | |||
| struct AVFilterFormats ***refs; ///< references to this list | |||
| } AVFilterFormats; | |||
| }; | |||
| /** | |||
| * Create a list of supported formats. This is intended for use in | |||
| * AVFilter->query_formats(). | |||
| * | |||
| * @param fmts list of media formats, terminated by -1 | |||
| * @return the format list, with no existing references | |||
| */ | |||
| attribute_deprecated | |||
| AVFilterFormats *avfilter_make_format_list(const int *fmts); | |||
| /** | |||
| * Add fmt to the list of media formats contained in *avff. | |||
| * If *avff is NULL the function allocates the filter formats struct | |||
| * and puts its pointer in *avff. | |||
| * | |||
| * @return a non negative value in case of success, or a negative | |||
| * value corresponding to an AVERROR code in case of error | |||
| */ | |||
| attribute_deprecated | |||
| int avfilter_add_format(AVFilterFormats **avff, int fmt); | |||
| /** | |||
| * Return a list of all formats supported by Libav for the given media type. | |||
| */ | |||
| attribute_deprecated | |||
| AVFilterFormats *avfilter_all_formats(enum AVMediaType type); | |||
| /** | |||
| * Return a format list which contains the intersection of the formats of | |||
| * a and b. Also, all the references of a, all the references of b, and | |||
| * a and b themselves will be deallocated. | |||
| * | |||
| * If a and b do not share any common formats, neither is modified, and NULL | |||
| * is returned. | |||
| */ | |||
| attribute_deprecated | |||
| AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b); | |||
| /** | |||
| * Add *ref as a new reference to formats. | |||
| * That is the pointers will point like in the ascii art below: | |||
| * ________ | |||
| * |formats |<--------. | |||
| * | ____ | ____|___________________ | |||
| * | |refs| | | __|_ | |||
| * | |* * | | | | | | AVFilterLink | |||
| * | |* *--------->|*ref| | |||
| * | |____| | | |____| | |||
| * |________| |________________________ | |||
| */ | |||
| attribute_deprecated | |||
| void avfilter_formats_ref(AVFilterFormats *formats, AVFilterFormats **ref); | |||
| /** | |||
| * If *ref is non-NULL, remove *ref as a reference to the format list | |||
| * it currently points to, deallocates that list if this was the last | |||
| * reference, and sets *ref to NULL. | |||
| * | |||
| * Before After | |||
| * ________ ________ NULL | |||
| * |formats |<--------. |formats | ^ | |||
| * | ____ | ____|________________ | ____ | ____|________________ | |||
| * | |refs| | | __|_ | |refs| | | __|_ | |||
| * | |* * | | | | | | AVFilterLink | |* * | | | | | | AVFilterLink | |||
| * | |* *--------->|*ref| | |* | | | |*ref| | |||
| * | |____| | | |____| | |____| | | |____| | |||
| * |________| |_____________________ |________| |_____________________ | |||
| */ | |||
| attribute_deprecated | |||
| void avfilter_formats_unref(AVFilterFormats **ref); | |||
| /** | |||
| * | |||
| * Before After | |||
| * ________ ________ | |||
| * |formats |<---------. |formats |<---------. | |||
| * | ____ | ___|___ | ____ | ___|___ | |||
| * | |refs| | | | | | |refs| | | | | NULL | |||
| * | |* *--------->|*oldref| | |* *--------->|*newref| ^ | |||
| * | |* * | | |_______| | |* * | | |_______| ___|___ | |||
| * | |____| | | |____| | | | | | |||
| * |________| |________| |*oldref| | |||
| * |_______| | |||
| */ | |||
| attribute_deprecated | |||
| void avfilter_formats_changeref(AVFilterFormats **oldref, | |||
| AVFilterFormats **newref); | |||
| attribute_deprecated | |||
| void avfilter_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats); | |||
| /** | |||
| * @} | |||
| */ | |||
| #endif | |||
| /** | |||
| * A filter pad used for either input or output. | |||
| @@ -479,13 +388,6 @@ attribute_deprecated | |||
| int avfilter_default_query_formats(AVFilterContext *ctx); | |||
| #endif | |||
| /** | |||
| * A helper for query_formats() which sets all links to the same list of | |||
| * formats. If there are no links hooked to this filter, the list of formats is | |||
| * freed. | |||
| */ | |||
| void avfilter_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats); | |||
| #if FF_API_FILTERS_PUBLIC | |||
| /** start_frame() handler for filters which simply pass video along */ | |||
| attribute_deprecated | |||
| @@ -189,7 +189,7 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) | |||
| continue; | |||
| if (link->in_formats != link->out_formats && | |||
| !avfilter_merge_formats(link->in_formats, | |||
| !ff_merge_formats(link->in_formats, | |||
| link->out_formats)) | |||
| convert_needed = 1; | |||
| if (link->type == AVMEDIA_TYPE_AUDIO) { | |||
| @@ -246,8 +246,8 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) | |||
| convert->filter->query_formats(convert); | |||
| inlink = convert->inputs[0]; | |||
| outlink = convert->outputs[0]; | |||
| if (!avfilter_merge_formats( inlink->in_formats, inlink->out_formats) || | |||
| !avfilter_merge_formats(outlink->in_formats, outlink->out_formats)) | |||
| if (!ff_merge_formats( inlink->in_formats, inlink->out_formats) || | |||
| !ff_merge_formats(outlink->in_formats, outlink->out_formats)) | |||
| ret |= AVERROR(ENOSYS); | |||
| if (inlink->type == AVMEDIA_TYPE_AUDIO && | |||
| (!ff_merge_samplerates(inlink->in_samplerates, | |||
| @@ -303,10 +303,10 @@ static int pick_format(AVFilterLink *link) | |||
| link->channel_layout = link->in_channel_layouts->channel_layouts[0]; | |||
| } | |||
| avfilter_formats_unref(&link->in_formats); | |||
| avfilter_formats_unref(&link->out_formats); | |||
| avfilter_formats_unref(&link->in_samplerates); | |||
| avfilter_formats_unref(&link->out_samplerates); | |||
| ff_formats_unref(&link->in_formats); | |||
| ff_formats_unref(&link->out_formats); | |||
| ff_formats_unref(&link->in_samplerates); | |||
| ff_formats_unref(&link->out_samplerates); | |||
| ff_channel_layouts_unref(&link->in_channel_layouts); | |||
| ff_channel_layouts_unref(&link->out_channel_layouts); | |||
| @@ -353,9 +353,9 @@ static int reduce_formats_on_filter(AVFilterContext *filter) | |||
| int i, j, k, ret = 0; | |||
| REDUCE_FORMATS(int, AVFilterFormats, formats, formats, | |||
| format_count, avfilter_add_format); | |||
| format_count, ff_add_format); | |||
| REDUCE_FORMATS(int, AVFilterFormats, samplerates, formats, | |||
| format_count, avfilter_add_format); | |||
| format_count, ff_add_format); | |||
| REDUCE_FORMATS(uint64_t, AVFilterChannelLayouts, channel_layouts, | |||
| channel_layouts, nb_channel_layouts, ff_add_channel_layout); | |||
| @@ -284,14 +284,14 @@ static int query_formats(AVFilterContext *ctx) | |||
| switch (ctx->outputs[0]->type) { | |||
| case AVMEDIA_TYPE_VIDEO: | |||
| avfilter_add_format(&formats, c->pix_fmt); | |||
| avfilter_set_common_formats(ctx, formats); | |||
| ff_add_format(&formats, c->pix_fmt); | |||
| ff_set_common_formats(ctx, formats); | |||
| break; | |||
| case AVMEDIA_TYPE_AUDIO: | |||
| avfilter_add_format(&formats, c->sample_fmt); | |||
| avfilter_set_common_formats(ctx, formats); | |||
| ff_add_format(&formats, c->sample_fmt); | |||
| ff_set_common_formats(ctx, formats); | |||
| avfilter_add_format(&samplerates, c->sample_rate); | |||
| ff_add_format(&samplerates, c->sample_rate); | |||
| ff_set_common_samplerates(ctx, samplerates); | |||
| ff_add_channel_layout(&channel_layouts, c->channel_layout); | |||
| @@ -76,7 +76,7 @@ do { | |||
| MERGE_REF(ret, b, fmts, type, fail); \ | |||
| } while (0) | |||
| AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b) | |||
| AVFilterFormats *ff_merge_formats(AVFilterFormats *a, AVFilterFormats *b) | |||
| { | |||
| AVFilterFormats *ret = NULL; | |||
| @@ -161,7 +161,7 @@ int ff_fmt_is_in(int fmt, const int *fmts) | |||
| return 0; | |||
| } | |||
| AVFilterFormats *avfilter_make_format_list(const int *fmts) | |||
| AVFilterFormats *ff_make_format_list(const int *fmts) | |||
| { | |||
| AVFilterFormats *formats; | |||
| int count; | |||
| @@ -195,7 +195,7 @@ do { \ | |||
| return 0; \ | |||
| } while (0) | |||
| int avfilter_add_format(AVFilterFormats **avff, int fmt) | |||
| int ff_add_format(AVFilterFormats **avff, int fmt) | |||
| { | |||
| ADD_FORMAT(avff, fmt, int, formats, format_count); | |||
| } | |||
| @@ -205,7 +205,7 @@ int ff_add_channel_layout(AVFilterChannelLayouts **l, uint64_t channel_layout) | |||
| ADD_FORMAT(l, channel_layout, uint64_t, channel_layouts, nb_channel_layouts); | |||
| } | |||
| AVFilterFormats *avfilter_all_formats(enum AVMediaType type) | |||
| AVFilterFormats *ff_all_formats(enum AVMediaType type) | |||
| { | |||
| AVFilterFormats *ret = NULL; | |||
| int fmt; | |||
| @@ -215,7 +215,7 @@ AVFilterFormats *avfilter_all_formats(enum AVMediaType type) | |||
| for (fmt = 0; fmt < num_formats; fmt++) | |||
| if ((type != AVMEDIA_TYPE_VIDEO) || | |||
| (type == AVMEDIA_TYPE_VIDEO && !(av_pix_fmt_descriptors[fmt].flags & PIX_FMT_HWACCEL))) | |||
| avfilter_add_format(&ret, fmt); | |||
| ff_add_format(&ret, fmt); | |||
| return ret; | |||
| } | |||
| @@ -244,7 +244,7 @@ void ff_channel_layouts_ref(AVFilterChannelLayouts *f, AVFilterChannelLayouts ** | |||
| FORMATS_REF(f, ref); | |||
| } | |||
| void avfilter_formats_ref(AVFilterFormats *f, AVFilterFormats **ref) | |||
| void ff_formats_ref(AVFilterFormats *f, AVFilterFormats **ref) | |||
| { | |||
| FORMATS_REF(f, ref); | |||
| } | |||
| @@ -280,7 +280,7 @@ do { \ | |||
| *ref = NULL; \ | |||
| } while (0) | |||
| void avfilter_formats_unref(AVFilterFormats **ref) | |||
| void ff_formats_unref(AVFilterFormats **ref) | |||
| { | |||
| FORMATS_UNREF(ref, formats); | |||
| } | |||
| @@ -309,8 +309,7 @@ void ff_channel_layouts_changeref(AVFilterChannelLayouts **oldref, | |||
| FORMATS_CHANGEREF(oldref, newref); | |||
| } | |||
| void avfilter_formats_changeref(AVFilterFormats **oldref, | |||
| AVFilterFormats **newref) | |||
| void ff_formats_changeref(AVFilterFormats **oldref, AVFilterFormats **newref) | |||
| { | |||
| FORMATS_CHANGEREF(oldref, newref); | |||
| } | |||
| @@ -350,7 +349,7 @@ void ff_set_common_samplerates(AVFilterContext *ctx, | |||
| AVFilterFormats *samplerates) | |||
| { | |||
| SET_COMMON_FORMATS(ctx, samplerates, in_samplerates, out_samplerates, | |||
| avfilter_formats_ref, formats); | |||
| ff_formats_ref, formats); | |||
| } | |||
| /** | |||
| @@ -358,10 +357,10 @@ void ff_set_common_samplerates(AVFilterContext *ctx, | |||
| * formats. If there are no links hooked to this filter, the list of formats is | |||
| * freed. | |||
| */ | |||
| void avfilter_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats) | |||
| void ff_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats) | |||
| { | |||
| SET_COMMON_FORMATS(ctx, formats, in_formats, out_formats, | |||
| avfilter_formats_ref, formats); | |||
| ff_formats_ref, formats); | |||
| } | |||
| int ff_default_query_formats(AVFilterContext *ctx) | |||
| @@ -370,7 +369,7 @@ int ff_default_query_formats(AVFilterContext *ctx) | |||
| ctx->outputs && ctx->outputs[0] ? ctx->outputs[0]->type : | |||
| AVMEDIA_TYPE_VIDEO; | |||
| avfilter_set_common_formats(ctx, avfilter_all_formats(type)); | |||
| ff_set_common_formats(ctx, ff_all_formats(type)); | |||
| if (type == AVMEDIA_TYPE_AUDIO) { | |||
| ff_set_common_channel_layouts(ctx, ff_all_channel_layouts()); | |||
| ff_set_common_samplerates(ctx, ff_all_samplerates()); | |||
| @@ -384,4 +383,37 @@ int avfilter_default_query_formats(AVFilterContext *ctx) | |||
| { | |||
| return ff_default_query_formats(ctx); | |||
| } | |||
| void avfilter_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats) | |||
| { | |||
| ff_set_common_formats(ctx, formats); | |||
| } | |||
| AVFilterFormats *avfilter_make_format_list(const int *fmts) | |||
| { | |||
| return ff_make_format_list(fmts); | |||
| } | |||
| int avfilter_add_format(AVFilterFormats **avff, int fmt) | |||
| { | |||
| return ff_add_format(avff, fmt); | |||
| } | |||
| AVFilterFormats *avfilter_all_formats(enum AVMediaType type) | |||
| { | |||
| return ff_all_formats(type); | |||
| } | |||
| AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b) | |||
| { | |||
| return ff_merge_formats(a, b); | |||
| } | |||
| void avfilter_formats_ref(AVFilterFormats *f, AVFilterFormats **ref) | |||
| { | |||
| ff_formats_ref(f, ref); | |||
| } | |||
| void avfilter_formats_unref(AVFilterFormats **ref) | |||
| { | |||
| ff_formats_unref(ref); | |||
| } | |||
| void avfilter_formats_changeref(AVFilterFormats **oldref, | |||
| AVFilterFormats **newref) | |||
| { | |||
| ff_formats_changeref(oldref, newref); | |||
| } | |||
| #endif | |||
| @@ -21,6 +21,56 @@ | |||
| #include "avfilter.h" | |||
| /** | |||
| * A list of supported formats for one end of a filter link. This is used | |||
| * during the format negotiation process to try to pick the best format to | |||
| * use to minimize the number of necessary conversions. Each filter gives a | |||
| * list of the formats supported by each input and output pad. The list | |||
| * given for each pad need not be distinct - they may be references to the | |||
| * same list of formats, as is often the case when a filter supports multiple | |||
| * formats, but will always output the same format as it is given in input. | |||
| * | |||
| * In this way, a list of possible input formats and a list of possible | |||
| * output formats are associated with each link. When a set of formats is | |||
| * negotiated over a link, the input and output lists are merged to form a | |||
| * new list containing only the common elements of each list. In the case | |||
| * that there were no common elements, a format conversion is necessary. | |||
| * Otherwise, the lists are merged, and all other links which reference | |||
| * either of the format lists involved in the merge are also affected. | |||
| * | |||
| * For example, consider the filter chain: | |||
| * filter (a) --> (b) filter (b) --> (c) filter | |||
| * | |||
| * where the letters in parenthesis indicate a list of formats supported on | |||
| * the input or output of the link. Suppose the lists are as follows: | |||
| * (a) = {A, B} | |||
| * (b) = {A, B, C} | |||
| * (c) = {B, C} | |||
| * | |||
| * First, the first link's lists are merged, yielding: | |||
| * filter (a) --> (a) filter (a) --> (c) filter | |||
| * | |||
| * Notice that format list (b) now refers to the same list as filter list (a). | |||
| * Next, the lists for the second link are merged, yielding: | |||
| * filter (a) --> (a) filter (a) --> (a) filter | |||
| * | |||
| * where (a) = {B}. | |||
| * | |||
| * Unfortunately, when the format lists at the two ends of a link are merged, | |||
| * we must ensure that all links which reference either pre-merge format list | |||
| * get updated as well. Therefore, we have the format list structure store a | |||
| * pointer to each of the pointers to itself. | |||
| */ | |||
| #if !FF_API_FILTERS_PUBLIC | |||
| struct AVFilterFormats { | |||
| unsigned format_count; ///< number of formats | |||
| int *formats; ///< list of media formats | |||
| unsigned refcount; ///< number of references to this list | |||
| struct AVFilterFormats ***refs; ///< references to this list | |||
| }; | |||
| #endif | |||
| typedef struct AVFilterChannelLayouts { | |||
| uint64_t *channel_layouts; ///< list of channel layouts | |||
| int nb_channel_layouts; ///< number of channel layouts | |||
| @@ -59,6 +109,13 @@ void ff_set_common_channel_layouts(AVFilterContext *ctx, | |||
| void ff_set_common_samplerates(AVFilterContext *ctx, | |||
| AVFilterFormats *samplerates); | |||
| /** | |||
| * A helper for query_formats() which sets all links to the same list of | |||
| * formats. If there are no links hooked to this filter, the list of formats is | |||
| * freed. | |||
| */ | |||
| void ff_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats); | |||
| int ff_add_channel_layout(AVFilterChannelLayouts **l, uint64_t channel_layout); | |||
| /** | |||
| @@ -77,4 +134,85 @@ void ff_channel_layouts_changeref(AVFilterChannelLayouts **oldref, | |||
| int ff_default_query_formats(AVFilterContext *ctx); | |||
| /** | |||
| * Create a list of supported formats. This is intended for use in | |||
| * AVFilter->query_formats(). | |||
| * | |||
| * @param fmts list of media formats, terminated by -1 | |||
| * @return the format list, with no existing references | |||
| */ | |||
| AVFilterFormats *ff_make_format_list(const int *fmts); | |||
| /** | |||
| * Add fmt to the list of media formats contained in *avff. | |||
| * If *avff is NULL the function allocates the filter formats struct | |||
| * and puts its pointer in *avff. | |||
| * | |||
| * @return a non negative value in case of success, or a negative | |||
| * value corresponding to an AVERROR code in case of error | |||
| */ | |||
| int ff_add_format(AVFilterFormats **avff, int fmt); | |||
| /** | |||
| * Return a list of all formats supported by Libav for the given media type. | |||
| */ | |||
| AVFilterFormats *ff_all_formats(enum AVMediaType type); | |||
| /** | |||
| * Return a format list which contains the intersection of the formats of | |||
| * a and b. Also, all the references of a, all the references of b, and | |||
| * a and b themselves will be deallocated. | |||
| * | |||
| * If a and b do not share any common formats, neither is modified, and NULL | |||
| * is returned. | |||
| */ | |||
| AVFilterFormats *ff_merge_formats(AVFilterFormats *a, AVFilterFormats *b); | |||
| /** | |||
| * Add *ref as a new reference to formats. | |||
| * That is the pointers will point like in the ascii art below: | |||
| * ________ | |||
| * |formats |<--------. | |||
| * | ____ | ____|___________________ | |||
| * | |refs| | | __|_ | |||
| * | |* * | | | | | | AVFilterLink | |||
| * | |* *--------->|*ref| | |||
| * | |____| | | |____| | |||
| * |________| |________________________ | |||
| */ | |||
| void ff_formats_ref(AVFilterFormats *formats, AVFilterFormats **ref); | |||
| /** | |||
| * If *ref is non-NULL, remove *ref as a reference to the format list | |||
| * it currently points to, deallocates that list if this was the last | |||
| * reference, and sets *ref to NULL. | |||
| * | |||
| * Before After | |||
| * ________ ________ NULL | |||
| * |formats |<--------. |formats | ^ | |||
| * | ____ | ____|________________ | ____ | ____|________________ | |||
| * | |refs| | | __|_ | |refs| | | __|_ | |||
| * | |* * | | | | | | AVFilterLink | |* * | | | | | | AVFilterLink | |||
| * | |* *--------->|*ref| | |* | | | |*ref| | |||
| * | |____| | | |____| | |____| | | |____| | |||
| * |________| |_____________________ |________| |_____________________ | |||
| */ | |||
| void ff_formats_unref(AVFilterFormats **ref); | |||
| /** | |||
| * | |||
| * Before After | |||
| * ________ ________ | |||
| * |formats |<---------. |formats |<---------. | |||
| * | ____ | ___|___ | ____ | ___|___ | |||
| * | |refs| | | | | | |refs| | | | | NULL | |||
| * | |* *--------->|*oldref| | |* *--------->|*newref| ^ | |||
| * | |* * | | |_______| | |* * | | |_______| ___|___ | |||
| * | |____| | | |____| | | | | | |||
| * |________| |________| |*oldref| | |||
| * |_______| | |||
| */ | |||
| void ff_formats_changeref(AVFilterFormats **oldref, AVFilterFormats **newref); | |||
| #endif // AVFILTER_FORMATS_H | |||
| @@ -28,6 +28,7 @@ | |||
| */ | |||
| #include "avfilter.h" | |||
| #include "formats.h" | |||
| #include "video.h" | |||
| typedef struct { | |||
| @@ -45,7 +46,7 @@ static int query_formats(AVFilterContext *ctx) | |||
| PIX_FMT_NONE | |||
| }; | |||
| avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); | |||
| ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); | |||
| return 0; | |||
| } | |||
| @@ -29,6 +29,7 @@ | |||
| #include "libavutil/eval.h" | |||
| #include "libavutil/pixdesc.h" | |||
| #include "avfilter.h" | |||
| #include "formats.h" | |||
| static const char *const var_names[] = { | |||
| "w", | |||
| @@ -129,7 +130,7 @@ static int query_formats(AVFilterContext *ctx) | |||
| PIX_FMT_NONE | |||
| }; | |||
| avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); | |||
| ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); | |||
| return 0; | |||
| } | |||
| @@ -26,6 +26,7 @@ | |||
| /* #define DEBUG */ | |||
| #include "avfilter.h" | |||
| #include "formats.h" | |||
| #include "video.h" | |||
| #include "libavutil/eval.h" | |||
| #include "libavutil/avstring.h" | |||
| @@ -106,7 +107,7 @@ static int query_formats(AVFilterContext *ctx) | |||
| PIX_FMT_NONE | |||
| }; | |||
| avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); | |||
| ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); | |||
| return 0; | |||
| } | |||
| @@ -25,6 +25,7 @@ | |||
| #include "libavutil/imgutils.h" | |||
| #include "avfilter.h" | |||
| #include "formats.h" | |||
| #include "video.h" | |||
| typedef struct { | |||
| @@ -47,7 +48,7 @@ static int query_formats(AVFilterContext *ctx) | |||
| PIX_FMT_NONE | |||
| }; | |||
| avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); | |||
| ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); | |||
| return 0; | |||
| } | |||
| @@ -29,6 +29,7 @@ | |||
| #include "libavutil/opt.h" | |||
| #include "libavutil/pixdesc.h" | |||
| #include "avfilter.h" | |||
| #include "formats.h" | |||
| #include "video.h" | |||
| /** | |||
| @@ -165,7 +166,7 @@ static int query_formats(AVFilterContext *ctx) | |||
| PIX_FMT_NONE | |||
| }; | |||
| avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); | |||
| ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); | |||
| return 0; | |||
| } | |||
| @@ -28,6 +28,7 @@ | |||
| #include "libavutil/pixdesc.h" | |||
| #include "libavutil/parseutils.h" | |||
| #include "avfilter.h" | |||
| #include "formats.h" | |||
| #include "video.h" | |||
| enum { Y, U, V, A }; | |||
| @@ -71,7 +72,7 @@ static int query_formats(AVFilterContext *ctx) | |||
| PIX_FMT_NONE | |||
| }; | |||
| avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); | |||
| ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); | |||
| return 0; | |||
| } | |||
| @@ -41,6 +41,7 @@ | |||
| #include "libavutil/lfg.h" | |||
| #include "avfilter.h" | |||
| #include "drawutils.h" | |||
| #include "formats.h" | |||
| #include "video.h" | |||
| #undef time | |||
| @@ -396,7 +397,7 @@ static int query_formats(AVFilterContext *ctx) | |||
| PIX_FMT_NONE | |||
| }; | |||
| avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); | |||
| ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); | |||
| return 0; | |||
| } | |||
| @@ -27,6 +27,7 @@ | |||
| #include "libavutil/pixdesc.h" | |||
| #include "avfilter.h" | |||
| #include "formats.h" | |||
| #include "video.h" | |||
| typedef struct { | |||
| @@ -79,7 +80,7 @@ static int query_formats(AVFilterContext *ctx) | |||
| PIX_FMT_NONE | |||
| }; | |||
| avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); | |||
| ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); | |||
| return 0; | |||
| } | |||
| @@ -28,6 +28,7 @@ | |||
| #include "libavutil/imgutils.h" | |||
| #include "libavutil/pixdesc.h" | |||
| #include "avfilter.h" | |||
| #include "formats.h" | |||
| typedef struct | |||
| { | |||
| @@ -76,12 +77,12 @@ static int query_formats(AVFilterContext *ctx) | |||
| || av_pix_fmt_descriptors[pix_fmt].flags & PIX_FMT_BITSTREAM) | |||
| && av_pix_fmt_descriptors[pix_fmt].nb_components | |||
| && !av_pix_fmt_descriptors[pix_fmt].log2_chroma_h | |||
| && (ret = avfilter_add_format(&formats, pix_fmt)) < 0) { | |||
| avfilter_formats_unref(&formats); | |||
| && (ret = ff_add_format(&formats, pix_fmt)) < 0) { | |||
| ff_formats_unref(&formats); | |||
| return ret; | |||
| } | |||
| avfilter_formats_ref(formats, &ctx->inputs[0]->out_formats); | |||
| avfilter_formats_ref(formats, &ctx->outputs[0]->in_formats); | |||
| ff_formats_ref(formats, &ctx->inputs[0]->out_formats); | |||
| ff_formats_ref(formats, &ctx->outputs[0]->in_formats); | |||
| } | |||
| return 0; | |||
| @@ -25,6 +25,7 @@ | |||
| #include "libavutil/pixdesc.h" | |||
| #include "avfilter.h" | |||
| #include "formats.h" | |||
| #include "video.h" | |||
| typedef struct { | |||
| @@ -89,7 +90,7 @@ static AVFilterFormats *make_format_list(FormatContext *format, int flag) | |||
| #if CONFIG_FORMAT_FILTER | |||
| static int query_formats_format(AVFilterContext *ctx) | |||
| { | |||
| avfilter_set_common_formats(ctx, make_format_list(ctx->priv, 1)); | |||
| ff_set_common_formats(ctx, make_format_list(ctx->priv, 1)); | |||
| return 0; | |||
| } | |||
| @@ -119,7 +120,7 @@ AVFilter avfilter_vf_format = { | |||
| #if CONFIG_NOFORMAT_FILTER | |||
| static int query_formats_noformat(AVFilterContext *ctx) | |||
| { | |||
| avfilter_set_common_formats(ctx, make_format_list(ctx->priv, 0)); | |||
| ff_set_common_formats(ctx, make_format_list(ctx->priv, 0)); | |||
| return 0; | |||
| } | |||
| @@ -31,6 +31,7 @@ | |||
| #include "libavutil/mathematics.h" | |||
| #include "libavutil/parseutils.h" | |||
| #include "avfilter.h" | |||
| #include "formats.h" | |||
| typedef f0r_instance_t (*f0r_construct_f)(unsigned int width, unsigned int height); | |||
| typedef void (*f0r_destruct_f)(f0r_instance_t instance); | |||
| @@ -320,20 +321,20 @@ static int query_formats(AVFilterContext *ctx) | |||
| AVFilterFormats *formats = NULL; | |||
| if (frei0r->plugin_info.color_model == F0R_COLOR_MODEL_BGRA8888) { | |||
| avfilter_add_format(&formats, PIX_FMT_BGRA); | |||
| ff_add_format(&formats, PIX_FMT_BGRA); | |||
| } else if (frei0r->plugin_info.color_model == F0R_COLOR_MODEL_RGBA8888) { | |||
| avfilter_add_format(&formats, PIX_FMT_RGBA); | |||
| ff_add_format(&formats, PIX_FMT_RGBA); | |||
| } else { /* F0R_COLOR_MODEL_PACKED32 */ | |||
| static const enum PixelFormat pix_fmts[] = { | |||
| PIX_FMT_BGRA, PIX_FMT_ARGB, PIX_FMT_ABGR, PIX_FMT_ARGB, PIX_FMT_NONE | |||
| }; | |||
| formats = avfilter_make_format_list(pix_fmts); | |||
| formats = ff_make_format_list(pix_fmts); | |||
| } | |||
| if (!formats) | |||
| return AVERROR(ENOMEM); | |||
| avfilter_set_common_formats(ctx, formats); | |||
| ff_set_common_formats(ctx, formats); | |||
| return 0; | |||
| } | |||
| @@ -36,6 +36,7 @@ | |||
| #include "libavutil/cpu.h" | |||
| #include "libavutil/pixdesc.h" | |||
| #include "avfilter.h" | |||
| #include "formats.h" | |||
| #include "gradfun.h" | |||
| DECLARE_ALIGNED(16, static const uint16_t, dither)[8][8] = { | |||
| @@ -160,7 +161,7 @@ static int query_formats(AVFilterContext *ctx) | |||
| PIX_FMT_NONE | |||
| }; | |||
| avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); | |||
| ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); | |||
| return 0; | |||
| } | |||
| @@ -25,6 +25,7 @@ | |||
| */ | |||
| #include "avfilter.h" | |||
| #include "formats.h" | |||
| #include "libavutil/pixdesc.h" | |||
| #include "libavutil/intreadwrite.h" | |||
| #include "libavutil/imgutils.h" | |||
| @@ -62,7 +63,7 @@ static int query_formats(AVFilterContext *ctx) | |||
| PIX_FMT_NONE | |||
| }; | |||
| avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); | |||
| ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); | |||
| return 0; | |||
| } | |||
| @@ -27,6 +27,7 @@ | |||
| #include "libavutil/pixdesc.h" | |||
| #include "avfilter.h" | |||
| #include "formats.h" | |||
| typedef struct { | |||
| int Coefs[4][512*16]; | |||
| @@ -268,7 +269,7 @@ static int query_formats(AVFilterContext *ctx) | |||
| PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV411P, PIX_FMT_NONE | |||
| }; | |||
| avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); | |||
| ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); | |||
| return 0; | |||
| } | |||
| @@ -61,7 +61,7 @@ static int query_formats(AVFilterContext *ctx) | |||
| PIX_FMT_BGR24, PIX_FMT_BGRA, PIX_FMT_GRAY8, PIX_FMT_NONE | |||
| }; | |||
| avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); | |||
| ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); | |||
| return 0; | |||
| } | |||
| @@ -29,6 +29,7 @@ | |||
| #include "libavutil/opt.h" | |||
| #include "libavutil/pixdesc.h" | |||
| #include "avfilter.h" | |||
| #include "formats.h" | |||
| #include "internal.h" | |||
| static const char *const var_names[] = { | |||
| @@ -163,7 +164,7 @@ static int query_formats(AVFilterContext *ctx) | |||
| enum PixelFormat *pix_fmts = lut->is_rgb ? rgb_pix_fmts : | |||
| lut->is_yuv ? yuv_pix_fmts : all_pix_fmts; | |||
| avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); | |||
| ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); | |||
| return 0; | |||
| } | |||
| @@ -26,6 +26,7 @@ | |||
| */ | |||
| #include "avfilter.h" | |||
| #include "formats.h" | |||
| #include "libavutil/eval.h" | |||
| #include "libavutil/avstring.h" | |||
| #include "libavutil/pixdesc.h" | |||
| @@ -94,12 +95,12 @@ static int query_formats(AVFilterContext *ctx) | |||
| { | |||
| const enum PixelFormat inout_pix_fmts[] = { PIX_FMT_YUV420P, PIX_FMT_NONE }; | |||
| const enum PixelFormat blend_pix_fmts[] = { PIX_FMT_YUVA420P, PIX_FMT_NONE }; | |||
| AVFilterFormats *inout_formats = avfilter_make_format_list(inout_pix_fmts); | |||
| AVFilterFormats *blend_formats = avfilter_make_format_list(blend_pix_fmts); | |||
| AVFilterFormats *inout_formats = ff_make_format_list(inout_pix_fmts); | |||
| AVFilterFormats *blend_formats = ff_make_format_list(blend_pix_fmts); | |||
| avfilter_formats_ref(inout_formats, &ctx->inputs [MAIN ]->out_formats); | |||
| avfilter_formats_ref(blend_formats, &ctx->inputs [OVERLAY]->out_formats); | |||
| avfilter_formats_ref(inout_formats, &ctx->outputs[MAIN ]->in_formats ); | |||
| ff_formats_ref(inout_formats, &ctx->inputs [MAIN ]->out_formats); | |||
| ff_formats_ref(blend_formats, &ctx->inputs [OVERLAY]->out_formats); | |||
| ff_formats_ref(inout_formats, &ctx->outputs[MAIN ]->in_formats ); | |||
| return 0; | |||
| } | |||
| @@ -25,6 +25,7 @@ | |||
| */ | |||
| #include "avfilter.h" | |||
| #include "formats.h" | |||
| #include "libavutil/avstring.h" | |||
| #include "libavutil/eval.h" | |||
| #include "libavutil/pixdesc.h" | |||
| @@ -84,7 +85,7 @@ static int query_formats(AVFilterContext *ctx) | |||
| PIX_FMT_NONE | |||
| }; | |||
| avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); | |||
| ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); | |||
| return 0; | |||
| } | |||
| @@ -24,6 +24,7 @@ | |||
| */ | |||
| #include "avfilter.h" | |||
| #include "formats.h" | |||
| #include "libavutil/avstring.h" | |||
| #include "libavutil/eval.h" | |||
| #include "libavutil/mathematics.h" | |||
| @@ -123,21 +124,21 @@ static int query_formats(AVFilterContext *ctx) | |||
| formats = NULL; | |||
| for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++) | |||
| if ( sws_isSupportedInput(pix_fmt) | |||
| && (ret = avfilter_add_format(&formats, pix_fmt)) < 0) { | |||
| avfilter_formats_unref(&formats); | |||
| && (ret = ff_add_format(&formats, pix_fmt)) < 0) { | |||
| ff_formats_unref(&formats); | |||
| return ret; | |||
| } | |||
| avfilter_formats_ref(formats, &ctx->inputs[0]->out_formats); | |||
| ff_formats_ref(formats, &ctx->inputs[0]->out_formats); | |||
| } | |||
| if (ctx->outputs[0]) { | |||
| formats = NULL; | |||
| for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++) | |||
| if ( sws_isSupportedOutput(pix_fmt) | |||
| && (ret = avfilter_add_format(&formats, pix_fmt)) < 0) { | |||
| avfilter_formats_unref(&formats); | |||
| && (ret = ff_add_format(&formats, pix_fmt)) < 0) { | |||
| ff_formats_unref(&formats); | |||
| return ret; | |||
| } | |||
| avfilter_formats_ref(formats, &ctx->outputs[0]->in_formats); | |||
| ff_formats_ref(formats, &ctx->outputs[0]->in_formats); | |||
| } | |||
| return 0; | |||
| @@ -29,6 +29,7 @@ | |||
| #include "libavutil/pixdesc.h" | |||
| #include "libavutil/imgutils.h" | |||
| #include "avfilter.h" | |||
| #include "formats.h" | |||
| typedef struct { | |||
| int hsub, vsub; | |||
| @@ -83,7 +84,7 @@ static int query_formats(AVFilterContext *ctx) | |||
| PIX_FMT_NONE | |||
| }; | |||
| avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); | |||
| ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); | |||
| return 0; | |||
| } | |||
| @@ -37,6 +37,7 @@ | |||
| */ | |||
| #include "avfilter.h" | |||
| #include "formats.h" | |||
| #include "libavutil/common.h" | |||
| #include "libavutil/mem.h" | |||
| #include "libavutil/pixdesc.h" | |||
| @@ -162,7 +163,7 @@ static int query_formats(AVFilterContext *ctx) | |||
| PIX_FMT_YUVJ444P, PIX_FMT_YUVJ440P, PIX_FMT_NONE | |||
| }; | |||
| avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); | |||
| ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); | |||
| return 0; | |||
| } | |||
| @@ -23,6 +23,7 @@ | |||
| #include "libavutil/common.h" | |||
| #include "libavutil/pixdesc.h" | |||
| #include "avfilter.h" | |||
| #include "formats.h" | |||
| #include "video.h" | |||
| #include "yadif.h" | |||
| @@ -387,7 +388,7 @@ static int query_formats(AVFilterContext *ctx) | |||
| PIX_FMT_NONE | |||
| }; | |||
| avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); | |||
| ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); | |||
| return 0; | |||
| } | |||
| @@ -24,6 +24,7 @@ | |||
| */ | |||
| #include "avfilter.h" | |||
| #include "formats.h" | |||
| #include "libavutil/pixdesc.h" | |||
| #include "libavutil/colorspace.h" | |||
| #include "libavutil/imgutils.h" | |||
| @@ -100,7 +101,7 @@ static int query_formats(AVFilterContext *ctx) | |||
| PIX_FMT_NONE | |||
| }; | |||
| avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); | |||
| ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); | |||
| return 0; | |||
| } | |||
| @@ -36,6 +36,7 @@ | |||
| #include "libavutil/imgutils.h" | |||
| #include "libavformat/avformat.h" | |||
| #include "avfilter.h" | |||
| #include "formats.h" | |||
| typedef struct { | |||
| const AVClass *class; | |||
| @@ -202,7 +203,7 @@ static int query_formats(AVFilterContext *ctx) | |||
| MovieContext *movie = ctx->priv; | |||
| enum PixelFormat pix_fmts[] = { movie->codec_ctx->pix_fmt, PIX_FMT_NONE }; | |||
| avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); | |||
| ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); | |||
| return 0; | |||
| } | |||
| @@ -26,6 +26,7 @@ | |||
| #include "libavutil/mathematics.h" | |||
| #include "libavutil/parseutils.h" | |||
| #include "avfilter.h" | |||
| #include "formats.h" | |||
| static const char *const var_names[] = { | |||
| "E", | |||
| @@ -37,6 +37,7 @@ | |||
| #include "libavutil/intreadwrite.h" | |||
| #include "libavutil/parseutils.h" | |||
| #include "avfilter.h" | |||
| #include "formats.h" | |||
| typedef struct { | |||
| const AVClass *class; | |||
| @@ -348,7 +349,7 @@ static int test_query_formats(AVFilterContext *ctx) | |||
| static const enum PixelFormat pix_fmts[] = { | |||
| PIX_FMT_RGB24, PIX_FMT_NONE | |||
| }; | |||
| avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); | |||
| ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); | |||
| return 0; | |||
| } | |||
| @@ -459,7 +460,7 @@ static int rgbtest_query_formats(AVFilterContext *ctx) | |||
| PIX_FMT_RGB555, PIX_FMT_BGR555, | |||
| PIX_FMT_NONE | |||
| }; | |||
| avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts)); | |||
| ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); | |||
| return 0; | |||
| } | |||