[vlc-devel] Re: How to embed VLC in my C application

Tony Anecito adanecito at yahoo.com
Wed Jun 13 00:33:15 CEST 2007


Actually I am trying to get multiple child windows running videos using the vlc libraries right now. I am using the latest builds and the jvlc bindings. I am trying to work through understanding how to get the right options setup like for streaming (I left and email for the vlc team today) but otherwise it appears to work fine but I need to get streaming working so I and my testers can get back to testing vlc.
   
  Regards,
  -Tony Anecito
  Founder,
  MyUniportal
  http://www.myuniportal.com
  

Rémi Denis-Courmont <rem at videolan.org> wrote:
  Hello,

Le mardi 12 juin 2007, Herman Schultz a écrit :
> I am trying to embed&invoke VLC in my c application.
>
> I invoke VLC like this:
> // i_argc is an int
> // ppsz_argv2 is char* ppsz_argv2[]
>
> int i_ret = VLC_Create();
> i_ret = VLC_Init( 0, i_argc, ppsz_argv2 );
> i_ret = VLC_AddIntf( 0, NULL, VLC_TRUE, VLC_TRUE );
>
> It works the first time when I do this.
> But when I do that the same i_argc, ppsz_arg2[] the second time, I
> get an segmentation inside VLC_Init().
>
> Can you please tell me why is there? Or if that is the right way to
> embed/invoke VLC in my own application.

There are two reasons why they crashes:
The bad reason is that VLC 0.8.6 is not quite multi-instance-safe yet; 
we are trying to solve this in upcoming version 0.9.0 but we would need 
people to test this seriously.

The good reason is that the "VLC" API (as used in src/vlc.c) uses main 
VLC object number "0". Given object numbers are shared across a 
process, there cannot be two VLC instance using object number 0. In 
other word, without some changes, the "VLC" API cannot be used to spawn 
more than one instance at a time.

*However*, as Pierre pointed out, the newer LibVLC media control API 
should work fine.

-- 
Rémi Denis-Courmont
http://www.remlab.net/


       
---------------------------------
Luggage? GPS? Comic books? 
Check out fitting  gifts for grads at Yahoo! Search.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20070612/1946aa90/attachment.html>


More information about the vlc-devel mailing list