<html><head></head><body>Hi,<br><br>Insanity in the GUI is not motivation for insanity in the API. As long as Chromecast was the only renderer, it didn't matter. That's VLC 3. We can't do it that way in 4.x, unless we drop UPnP.<br><br><div class="gmail_quote">Le 10 août 2020 10:37:39 GMT+03:00, "Hugo Beauzée-Luyssen" <hugo@beauzee.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;">
<pre class="k9mail">On Mon, Jun 29, 2020, at 3:48 PM, 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;">Le maanantaina 29. kesäkuuta 2020, 12.54.12 EEST Hugo Beauzée-Luyssen a écrit <br>:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"><hr> modules/lua/libs/renderers.c | 32 ++++++++++++++++++++++++++++++--<br> 1 file changed, 30 insertions(+), 2 deletions(-)<br><br>diff --git a/modules/lua/libs/renderers.c b/modules/lua/libs/renderers.c<br>index 822b7ad237..3e132a95a8 100644<br>--- a/modules/lua/libs/renderers.c<br>+++ b/modules/lua/libs/renderers.c<br>@@ -179,11 +179,39 @@ static int vlclua_rd_create( lua_State* L )<br> vlc_vector_init( &sys->items );<br> vlc_mutex_init( &sys->mutex );<br> sys->last_renderer_id = 0;<br>+ sys->rd = NULL;<br><br> vlc_object_t *this = vlclua_get_this( L );<br>- const char* name = luaL_checkstring( L, 1 );<br>+ const char* name = lua_tostring( L, 1 );<br>+<br>+ if ( name )<br>+ {<br>+ sys->rd = vlc_rd_new( this, name, &sys->owner );<br>+ }<br>+ else<br>+ {<br>+ char** names;<br>+ char** longnames;<br>+ if ( vlc_rd_get_names( this, &names, &longnames ) != VLC_SUCCESS )<br>+ {<br>+ vlc_vector_destroy( &sys->items );<br>+ return 0;<br>+ }<br>+ int i = 0;<br>+ while ( sys->rd == NULL && names[i] != NULL )<br>+ {<br>+ sys->rd = vlc_rd_new( this, names[i], &sys->owner );<br>+ ++i;<br>+ }<br>+ for ( i = 0; names[i] != NULL; ++i )<br>+ {<br>+ free( names[i] );<br>+ free( longnames[i] );<br>+ }<br>+ free( longnames );<br>+ free( names );<br>+ }<br></blockquote>If there are more than one renderer, that gives you whatever.<br>I can't grasp in what usage scenario this would be intended.<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;">- sys->rd = vlc_rd_new( this, name, &sys->owner );<br> if ( !sys->rd )<br> {<br> vlc_vector_destroy( &sys->items );<br></blockquote><br></blockquote><br>Hi,<br><br>This is mostly to be consistent with both Qt and macOS UIs. All renderer discovery modules have expose the same functionalities but they might expose slightly different names. <br>Also, I'm not sure we should require a name in this API, but that's on me since I forgot to address it before pushing.<br></pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>