<html><head></head><body>Hi,<br><br>That API is fundamentally incompatible with asynchronous use as the filter would have no sink to output to outside the callback.<br><br>That's why decoders get an owner callback for this purpose instead.<br><br>While I don't expect that asynchronous filters will work quiet yet, I don't want to revector into an API that gets us further from the goal.<br><br><div class="gmail_quote">Le 25 septembre 2020 17:46:43 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">If a filter sending pictures to a sink send more than one picture to a sink,<br>the code will assert. It means filter_FilterSingle was used with a filter that<br>sends more than one picture. So filter_FilterSingle() should only be used with<br>safe filters, ie not user defined ones bu mostly converters. This is already<br>the case.<hr> include/vlc_filter.h | 15 +++++++++++++++<br> 1 file changed, 15 insertions(+)<br><br>diff --git a/include/vlc_filter.h b/include/vlc_filter.h<br>index 9f8da434fd4..e660e8c6d18 100644<br>--- a/include/vlc_filter.h<br>+++ b/include/vlc_filter.h<br>@@ -219,8 +219,23 @@ static inline picture_t *filter_NewPicture( filter_t *p_filter )<br>     return pic;<br> }<br> <br>+static inline int GetSingleResult(struct vlc_video_sink *sink, picture_t *output)<br>+{<br>+    picture_t **single_output = (picture_t **)sink->sys;<br>+    vlc_assert(*single_output == NULL); // called filter_FilterSingle on wrong filter<br>+    *single_output = output;<br>+    return VLC_SUCCESS;<br>+}<br>+<br> static inline picture_t *filter_FilterSingle( filter_t *p_filter, picture_t *pic )<br> {<br>+    if ( p_filter->pf_video_filter_into != NULL )<br>+    {<br>+        picture_t *result = NULL;<br>+        struct vlc_video_sink sink = { &result, GetSingleResult };<br>+        p_filter->pf_video_filter_into( p_filter, pic, &sink );<br>+        return result;<br>+    }<br>     return p_filter->pf_video_filter( p_filter, pic );<br> }<br> </pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>