[vlc-devel] Problem transporting psz (string) data with a libvlc event

basos g noxelia at gmail.com
Sat Nov 8 18:00:41 CET 2008


2008/11/7 Rémi Denis-Courmont <rdenis at simphalempin.com>:
>
> On Fri, 7 Nov 2008 12:45:16 +0200, "basos g" <noxelia at gmail.com> wrote:
>>  The problem is that i got a segi when i try to read the string data
>> outside vlc (from the libvlc user thread). I have comfirmed that the
>> psz_filename address is the same inside and outside of libvlc.
>> Is there some point i'm missing about free storage concerning
>> interthread transport ?
>
> The last thread to use the data must free it. The libc heap is thread-safe.
>
>> Is there a limitation for access rights on memmory allocated withing a
>> thread from another ??
>
> No.
>
>> Or is there some implicit mechanism that might free the string data
>> asynchronously while we are inside libvlc_event_send ?????
>
> Doubt it.

So it needs more digging....
>
> In any case, I don't think yet another event is the right thing to do. A
> blocking API sounds much more usable, and less bug-prone. That's how it's
> done with mediacontrol already.
>
The reason i want this feauture is because i need to know
asynchronously from a libvlc application when a snapshot has been
taken and what is the filename of the new image. The first has been
achieved. The hole story is about transporting psz_data with the
event.. As far as the interthread issue i have though of it and
realized that the callback function (attached with
libvlc_event_attach) runs in the same vlc thread that handles the
var_Set callback (where i have confirmed that psz data can be read)..

For the blocking API thing, please provide some more info as i'm
fairly new to vlc internals. But the main point is that i want to
export this asynchronous event to a libvlc user program.

vasil
> --
> Rémi Denis-Courmont
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
>



More information about the vlc-devel mailing list