| @@ -25,7 +25,7 @@ · 24 unmodified lines |
| 25 | 25 | #include "libavutil/pixdesc.h" |
| 26 | 26 | #include "avfilter.h" |
| 27 | 27 | #include "internal.h" |
| 28 | | −#include "framesync.h" |
| 28 | +#include "framesync2.h" |
| 29 | 29 | |
| 30 | 30 | typedef struct InputParam { |
| 31 | 31 | int depth[4]; |
| @@ -58,12 +58,6 @@ static const AVOption mergeplanes_options[] = { · 26 unmodified lines |
| 58 | 58 | |
| 59 | 59 | AVFILTER_DEFINE_CLASS(mergeplanes); |
| 60 | 60 | |
| 61 | | −static int filter_frame(AVFilterLink *inlink, AVFrame *in) |
| 62 | | −{ |
| 63 | | − MergePlanesContext *s = inlink->dst->priv; |
| 64 | | − return ff_framesync_filter_frame(&s->fs, inlink, in); |
| 65 | | −} |
| 66 | | − |
| 67 | 61 | static av_cold int init(AVFilterContext *ctx) |
| 68 | 62 | { |
| 69 | 63 | MergePlanesContext *s = ctx->priv; |
| @@ -101,7 +95,6 @@ static av_cold int init(AVFilterContext *ctx) · 31 unmodified lines |
| 101 | 95 | pad.name = av_asprintf("in%d", i); |
| 102 | 96 | if (!pad.name) |
| 103 | 97 | return AVERROR(ENOMEM); |
| 104 | | − pad.filter_frame = filter_frame; |
| 105 | 98 | |
| 106 | 99 | if ((ret = ff_insert_inpad(ctx, i, &pad)) < 0){ |
| 107 | 100 | av_freep(&pad.name); |
| @@ -150,7 +143,7 @@ static int process_frame(FFFrameSync *fs) · 42 unmodified lines |
| 150 | 143 | int i, ret; |
| 151 | 144 | |
| 152 | 145 | for (i = 0; i < s->nb_inputs; i++) { |
| 153 | | − if ((ret = ff_framesync_get_frame(&s->fs, i, &in[i], 0)) < 0) |
| 146 | + if ((ret = ff_framesync2_get_frame(&s->fs, i, &in[i], 0)) < 0) |
| 154 | 147 | return ret; |
| 155 | 148 | } |
| 156 | 149 | |
| @@ -179,7 +172,7 @@ static int config_output(AVFilterLink *outlink) · 22 unmodified lines |
| 179 | 172 | FFFrameSyncIn *in; |
| 180 | 173 | int i, ret; |
| 181 | 174 | |
| 182 | | − if ((ret = ff_framesync_init(&s->fs, ctx, s->nb_inputs)) < 0) |
| 175 | + if ((ret = ff_framesync2_init(&s->fs, ctx, s->nb_inputs)) < 0) |
| 183 | 176 | return ret; |
| 184 | 177 | |
| 185 | 178 | in = s->fs.in; |
| @@ -272,15 +265,15 @@ static int config_output(AVFilterLink *outlink) · 86 unmodified lines |
| 272 | 265 | } |
| 273 | 266 | } |
| 274 | 267 | |
| 275 | | − return ff_framesync_configure(&s->fs); |
| 268 | + return ff_framesync2_configure(&s->fs); |
| 276 | 269 | fail: |
| 277 | 270 | return AVERROR(EINVAL); |
| 278 | 271 | } |
| 279 | 272 | |
| 280 | | −static int request_frame(AVFilterLink *outlink) |
| 273 | +static int activate(AVFilterContext *ctx) |
| 281 | 274 | { |
| 282 | | − MergePlanesContext *s = outlink->src->priv; |
| 283 | | − return ff_framesync_request_frame(&s->fs, outlink); |
| 275 | + MergePlanesContext *s = ctx->priv; |
| 276 | + return ff_framesync2_activate(&s->fs); |
| 284 | 277 | } |
| 285 | 278 | |
| 286 | 279 | static av_cold void uninit(AVFilterContext *ctx) |
| @@ -288,7 +281,7 @@ static av_cold void uninit(AVFilterContext *ctx) · 1 unmodified line |
| 288 | 281 | MergePlanesContext *s = ctx->priv; |
| 289 | 282 | int i; |
| 290 | 283 | |
| 291 | | − ff_framesync_uninit(&s->fs); |
| 284 | + ff_framesync2_uninit(&s->fs); |
| 292 | 285 | |
| 293 | 286 | for (i = 0; i < ctx->nb_inputs; i++) |
| 294 | 287 | av_freep(&ctx->input_pads[i].name); |
| @@ -299,7 +292,6 @@ static const AVFilterPad mergeplanes_outputs[] = { · 4 unmodified lines |
| 299 | 292 | .name = "default", |
| 300 | 293 | .type = AVMEDIA_TYPE_VIDEO, |
| 301 | 294 | .config_props = config_output, |
| 302 | | − .request_frame = request_frame, |
| 303 | 295 | }, |
| 304 | 296 | { NULL } |
| 305 | 297 | }; |
| @@ -312,6 +304,7 @@ AVFilter ff_vf_mergeplanes = { · 6 unmodified lines |
| 312 | 304 | .init = init, |
| 313 | 305 | .uninit = uninit, |
| 314 | 306 | .query_formats = query_formats, |
| 307 | + .activate = activate, |
| 315 | 308 | .inputs = NULL, |
| 316 | 309 | .outputs = mergeplanes_outputs, |
| 317 | 310 | .flags = AVFILTER_FLAG_DYNAMIC_INPUTS, |