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