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
226OBJS-$(CONFIG_LUTRGB_FILTER) += vf_lut.o226OBJS-$(CONFIG_LUTRGB_FILTER) += vf_lut.o
227OBJS-$(CONFIG_LUTYUV_FILTER) += vf_lut.o227OBJS-$(CONFIG_LUTYUV_FILTER) += vf_lut.o
228OBJS-$(CONFIG_MASKEDCLAMP_FILTER) += vf_maskedclamp.o framesync.o228OBJS-$(CONFIG_MASKEDCLAMP_FILTER) += vf_maskedclamp.o framesync.o
229OBJS-$(CONFIG_MASKEDMERGE_FILTER) += vf_maskedmerge.o framesync.o229OBJS-$(CONFIG_MASKEDMERGE_FILTER) += vf_maskedmerge.o framesync2.o
230OBJS-$(CONFIG_MCDEINT_FILTER) += vf_mcdeint.o230OBJS-$(CONFIG_MCDEINT_FILTER) += vf_mcdeint.o
231OBJS-$(CONFIG_MERGEPLANES_FILTER) += vf_mergeplanes.o framesync.o231OBJS-$(CONFIG_MERGEPLANES_FILTER) += vf_mergeplanes.o framesync.o
232OBJS-$(CONFIG_MESTIMATE_FILTER) += vf_mestimate.o motion_estimation.o232OBJS-$(CONFIG_MESTIMATE_FILTER) += vf_mestimate.o motion_estimation.o
libavfilter/maskedmerge.h+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
22#define AVFILTER_MASKEDMERGE_H22#define AVFILTER_MASKEDMERGE_H
23 23
24#include "avfilter.h"24#include "avfilter.h"
25#include "framesync.h"25#include "framesync2.h"
26 26
27typedef struct MaskedMergeContext {27typedef struct MaskedMergeContext {
28 const AVClass *class;28 const AVClass *class;
libavfilter/vf_maskedmerge.c+10−19
@@ -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
257static int filter_frame(AVFilterLink *inlink, AVFrame *buf)257static 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
263static 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
269static av_cold void uninit(AVFilterContext *ctx)263static 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
276static const AVFilterPad maskedmerge_inputs[] = {270static 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,

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