<div dir="ltr">Hello everybody,<div><br></div><div>I've setup a filter chain in my program to deinterlace and scale the video frame before rendering, it works very well, and the code is faster that the custom deinterlace/scale that I used before, the problem I have is that I need to change the filter when the window is resized, here is the filter, as dumped by avfilter_graph_dump:</div><div><br></div><div><div><font face="monospace, monospace">+----------+</font></div><div><font face="monospace, monospace">|    in    |default--[720x576 64:45 yuv420p]--Parsed_yadif_0:default</font></div><div><font face="monospace, monospace">| (buffer) |</font></div><div><font face="monospace, monospace">+----------+</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">                                                   +--------------+</font></div><div><font face="monospace, monospace">Parsed_scale_1:default--[800x450 1:1 argb]--default|     out      |</font></div><div><font face="monospace, monospace">                                                   | (buffersink) |</font></div><div><font face="monospace, monospace">                                                   +--------------+</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">                                            +----------------+</font></div><div><font face="monospace, monospace">in:default--[720x576 64:45 yuv420p]--default| Parsed_yadif_0 |default--[720x576 64:45 yuv420p]--Parsed_scale_1:default</font></div><div><font face="monospace, monospace">                                            |    (yadif)     |</font></div><div><font face="monospace, monospace">                                            +----------------+</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">                                                        +----------------+</font></div><div><font face="monospace, monospace">Parsed_yadif_0:default--[720x576 64:45 yuv420p]--default| Parsed_scale_1 |default--[800x450 1:1 argb]--out:default</font></div><div><font face="monospace, monospace">                                                        |    (scale)     |</font></div><div><font face="monospace, monospace">                                                        +----------------+</font></div><div><br></div></div><div><br></div><div>When a resize event occurs I'm trying to change it in this way:</div><div><br></div><div><div><font face="monospace, monospace">    if (AVFilterContext *ctx = avfilter_graph_get_filter(filter_graph_, "Parsed_scale_1")) {</font></div><div><font face="monospace, monospace">        std::ostringstream os;</font></div><div><font face="monospace, monospace">        os << "w=" << img_.Width() << ":h=" << img_.Height() << ":eval";</font></div><div><font face="monospace, monospace">        // passes w=XXX:h=YYY:eval to the filter</font></div><div><font face="monospace, monospace">        if (avfilter_init_str(ctx, os.str().c_str()) < 0) {</font></div><div><font face="monospace, monospace">            ELOG << "Unable to reinit filter!";</font></div><div><font face="monospace, monospace">        }</font></div><div>         }</div><div><font face="monospace, monospace">    else</font></div><div><font face="monospace, monospace">        ELOG << "Unable to find filter!";</font></div><div><br></div><div>... no error is reported but the filter is not changed after the call...</div><div><br></div><div>Note that I added to the filter the "eval" option since I read in the filter documentation that otherwise the size is evaluated only for the first frame...</div><div><br></div><div>I've tried to read through the avfilter documentation but I cannot find a specific function to do that, I hope that the only way to do that is not to delete all the filtergraph and rebuild it, I can do it if needed but I've a few concerns about the AVFilterInOut inputs/outputs, if they need to be freed or not, avfilter_graph_parse_ptr says it should not be freed by user, avfilter_graph_parse says it should...</div><div><br></div><div>Thanks in advance!</div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div dir="ltr"><div><font size="2"><b>Bye,</b></font></div><div dir="ltr"><font size="2"><b>Gabriele Greco</b><br></font><br></div></div></div></div>
</div></div>