<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2652.35">
<TITLE>RE: [vlc-devel] Re: problems with many libvlc instances</TITLE>
</HEAD>
<BODY>
<BR>

<P><FONT SIZE=2>As you tall me, using the libvlc_playlist_add_extended function I can set the width, height and video position. </FONT>
</P>

<P><FONT SIZE=2>Thank you very much and thanks for all the people helped me.</FONT>
</P>

<P><FONT SIZE=2>Regards,</FONT>
<BR><FONT SIZE=2>Daniel</FONT>
</P>
<BR>

<P><FONT SIZE=2>-----Mensaje original-----</FONT>
<BR><FONT SIZE=2>De: Clément Stenac [<A HREF="mailto:zorglub@diwi.org">mailto:zorglub@diwi.org</A>] </FONT>
<BR><FONT SIZE=2>Enviado el: miércoles, 28 de junio de 2006 14:25</FONT>
<BR><FONT SIZE=2>Para: vlc-devel@videolan.org</FONT>
<BR><FONT SIZE=2>Asunto: [vlc-devel] Re: problems with many libvlc instances</FONT>
</P>

<P><FONT SIZE=2>It's actually a vocabulary problem. You can call libvlc_new() twice, but</FONT>
<BR><FONT SIZE=2>some stuff behind will be shared. Most notably, the configuration will</FONT>
<BR><FONT SIZE=2>be shared, that's why you can't use global options to handle</FONT>
<BR><FONT SIZE=2>positionning.</FONT>
</P>

<P><FONT SIZE=2>For example, if you consider the following snippet: </FONT>
</P>

<P><FONT SIZE=2>    libvlc_instance_t *p_instance, *p_instance2;</FONT>
<BR><FONT SIZE=2>    char *argv[] = { "vlc", "-vvv","--no-color" };</FONT>
<BR><FONT SIZE=2>    char *argv1[] = { "vlc", "-vvv","--color" };</FONT>
</P>

<P><FONT SIZE=2>    libvlc_exception_t exception;</FONT>
<BR><FONT SIZE=2>    libvlc_exception_init( &exception );</FONT>
</P>

<P><FONT SIZE=2>    fprintf( stderr, "********* INIT 1\n" );</FONT>
<BR><FONT SIZE=2>    p_instance = libvlc_new( 3, argv, &exception );</FONT>
<BR><FONT SIZE=2>    fprintf( stderr, "********* INIT 2\n" );</FONT>
<BR><FONT SIZE=2>    p_instance2 = libvlc_new( 3, argv1, &exception );</FONT>
<BR><FONT SIZE=2>    fprintf( stderr, "********* Add\n" );</FONT>
<BR><FONT SIZE=2>    libvlc_playlist_add( p_instance, "test.mp3" , NULL , &exception );</FONT>
<BR><FONT SIZE=2>    fprintf( stderr, "************ Playing : %i %i\n", libvlc_playlist_isplaying( p_instance, &exception  ), libvlc_playlist_isplaying( p_instance2, &exception ) );</FONT></P>

<P><FONT SIZE=2>    fprintf( stderr, "********** Play\n" );</FONT>
<BR><FONT SIZE=2>    libvlc_playlist_play( p_instance, -1, 0, NULL, &exception );</FONT>
<BR><FONT SIZE=2>    sleep( 1 );</FONT>
<BR><FONT SIZE=2>    fprintf( stderr, "************ Playing : %i %i\n", libvlc_playlist_isplaying( p_instance, &exception  ), libvlc_playlist_isplaying( p_instance2, &exception ) );</FONT></P>

<P><FONT SIZE=2>    sleep( 1 );</FONT>
<BR><FONT SIZE=2>    fprintf( stderr, "********** Kill\n" );</FONT>
<BR><FONT SIZE=2>    libvlc_destroy( p_instance );</FONT>
<BR><FONT SIZE=2>    libvlc_destroy( p_instance2 );</FONT>
</P>

<P><FONT SIZE=2>You will correctly see that two instances are created, and that only one</FONT>
<BR><FONT SIZE=2>plays the test.mp3 file (You'll see Playing : 1 0) ... but all messages</FONT>
<BR><FONT SIZE=2>will be black-and-white.</FONT>
</P>

<P><FONT SIZE=2>What you can do is use so-called input options to the specific items.</FONT>
</P>

<P><FONT SIZE=2>For that, use the libvlc_playlist_add_extended call, which takes</FONT>
<BR><FONT SIZE=2>an array of strings as argument. Use a syntax like "video-x=12"</FONT>
<BR><FONT SIZE=2>"video-y=42" in this array.</FONT>
</P>

<P><FONT SIZE=2>Regards, </FONT>
</P>

<P><FONT SIZE=2>-- </FONT>
<BR><FONT SIZE=2>Zorglub</FONT>
<BR><FONT SIZE=2>Clément Stenac</FONT>
</P>

<P><FONT SIZE=2>-- </FONT>
<BR><FONT SIZE=2>This is the vlc-devel mailing-list, see <A HREF="http://www.videolan.org/vlc/" TARGET="_blank">http://www.videolan.org/vlc/</A></FONT>
<BR><FONT SIZE=2>To unsubscribe, please read <A HREF="http://developers.videolan.org/lists.html" TARGET="_blank">http://developers.videolan.org/lists.html</A></FONT>
</P>

</BODY>
</HTML>