[FFmpeg-devel] [PATCH] avfilter/vf_stereo3d: implement auto detection by using frame side data

wm4 nfxjfg at googlemail.com
Fri Dec 1 18:23:52 EET 2017


On Fri, 1 Dec 2017 10:35:34 +0100
Paul B Mahol <onemda at gmail.com> wrote:

> On 12/1/17, Nicolas George <george at nsup.org> wrote:
> > Paul B Mahol (2017-11-30):  
> >> +static int reset_links(AVFilterContext *filter)
> >> +{
> >> +    int i, ret;
> >> +
> >> +    if (!filter)
> >> +        return 0;
> >> +
> >> +    for (i = 0; i < filter->nb_outputs; i++) {
> >> +        AVFilterLink *link = filter->outputs[i];
> >> +
> >> +        link->init_state = AVLINK_UNINIT;
> >> +        link->frame_rate.num = link->frame_rate.den = 0;
> >> +        link->w = link->h = 0;
> >> +
> >> +        ret = reset_links(link->dst);
> >> +        if (ret < 0)
> >> +            return ret;
> >> +    }
> >> +
> >> +    if (!i)
> >> +        return avfilter_config_links(filter);
> >> +
> >> +    return 0;
> >> +}  
> >
> > Sorry, but no. All filters are currently written with the assumption
> > that config_props is called only once. Not all of them actually rely on
> > this assumption, but some do, and expect the fields of the private
> > context to be in their initial state. Violating that assumption would
> > result in a lot of memory leaks and probably a few crashes, some of them
> > security relevant.  
> 
> Not all filters are written with such assumption. And I would like to fix those
> who rely on this assumption.

SGTM

> >
> > Plus, the public API of buffersink does not document params changes and
> > does not provide a good way of reacting to it, so enabling params
> > changes like that would have problematic results on applications that
> > expect frames with all the same size.  
> 
> Well for that point one can always autoinsert scale filter if user does
> not set some flag when calling buffersink function.

Also SGTM.


More information about the ffmpeg-devel mailing list