| @@ -71,9 +71,9 @@ static int process_frame(FFFrameSync *fs) · 70 unmodified lines |
| 71 | AVFrame *out, *base, *overlay, *mask; | 71 | AVFrame *out, *base, *overlay, *mask; |
| 72 | int ret; | 72 | int ret; |
| 73 | | 73 | |
| 74 | if ((ret = ff_framesync_get_frame(&s->fs, 0, &base, 0)) < 0 || | 74 | if ((ret = ff_framesync2_get_frame(&s->fs, 0, &base, 0)) < 0 || |
| 75 | (ret = ff_framesync_get_frame(&s->fs, 1, &overlay, 0)) < 0 || | 75 | (ret = ff_framesync2_get_frame(&s->fs, 1, &overlay, 0)) < 0 || |
| 76 | (ret = ff_framesync_get_frame(&s->fs, 2, &mask, 0)) < 0) | 76 | (ret = ff_framesync2_get_frame(&s->fs, 2, &mask, 0)) < 0) |
| 77 | return ret; | 77 | return ret; |
| 78 | | 78 | |
| 79 | if (ctx->is_disabled) { | 79 | if (ctx->is_disabled) { |
| @@ -232,7 +232,7 @@ static int config_output(AVFilterLink *outlink) · 152 unmodified lines |
| 232 | if ((ret = av_image_fill_linesizes(s->linesize, outlink->format, outlink->w)) < 0) | 232 | if ((ret = av_image_fill_linesizes(s->linesize, outlink->format, outlink->w)) < 0) |
| 233 | return ret; | 233 | return ret; |
| 234 | | 234 | |
| 235 | if ((ret = ff_framesync_init(&s->fs, ctx, 3)) < 0) | 235 | if ((ret = ff_framesync2_init(&s->fs, ctx, 3)) < 0) |
| 236 | return ret; | 236 | return ret; |
| 237 | | 237 | |
| 238 | in = s->fs.in; | 238 | in = s->fs.in; |
| @@ -251,44 +251,35 @@ static int config_output(AVFilterLink *outlink) · 12 unmodified lines |
| 251 | s->fs.opaque = s; | 251 | s->fs.opaque = s; |
| 252 | s->fs.on_event = process_frame; | 252 | s->fs.on_event = process_frame; |
| 253 | | 253 | |
| 254 | return ff_framesync_configure(&s->fs); | 254 | return ff_framesync2_configure(&s->fs); |
| 255 | } | 255 | } |
| 256 | | 256 | |
| 257 | static int filter_frame(AVFilterLink *inlink, AVFrame *buf) | 257 | static int activate(AVFilterContext *ctx) |
| 258 | { | 258 | { |
| 259 | MaskedMergeContext *s = inlink->dst->priv; | 259 | MaskedMergeContext *s = ctx->priv; |
| 260 | return ff_framesync_filter_frame(&s->fs, inlink, buf); | 260 | return ff_framesync2_activate(&s->fs); |
| 261 | } | | |
| 262 | | | |
| 263 | static int request_frame(AVFilterLink *outlink) | | |
| 264 | { | | |
| 265 | MaskedMergeContext *s = outlink->src->priv; | | |
| 266 | return ff_framesync_request_frame(&s->fs, outlink); | | |
| 267 | } | 261 | } |
| 268 | | 262 | |
| 269 | static av_cold void uninit(AVFilterContext *ctx) | 263 | static av_cold void uninit(AVFilterContext *ctx) |
| 270 | { | 264 | { |
| 271 | MaskedMergeContext *s = ctx->priv; | 265 | MaskedMergeContext *s = ctx->priv; |
| 272 | | 266 | |
| 273 | ff_framesync_uninit(&s->fs); | 267 | ff_framesync2_uninit(&s->fs); |
| 274 | } | 268 | } |
| 275 | | 269 | |
| 276 | static const AVFilterPad maskedmerge_inputs[] = { | 270 | static const AVFilterPad maskedmerge_inputs[] = { |
| 277 | { | 271 | { |
| 278 | .name = "base", | 272 | .name = "base", |
| 279 | .type = AVMEDIA_TYPE_VIDEO, | 273 | .type = AVMEDIA_TYPE_VIDEO, |
| 280 | .filter_frame = filter_frame, | | |
| 281 | .config_props = config_input, | 274 | .config_props = config_input, |
| 282 | }, | 275 | }, |
| 283 | { | 276 | { |
| 284 | .name = "overlay", | 277 | .name = "overlay", |
| 285 | .type = AVMEDIA_TYPE_VIDEO, | 278 | .type = AVMEDIA_TYPE_VIDEO, |
| 286 | .filter_frame = filter_frame, | | |
| 287 | }, | 279 | }, |
| 288 | { | 280 | { |
| 289 | .name = "mask", | 281 | .name = "mask", |
| 290 | .type = AVMEDIA_TYPE_VIDEO, | 282 | .type = AVMEDIA_TYPE_VIDEO, |
| 291 | .filter_frame = filter_frame, | | |
| 292 | }, | 283 | }, |
| 293 | { NULL } | 284 | { NULL } |
| 294 | }; | 285 | }; |
| @@ -298,7 +289,6 @@ static const AVFilterPad maskedmerge_outputs[] = { · 3 unmodified lines |
| 298 | .name = "default", | 289 | .name = "default", |
| 299 | .type = AVMEDIA_TYPE_VIDEO, | 290 | .type = AVMEDIA_TYPE_VIDEO, |
| 300 | .config_props = config_output, | 291 | .config_props = config_output, |
| 301 | .request_frame = request_frame, | | |
| 302 | }, | 292 | }, |
| 303 | { NULL } | 293 | { NULL } |
| 304 | }; | 294 | }; |
| @@ -309,6 +299,7 @@ AVFilter ff_vf_maskedmerge = { · 4 unmodified lines |
| 309 | .priv_size = sizeof(MaskedMergeContext), | 299 | .priv_size = sizeof(MaskedMergeContext), |
| 310 | .uninit = uninit, | 300 | .uninit = uninit, |
| 311 | .query_formats = query_formats, | 301 | .query_formats = query_formats, |
| | 302 | .activate = activate, |
| 312 | .inputs = maskedmerge_inputs, | 303 | .inputs = maskedmerge_inputs, |
| 313 | .outputs = maskedmerge_outputs, | 304 | .outputs = maskedmerge_outputs, |
| 314 | .priv_class = &maskedmerge_class, | 305 | .priv_class = &maskedmerge_class, |