[vlc-devel] commit: libvlc: add mouse events as libvlc_MediaPlayerEvents ( Jean-Paul Saman )

Rémi Denis-Courmont remi at remlab.net
Thu Feb 11 15:05:41 CET 2010


On Thu, 11 Feb 2010 13:03:27 +0100, Laurent Aimar <fenrir at via.ecp.fr>
wrote:
>> > Attaching mouse-object to vout_thread_t seems a bad idea to me as it
>> > used only by the logo filter.
>> >  IMO, it should be moved to the logo filter instead.
>> 
>> But how do I obtain the logo filter object then? Without
>> vlc_object_find_name() ??
> 
>  A new function that can retreive a filter (or a filter list) from
> the vout is needed (like it was added for retreiving the decoder
objects).
> 
> But using vlc_object_find_name or ->p_parent are both ugly and dangerous
> (dunno which one is worst) and so no new uses should be added.

p_parent is ugly and bad practice as it breaks the encapsulation principle
(as does vlc_object_find_name()). But it is not dangerous in terms of
synchronization, if the object is attached *first* and never detached.

To my knowledge, only those objects have a changing parent which is not
safe to use:
 - input's video outputs,
 - input's audio output,
 - input's stream output instance,
(in other words, the input "resources").

Everything else should be OK, except for the instance object which does not
have a parent.

-- 
Rémi Denis-Courmont
http://www.remlab.net
http://fi.linkedin.com/in/remidenis




More information about the vlc-devel mailing list