<html><head></head><body>Hmm well yeah... in other words, it's not easy or at least not obvious in the general case.<br><br>Also how does should an OpenGL shader-based filter if the decoder device is, say, NVdec, and the video context is X11? It knows neither of them. Sure it'd solvable, but to me it's not obvious at all, and I'd rather sort it out in a workshop than over a mailing list.<br><br><div class="gmail_quote">Le 18 septembre 2019 12:15:30 GMT+03:00, Steve Lhomme <robux4@ycbcr.xyz> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">On input of filters it's easy, they get a video context (or NULL for CPU <br>based sources).<br><br>The issue is when a filter needs to create a video context on its own. <br>For CPU to GPU filters it cannot use the input video context. Just like <br>a decoder it should use the "decoder device" to create its output video <br>context.<br><br>So just like for the decoder, the owner of the filter provides a <br>"get_decoder_device" callback to get it.<br><br>On 2019-09-18 10:39, Rémi Denis-Courmont wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">Hi,<br><br>I am not sure how hardware should be exposed to filters/converters. I don't recall covering that part of the puzzle at the February workshop.<br><br>Le 18 septembre 2019 09:00:41 GMT+03:00, Steve Lhomme <robux4@ycbcr.xyz> a écrit :<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;">On 2019-09-17 17:32, Rémi Denis-Courmont wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #8ae234; padding-left: 1ex;">Le tiistaina 17. syyskuuta 2019, 17.22.33 EEST Steve Lhomme a écrit :<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #fcaf3e; padding-left: 1ex;">In this case we just allocate a picture from the filter output<br></blockquote></blockquote>format.<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #8ae234; padding-left: 1ex;"><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #fcaf3e; padding-left: 1ex;"><hr>    include/vlc_filter.h | 7 ++++++-<br>    1 file changed, 6 insertions(+), 1 deletion(-)<br><br> diff --git a/include/vlc_filter.h b/include/vlc_filter.h<br> index 0c756ce10ec..0bc10e91997 100644<br> --- a/include/vlc_filter.h<br> +++ b/include/vlc_filter.h<br> @@ -26,6 +26,7 @@<br>    #define VLC_FILTER_H 1<br><br>    #include <vlc_es.h><br> +#include <vlc_picture.h><br><br>    /**<br>     * \defgroup filter Filters<br> @@ -160,7 +161,11 @@ struct filter_t<br>     */<br>    static inline picture_t *filter_NewPicture( filter_t *p_filter )<br>    {<br> -    picture_t *pic = p_filter->owner.video->buffer_new( p_filter );<br> +    picture_t *pic;<br> +    if ( p_filter->owner.video != NULL &&<br></blockquote></blockquote>p_filter->owner.video->buffer_new<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #8ae234; padding-left: 1ex;"><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #fcaf3e; padding-left: 1ex;">!= NULL)<br></blockquote>Two checks look redundant, though anyway this callback should go away<br>altogether eventually.<br></blockquote> Yes, it will go away.<br><br> The owner will have the "get_device" callback so it's possible at some<br> point in the code to have one callback and not the other. But in the<br> end<br> this code won't be there anymore.<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #8ae234; padding-left: 1ex;"><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #fcaf3e; padding-left: 1ex;">+        pic = p_filter->owner.video->buffer_new( p_filter );<br>+    else<br>+        pic = picture_NewFromFormat( &p_filter->fmt_out.video );<br>       if( pic == NULL )<br>           msg_Warn( p_filter, "can't get output picture" );<br>       return pic;<br></blockquote><br> -- <br> Rémi Denis-Courmont<br> <a href="http://www.remlab.net/">http://www.remlab.net/</a><hr> vlc-devel mailing list<br> To unsubscribe or modify your subscription options:<br> <a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br><br></blockquote><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></blockquote>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.<hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br><br></blockquote><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>