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