History

lavfi/vf_maskedmerge: move to "activate" design.

Nicolas George committed 9 years ago

Commit a5e3b0c1 parent 62060843 files · +12 −21Browse files

Unified · Split

3 files
  1. libavfilter/Makefile +1 −1
  2. libavfilter/maskedmerge.h +1 −1
  3. libavfilter/vf_maskedmerge.c +10 −19
libavfilter/Makefile+1−1
@@ -226,7 +226,7 @@ OBJS-$(CONFIG_LUT3D_FILTER) += vf_lut3d.o · 225 unmodified lines
226226 OBJS-$(CONFIG_LUTRGB_FILTER) += vf_lut.o
227227 OBJS-$(CONFIG_LUTYUV_FILTER) += vf_lut.o
228228 OBJS-$(CONFIG_MASKEDCLAMP_FILTER) += vf_maskedclamp.o framesync.o
229−OBJS-$(CONFIG_MASKEDMERGE_FILTER) += vf_maskedmerge.o framesync.o
229+OBJS-$(CONFIG_MASKEDMERGE_FILTER) += vf_maskedmerge.o framesync2.o
230230 OBJS-$(CONFIG_MCDEINT_FILTER) += vf_mcdeint.o
231231 OBJS-$(CONFIG_MERGEPLANES_FILTER) += vf_mergeplanes.o framesync.o
232232 OBJS-$(CONFIG_MESTIMATE_FILTER) += vf_mestimate.o motion_estimation.o
libavfilter/maskedmerge.h+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 #define AVFILTER_MASKEDMERGE_H
2323
2424 #include "avfilter.h"
25−#include "framesync.h"
25+#include "framesync2.h"
2626
2727 typedef struct MaskedMergeContext {
2828 const AVClass *class;
libavfilter/vf_maskedmerge.c+10−19
@@ -71,9 +71,9 @@ static int process_frame(FFFrameSync *fs) · 70 unmodified lines
7171 AVFrame *out, *base, *overlay, *mask;
7272 int ret;
7373
74− if ((ret = ff_framesync_get_frame(&s->fs, 0, &base, 0)) < 0 ||
75− (ret = ff_framesync_get_frame(&s->fs, 1, &overlay, 0)) < 0 ||
76− (ret = ff_framesync_get_frame(&s->fs, 2, &mask, 0)) < 0)
74+ if ((ret = ff_framesync2_get_frame(&s->fs, 0, &base, 0)) < 0 ||
75+ (ret = ff_framesync2_get_frame(&s->fs, 1, &overlay, 0)) < 0 ||
76+ (ret = ff_framesync2_get_frame(&s->fs, 2, &mask, 0)) < 0)
7777 return ret;
7878
7979 if (ctx->is_disabled) {
@@ -232,7 +232,7 @@ static int config_output(AVFilterLink *outlink) · 152 unmodified lines
232232 if ((ret = av_image_fill_linesizes(s->linesize, outlink->format, outlink->w)) < 0)
233233 return ret;
234234
235− if ((ret = ff_framesync_init(&s->fs, ctx, 3)) < 0)
235+ if ((ret = ff_framesync2_init(&s->fs, ctx, 3)) < 0)
236236 return ret;
237237
238238 in = s->fs.in;
@@ -251,44 +251,35 @@ static int config_output(AVFilterLink *outlink) · 12 unmodified lines
251251 s->fs.opaque = s;
252252 s->fs.on_event = process_frame;
253253
254− return ff_framesync_configure(&s->fs);
254+ return ff_framesync2_configure(&s->fs);
255255 }
256256
257−static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
257+static int activate(AVFilterContext *ctx)
258258 {
259− MaskedMergeContext *s = inlink->dst->priv;
260− return ff_framesync_filter_frame(&s->fs, inlink, buf);
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);
259+ MaskedMergeContext *s = ctx->priv;
260+ return ff_framesync2_activate(&s->fs);
267261 }
268262
269263 static av_cold void uninit(AVFilterContext *ctx)
270264 {
271265 MaskedMergeContext *s = ctx->priv;
272266
273− ff_framesync_uninit(&s->fs);
267+ ff_framesync2_uninit(&s->fs);
274268 }
275269
276270 static const AVFilterPad maskedmerge_inputs[] = {
277271 {
278272 .name = "base",
279273 .type = AVMEDIA_TYPE_VIDEO,
280− .filter_frame = filter_frame,
281274 .config_props = config_input,
282275 },
283276 {
284277 .name = "overlay",
285278 .type = AVMEDIA_TYPE_VIDEO,
286− .filter_frame = filter_frame,
287279 },
288280 {
289281 .name = "mask",
290282 .type = AVMEDIA_TYPE_VIDEO,
291− .filter_frame = filter_frame,
292283 },
293284 { NULL }
294285 };
@@ -298,7 +289,6 @@ static const AVFilterPad maskedmerge_outputs[] = { · 3 unmodified lines
298289 .name = "default",
299290 .type = AVMEDIA_TYPE_VIDEO,
300291 .config_props = config_output,
301− .request_frame = request_frame,
302292 },
303293 { NULL }
304294 };
@@ -309,6 +299,7 @@ AVFilter ff_vf_maskedmerge = { · 4 unmodified lines
309299 .priv_size = sizeof(MaskedMergeContext),
310300 .uninit = uninit,
311301 .query_formats = query_formats,
302+ .activate = activate,
312303 .inputs = maskedmerge_inputs,
313304 .outputs = maskedmerge_outputs,
314305 .priv_class = &maskedmerge_class,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t