On Wed, 25 Jul 2012 02:53:09 +0000 (UTC), Loren Merritt <lor...@u.washington.edu> wrote: > On Wed, 25 Jul 2012, Loren Merritt wrote: > > > --- a/libavfilter/vf_hqdn3d.c > > +++ b/libavfilter/vf_hqdn3d.c > > @@ -294,6 +294,23 @@ static int config_input(AVFilterLink *inlink) > > return 0; > > } > > > > +static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref) > > +{ > > + AVFilterLink *outlink = inlink->dst->outputs[0]; > > + AVFilterBufferRef *outpicref; > > + > > + if (inpicref->perms & AV_PERM_PRESERVE) { > > + outpicref = ff_get_video_buffer(outlink, AV_PERM_WRITE, > > outlink->w, outlink->h); > > + avfilter_copy_buffer_ref_props(outpicref, inpicref); > > + outpicref->video->w = outlink->w; > > + outpicref->video->h = outlink->h; > > + } else > > + outpicref = inpicref; > > + > > + outlink->out_buf = outpicref; > > + ff_start_frame(outlink, avfilter_ref_buffer(outpicref, ~0)); > > +} > > This seems like the sort of thing a bunch of filters should use, and 3 of > them do. How to factor it out? It doesn't quite fit in AV_PERM_*, since > it's a property of a filter, not of a particular frame buffer. I suppose I > could just move this version of start_frame somewhere common. >
Yes, video.c would be an appropriate place. -- Anton Khirnov _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel