[vlc-devel] How to create a field that is accessible by multiple modules
Peter Tap
ptrtap at yahoo.com
Sat Nov 17 20:42:33 CET 2012
Brilliant. Thank you very much for your help.
Regards,
Peter
________________________________
From: Thomas Brouckaert <thomasbrouckaert at gmail.com>
To: Mailing list for VLC media player developers <vlc-devel at videolan.org>
Sent: Saturday, November 17, 2012 4:07 AM
Subject: Re: [vlc-devel] How to create a field that is accessible by multiple modules
Hey Peter,
I used to have the same problem and found a hackish solution that ofc never should be used in official code, but it is perfect for lab or own usage.
I wanted to extend the libVLC API with some of my own methods that needed to communicate with my own module. I just used the p_libvlc object's variable space to store this variabels.
Your code should like this:
//Set a var
var_Create(stream->p_libvlc, "variabel_name_1", VLC_VAR_INTEGER);
var_SetInteger(stream->p_libvlc, "variabel_name_1", active);
//get a var
return var_InheritInteger(stream->p_libvlc, "variabel_name_1");
I have no idea if this solution is thread safe and stuff like that, like I said, it is a hacksish solution that you shouldn't use in decent code.
Kind regards,
Thomas Brouckaert
On Sat, Nov 17, 2012 at 12:30 PM, Peter Tap <ptrtap at yahoo.com> wrote:
Hi Remi,
>
>It appears rc.c is making a call to vlc_object_find_name method. However, this method doesn't seem to work anymore. Plus, there is a warning on not to use this API.
>
>For now, I am using a file-based mechanism to share values between two modules. Wish there was a better way.
>
>
>Peter
>
>
>----- Original Message -----
>
>From: Peter Tap <ptrtap at yahoo.com>
>To: Mailing list for VLC media player developers <vlc-devel at videolan.org>
>Cc:
>Sent: Thursday, November 15, 2012 6:19 PM
>Subject: Re: [vlc-devel] How to create a field that is accessible by multiple modules
>
>Remi,
>
>Thank you for your help.
>
>I think this is not entirely true. Although each object may have its own independent dictionary, there is some way for others to get/set the values. If you look at gui/qt4, it is able to dynamically build preferences UI by obtaining all the key/values from all the modules. Also, the remote control interface (control/rc.c) has a way to get/set value for any other module's field. You can enter a command "@name marq-x value," for example within the remote control interface and set the "x" position value for marquee control.
>
>It is just that I am not able to figure out how exactly they are achieving this.
>
>Regards,
>Peter
>
>
>----- Original Message -----
>From: Rémi Denis-Courmont <remi at remlab.net>
>>
>> Can someone please help me understand how I can share the field between
>> two different modules?
>
>You cannot. Each object has its own independent dictionary.
>
>--
>Rémi Denis-Courmont
>Sent from my collocated server
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>http://mailman.videolan.org/listinfo/vlc-devel
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>http://mailman.videolan.org/listinfo/vlc-devel
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>http://mailman.videolan.org/listinfo/vlc-devel
>
_______________________________________________
vlc-devel mailing list
To unsubscribe or modify your subscription options:
http://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20121117/fd586f90/attachment.html>
More information about the vlc-devel
mailing list