Unified · Split
| @@ -75,14 +75,14 @@ static int query_formats(AVFilterContext *ctx) · 74 unmodified lines | |||
| 75 | AVFilterLink *outlink = ctx->outputs[0]; | 75 | AVFilterLink *outlink = ctx->outputs[0]; |
| 76 | AVFilterChannelLayouts *layouts; | 76 | AVFilterChannelLayouts *layouts; |
| 77 | 77 | ||
| 78 | avfilter_formats_ref(avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO), | 78 | ff_formats_ref(avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO), |
| 79 | &inlink->out_formats); | 79 | &inlink->out_formats); |
| 80 | if (aconvert->out_sample_fmt != AV_SAMPLE_FMT_NONE) { | 80 | if (aconvert->out_sample_fmt != AV_SAMPLE_FMT_NONE) { |
| 81 | formats = NULL; | 81 | formats = NULL; |
| 82 | avfilter_add_format(&formats, aconvert->out_sample_fmt); | 82 | ff_add_format(&formats, aconvert->out_sample_fmt); |
| 83 | avfilter_formats_ref(formats, &outlink->in_formats); | 83 | ff_formats_ref(formats, &outlink->in_formats); |
| 84 | } else | 84 | } else |
| 85 | avfilter_formats_ref(avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO), | 85 | ff_formats_ref(avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO), |
| 86 | &outlink->in_formats); | 86 | &outlink->in_formats); |
| 87 | 87 | ||
| 88 | ff_channel_layouts_ref(ff_all_channel_layouts(), | 88 | ff_channel_layouts_ref(ff_all_channel_layouts(), |
| @@ -119,8 +119,8 @@ static int query_formats(AVFilterContext *ctx) · 118 unmodified lines | |||
| 119 | if ((inlayout[i] >> c) & 1) | 119 | if ((inlayout[i] >> c) & 1) |
| 120 | *(route[i]++) = out_ch_number++; | 120 | *(route[i]++) = out_ch_number++; |
| 121 | } | 121 | } |
| 122 | formats = avfilter_make_format_list(ff_packed_sample_fmts_array); | 122 | formats = ff_make_format_list(ff_packed_sample_fmts_array); |
| 123 | avfilter_set_common_sample_formats(ctx, formats); | 123 | ff_set_common_formats(ctx, formats); |
| 124 | for (i = 0; i < am->nb_inputs; i++) { | 124 | for (i = 0; i < am->nb_inputs; i++) { |
| 125 | layouts = NULL; | 125 | layouts = NULL; |
| 126 | ff_add_channel_layout(&layouts, inlayout[i]); | 126 | ff_add_channel_layout(&layouts, inlayout[i]); |
| @@ -315,7 +315,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) · 188 unmodified lines | |||
| 315 | .min_perms = AV_PERM_READ | AV_PERM_PRESERVE, | 315 | .min_perms = AV_PERM_READ | AV_PERM_PRESERVE, |
| 316 | }; | 316 | }; |
| 317 | snprintf(name, sizeof(name), "in%d", i); | 317 | snprintf(name, sizeof(name), "in%d", i); |
| 318 | avfilter_insert_inpad(ctx, i, &pad); | 318 | ff_insert_inpad(ctx, i, &pad); |
| 319 | } | 319 | } |
| 320 | return 0; | 320 | return 0; |
| 321 | } | 321 | } |
| @@ -91,29 +91,29 @@ static int query_formats(AVFilterContext *ctx) · 90 unmodified lines | |||
| 91 | AVFilterLink *inlink = ctx->inputs[0]; | 91 | AVFilterLink *inlink = ctx->inputs[0]; |
| 92 | AVFilterLink *outlink = ctx->outputs[0]; | 92 | AVFilterLink *outlink = ctx->outputs[0]; |
| 93 | 93 | ||
| 94 | AVFilterFormats *in_formats = avfilter_all_formats(AVMEDIA_TYPE_AUDIO); | 94 | AVFilterFormats *in_formats = ff_all_formats(AVMEDIA_TYPE_AUDIO); |
| 95 | AVFilterFormats *out_formats; | 95 | AVFilterFormats *out_formats; |
| 96 | AVFilterFormats *in_samplerates = ff_all_samplerates(); | 96 | AVFilterFormats *in_samplerates = ff_all_samplerates(); |
| 97 | AVFilterFormats *out_samplerates; | 97 | AVFilterFormats *out_samplerates; |
| 98 | AVFilterChannelLayouts *in_layouts = ff_all_channel_layouts(); | 98 | AVFilterChannelLayouts *in_layouts = ff_all_channel_layouts(); |
| 99 | AVFilterChannelLayouts *out_layouts; | 99 | AVFilterChannelLayouts *out_layouts; |
| 100 | 100 | ||
| 101 | avfilter_formats_ref (in_formats, &inlink->out_formats); | 101 | ff_formats_ref (in_formats, &inlink->out_formats); |
| 102 | avfilter_formats_ref (in_samplerates, &inlink->out_samplerates); | 102 | ff_formats_ref (in_samplerates, &inlink->out_samplerates); |
| 103 | ff_channel_layouts_ref(in_layouts, &inlink->out_channel_layouts); | 103 | ff_channel_layouts_ref(in_layouts, &inlink->out_channel_layouts); |
| 104 | 104 | ||
| 105 | if(out_rate > 0) { | 105 | if(out_rate > 0) { |
| 106 | out_samplerates = avfilter_make_format_list((int[]){ out_rate, -1 }); | 106 | out_samplerates = ff_make_format_list((int[]){ out_rate, -1 }); |
| 107 | } else { | 107 | } else { |
| 108 | out_samplerates = ff_all_samplerates(); | 108 | out_samplerates = ff_all_samplerates(); |
| 109 | } | 109 | } |
| 110 | avfilter_formats_ref(out_samplerates, &outlink->in_samplerates); | 110 | ff_formats_ref(out_samplerates, &outlink->in_samplerates); |
| 111 | 111 | ||
| 112 | if(out_format != AV_SAMPLE_FMT_NONE) { | 112 | if(out_format != AV_SAMPLE_FMT_NONE) { |
| 113 | out_formats = avfilter_make_format_list((int[]){ out_format, -1 }); | 113 | out_formats = ff_make_format_list((int[]){ out_format, -1 }); |
| 114 | } else | 114 | } else |
| 115 | out_formats = avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO); | 115 | out_formats = avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO); |
| 116 | avfilter_formats_ref(out_formats, &outlink->in_formats); | 116 | ff_formats_ref(out_formats, &outlink->in_formats); |
| 117 | 117 | ||
| 118 | if(out_layout) { | 118 | if(out_layout) { |
| 119 | out_layouts = avfilter_make_format64_list((int64_t[]){ out_layout, -1 }); | 119 | out_layouts = avfilter_make_format64_list((int64_t[]){ out_layout, -1 }); |
| @@ -85,11 +85,11 @@ static int query_formats(AVFilterContext *ctx) · 84 unmodified lines | |||
| 85 | 85 | ||
| 86 | for (i = 0; i < 2; i++) { | 86 | for (i = 0; i < 2; i++) { |
| 87 | formats = ctx->inputs[i]->in_formats; | 87 | formats = ctx->inputs[i]->in_formats; |
| 88 | avfilter_formats_ref(formats, &ctx->inputs[i]->out_formats); | 88 | ff_formats_ref(formats, &ctx->inputs[i]->out_formats); |
| 89 | avfilter_formats_ref(formats, &ctx->outputs[i]->in_formats); | 89 | ff_formats_ref(formats, &ctx->outputs[i]->in_formats); |
| 90 | rates = ff_all_samplerates(); | 90 | rates = ff_all_samplerates(); |
| 91 | avfilter_formats_ref(rates, &ctx->inputs[i]->out_samplerates); | 91 | ff_formats_ref(rates, &ctx->inputs[i]->out_samplerates); |
| 92 | avfilter_formats_ref(rates, &ctx->outputs[i]->in_samplerates); | 92 | ff_formats_ref(rates, &ctx->outputs[i]->in_samplerates); |
| 93 | layouts = ctx->inputs[i]->in_channel_layouts; | 93 | layouts = ctx->inputs[i]->in_channel_layouts; |
| 94 | ff_channel_layouts_ref(layouts, &ctx->inputs[i]->out_channel_layouts); | 94 | ff_channel_layouts_ref(layouts, &ctx->inputs[i]->out_channel_layouts); |
| 95 | ff_channel_layouts_ref(layouts, &ctx->outputs[i]->in_channel_layouts); | 95 | ff_channel_layouts_ref(layouts, &ctx->outputs[i]->in_channel_layouts); |
| @@ -82,11 +82,11 @@ static int query_formats(AVFilterContext *ctx) · 81 unmodified lines | |||
| 82 | AVFilterFormats *formats = NULL; | 82 | AVFilterFormats *formats = NULL; |
| 83 | AVFilterChannelLayouts *layout = NULL; | 83 | AVFilterChannelLayouts *layout = NULL; |
| 84 | 84 | ||
| 85 | avfilter_add_format(&formats, AV_SAMPLE_FMT_S16); | 85 | ff_add_format(&formats, AV_SAMPLE_FMT_S16); |
| 86 | avfilter_set_common_sample_formats(ctx, formats); | 86 | ff_set_common_formats(ctx, formats); |
| 87 | ff_add_channel_layout(&layout, AV_CH_LAYOUT_STEREO); | 87 | ff_add_channel_layout(&layout, AV_CH_LAYOUT_STEREO); |
| 88 | ff_set_common_channel_layouts(ctx, layout); | 88 | ff_set_common_channel_layouts(ctx, layout); |
| 89 | ff_set_common_samplerates(ctx, avfilter_make_format_list(sample_rates)); | 89 | ff_set_common_samplerates(ctx, ff_make_format_list(sample_rates)); |
| 90 | 90 | ||
| 91 | return 0; | 91 | return 0; |
| 92 | } | 92 | } |
| @@ -217,7 +217,7 @@ static int query_formats(AVFilterContext *ctx) · 216 unmodified lines | |||
| 217 | 217 | ||
| 218 | pan->pure_gains = are_gains_pure(pan); | 218 | pan->pure_gains = are_gains_pure(pan); |
| 219 | /* libswr supports any sample and packing formats */ | 219 | /* libswr supports any sample and packing formats */ |
| 220 | avfilter_set_common_sample_formats(ctx, avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO)); | 220 | ff_set_common_formats(ctx, avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO)); |
| 221 | 221 | ||
| 222 | formats = ff_all_samplerates(); | 222 | formats = ff_all_samplerates(); |
| 223 | if (!formats) | 223 | if (!formats) |
| @@ -137,10 +137,10 @@ static int query_formats(AVFilterContext *ctx) · 136 unmodified lines | |||
| 137 | return AVERROR(ENOMEM); | 137 | return AVERROR(ENOMEM); |
| 138 | ff_set_common_channel_layouts(ctx, layouts); | 138 | ff_set_common_channel_layouts(ctx, layouts); |
| 139 | 139 | ||
| 140 | formats = avfilter_make_format_list(sample_fmts); | 140 | formats = ff_make_format_list(sample_fmts); |
| 141 | if (!formats) | 141 | if (!formats) |
| 142 | return AVERROR(ENOMEM); | 142 | return AVERROR(ENOMEM); |
| 143 | avfilter_set_common_sample_formats(ctx, formats); | 143 | ff_set_common_formats(ctx, formats); |
| 144 | 144 | ||
| 145 | formats = ff_all_samplerates(); | 145 | formats = ff_all_samplerates(); |
| 146 | if (!formats) | 146 | if (!formats) |
| @@ -97,10 +97,10 @@ static int query_formats(AVFilterContext *ctx) · 96 unmodified lines | |||
| 97 | return AVERROR(ENOMEM); | 97 | return AVERROR(ENOMEM); |
| 98 | ff_set_common_channel_layouts(ctx, layouts); | 98 | ff_set_common_channel_layouts(ctx, layouts); |
| 99 | 99 | ||
| 100 | formats = avfilter_make_format_list(sample_fmts); | 100 | formats = ff_make_format_list(sample_fmts); |
| 101 | if (!formats) | 101 | if (!formats) |
| 102 | return AVERROR(ENOMEM); | 102 | return AVERROR(ENOMEM); |
| 103 | avfilter_set_common_sample_formats(ctx, formats); | 103 | ff_set_common_formats(ctx, formats); |
| 104 | 104 | ||
| 105 | formats = ff_all_samplerates(); | 105 | formats = ff_all_samplerates(); |
| 106 | if (!formats) | 106 | if (!formats) |
| @@ -199,9 +199,9 @@ static int query_formats(AVFilterContext *ctx) · 198 unmodified lines | |||
| 199 | int64_t chlayouts[] = { eval->chlayout, -1 }; | 199 | int64_t chlayouts[] = { eval->chlayout, -1 }; |
| 200 | int sample_rates[] = { eval->sample_rate, -1 }; | 200 | int sample_rates[] = { eval->sample_rate, -1 }; |
| 201 | 201 | ||
| 202 | avfilter_set_common_sample_formats (ctx, avfilter_make_format_list(sample_fmts)); | 202 | ff_set_common_formats (ctx, ff_make_format_list(sample_fmts)); |
| 203 | ff_set_common_channel_layouts(ctx, avfilter_make_format64_list(chlayouts)); | 203 | ff_set_common_channel_layouts(ctx, avfilter_make_format64_list(chlayouts)); |
| 204 | ff_set_common_samplerates(ctx, avfilter_make_format_list(sample_rates)); | 204 | ff_set_common_samplerates(ctx, ff_make_format_list(sample_rates)); |
| 205 | 205 | ||
| 206 | return 0; | 206 | return 0; |
| 207 | } | 207 | } |
| @@ -189,7 +189,7 @@ static int filter_query_formats(AVFilterContext *ctx) · 188 unmodified lines | |||
| 189 | formats = avfilter_make_all_formats(type); | 189 | formats = avfilter_make_all_formats(type); |
| 190 | if (!formats) | 190 | if (!formats) |
| 191 | return AVERROR(ENOMEM); | 191 | return AVERROR(ENOMEM); |
| 192 | avfilter_set_common_formats(ctx, formats); | 192 | ff_set_common_formats(ctx, formats); |
| 193 | if (type == AVMEDIA_TYPE_AUDIO) { | 193 | if (type == AVMEDIA_TYPE_AUDIO) { |
| 194 | samplerates = ff_all_samplerates(); | 194 | samplerates = ff_all_samplerates(); |
| 195 | if (!samplerates) | 195 | if (!samplerates) |
| @@ -231,9 +231,9 @@ static int insert_conv_filter(AVFilterGraph *graph, AVFilterLink *link, · 35 unmodified lines | |||
| 231 | filter_query_formats(filt_ctx); | 231 | filter_query_formats(filt_ctx); |
| 232 | 232 | ||
| 233 | if ( ((link = filt_ctx-> inputs[0]) && | 233 | if ( ((link = filt_ctx-> inputs[0]) && |
| 234 | !avfilter_merge_formats(link->in_formats, link->out_formats)) || | 234 | !ff_merge_formats(link->in_formats, link->out_formats)) || |
| 235 | ((link = filt_ctx->outputs[0]) && | 235 | ((link = filt_ctx->outputs[0]) && |
| 236 | !avfilter_merge_formats(link->in_formats, link->out_formats)) | 236 | !ff_merge_formats(link->in_formats, link->out_formats)) |
| 237 | ) { | 237 | ) { |
| 238 | av_log(NULL, AV_LOG_ERROR, | 238 | av_log(NULL, AV_LOG_ERROR, |
| 239 | "Impossible to convert between the formats supported by the filter " | 239 | "Impossible to convert between the formats supported by the filter " |
| @@ -295,7 +295,7 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) · 55 unmodified lines | |||
| 295 | return AVERROR(EINVAL); | 295 | return AVERROR(EINVAL); |
| 296 | 296 | ||
| 297 | if (link->type == AVMEDIA_TYPE_VIDEO && | 297 | if (link->type == AVMEDIA_TYPE_VIDEO && |
| 298 | !avfilter_merge_formats(link->in_formats, link->out_formats)) { | 298 | !ff_merge_formats(link->in_formats, link->out_formats)) { |
| 299 | 299 | ||
| 300 | /* couldn't merge format lists, auto-insert scale filter */ | 300 | /* couldn't merge format lists, auto-insert scale filter */ |
| 301 | snprintf(filt_args, sizeof(filt_args), "0:0:%s", | 301 | snprintf(filt_args, sizeof(filt_args), "0:0:%s", |
| @@ -310,7 +310,7 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) · 8 unmodified lines | |||
| 310 | /* Merge all three list before checking: that way, in all | 310 | /* Merge all three list before checking: that way, in all |
| 311 | * three categories, aconvert will use a common format | 311 | * three categories, aconvert will use a common format |
| 312 | * whenever possible. */ | 312 | * whenever possible. */ |
| 313 | formats = avfilter_merge_formats(link->in_formats, link->out_formats); | 313 | formats = ff_merge_formats(link->in_formats, link->out_formats); |
| 314 | chlayouts = ff_merge_channel_layouts(link->in_channel_layouts , link->out_channel_layouts); | 314 | chlayouts = ff_merge_channel_layouts(link->in_channel_layouts , link->out_channel_layouts); |
| 315 | samplerates = ff_merge_samplerates (link->in_samplerates, link->out_samplerates); | 315 | samplerates = ff_merge_samplerates (link->in_samplerates, link->out_samplerates); |
| 316 | 316 | ||
| @@ -34,13 +34,11 @@ static void set_common_formats(AVFilterContext *ctx, AVFilterFormats *fmts, · 33 unmodified lines | |||
| 34 | int i; | 34 | int i; |
| 35 | for (i = 0; i < ctx->input_count; i++) | 35 | for (i = 0; i < ctx->input_count; i++) |
| 36 | if (ctx->inputs[i] && ctx->inputs[i]->type == type) | 36 | if (ctx->inputs[i] && ctx->inputs[i]->type == type) |
| 37 | avfilter_formats_ref(fmts, | 37 | ff_formats_ref(fmts, (AVFilterFormats **)((uint8_t *)ctx->inputs[i]+offout)); |
| 38 | (AVFilterFormats **)((uint8_t *)ctx->inputs[i]+offout)); | ||
| 39 | 38 | ||
| 40 | for (i = 0; i < ctx->output_count; i++) | 39 | for (i = 0; i < ctx->output_count; i++) |
| 41 | if (ctx->outputs[i] && ctx->outputs[i]->type == type) | 40 | if (ctx->outputs[i] && ctx->outputs[i]->type == type) |
| 42 | avfilter_formats_ref(fmts, | 41 | ff_formats_ref(fmts, (AVFilterFormats **)((uint8_t *)ctx->outputs[i]+offin)); |
| 43 | (AVFilterFormats **)((uint8_t *)ctx->outputs[i]+offin)); | ||
| 44 | 42 | ||
| 45 | if (!fmts->refcount) { | 43 | if (!fmts->refcount) { |
| 46 | av_free(fmts->formats); | 44 | av_free(fmts->formats); |
| @@ -23,6 +23,7 @@ · 22 unmodified lines | |||
| 23 | #include "libavutil/colorspace.h" | 23 | #include "libavutil/colorspace.h" |
| 24 | #include "libavutil/pixdesc.h" | 24 | #include "libavutil/pixdesc.h" |
| 25 | #include "drawutils.h" | 25 | #include "drawutils.h" |
| 26 | #include "formats.h" | ||
| 26 | 27 | ||
| 27 | enum { RED = 0, GREEN, BLUE, ALPHA }; | 28 | enum { RED = 0, GREEN, BLUE, ALPHA }; |
| 28 | 29 | ||
| @@ -505,7 +506,7 @@ AVFilterFormats *ff_draw_supported_pixel_formats(unsigned flags) · 476 unmodified lines | |||
| 505 | if (ff_draw_init(&draw, i, flags) >= 0) | 506 | if (ff_draw_init(&draw, i, flags) >= 0) |
| 506 | pix_fmts[n++] = i; | 507 | pix_fmts[n++] = i; |
| 507 | pix_fmts[n++] = PIX_FMT_NONE; | 508 | pix_fmts[n++] = PIX_FMT_NONE; |
| 508 | return avfilter_make_format_list(pix_fmts); | 509 | return ff_make_format_list(pix_fmts); |
| 509 | } | 510 | } |
| 510 | 511 | ||
| 511 | #ifdef TEST | 512 | #ifdef TEST |
| @@ -299,7 +299,7 @@ AVFilterFormats *avfilter_make_all_packing_formats(void) · 298 unmodified lines | |||
| 299 | -1, | 299 | -1, |
| 300 | }; | 300 | }; |
| 301 | 301 | ||
| 302 | return avfilter_make_format_list(packing); | 302 | return ff_make_format_list(packing); |
| 303 | } | 303 | } |
| 304 | #endif | 304 | #endif |
| 305 | 305 | ||
| @@ -152,7 +152,7 @@ int av_buffersink_poll_frame(AVFilterContext *ctx) · 151 unmodified lines | |||
| 152 | BufferSinkContext *buf = ctx->priv; | 152 | BufferSinkContext *buf = ctx->priv; |
| 153 | AVFilterLink *inlink = ctx->inputs[0]; | 153 | AVFilterLink *inlink = ctx->inputs[0]; |
| 154 | 154 | ||
| 155 | return av_fifo_size(buf->fifo)/sizeof(AVFilterBufferRef *) + avfilter_poll_frame(inlink); | 155 | return av_fifo_size(buf->fifo)/sizeof(AVFilterBufferRef *) + ff_poll_frame(inlink); |
| 156 | } | 156 | } |
| 157 | 157 | ||
| 158 | #if FF_API_OLD_VSINK_API | 158 | #if FF_API_OLD_VSINK_API |
| @@ -201,9 +201,9 @@ static int vsink_query_formats(AVFilterContext *ctx) · 42 unmodified lines | |||
| 201 | BufferSinkContext *buf = ctx->priv; | 201 | BufferSinkContext *buf = ctx->priv; |
| 202 | 202 | ||
| 203 | if (buf->pixel_fmts) | 203 | if (buf->pixel_fmts) |
| 204 | avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(buf->pixel_fmts)); | 204 | ff_set_common_formats(ctx, ff_make_format_list(buf->pixel_fmts)); |
| 205 | else | 205 | else |
| 206 | avfilter_default_query_formats(ctx); | 206 | ff_default_query_formats(ctx); |
| 207 | 207 | ||
| 208 | return 0; | 208 | return 0; |
| 209 | } | 209 | } |
| @@ -272,9 +272,9 @@ static int asink_query_formats(AVFilterContext *ctx) · 62 unmodified lines | |||
| 272 | AVFilterFormats *formats = NULL; | 272 | AVFilterFormats *formats = NULL; |
| 273 | AVFilterChannelLayouts *layouts = NULL; | 273 | AVFilterChannelLayouts *layouts = NULL; |
| 274 | 274 | ||
| 275 | if (!(formats = avfilter_make_format_list(buf->sample_fmts))) | 275 | if (!(formats = ff_make_format_list(buf->sample_fmts))) |
| 276 | return AVERROR(ENOMEM); | 276 | return AVERROR(ENOMEM); |
| 277 | avfilter_set_common_sample_formats(ctx, formats); | 277 | ff_set_common_formats(ctx, formats); |
| 278 | 278 | ||
| 279 | if (!(layouts = avfilter_make_format64_list(buf->channel_layouts))) | 279 | if (!(layouts = avfilter_make_format64_list(buf->channel_layouts))) |
| 280 | return AVERROR(ENOMEM); | 280 | return AVERROR(ENOMEM); |
| @@ -371,8 +371,8 @@ static int amovie_query_formats(AVFilterContext *ctx) · 370 unmodified lines | |||
| 371 | int64_t chlayouts[] = { c->channel_layout ? c->channel_layout : | 371 | int64_t chlayouts[] = { c->channel_layout ? c->channel_layout : |
| 372 | av_get_default_channel_layout(c->channels), -1 }; | 372 | av_get_default_channel_layout(c->channels), -1 }; |
| 373 | 373 | ||
| 374 | avfilter_set_common_sample_formats (ctx, avfilter_make_format_list(sample_fmts)); | 374 | ff_set_common_formats (ctx, ff_make_format_list(sample_fmts)); |
| 375 | ff_set_common_samplerates (ctx, avfilter_make_format_list(sample_rates)); | 375 | ff_set_common_samplerates (ctx, ff_make_format_list(sample_rates)); |
| 376 | ff_set_common_channel_layouts(ctx, avfilter_make_format64_list(chlayouts)); | 376 | ff_set_common_channel_layouts(ctx, avfilter_make_format64_list(chlayouts)); |
| 377 | 377 | ||
| 378 | return 0; | 378 | return 0; |
| @@ -52,7 +52,7 @@ static int query_formats(AVFilterContext *ctx) · 51 unmodified lines | |||
| 52 | PIX_FMT_NONE, | 52 | PIX_FMT_NONE, |
| 53 | }; | 53 | }; |
| 54 | 54 | ||
| 55 | avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts)); | 55 | ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); |
| 56 | return 0; | 56 | return 0; |
| 57 | } | 57 | } |
| 58 | 58 | ||
| @@ -87,7 +87,7 @@ static void end_frame(AVFilterLink *inlink) · 28 unmodified lines | |||
| 87 | 87 | ||
| 88 | bbox->frame++; | 88 | bbox->frame++; |
| 89 | avfilter_unref_buffer(picref); | 89 | avfilter_unref_buffer(picref); |
| 90 | avfilter_end_frame(inlink->dst->outputs[0]); | 90 | ff_end_frame(inlink->dst->outputs[0]); |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | AVFilter avfilter_vf_bbox = { | 93 | AVFilter avfilter_vf_bbox = { |
| @@ -100,7 +100,7 @@ AVFilter avfilter_vf_bbox = { · 6 unmodified lines | |||
| 100 | .inputs = (const AVFilterPad[]) { | 100 | .inputs = (const AVFilterPad[]) { |
| 101 | { .name = "default", | 101 | { .name = "default", |
| 102 | .type = AVMEDIA_TYPE_VIDEO, | 102 | .type = AVMEDIA_TYPE_VIDEO, |
| 103 | .get_video_buffer = avfilter_null_get_video_buffer, | 103 | .get_video_buffer = ff_null_get_video_buffer, |
| 104 | .start_frame = ff_null_start_frame_keep_ref, | 104 | .start_frame = ff_null_start_frame_keep_ref, |
| 105 | .end_frame = end_frame, | 105 | .end_frame = end_frame, |
| 106 | .min_perms = AV_PERM_READ, }, | 106 | .min_perms = AV_PERM_READ, }, |
| @@ -79,7 +79,7 @@ static int query_formats(AVFilterContext *ctx) · 78 unmodified lines | |||
| 79 | PIX_FMT_NONE | 79 | PIX_FMT_NONE |
| 80 | }; | 80 | }; |
| 81 | 81 | ||
| 82 | avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts)); | 82 | ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); |
| 83 | return 0; | 83 | return 0; |
| 84 | } | 84 | } |
| 85 | 85 | ||
| @@ -134,7 +134,7 @@ static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) · 48 unmodified lines | |||
| 134 | p += picref->linesize[0]; | 134 | p += picref->linesize[0]; |
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | avfilter_draw_slice(ctx->outputs[0], y, h, slice_dir); | 137 | ff_draw_slice(ctx->outputs[0], y, h, slice_dir); |
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | static void end_frame(AVFilterLink *inlink) | 140 | static void end_frame(AVFilterLink *inlink) |
| @@ -176,7 +176,7 @@ static void end_frame(AVFilterLink *inlink) · 35 unmodified lines | |||
| 176 | blackdetect->frame_count++; | 176 | blackdetect->frame_count++; |
| 177 | blackdetect->nb_black_pixels = 0; | 177 | blackdetect->nb_black_pixels = 0; |
| 178 | avfilter_unref_buffer(picref); | 178 | avfilter_unref_buffer(picref); |
| 179 | avfilter_end_frame(inlink->dst->outputs[0]); | 179 | ff_end_frame(inlink->dst->outputs[0]); |
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | AVFilter avfilter_vf_blackdetect = { | 182 | AVFilter avfilter_vf_blackdetect = { |
| @@ -191,7 +191,7 @@ AVFilter avfilter_vf_blackdetect = { · 8 unmodified lines | |||
| 191 | .type = AVMEDIA_TYPE_VIDEO, | 191 | .type = AVMEDIA_TYPE_VIDEO, |
| 192 | .config_props = config_input, | 192 | .config_props = config_input, |
| 193 | .draw_slice = draw_slice, | 193 | .draw_slice = draw_slice, |
| 194 | .get_video_buffer = avfilter_null_get_video_buffer, | 194 | .get_video_buffer = ff_null_get_video_buffer, |
| 195 | .start_frame = ff_null_start_frame_keep_ref, | 195 | .start_frame = ff_null_start_frame_keep_ref, |
| 196 | .end_frame = end_frame, }, | 196 | .end_frame = end_frame, }, |
| 197 | { .name = NULL } | 197 | { .name = NULL } |
| @@ -31,6 +31,8 @@ · 30 unmodified lines | |||
| 31 | #include <strings.h> | 31 | #include <strings.h> |
| 32 | #include <float.h> | 32 | #include <float.h> |
| 33 | #include "avfilter.h" | 33 | #include "avfilter.h" |
| 34 | #include "formats.h" | ||
| 35 | #include "video.h" | ||
| 34 | #include "libavutil/pixdesc.h" | 36 | #include "libavutil/pixdesc.h" |
| 35 | #include "libavutil/avstring.h" | 37 | #include "libavutil/avstring.h" |
| 36 | 38 | ||
| @@ -325,7 +327,7 @@ static int query_formats(AVFilterContext *ctx) · 288 unmodified lines | |||
| 325 | PIX_FMT_NONE | 327 | PIX_FMT_NONE |
| 326 | }; | 328 | }; |
| 327 | 329 | ||
| 328 | avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts)); | 330 | ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); |
| 329 | 331 | ||
| 330 | return 0; | 332 | return 0; |
| 331 | } | 333 | } |
| @@ -333,7 +335,7 @@ static int query_formats(AVFilterContext *ctx) · 1 unmodified line | |||
| 333 | static AVFilterBufferRef *get_video_buffer(AVFilterLink *inlink, int perms, int w, int h) | 335 | static AVFilterBufferRef *get_video_buffer(AVFilterLink *inlink, int perms, int w, int h) |
| 334 | { | 336 | { |
| 335 | AVFilterBufferRef *picref = | 337 | AVFilterBufferRef *picref = |
| 336 | avfilter_get_video_buffer(inlink->dst->outputs[0], perms, w, h); | 338 | ff_get_video_buffer(inlink->dst->outputs[0], perms, w, h); |
| 337 | return picref; | 339 | return picref; |
| 338 | } | 340 | } |
| 339 | 341 | ||
| @@ -343,7 +345,7 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref) · 3 unmodified lines | |||
| 343 | 345 | ||
| 344 | link->dst->outputs[0]->out_buf = outpicref; | 346 | link->dst->outputs[0]->out_buf = outpicref; |
| 345 | 347 | ||
| 346 | avfilter_start_frame(link->dst->outputs[0], outpicref); | 348 | ff_start_frame(link->dst->outputs[0], outpicref); |
| 347 | } | 349 | } |
| 348 | 350 | ||
| 349 | static void end_frame(AVFilterLink *link) | 351 | static void end_frame(AVFilterLink *link) |
| @@ -359,8 +361,8 @@ static void end_frame(AVFilterLink *link) · 9 unmodified lines | |||
| 359 | else | 361 | else |
| 360 | process_frame_uyvy422(color, out, link->cur_buf); | 362 | process_frame_uyvy422(color, out, link->cur_buf); |
| 361 | 363 | ||
| 362 | avfilter_draw_slice(ctx->outputs[0], 0, link->dst->outputs[0]->h, 1); | 364 | ff_draw_slice(ctx->outputs[0], 0, link->dst->outputs[0]->h, 1); |
| 363 | avfilter_end_frame(ctx->outputs[0]); | 365 | ff_end_frame(ctx->outputs[0]); |
| 364 | avfilter_unref_buffer(link->cur_buf); | 366 | avfilter_unref_buffer(link->cur_buf); |
| 365 | } | 367 | } |
| 366 | 368 | ||
| @@ -50,6 +50,8 @@ · 49 unmodified lines | |||
| 50 | */ | 50 | */ |
| 51 | 51 | ||
| 52 | #include "avfilter.h" | 52 | #include "avfilter.h" |
| 53 | #include "formats.h" | ||
| 54 | #include "video.h" | ||
| 53 | #include "libavutil/common.h" | 55 | #include "libavutil/common.h" |
| 54 | #include "libavutil/mem.h" | 56 | #include "libavutil/mem.h" |
| 55 | #include "libavutil/pixdesc.h" | 57 | #include "libavutil/pixdesc.h" |
| @@ -390,7 +392,7 @@ static int query_formats(AVFilterContext *ctx) · 334 unmodified lines | |||
| 390 | PIX_FMT_YUVJ444P, PIX_FMT_YUVJ440P, PIX_FMT_NONE | 392 | PIX_FMT_YUVJ444P, PIX_FMT_YUVJ440P, PIX_FMT_NONE |
| 391 | }; | 393 | }; |
| 392 | 394 | ||
| 393 | avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts)); | 395 | ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); |
| 394 | 396 | ||
| 395 | return 0; | 397 | return 0; |
| 396 | } | 398 | } |
| @@ -525,8 +527,8 @@ static void end_frame(AVFilterLink *link) · 128 unmodified lines | |||
| 525 | deshake->ref = in; | 527 | deshake->ref = in; |
| 526 | 528 | ||
| 527 | // Draw the transformed frame information | 529 | // Draw the transformed frame information |
| 528 | avfilter_draw_slice(link->dst->outputs[0], 0, link->h, 1); | 530 | ff_draw_slice(link->dst->outputs[0], 0, link->h, 1); |
| 529 | avfilter_end_frame(link->dst->outputs[0]); | 531 | ff_end_frame(link->dst->outputs[0]); |
| 530 | avfilter_unref_buffer(out); | 532 | avfilter_unref_buffer(out); |
| 531 | } | 533 | } |
| 532 | 534 | ||
| @@ -88,14 +88,14 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) · 87 unmodified lines | |||
| 88 | AVFilterLink *outlink = inlink->dst->outputs[0]; | 88 | AVFilterLink *outlink = inlink->dst->outputs[0]; |
| 89 | 89 | ||
| 90 | outlink->out_buf = | 90 | outlink->out_buf = |
| 91 | avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h); | 91 | ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h); |
| 92 | avfilter_copy_buffer_ref_props(outlink->out_buf, picref); | 92 | avfilter_copy_buffer_ref_props(outlink->out_buf, picref); |
| 93 | 93 | ||
| 94 | /* copy palette if required */ | 94 | /* copy palette if required */ |
| 95 | if (av_pix_fmt_descriptors[inlink->format].flags & PIX_FMT_PAL) | 95 | if (av_pix_fmt_descriptors[inlink->format].flags & PIX_FMT_PAL) |
| 96 | memcpy(inlink->dst->outputs[0]->out_buf->data[1], picref->data[1], AVPALETTE_SIZE); | 96 | memcpy(inlink->dst->outputs[0]->out_buf->data[1], picref->data[1], AVPALETTE_SIZE); |
| 97 | 97 | ||
| 98 | avfilter_start_frame(outlink, avfilter_ref_buffer(outlink->out_buf, ~0)); | 98 | ff_start_frame(outlink, avfilter_ref_buffer(outlink->out_buf, ~0)); |
| 99 | } | 99 | } |
| 100 | 100 | ||
| 101 | static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) | 101 | static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) |
| @@ -22,6 +22,7 @@ · 21 unmodified lines | |||
| 22 | #include "libavutil/common.h" | 22 | #include "libavutil/common.h" |
| 23 | #include "libavutil/pixdesc.h" | 23 | #include "libavutil/pixdesc.h" |
| 24 | #include "avfilter.h" | 24 | #include "avfilter.h" |
| 25 | #include "internal.h" | ||
| 25 | 26 | ||
| 26 | #undef NDEBUG | 27 | #undef NDEBUG |
| 27 | #include <assert.h> | 28 | #include <assert.h> |
| @@ -185,7 +186,7 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref) · 157 unmodified lines | |||
| 185 | if (!idet->prev) | 186 | if (!idet->prev) |
| 186 | idet->prev = avfilter_ref_buffer(idet->cur, AV_PERM_READ); | 187 | idet->prev = avfilter_ref_buffer(idet->cur, AV_PERM_READ); |
| 187 | 188 | ||
| 188 | avfilter_start_frame(ctx->outputs[0], avfilter_ref_buffer(idet->cur, AV_PERM_READ)); | 189 | ff_start_frame(ctx->outputs[0], avfilter_ref_buffer(idet->cur, AV_PERM_READ)); |
| 189 | } | 190 | } |
| 190 | 191 | ||
| 191 | static void end_frame(AVFilterLink *link) | 192 | static void end_frame(AVFilterLink *link) |
| @@ -203,8 +204,8 @@ static void end_frame(AVFilterLink *link) · 11 unmodified lines | |||
| 203 | 204 | ||
| 204 | filter(ctx); | 205 | filter(ctx); |
| 205 | 206 | ||
| 206 | avfilter_draw_slice(ctx->outputs[0], 0, link->h, 1); | 207 | ff_draw_slice(ctx->outputs[0], 0, link->h, 1); |
| 207 | avfilter_end_frame(ctx->outputs[0]); | 208 | ff_end_frame(ctx->outputs[0]); |
| 208 | } | 209 | } |
| 209 | 210 | ||
| 210 | static int request_frame(AVFilterLink *link) | 211 | static int request_frame(AVFilterLink *link) |
| @@ -227,12 +228,12 @@ static int poll_frame(AVFilterLink *link) · 16 unmodified lines | |||
| 227 | IDETContext *idet = link->src->priv; | 228 | IDETContext *idet = link->src->priv; |
| 228 | int ret, val; | 229 | int ret, val; |
| 229 | 230 | ||
| 230 | val = avfilter_poll_frame(link->src->inputs[0]); | 231 | val = ff_poll_frame(link->src->inputs[0]); |
| 231 | 232 | ||
| 232 | if (val >= 1 && !idet->next) { //FIXME change API to not requre this red tape | 233 | if (val >= 1 && !idet->next) { //FIXME change API to not requre this red tape |
| 233 | if ((ret = avfilter_request_frame(link->src->inputs[0])) < 0) | 234 | if ((ret = avfilter_request_frame(link->src->inputs[0])) < 0) |
| 234 | return ret; | 235 | return ret; |
| 235 | val = avfilter_poll_frame(link->src->inputs[0]); | 236 | val = ff_poll_frame(link->src->inputs[0]); |
| 236 | } | 237 | } |
| 237 | assert(idet->next || !val); | 238 | assert(idet->next || !val); |
| 238 | 239 | ||
| @@ -286,7 +287,7 @@ static int query_formats(AVFilterContext *ctx) · 47 unmodified lines | |||
| 286 | PIX_FMT_NONE | 287 | PIX_FMT_NONE |
| 287 | }; | 288 | }; |
| 288 | 289 | ||
| 289 | avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts)); | 290 | ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); |
| 290 | 291 | ||
| 291 | return 0; | 292 | return 0; |
| 292 | } | 293 | } |
| @@ -71,6 +71,8 @@ · 70 unmodified lines | |||
| 71 | 71 | ||
| 72 | #include "libavutil/imgutils.h" | 72 | #include "libavutil/imgutils.h" |
| 73 | #include "avfilter.h" | 73 | #include "avfilter.h" |
| 74 | #include "formats.h" | ||
| 75 | #include "video.h" | ||
| 74 | #include "bbox.h" | 76 | #include "bbox.h" |
| 75 | #include "lavfutils.h" | 77 | #include "lavfutils.h" |
| 76 | #include "lswsutils.h" | 78 | #include "lswsutils.h" |
| @@ -190,7 +192,7 @@ static void convert_mask_to_strength_mask(uint8_t *data, int linesize, · 113 unmodified lines | |||
| 190 | static int query_formats(AVFilterContext *ctx) | 192 | static int query_formats(AVFilterContext *ctx) |
| 191 | { | 193 | { |
| 192 | enum PixelFormat pix_fmts[] = { PIX_FMT_YUV420P, PIX_FMT_NONE }; | 194 | enum PixelFormat pix_fmts[] = { PIX_FMT_YUV420P, PIX_FMT_NONE }; |
| 193 | avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts)); | 195 | ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); |
| 194 | return 0; | 196 | return 0; |
| 195 | } | 197 | } |
| 196 | 198 | ||
| @@ -476,7 +478,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref) · 279 unmodified lines | |||
| 476 | AVFilterBufferRef *outpicref; | 478 | AVFilterBufferRef *outpicref; |
| 477 | 479 | ||
| 478 | if (inpicref->perms & AV_PERM_PRESERVE) { | 480 | if (inpicref->perms & AV_PERM_PRESERVE) { |
| 479 | outpicref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, | 481 | outpicref = ff_get_video_buffer(outlink, AV_PERM_WRITE, |
| 480 | outlink->w, outlink->h); | 482 | outlink->w, outlink->h); |
| 481 | avfilter_copy_buffer_ref_props(outpicref, inpicref); | 483 | avfilter_copy_buffer_ref_props(outpicref, inpicref); |
| 482 | outpicref->video->w = outlink->w; | 484 | outpicref->video->w = outlink->w; |
| @@ -485,7 +487,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref) · 2 unmodified lines | |||
| 485 | outpicref = inpicref; | 487 | outpicref = inpicref; |
| 486 | 488 | ||
| 487 | outlink->out_buf = outpicref; | 489 | outlink->out_buf = outpicref; |
| 488 | avfilter_start_frame(outlink, avfilter_ref_buffer(outpicref, ~0)); | 490 | ff_start_frame(outlink, avfilter_ref_buffer(outpicref, ~0)); |
| 489 | } | 491 | } |
| 490 | 492 | ||
| 491 | static void end_frame(AVFilterLink *inlink) | 493 | static void end_frame(AVFilterLink *inlink) |
| @@ -512,8 +514,8 @@ static void end_frame(AVFilterLink *inlink) · 20 unmodified lines | |||
| 512 | removelogo->half_mask_data, inlink->w/2, | 514 | removelogo->half_mask_data, inlink->w/2, |
| 513 | inlink->w/2, inlink->h/2, direct, &removelogo->half_mask_bbox); | 515 | inlink->w/2, inlink->h/2, direct, &removelogo->half_mask_bbox); |
| 514 | 516 | ||
| 515 | avfilter_draw_slice(outlink, 0, inlink->h, 1); | 517 | ff_draw_slice(outlink, 0, inlink->h, 1); |
| 516 | avfilter_end_frame(outlink); | 518 | ff_end_frame(outlink); |
| 517 | avfilter_unref_buffer(inpicref); | 519 | avfilter_unref_buffer(inpicref); |
| 518 | if (!direct) | 520 | if (!direct) |
| 519 | avfilter_unref_buffer(outpicref); | 521 | avfilter_unref_buffer(outpicref); |
| @@ -554,7 +556,7 @@ AVFilter avfilter_vf_removelogo = { · 34 unmodified lines | |||
| 554 | .inputs = (const AVFilterPad[]) { | 556 | .inputs = (const AVFilterPad[]) { |
| 555 | { .name = "default", | 557 | { .name = "default", |
| 556 | .type = AVMEDIA_TYPE_VIDEO, | 558 | .type = AVMEDIA_TYPE_VIDEO, |
| 557 | .get_video_buffer = avfilter_null_get_video_buffer, | 559 | .get_video_buffer = ff_null_get_video_buffer, |
| 558 | .config_props = config_props_input, | 560 | .config_props = config_props_input, |
| 559 | .draw_slice = null_draw_slice, | 561 | .draw_slice = null_draw_slice, |
| 560 | .start_frame = start_frame, | 562 | .start_frame = start_frame, |
| @@ -390,7 +390,7 @@ static int query_formats(AVFilterContext *ctx) · 389 unmodified lines | |||
| 390 | PIX_FMT_RGB24, PIX_FMT_BGR24, | 390 | PIX_FMT_RGB24, PIX_FMT_BGR24, |
| 391 | PIX_FMT_NONE | 391 | PIX_FMT_NONE |
| 392 | }; | 392 | }; |
| 393 | avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts)); | 393 | ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); |
| 394 | } | 394 | } |
| 395 | return 0; | 395 | return 0; |
| 396 | } | 396 | } |
| @@ -24,6 +24,7 @@ · 23 unmodified lines | |||
| 24 | */ | 24 | */ |
| 25 | 25 | ||
| 26 | #include "avfilter.h" | 26 | #include "avfilter.h" |
| 27 | #include "video.h" | ||
| 27 | 28 | ||
| 28 | enum SetFieldMode { | 29 | enum SetFieldMode { |
| 29 | MODE_AUTO = -1, | 30 | MODE_AUTO = -1, |
| @@ -79,7 +80,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref) · 49 unmodified lines | |||
| 79 | outpicref->video->interlaced = 1; | 80 | outpicref->video->interlaced = 1; |
| 80 | outpicref->video->top_field_first = setfield->mode; | 81 | outpicref->video->top_field_first = setfield->mode; |
| 81 | } | 82 | } |
| 82 | avfilter_start_frame(inlink->dst->outputs[0], outpicref); | 83 | ff_start_frame(inlink->dst->outputs[0], outpicref); |
| 83 | } | 84 | } |
| 84 | 85 | ||
| 85 | AVFilter avfilter_vf_setfield = { | 86 | AVFilter avfilter_vf_setfield = { |
| @@ -92,7 +93,7 @@ AVFilter avfilter_vf_setfield = { · 6 unmodified lines | |||
| 92 | .inputs = (const AVFilterPad[]) { | 93 | .inputs = (const AVFilterPad[]) { |
| 93 | { .name = "default", | 94 | { .name = "default", |
| 94 | .type = AVMEDIA_TYPE_VIDEO, | 95 | .type = AVMEDIA_TYPE_VIDEO, |
| 95 | .get_video_buffer = avfilter_null_get_video_buffer, | 96 | .get_video_buffer = ff_null_get_video_buffer, |
| 96 | .start_frame = start_frame, }, | 97 | .start_frame = start_frame, }, |
| 97 | { .name = NULL } | 98 | { .name = NULL } |
| 98 | }, | 99 | }, |
| @@ -29,6 +29,8 @@ · 28 unmodified lines | |||
| 29 | #include "libavutil/pixdesc.h" | 29 | #include "libavutil/pixdesc.h" |
| 30 | #include "libavutil/intreadwrite.h" | 30 | #include "libavutil/intreadwrite.h" |
| 31 | #include "avfilter.h" | 31 | #include "avfilter.h" |
| 32 | #include "formats.h" | ||
| 33 | #include "video.h" | ||
| 32 | 34 | ||
| 33 | typedef struct { | 35 | typedef struct { |
| 34 | /* masks used for two pixels interpolation */ | 36 | /* masks used for two pixels interpolation */ |
| @@ -238,7 +240,7 @@ static int query_formats(AVFilterContext *ctx) · 203 unmodified lines | |||
| 238 | PIX_FMT_NONE | 240 | PIX_FMT_NONE |
| 239 | }; | 241 | }; |
| 240 | 242 | ||
| 241 | avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts)); | 243 | ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); |
| 242 | return 0; | 244 | return 0; |
| 243 | } | 245 | } |
| 244 | 246 | ||
| @@ -313,8 +315,8 @@ static void end_frame(AVFilterLink *inlink) · 68 unmodified lines | |||
| 313 | inlink->w, inlink->h); | 315 | inlink->w, inlink->h); |
| 314 | 316 | ||
| 315 | avfilter_unref_buffer(inpicref); | 317 | avfilter_unref_buffer(inpicref); |
| 316 | avfilter_draw_slice(outlink, 0, outlink->h, 1); | 318 | ff_draw_slice(outlink, 0, outlink->h, 1); |
| 317 | avfilter_end_frame(outlink); | 319 | ff_end_frame(outlink); |
| 318 | avfilter_unref_buffer(outpicref); | 320 | avfilter_unref_buffer(outpicref); |
| 319 | } | 321 | } |
| 320 | 322 | ||
| @@ -24,12 +24,14 @@ · 23 unmodified lines | |||
| 24 | */ | 24 | */ |
| 25 | 25 | ||
| 26 | #include "avfilter.h" | 26 | #include "avfilter.h" |
| 27 | #include "formats.h" | ||
| 28 | #include "video.h" | ||
| 27 | 29 | ||
| 28 | static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms, | 30 | static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms, |
| 29 | int w, int h) | 31 | int w, int h) |
| 30 | { | 32 | { |
| 31 | AVFilterBufferRef *picref = | 33 | AVFilterBufferRef *picref = |
| 32 | avfilter_default_get_video_buffer(link, perms, w, h); | 34 | ff_default_get_video_buffer(link, perms, w, h); |
| 33 | uint8_t *tmp; | 35 | uint8_t *tmp; |
| 34 | int tmp2; | 36 | int tmp2; |
| 35 | 37 | ||
| @@ -54,7 +56,7 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *inpicref) · 18 unmodified lines | |||
| 54 | outpicref->linesize[1] = inpicref->linesize[2]; | 56 | outpicref->linesize[1] = inpicref->linesize[2]; |
| 55 | outpicref->linesize[2] = inpicref->linesize[1]; | 57 | outpicref->linesize[2] = inpicref->linesize[1]; |
| 56 | 58 | ||
| 57 | avfilter_start_frame(link->dst->outputs[0], outpicref); | 59 | ff_start_frame(link->dst->outputs[0], outpicref); |
| 58 | } | 60 | } |
| 59 | 61 | ||
| 60 | static int query_formats(AVFilterContext *ctx) | 62 | static int query_formats(AVFilterContext *ctx) |
| @@ -68,7 +70,7 @@ static int query_formats(AVFilterContext *ctx) · 7 unmodified lines | |||
| 68 | PIX_FMT_NONE, | 70 | PIX_FMT_NONE, |
| 69 | }; | 71 | }; |
| 70 | 72 | ||
| 71 | avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts)); | 73 | ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); |
| 72 | return 0; | 74 | return 0; |
| 73 | } | 75 | } |
| 74 | 76 | ||
| @@ -28,6 +28,7 @@ · 27 unmodified lines | |||
| 28 | */ | 28 | */ |
| 29 | 29 | ||
| 30 | #include "avfilter.h" | 30 | #include "avfilter.h" |
| 31 | #include "internal.h" | ||
| 31 | 32 | ||
| 32 | #define HIST_SIZE (3*256) | 33 | #define HIST_SIZE (3*256) |
| 33 | 34 | ||
| @@ -151,10 +152,10 @@ static void end_frame(AVFilterLink *inlink) · 117 unmodified lines | |||
| 151 | picref = thumb->frames[best_frame_idx].buf; | 152 | picref = thumb->frames[best_frame_idx].buf; |
| 152 | av_log(ctx, AV_LOG_INFO, "frame id #%d (pts_time=%f) selected\n", | 153 | av_log(ctx, AV_LOG_INFO, "frame id #%d (pts_time=%f) selected\n", |
| 153 | best_frame_idx, picref->pts * av_q2d(inlink->time_base)); | 154 | best_frame_idx, picref->pts * av_q2d(inlink->time_base)); |
| 154 | avfilter_start_frame(outlink, picref); | 155 | ff_start_frame(outlink, picref); |
| 155 | thumb->frames[best_frame_idx].buf = NULL; | 156 | thumb->frames[best_frame_idx].buf = NULL; |
| 156 | avfilter_draw_slice(outlink, 0, inlink->h, 1); | 157 | ff_draw_slice(outlink, 0, inlink->h, 1); |
| 157 | avfilter_end_frame(outlink); | 158 | ff_end_frame(outlink); |
| 158 | } | 159 | } |
| 159 | 160 | ||
| 160 | static av_cold void uninit(AVFilterContext *ctx) | 161 | static av_cold void uninit(AVFilterContext *ctx) |
| @@ -188,7 +189,7 @@ static int poll_frame(AVFilterLink *link) · 27 unmodified lines | |||
| 188 | { | 189 | { |
| 189 | ThumbContext *thumb = link->src->priv; | 190 | ThumbContext *thumb = link->src->priv; |
| 190 | AVFilterLink *inlink = link->src->inputs[0]; | 191 | AVFilterLink *inlink = link->src->inputs[0]; |
| 191 | int ret, available_frames = avfilter_poll_frame(inlink); | 192 | int ret, available_frames = ff_poll_frame(inlink); |
| 192 | 193 | ||
| 193 | /* If the input link is not able to provide any frame, we can't do anything | 194 | /* If the input link is not able to provide any frame, we can't do anything |
| 194 | * at the moment and thus have zero thumbnail available. */ | 195 | * at the moment and thus have zero thumbnail available. */ |
| @@ -212,7 +213,7 @@ static int query_formats(AVFilterContext *ctx) · 17 unmodified lines | |||
| 212 | PIX_FMT_RGB24, PIX_FMT_BGR24, | 213 | PIX_FMT_RGB24, PIX_FMT_BGR24, |
| 213 | PIX_FMT_NONE | 214 | PIX_FMT_NONE |
| 214 | }; | 215 | }; |
| 215 | avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts)); | 216 | ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); |
| 216 | return 0; | 217 | return 0; |
| 217 | } | 218 | } |
| 218 | 219 | ||
| @@ -226,7 +227,7 @@ AVFilter avfilter_vf_thumbnail = { · 7 unmodified lines | |||
| 226 | .inputs = (const AVFilterPad[]) { | 227 | .inputs = (const AVFilterPad[]) { |
| 227 | { .name = "default", | 228 | { .name = "default", |
| 228 | .type = AVMEDIA_TYPE_VIDEO, | 229 | .type = AVMEDIA_TYPE_VIDEO, |
| 229 | .get_video_buffer = avfilter_null_get_video_buffer, | 230 | .get_video_buffer = ff_null_get_video_buffer, |
| 230 | .start_frame = null_start_frame, | 231 | .start_frame = null_start_frame, |
| 231 | .draw_slice = draw_slice, | 232 | .draw_slice = draw_slice, |
| 232 | .end_frame = end_frame, | 233 | .end_frame = end_frame, |
| @@ -103,7 +103,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) · 102 unmodified lines | |||
| 103 | 103 | ||
| 104 | if (tile->current) | 104 | if (tile->current) |
| 105 | return; | 105 | return; |
| 106 | outlink->out_buf = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, | 106 | outlink->out_buf = ff_get_video_buffer(outlink, AV_PERM_WRITE, |
| 107 | outlink->w, outlink->h); | 107 | outlink->w, outlink->h); |
| 108 | avfilter_copy_buffer_ref_props(outlink->out_buf, picref); | 108 | avfilter_copy_buffer_ref_props(outlink->out_buf, picref); |
| 109 | outlink->out_buf->video->w = outlink->w; | 109 | outlink->out_buf->video->w = outlink->w; |
| @@ -76,7 +76,7 @@ static int query_formats(AVFilterContext *ctx) · 75 unmodified lines | |||
| 76 | PIX_FMT_NONE | 76 | PIX_FMT_NONE |
| 77 | }; | 77 | }; |
| 78 | 78 | ||
| 79 | avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts)); | 79 | ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); |
| 80 | return 0; | 80 | return 0; |
| 81 | } | 81 | } |
| 82 | 82 | ||
| @@ -224,7 +224,7 @@ static void end_frame(AVFilterLink *inlink) · 141 unmodified lines | |||
| 224 | switch (tinterlace->mode) { | 224 | switch (tinterlace->mode) { |
| 225 | case MODE_MERGE: /* move the odd frame into the upper field of the new image, even into | 225 | case MODE_MERGE: /* move the odd frame into the upper field of the new image, even into |
| 226 | * the lower field, generating a double-height video at half framerate */ | 226 | * the lower field, generating a double-height video at half framerate */ |
| 227 | out = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h); | 227 | out = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h); |
| 228 | avfilter_copy_buffer_ref_props(out, cur); | 228 | avfilter_copy_buffer_ref_props(out, cur); |
| 229 | out->video->h = outlink->h; | 229 | out->video->h = outlink->h; |
| 230 | out->video->interlaced = 1; | 230 | out->video->interlaced = 1; |
| @@ -251,7 +251,7 @@ static void end_frame(AVFilterLink *inlink) · 20 unmodified lines | |||
| 251 | 251 | ||
| 252 | case MODE_PAD: /* expand each frame to double height, but pad alternate | 252 | case MODE_PAD: /* expand each frame to double height, but pad alternate |
| 253 | * lines with black; framerate unchanged */ | 253 | * lines with black; framerate unchanged */ |
| 254 | out = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h); | 254 | out = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h); |
| 255 | avfilter_copy_buffer_ref_props(out, cur); | 255 | avfilter_copy_buffer_ref_props(out, cur); |
| 256 | out->video->h = outlink->h; | 256 | out->video->h = outlink->h; |
| 257 | 257 | ||
| @@ -273,7 +273,7 @@ static void end_frame(AVFilterLink *inlink) · 15 unmodified lines | |||
| 273 | case MODE_INTERLEAVE_TOP: /* top field first */ | 273 | case MODE_INTERLEAVE_TOP: /* top field first */ |
| 274 | case MODE_INTERLEAVE_BOTTOM: /* bottom field first */ | 274 | case MODE_INTERLEAVE_BOTTOM: /* bottom field first */ |
| 275 | tff = tinterlace->mode == MODE_INTERLEAVE_TOP; | 275 | tff = tinterlace->mode == MODE_INTERLEAVE_TOP; |
| 276 | out = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h); | 276 | out = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h); |
| 277 | avfilter_copy_buffer_ref_props(out, cur); | 277 | avfilter_copy_buffer_ref_props(out, cur); |
| 278 | out->video->interlaced = 1; | 278 | out->video->interlaced = 1; |
| 279 | out->video->top_field_first = tff; | 279 | out->video->top_field_first = tff; |
| @@ -295,13 +295,13 @@ static void end_frame(AVFilterLink *inlink) · 15 unmodified lines | |||
| 295 | out = avfilter_ref_buffer(cur, AV_PERM_READ); | 295 | out = avfilter_ref_buffer(cur, AV_PERM_READ); |
| 296 | out->video->interlaced = 1; | 296 | out->video->interlaced = 1; |
| 297 | 297 | ||
| 298 | avfilter_start_frame(outlink, out); | 298 | ff_start_frame(outlink, out); |
| 299 | avfilter_draw_slice(outlink, 0, outlink->h, 1); | 299 | ff_draw_slice(outlink, 0, outlink->h, 1); |
| 300 | avfilter_end_frame(outlink); | 300 | ff_end_frame(outlink); |
| 301 | 301 | ||
| 302 | /* output mix of current and next frame */ | 302 | /* output mix of current and next frame */ |
| 303 | tff = next->video->top_field_first; | 303 | tff = next->video->top_field_first; |
| 304 | out = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h); | 304 | out = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h); |
| 305 | avfilter_copy_buffer_ref_props(out, next); | 305 | avfilter_copy_buffer_ref_props(out, next); |
| 306 | out->video->interlaced = 1; | 306 | out->video->interlaced = 1; |
| 307 | 307 | ||
| @@ -318,9 +318,9 @@ static void end_frame(AVFilterLink *inlink) · 10 unmodified lines | |||
| 318 | break; | 318 | break; |
| 319 | } | 319 | } |
| 320 | 320 | ||
| 321 | avfilter_start_frame(outlink, out); | 321 | ff_start_frame(outlink, out); |
| 322 | avfilter_draw_slice(outlink, 0, outlink->h, 1); | 322 | ff_draw_slice(outlink, 0, outlink->h, 1); |
| 323 | avfilter_end_frame(outlink); | 323 | ff_end_frame(outlink); |
| 324 | 324 | ||
| 325 | tinterlace->frame++; | 325 | tinterlace->frame++; |
| 326 | } | 326 | } |
| @@ -331,12 +331,12 @@ static int poll_frame(AVFilterLink *outlink) · 4 unmodified lines | |||
| 331 | AVFilterLink *inlink = outlink->src->inputs[0]; | 331 | AVFilterLink *inlink = outlink->src->inputs[0]; |
| 332 | int ret, val; | 332 | int ret, val; |
| 333 | 333 | ||
| 334 | val = avfilter_poll_frame(inlink); | 334 | val = ff_poll_frame(inlink); |
| 335 | 335 | ||
| 336 | if (val == 1 && !tinterlace->next) { | 336 | if (val == 1 && !tinterlace->next) { |
| 337 | if ((ret = avfilter_request_frame(inlink)) < 0) | 337 | if ((ret = avfilter_request_frame(inlink)) < 0) |
| 338 | return ret; | 338 | return ret; |
| 339 | val = avfilter_poll_frame(inlink); | 339 | val = ff_poll_frame(inlink); |
| 340 | } | 340 | } |
| 341 | assert(tinterlace->next); | 341 | assert(tinterlace->next); |
| 342 | 342 | ||
| @@ -220,7 +220,7 @@ void ff_start_frame(AVFilterLink *link, AVFilterBufferRef *picref) · 219 unmodified lines | |||
| 220 | void ff_null_start_frame_keep_ref(AVFilterLink *inlink, | 220 | void ff_null_start_frame_keep_ref(AVFilterLink *inlink, |
| 221 | AVFilterBufferRef *picref) | 221 | AVFilterBufferRef *picref) |
| 222 | { | 222 | { |
| 223 | avfilter_start_frame(inlink->dst->outputs[0], avfilter_ref_buffer(picref, ~0)); | 223 | ff_start_frame(inlink->dst->outputs[0], avfilter_ref_buffer(picref, ~0)); |
| 224 | } | 224 | } |
| 225 | 225 | ||
| 226 | void ff_null_end_frame(AVFilterLink *link) | 226 | void ff_null_end_frame(AVFilterLink *link) |
| @@ -31,6 +31,8 @@ · 30 unmodified lines | |||
| 31 | #include "libavutil/parseutils.h" | 31 | #include "libavutil/parseutils.h" |
| 32 | #include "libavutil/random_seed.h" | 32 | #include "libavutil/random_seed.h" |
| 33 | #include "avfilter.h" | 33 | #include "avfilter.h" |
| 34 | #include "formats.h" | ||
| 35 | #include "video.h" | ||
| 34 | 36 | ||
| 35 | typedef struct { | 37 | typedef struct { |
| 36 | const AVClass *class; | 38 | const AVClass *class; |
| @@ -305,7 +307,7 @@ static int request_frame(AVFilterLink *outlink) · 268 unmodified lines | |||
| 305 | { | 307 | { |
| 306 | CellAutoContext *cellauto = outlink->src->priv; | 308 | CellAutoContext *cellauto = outlink->src->priv; |
| 307 | AVFilterBufferRef *picref = | 309 | AVFilterBufferRef *picref = |
| 308 | avfilter_get_video_buffer(outlink, AV_PERM_WRITE, cellauto->w, cellauto->h); | 310 | ff_get_video_buffer(outlink, AV_PERM_WRITE, cellauto->w, cellauto->h); |
| 309 | picref->video->sample_aspect_ratio = (AVRational) {1, 1}; | 311 | picref->video->sample_aspect_ratio = (AVRational) {1, 1}; |
| 310 | if (cellauto->generation == 0 && cellauto->start_full) { | 312 | if (cellauto->generation == 0 && cellauto->start_full) { |
| 311 | int i; | 313 | int i; |
| @@ -322,9 +324,9 @@ static int request_frame(AVFilterLink *outlink) · 10 unmodified lines | |||
| 322 | show_cellauto_row(outlink->src); | 324 | show_cellauto_row(outlink->src); |
| 323 | #endif | 325 | #endif |
| 324 | 326 | ||
| 325 | avfilter_start_frame(outlink, avfilter_ref_buffer(picref, ~0)); | 327 | ff_start_frame(outlink, avfilter_ref_buffer(picref, ~0)); |
| 326 | avfilter_draw_slice(outlink, 0, cellauto->h, 1); | 328 | ff_draw_slice(outlink, 0, cellauto->h, 1); |
| 327 | avfilter_end_frame(outlink); | 329 | ff_end_frame(outlink); |
| 328 | avfilter_unref_buffer(picref); | 330 | avfilter_unref_buffer(picref); |
| 329 | 331 | ||
| 330 | return 0; | 332 | return 0; |
| @@ -333,7 +335,7 @@ static int request_frame(AVFilterLink *outlink) · 2 unmodified lines | |||
| 333 | static int query_formats(AVFilterContext *ctx) | 335 | static int query_formats(AVFilterContext *ctx) |
| 334 | { | 336 | { |
| 335 | static const enum PixelFormat pix_fmts[] = { PIX_FMT_MONOBLACK, PIX_FMT_NONE }; | 337 | static const enum PixelFormat pix_fmts[] = { PIX_FMT_MONOBLACK, PIX_FMT_NONE }; |
| 336 | avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts)); | 338 | ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); |
| 337 | return 0; | 339 | return 0; |
| 338 | } | 340 | } |
| 339 | 341 | ||
| @@ -32,6 +32,8 @@ · 31 unmodified lines | |||
| 32 | #include "libavutil/parseutils.h" | 32 | #include "libavutil/parseutils.h" |
| 33 | #include "libavutil/random_seed.h" | 33 | #include "libavutil/random_seed.h" |
| 34 | #include "avfilter.h" | 34 | #include "avfilter.h" |
| 35 | #include "formats.h" | ||
| 36 | #include "video.h" | ||
| 35 | 37 | ||
| 36 | typedef struct { | 38 | typedef struct { |
| 37 | const AVClass *class; | 39 | const AVClass *class; |
| @@ -431,7 +433,7 @@ static void fill_picture_rgb(AVFilterContext *ctx, AVFilterBufferRef *picref) · 393 unmodified lines | |||
| 431 | static int request_frame(AVFilterLink *outlink) | 433 | static int request_frame(AVFilterLink *outlink) |
| 432 | { | 434 | { |
| 433 | LifeContext *life = outlink->src->priv; | 435 | LifeContext *life = outlink->src->priv; |
| 434 | AVFilterBufferRef *picref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, life->w, life->h); | 436 | AVFilterBufferRef *picref = ff_get_video_buffer(outlink, AV_PERM_WRITE, life->w, life->h); |
| 435 | picref->video->sample_aspect_ratio = (AVRational) {1, 1}; | 437 | picref->video->sample_aspect_ratio = (AVRational) {1, 1}; |
| 436 | picref->pts = life->pts++; | 438 | picref->pts = life->pts++; |
| 437 | picref->pos = -1; | 439 | picref->pos = -1; |
| @@ -442,9 +444,9 @@ static int request_frame(AVFilterLink *outlink) · 4 unmodified lines | |||
| 442 | show_life_grid(outlink->src); | 444 | show_life_grid(outlink->src); |
| 443 | #endif | 445 | #endif |
| 444 | 446 | ||
| 445 | avfilter_start_frame(outlink, avfilter_ref_buffer(picref, ~0)); | 447 | ff_start_frame(outlink, avfilter_ref_buffer(picref, ~0)); |
| 446 | avfilter_draw_slice(outlink, 0, life->h, 1); | 448 | ff_draw_slice(outlink, 0, life->h, 1); |
| 447 | avfilter_end_frame(outlink); | 449 | ff_end_frame(outlink); |
| 448 | avfilter_unref_buffer(picref); | 450 | avfilter_unref_buffer(picref); |
| 449 | 451 | ||
| 450 | return 0; | 452 | return 0; |
| @@ -462,7 +464,7 @@ static int query_formats(AVFilterContext *ctx) · 11 unmodified lines | |||
| 462 | pix_fmts[0] = PIX_FMT_MONOBLACK; | 464 | pix_fmts[0] = PIX_FMT_MONOBLACK; |
| 463 | life->draw = fill_picture_monoblack; | 465 | life->draw = fill_picture_monoblack; |
| 464 | } | 466 | } |
| 465 | avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts)); | 467 | ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); |
| 466 | return 0; | 468 | return 0; |
| 467 | } | 469 | } |
| 468 | 470 | ||
| @@ -27,6 +27,8 @@ · 26 unmodified lines | |||
| 27 | */ | 27 | */ |
| 28 | 28 | ||
| 29 | #include "avfilter.h" | 29 | #include "avfilter.h" |
| 30 | #include "formats.h" | ||
| 31 | #include "video.h" | ||
| 30 | #include "libavutil/imgutils.h" | 32 | #include "libavutil/imgutils.h" |
| 31 | #include "libavutil/opt.h" | 33 | #include "libavutil/opt.h" |
| 32 | #include "libavutil/parseutils.h" | 34 | #include "libavutil/parseutils.h" |
| @@ -161,7 +163,7 @@ static int query_formats(AVFilterContext *ctx) · 128 unmodified lines | |||
| 161 | PIX_FMT_NONE | 163 | PIX_FMT_NONE |
| 162 | }; | 164 | }; |
| 163 | 165 | ||
| 164 | avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts)); | 166 | ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); |
| 165 | return 0; | 167 | return 0; |
| 166 | } | 168 | } |
| 167 | 169 | ||
| @@ -385,15 +387,15 @@ static void draw_mandelbrot(AVFilterContext *ctx, uint32_t *color, int linesize, · 217 unmodified lines | |||
| 385 | static int request_frame(AVFilterLink *link) | 387 | static int request_frame(AVFilterLink *link) |
| 386 | { | 388 | { |
| 387 | MBContext *mb = link->src->priv; | 389 | MBContext *mb = link->src->priv; |
| 388 | AVFilterBufferRef *picref = avfilter_get_video_buffer(link, AV_PERM_WRITE, mb->w, mb->h); | 390 | AVFilterBufferRef *picref = ff_get_video_buffer(link, AV_PERM_WRITE, mb->w, mb->h); |
| 389 | picref->video->sample_aspect_ratio = (AVRational) {1, 1}; | 391 | picref->video->sample_aspect_ratio = (AVRational) {1, 1}; |
| 390 | picref->pts = mb->pts++; | 392 | picref->pts = mb->pts++; |
| 391 | picref->pos = -1; | 393 | picref->pos = -1; |
| 392 | 394 | ||
| 393 | avfilter_start_frame(link, avfilter_ref_buffer(picref, ~0)); | 395 | ff_start_frame(link, avfilter_ref_buffer(picref, ~0)); |
| 394 | draw_mandelbrot(link->src, (uint32_t*)picref->data[0], picref->linesize[0]/4, picref->pts); | 396 | draw_mandelbrot(link->src, (uint32_t*)picref->data[0], picref->linesize[0]/4, picref->pts); |
| 395 | avfilter_draw_slice(link, 0, mb->h, 1); | 397 | ff_draw_slice(link, 0, mb->h, 1); |
| 396 | avfilter_end_frame(link); | 398 | ff_end_frame(link); |
| 397 | avfilter_unref_buffer(picref); | 399 | avfilter_unref_buffer(picref); |
| 398 | 400 | ||
| 399 | return 0; | 401 | return 0; |
| @@ -28,6 +28,8 @@ · 27 unmodified lines | |||
| 28 | #include "libavutil/parseutils.h" | 28 | #include "libavutil/parseutils.h" |
| 29 | #include "libavutil/pixdesc.h" | 29 | #include "libavutil/pixdesc.h" |
| 30 | #include "avfilter.h" | 30 | #include "avfilter.h" |
| 31 | #include "formats.h" | ||
| 32 | #include "video.h" | ||
| 31 | 33 | ||
| 32 | #define WIDTH 512 | 34 | #define WIDTH 512 |
| 33 | #define HEIGHT 512 | 35 | #define HEIGHT 512 |
| @@ -320,7 +322,7 @@ static int query_formats(AVFilterContext *ctx) · 286 unmodified lines | |||
| 320 | PIX_FMT_YUV420P, PIX_FMT_NONE | 322 | PIX_FMT_YUV420P, PIX_FMT_NONE |
| 321 | }; | 323 | }; |
| 322 | 324 | ||
| 323 | avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts)); | 325 | ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); |
| 324 | return 0; | 326 | return 0; |
| 325 | } | 327 | } |
| 326 | 328 | ||
| @@ -334,7 +336,7 @@ static int request_frame(AVFilterLink *outlink) · 7 unmodified lines | |||
| 334 | 336 | ||
| 335 | if (test->max_pts >= 0 && test->pts > test->max_pts) | 337 | if (test->max_pts >= 0 && test->pts > test->max_pts) |
| 336 | return AVERROR_EOF; | 338 | return AVERROR_EOF; |
| 337 | picref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, w, h); | 339 | picref = ff_get_video_buffer(outlink, AV_PERM_WRITE, w, h); |
| 338 | picref->pts = test->pts++; | 340 | picref->pts = test->pts++; |
| 339 | 341 | ||
| 340 | // clean image | 342 | // clean image |
| @@ -360,9 +362,9 @@ static int request_frame(AVFilterLink *outlink) · 19 unmodified lines | |||
| 360 | 362 | ||
| 361 | test->frame_nb++; | 363 | test->frame_nb++; |
| 362 | 364 | ||
| 363 | avfilter_start_frame(outlink, avfilter_ref_buffer(picref, ~0)); | 365 | ff_start_frame(outlink, avfilter_ref_buffer(picref, ~0)); |
| 364 | avfilter_draw_slice(outlink, 0, picref->video->h, 1); | 366 | ff_draw_slice(outlink, 0, picref->video->h, 1); |
| 365 | avfilter_end_frame(outlink); | 367 | ff_end_frame(outlink); |
| 366 | avfilter_unref_buffer(picref); | 368 | avfilter_unref_buffer(picref); |
| 367 | 369 | ||
| 368 | return 0; | 370 | return 0; |