[vlc-devel] LibVLC vmem vout and Elementary Stream ID

Rémi Denis-Courmont remi at remlab.net
Thu Feb 27 19:19:28 CET 2014


Le jeudi 27 février 2014, 11:26:34 Jérôme Forissier a écrit :
> On 26 févr. 2014, at 18:40, Rémi Denis-Courmont wrote:
> > Le mercredi 26 février 2014, 18:27:05 Jérôme Forissier a écrit :
> >> So I am proposing to add a
> >> new parameter to setup(): int es_id, "the ID of the elementary stream
> >> that
> >> caused the decoder to instantiate the video output".
> > 
> > You cannot add *any* new parameter. That would break binary compatibility.
> > You need to either add a new callback, or a new function.
> 
> Sure. Or, what about using a thread-specific variable to store the ID?

Even if you find a reasonable way to associate an ES ID to a setup callback 
invocation, thread-local storage will be impractical. The video output 
callbacks are called from the vmem plugin, while the libvlc functions are 
defined in the libvlc run-time. Where would you store the thread local variable 
then?

You may be much better off storing the ID right after the opaque pointer 
storage space while calling setup(). That is a simple change to vmem.c:

int blah_blah_get_track_id(void **opaque)
{
    return *(int *)(opaque + 1);
}


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




More information about the vlc-devel mailing list