[vlc-devel] Re: problems with many libvlc instances

Donoso Gabilondo, Daniel donoso.d at ikusi.es
Wed Jun 28 17:32:11 CEST 2006


As you tall me, using the libvlc_playlist_add_extended function I can set
the width, height and video position. 

Thank you very much and thanks for all the people helped me.

Regards,
Daniel


-----Mensaje original-----
De: Clément Stenac [mailto:zorglub at diwi.org] 
Enviado el: miércoles, 28 de junio de 2006 14:25
Para: vlc-devel at videolan.org
Asunto: [vlc-devel] Re: problems with many libvlc instances

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

For example, if you consider the following snippet: 

    libvlc_instance_t *p_instance, *p_instance2;
    char *argv[] = { "vlc", "-vvv","--no-color" };
    char *argv1[] = { "vlc", "-vvv","--color" };

    libvlc_exception_t exception;
    libvlc_exception_init( &exception );

    fprintf( stderr, "********* INIT 1\n" );
    p_instance = libvlc_new( 3, argv, &exception );
    fprintf( stderr, "********* INIT 2\n" );
    p_instance2 = libvlc_new( 3, argv1, &exception );
    fprintf( stderr, "********* Add\n" );
    libvlc_playlist_add( p_instance, "test.mp3" , NULL , &exception );
    fprintf( stderr, "************ Playing : %i %i\n",
libvlc_playlist_isplaying( p_instance, &exception  ),
libvlc_playlist_isplaying( p_instance2, &exception ) );
    fprintf( stderr, "********** Play\n" );
    libvlc_playlist_play( p_instance, -1, 0, NULL, &exception );
    sleep( 1 );
    fprintf( stderr, "************ Playing : %i %i\n",
libvlc_playlist_isplaying( p_instance, &exception  ),
libvlc_playlist_isplaying( p_instance2, &exception ) );
    sleep( 1 );
    fprintf( stderr, "********** Kill\n" );
    libvlc_destroy( p_instance );
    libvlc_destroy( p_instance2 );

You will correctly see that two instances are created, and that only one
plays the test.mp3 file (You'll see Playing : 1 0) ... but all messages
will be black-and-white.

What you can do is use so-called input options to the specific items.

For that, use the libvlc_playlist_add_extended call, which takes
an array of strings as argument. Use a syntax like "video-x=12"
"video-y=42" in this array.

Regards, 

-- 
Zorglub
Clément Stenac

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20060628/f6fcb3b6/attachment.html>


More information about the vlc-devel mailing list