<!doctype html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body>And then if the first patch is rejected, I have wasted many hours of work on all the other un-mergeable patches. Thanks but no thanks.<br><br><div class="gmail_quote">Le 20 avril 2020 10:18:04 GMT+03:00, Thomas Guillem <thomas@gllm.fr> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><br></div><div>On Mon, Apr 20, 2020, at 09:10, Rémi Denis-Courmont wrote:<br></div><blockquote type="cite" id="qt"><div>That's a catch-22 requirement. I can't do the transition without this patch.<br></div></blockquote><div><br></div><div>I don't get your catch-22, you can do the transition on your private branch and propose the whole branch then.<br></div><div><br></div><div>Having said that, I'm OK with this patch, it can be pushed now.<br></div><div><br></div><blockquote type="cite" id="qt"><div><br></div><div class="qt-gmail_quote"><div>Le 20 avril 2020 08:49:23 GMT+03:00, Steve Lhomme <robux4@ycbcr.xyz> a écrit :<br></div><blockquote class="qt-gmail_quote" style="margin-top:0pt;margin-right:0pt;margin-bottom:0pt;margin-left:0.8ex;border-left-color:rgb(204, 204, 204);border-left-style:solid;border-left-width:1px;padding-left:1ex;"><pre class="qt-k9mail"><div>It seems to just double the code to do something. What is the use for that ?<br></div><div>Maybe it's better to wait until we have some real examples that use it <br></div><div>before merging.<br></div><div><br></div><div>On 2020-04-19 13:27, Rémi Denis-Courmont wrote:<br></div><blockquote class="qt-gmail_quote" style="margin-top:0pt;margin-right:0pt;margin-bottom:1ex;margin-left:0.8ex;border-left-color:rgb(114, 159, 207);border-left-style:solid;border-left-width:1px;padding-left:1ex;"><div><hr> include/vlc_sout.h | 42 ++++++++++++++++++++++++++-----<br></div><div> src/stream_output/stream_output.c | 1 +<br></div><div> 2 files changed, 37 insertions(+), 6 deletions(-)<br></div><div><br></div><div>diff --git a/include/vlc_sout.h b/include/vlc_sout.h<br></div><div>index 9b9c898cfc..a6fcf2b028 100644<br></div><div>--- a/include/vlc_sout.h<br></div><div>+++ b/include/vlc_sout.h<br></div><div>@@ -188,6 +188,14 @@ enum sout_stream_query_e {<br></div><div> SOUT_STREAM_ID_SPU_HIGHLIGHT, /* arg1=void *, arg2=const vlc_spu_highlight_t *, res=can fail */<br></div><div> };<br></div><div> <br></div><div>+struct sout_stream_operations {<br></div><div>+ void *(*add)(sout_stream_t *, const es_format_t *);<br></div><div>+ void (*del)(sout_stream_t *, void *);<br></div><div>+ int (*send)(sout_stream_t *, void *, block_t *);<br></div><div>+ int (*control)( sout_stream_t *, int, va_list );<br></div><div>+ void (*flush)( sout_stream_t *, void *);<br></div><div>+};<br></div><div>+<br></div><div> struct sout_stream_t<br></div><div> {<br></div><div> struct vlc_object_t obj;<br></div><div>@@ -199,6 +207,8 @@ struct sout_stream_t<br></div><div> config_chain_t *p_cfg;<br></div><div> sout_stream_t *p_next;<br></div><div> <br></div><div>+ const struct sout_stream_operations *ops;<br></div><div>+<br></div><div> /* add, remove a stream */<br></div><div> void *(*pf_add)( sout_stream_t *, const es_format_t * );<br></div><div> void (*pf_del)( sout_stream_t *, void * );<br></div><div>@@ -218,31 +228,51 @@ VLC_API sout_stream_t *sout_StreamChainNew(sout_instance_t *p_sout,<br></div><div> static inline void *sout_StreamIdAdd( sout_stream_t *s,<br></div><div> const es_format_t *fmt )<br></div><div> {<br></div><div>- return s->pf_add( s, fmt );<br></div><div>+ if (s->ops == NULL)<br></div><div>+ return s->pf_add(s, fmt);<br></div><div>+ return s->ops->add(s, fmt);<br></div><div> }<br></div><div> <br></div><div> static inline void sout_StreamIdDel( sout_stream_t *s,<br></div><div> void *id )<br></div><div> {<br></div><div>- s->pf_del( s, id );<br></div><div>+ if (s->ops == NULL) {<br></div><div>+ s->pf_del(s, id);<br></div><div>+ return;<br></div><div>+ }<br></div><div>+ s->ops->del(s, id);<br></div><div> }<br></div><div> <br></div><div> static inline int sout_StreamIdSend( sout_stream_t *s,<br></div><div> void *id, block_t *b )<br></div><div> {<br></div><div>- return s->pf_send( s, id, b );<br></div><div>+ if (s->ops == NULL)<br></div><div>+ return s->pf_send(s, id, b);<br></div><div>+ return s->ops->send(s, id, b);<br></div><div> }<br></div><div> <br></div><div> static inline void sout_StreamFlush( sout_stream_t *s,<br></div><div> void *id )<br></div><div> {<br></div><div>- if (s->pf_flush)<br></div><div>- s->pf_flush( s, id );<br></div><div>+ if (s->ops == NULL) {<br></div><div>+ if (s->pf_flush != NULL)<br></div><div>+ s->pf_flush(s, id);<br></div><div>+ return;<br></div><div>+ }<br></div><div>+ if (s->ops->flush != NULL)<br></div><div>+ s->ops->flush(s, id);<br></div><div> }<br></div><div> <br></div><div> static inline int sout_StreamControlVa( sout_stream_t *s, int i_query, va_list args )<br></div><div> {<br></div><div>- return s->pf_control ? s->pf_control( s, i_query, args ) : VLC_EGENERIC;<br></div><div>+ if (s->ops == NULL) {<br></div><div>+ if (s->pf_control == NULL)<br></div><div>+ return VLC_EGENERIC;<br></div><div>+ return s->pf_control(s, i_query, args);<br></div><div>+ }<br></div><div>+ if (s->ops->control == NULL)<br></div><div>+ return VLC_EGENERIC;<br></div><div>+ return s->ops->control(s, i_query, args);<br></div><div> }<br></div><div> <br></div><div> static inline int sout_StreamControl( sout_stream_t *s, int i_query, ... )<br></div><div>diff --git a/src/stream_output/stream_output.c b/src/stream_output/stream_output.c<br></div><div>index a89b6601c5..524b1a65ca 100644<br></div><div>--- a/src/stream_output/stream_output.c<br></div><div>+++ b/src/stream_output/stream_output.c<br></div><div>@@ -810,6 +810,7 @@ static sout_stream_t *sout_StreamNew( sout_instance_t *p_sout, char *psz_name,<br></div><div> p_stream->psz_name = psz_name;<br></div><div> p_stream->p_cfg = p_cfg;<br></div><div> p_stream->p_next = p_next;<br></div><div>+ p_stream->ops = NULL;<br></div><div> p_stream->pf_flush = NULL;<br></div><div> p_stream->pf_control = NULL;<br></div><div> p_stream->pace_nocontrol = false;<br></div><div>-- <br></div><div>2.26.1<hr>vlc-devel mailing list<br></div><div>To unsubscribe or modify your subscription options:<br></div><div><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></div></blockquote><div><hr>vlc-devel mailing list<br></div><div>To unsubscribe or modify your subscription options:<br></div><div><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></div></pre></blockquote></div><div><br></div><div>-- <br></div><div>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté. <br></div><div>_______________________________________________<br></div><div>vlc-devel mailing list<br></div><div>To unsubscribe or modify your subscription options:<br></div><div>https://mailman.videolan.org/listinfo/vlc-devel<br></div></blockquote><div><br></div></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>