| @@ -25,7 +25,7 @@ · 24 unmodified lines |
| 25 | #include "formats.h" | 25 | #include "formats.h" |
| 26 | #include "internal.h" | 26 | #include "internal.h" |
| 27 | #include "video.h" | 27 | #include "video.h" |
| 28 | #include "framesync.h" | 28 | #include "framesync2.h" |
| 29 | | 29 | |
| 30 | typedef struct MidEqualizerContext { | 30 | typedef struct MidEqualizerContext { |
| 31 | const AVClass *class; | 31 | const AVClass *class; |
| @@ -89,8 +89,8 @@ static int process_frame(FFFrameSync *fs) · 57 unmodified lines |
| 89 | AVFrame *out, *in0, *in1; | 89 | AVFrame *out, *in0, *in1; |
| 90 | int ret; | 90 | int ret; |
| 91 | | 91 | |
| 92 | if ((ret = ff_framesync_get_frame(&s->fs, 0, &in0, 0)) < 0 || | 92 | if ((ret = ff_framesync2_get_frame(&s->fs, 0, &in0, 0)) < 0 || |
| 93 | (ret = ff_framesync_get_frame(&s->fs, 1, &in1, 0)) < 0) | 93 | (ret = ff_framesync2_get_frame(&s->fs, 1, &in1, 0)) < 0) |
| 94 | return ret; | 94 | return ret; |
| 95 | | 95 | |
| 96 | if (ctx->is_disabled) { | 96 | if (ctx->is_disabled) { |
| @@ -311,7 +311,7 @@ static int config_output(AVFilterLink *outlink) · 214 unmodified lines |
| 311 | outlink->sample_aspect_ratio = in0->sample_aspect_ratio; | 311 | outlink->sample_aspect_ratio = in0->sample_aspect_ratio; |
| 312 | outlink->frame_rate = in0->frame_rate; | 312 | outlink->frame_rate = in0->frame_rate; |
| 313 | | 313 | |
| 314 | if ((ret = ff_framesync_init(&s->fs, ctx, 2)) < 0) | 314 | if ((ret = ff_framesync2_init(&s->fs, ctx, 2)) < 0) |
| 315 | return ret; | 315 | return ret; |
| 316 | | 316 | |
| 317 | in = s->fs.in; | 317 | in = s->fs.in; |
| @@ -326,26 +326,20 @@ static int config_output(AVFilterLink *outlink) · 8 unmodified lines |
| 326 | s->fs.opaque = s; | 326 | s->fs.opaque = s; |
| 327 | s->fs.on_event = process_frame; | 327 | s->fs.on_event = process_frame; |
| 328 | | 328 | |
| 329 | return ff_framesync_configure(&s->fs); | 329 | return ff_framesync2_configure(&s->fs); |
| 330 | } | 330 | } |
| 331 | | 331 | |
| 332 | static int filter_frame(AVFilterLink *inlink, AVFrame *buf) | 332 | static int activate(AVFilterContext *ctx) |
| 333 | { | 333 | { |
| 334 | MidEqualizerContext *s = inlink->dst->priv; | 334 | MidEqualizerContext *s = ctx->priv; |
| 335 | return ff_framesync_filter_frame(&s->fs, inlink, buf); | 335 | return ff_framesync2_activate(&s->fs); |
| 336 | } | | |
| 337 | | | |
| 338 | static int request_frame(AVFilterLink *outlink) | | |
| 339 | { | | |
| 340 | MidEqualizerContext *s = outlink->src->priv; | | |
| 341 | return ff_framesync_request_frame(&s->fs, outlink); | | |
| 342 | } | 336 | } |
| 343 | | 337 | |
| 344 | static av_cold void uninit(AVFilterContext *ctx) | 338 | static av_cold void uninit(AVFilterContext *ctx) |
| 345 | { | 339 | { |
| 346 | MidEqualizerContext *s = ctx->priv; | 340 | MidEqualizerContext *s = ctx->priv; |
| 347 | | 341 | |
| 348 | ff_framesync_uninit(&s->fs); | 342 | ff_framesync2_uninit(&s->fs); |
| 349 | av_freep(&s->histogram[0]); | 343 | av_freep(&s->histogram[0]); |
| 350 | av_freep(&s->histogram[1]); | 344 | av_freep(&s->histogram[1]); |
| 351 | av_freep(&s->cchange); | 345 | av_freep(&s->cchange); |
| @@ -355,13 +349,11 @@ static const AVFilterPad midequalizer_inputs[] = { · 3 unmodified lines |
| 355 | { | 349 | { |
| 356 | .name = "in0", | 350 | .name = "in0", |
| 357 | .type = AVMEDIA_TYPE_VIDEO, | 351 | .type = AVMEDIA_TYPE_VIDEO, |
| 358 | .filter_frame = filter_frame, | | |
| 359 | .config_props = config_input0, | 352 | .config_props = config_input0, |
| 360 | }, | 353 | }, |
| 361 | { | 354 | { |
| 362 | .name = "in1", | 355 | .name = "in1", |
| 363 | .type = AVMEDIA_TYPE_VIDEO, | 356 | .type = AVMEDIA_TYPE_VIDEO, |
| 364 | .filter_frame = filter_frame, | | |
| 365 | .config_props = config_input1, | 357 | .config_props = config_input1, |
| 366 | }, | 358 | }, |
| 367 | { NULL } | 359 | { NULL } |
| @@ -372,7 +364,6 @@ static const AVFilterPad midequalizer_outputs[] = { · 4 unmodified lines |
| 372 | .name = "default", | 364 | .name = "default", |
| 373 | .type = AVMEDIA_TYPE_VIDEO, | 365 | .type = AVMEDIA_TYPE_VIDEO, |
| 374 | .config_props = config_output, | 366 | .config_props = config_output, |
| 375 | .request_frame = request_frame, | | |
| 376 | }, | 367 | }, |
| 377 | { NULL } | 368 | { NULL } |
| 378 | }; | 369 | }; |
| @@ -383,6 +374,7 @@ AVFilter ff_vf_midequalizer = { · 4 unmodified lines |
| 383 | .priv_size = sizeof(MidEqualizerContext), | 374 | .priv_size = sizeof(MidEqualizerContext), |
| 384 | .uninit = uninit, | 375 | .uninit = uninit, |
| 385 | .query_formats = query_formats, | 376 | .query_formats = query_formats, |
| | 377 | .activate = activate, |
| 386 | .inputs = midequalizer_inputs, | 378 | .inputs = midequalizer_inputs, |
| 387 | .outputs = midequalizer_outputs, | 379 | .outputs = midequalizer_outputs, |
| 388 | .priv_class = &midequalizer_class, | 380 | .priv_class = &midequalizer_class, |