diff options
author | Loren Merritt <lorenm@u.washington.edu> | 2012-07-26 22:51:12 +0000 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2012-07-28 14:15:14 -0700 |
commit | fb44e7401f44ce9c1dded07d992c57bd82ff666c (patch) | |
tree | ca9e8f08b864cebe4714b2fe121fd35ad35b7c3c /libavfilter/vf_gradfun.c | |
parent | 60b9785530dfc290a4c8763214938eb367e68cbe (diff) | |
download | ffmpeg-fb44e7401f44ce9c1dded07d992c57bd82ff666c.tar.gz |
factor identical ff_inplace_start_frame out of two filters
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavfilter/vf_gradfun.c')
-rw-r--r-- | libavfilter/vf_gradfun.c | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/libavfilter/vf_gradfun.c b/libavfilter/vf_gradfun.c index 52dcb7092f..f8896b5e57 100644 --- a/libavfilter/vf_gradfun.c +++ b/libavfilter/vf_gradfun.c @@ -180,41 +180,6 @@ static int config_input(AVFilterLink *inlink) return 0; } -static int start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref) -{ - AVFilterLink *outlink = inlink->dst->outputs[0]; - AVFilterBufferRef *outpicref = NULL, *for_next_filter; - int ret = 0; - - if (inpicref->perms & AV_PERM_PRESERVE) { - outpicref = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h); - if (!outpicref) - return AVERROR(ENOMEM); - - avfilter_copy_buffer_ref_props(outpicref, inpicref); - outpicref->video->w = outlink->w; - outpicref->video->h = outlink->h; - } else { - outpicref = avfilter_ref_buffer(inpicref, ~0); - if (!outpicref) - return AVERROR(ENOMEM); - } - - for_next_filter = avfilter_ref_buffer(outpicref, ~0); - if (for_next_filter) - ret = ff_start_frame(outlink, for_next_filter); - else - ret = AVERROR(ENOMEM); - - if (ret < 0) { - avfilter_unref_bufferp(&outpicref); - return ret; - } - - outlink->out_buf = outpicref; - return 0; -} - static int null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) { return 0; @@ -261,7 +226,7 @@ AVFilter avfilter_vf_gradfun = { .inputs = (const AVFilterPad[]) {{ .name = "default", .type = AVMEDIA_TYPE_VIDEO, .config_props = config_input, - .start_frame = start_frame, + .start_frame = ff_inplace_start_frame, .draw_slice = null_draw_slice, .end_frame = end_frame, .min_perms = AV_PERM_READ, }, |