[vlc-devel] Multiple instances and/or multiple players
pdherbemont at gmail.com
Tue Aug 18 14:26:58 CEST 2009
On Aug 18, 2009, at 1:08 PM, Rémi Denis-Courmont wrote:
> On Tue, 18 Aug 2009 12:39:14 +0200, Pierre d'Herbemont
> <pdherbemont at gmail.com> wrote:
>> A few things come to my mind:
>> - multiple instances is not something that is being tested a lot in
> Neither are multiple players.
I have been using it and it works. Didn't test the other way around :)
>> - I am a bit candid here, but what is the effective performance
>> impact? do you have any numbers?
> It consumes a little bit more memory, although this is in great due
> unused playlist. The module directory has to be browsed if you destroy
> *all* instances _then_ create a new one. That said this cost is also
> present if libvlc is instanciated only when one (or more) player is
> If we want to optimize it away, I would rather have a pair of void(*)
> function that increase the reference count of the module cache (kind
> like WSAStartup/WSACleanup on Windows), than use
>> - Do we want to allow sharing of input item between different
>> instance? How much do we want to make sure we can share between two
> Do input items reference anything external anyway? They are not even
Right, I think they should be fine. I am trying to find problematic
>> - Cache: All cached data will be into globals? How do you plan to
>> flush caches? AFAIK this was the only goal of libvlc_new,
> The module cache is already implicitly shared across all instances,
> -this is a bug- so is the configuration.
This is fair. Yet, if we want to reuse one vlc object between two
instances (to be able to cache), is this something that could be
envisioned? That's something that makes me believe that using multiple
instance is weak. (more below)
>> - Having multiple audio output could be problematic in some platform,
>> and doing audio mixing ourselves is then a great plus. How do you do
>> that with one instance?
> Having a *single* audio output sucks. As Brezhoneg pointed out, you
> configure the audio per input as a consequence of this mis-design. I
> planning to have per-input audio outputs regardless - if we keep
> player per instances.
This is not so related. All the audio mixing is done by VLC. So each
audio configuration should be independent. Everything else is a bug.
However the question of being able to reuse the same audio output
remains unanswered. We could think about something similar when trying
to stream two media player instances to the same video output
(mosaic), but with independent controls. I admit that this is
>> That said, this is an implementation details, how do you plan to
>> reflect that on the API?
> Basically, we could merge instance and player types, and simplify
> quite a
> bunch of stuff.
This would be great, even if we don't chose to have multiple instance.
This choice has to be an implementation detail.
More information about the vlc-devel