libvlc_new vs libvlc_retain with multiple videos

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

libvlc_new vs libvlc_retain with multiple videos

Postby Beardless2 » 17 Nov 2010 18:26

Hi,

I am building an Win32 application that display four videos using four libvlc_media_player_t.

Please could someone list the advantages and disadvantage of using separate calls to libvlc_new to create four instances of LibVLC, or to make 1 call to libvlc_new and three calles to libvlc_retain to create just a single instance?

From doxygen : "You can create one (or more) instance(s) of LibVLC in a given process, with libvlc_new() and destroy them with libvlc_release()."

I believe in the past (1.0.x) I would be required to make multiple instances of libvlc to get around some bugs in libvlc, but wondered if this has now changed with 1.1.x?

Chris

Rémi Denis-Courmont
Developer
Developer
Posts: 15143
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: libvlc_new vs libvlc_retain with multiple videos

Postby Rémi Denis-Courmont » 17 Nov 2010 19:30

There are no benefits to creating multiple instances, other than simplifying your source code.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

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

Re: libvlc_new vs libvlc_retain with multiple videos

Postby Beardless2 » 17 Nov 2010 21:37

thanks, so no benefits but are there any drawbacks other than the extra source code? i.e. more memory usage, more threads etc?

Rémi Denis-Courmont
Developer
Developer
Posts: 15143
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: libvlc_new vs libvlc_retain with multiple videos

Postby Rémi Denis-Courmont » 18 Nov 2010 18:04

In recent versions, there shouldn't be any thread on a bare libvlc instance, at least on Linux. Of course, it will require a little bit more memory, but that should be peanuts to the cost of a media instance.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 6 guests