Help with Libvlc structure

This forum is about all development around libVLC.
Beardless2
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 02 Feb 2007 09:53

Help with Libvlc structure

Postby Beardless2 » 30 Dec 2008 13:25

Hi,

I am a little confused about the libvlc structure in order play mulitple video files in a single app.

For a simple case of a single instance of vlc, I need to create 1 x instance of vlc using libvlc_new, i then need a media player using libvlc_media_player_new, and finally a media item using libvlc_media_new.

If i want to have multiple vlcs in my app, do i need 2 x of everything? or 1 x vlc (i.e. just create one vlc instance) and 2 x media player/media item? or just 1 x vlc, 1 x media player and 2 x media items?

Chris

erwan10
Developer
Developer
Posts: 415
Joined: 02 Nov 2008 23:16

Re: Help with Libvlc structure

Postby erwan10 » 30 Dec 2008 14:55

libvlc is a promising API, ....

but when it comes to playing multiple videos concurrently, some work still needs to be done.

case one:
- You create 1 single libvlc instance (libvlc_new) and multiple medias/media_players. It works perfectly except for the following:
- hotkeys are all mixed up (hotkeys pertaining to one video trigger action for another one)
- audio subsystem was never made multi-video friendly. you can only monitor one audio (chosen randomly) within a libvlc instance.

case two:
- You create as many libvlc instances (libvlc_new) as there are concurrent videos. Works fine except for the following:
- options passed to the libvlc instance are not independent. A new instance overwrites options set up for a previous one.
- that's a lot of threads (big overhead just for working out problems met with case one)

In both cases, from a OS point of view, only one vlc is created.

Beardless2
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 02 Feb 2007 09:53

Re: Help with Libvlc structure

Postby Beardless2 » 30 Dec 2008 18:10

thanks - that helps alot.

Do you know if the "work that needs to be done" is currently in development and will be out in time for v1.0 or a future minor release?

erwan10
Developer
Developer
Posts: 415
Joined: 02 Nov 2008 23:16

Re: Help with Libvlc structure

Postby erwan10 » 30 Dec 2008 19:02

I wish I knew ..... But, I'm afraid these problems have not come up as top priorities and they don't seem to be much talked about for the vlc1.0.0 release.

Beardless2
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 02 Feb 2007 09:53

Re: Help with Libvlc structure

Postby Beardless2 » 30 Dec 2008 19:54

ok - maybe if a mod/developer can address there issues if they look in here?

Also, do you know the correct/safe way to destroy vlc. I.e. Stop the video, destroy the media item, then destroy the media player, then finally destroy the vlc instance - is that the correct order?

erwan10
Developer
Developer
Posts: 415
Joined: 02 Nov 2008 23:16

Re: Help with Libvlc structure

Postby erwan10 » 30 Dec 2008 20:17

yes, the way you do it works.
Media item can be released early in the process, because media_player keeps a reference anyway.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 7 guests