[vlc-devel] Support of events in Mozilla plugin - Beta

jpd at videolan.org jpd at videolan.org
Wed Dec 2 18:52:31 CET 2009

I haven't had time to review the code, but perhaps you could answer me
some of the following questions anyway.

On Tue, Dec 01, 2009 at 05:06:02PM +0100, y.brehon at qiplay.com wrote:
> - We don't register events with libvlc when an eventlistener is created,
> because events would then be associated to the playlist.

I don't see how this works, but admittedly I'm not up to speed on that
part of libvlc.

> This means as soon as the video is stopped, events would no longer be
> attached.

This bit is important for the next question, but first:

> Moreover, this technique prevents new event listeners from being
> attached while a video is being played. This is why we chose to
> register for all events which may interest the plugin right from the
> beginning, and then filter these events as they are called.

Seems to me to be a case of carefully directing what to attach where. If
attaching is that brittle we probably need to fix that.

> - The event registration is not in the constructor because we need to
> re-register for events every time the playlist changes, not only at
> creation

Above you appear to say that you're trying to avoid having to re-register,
and here you say that it needs to happen anyway. Can you explain?

This because it leads me to think that it would be advantageous to keep
a master bitmap of what to re-register and use it to lazily register
while at it. Could you elaborate on why that wouldn't be possible?

> - This is why for now, we register all "interesting" events in
> VlcPlugin::playlist_select (no way of simply knowing which event are
> "registerable" and which ones are not)

Alright, but I see no actual requirement to do that at startup; merely
keeping a {list,bitmap} of what is registerable is enough.

> - There is not (yet ?) a removeListener method for a single event
> listener.

If we need one we can make one.

More information about the vlc-devel mailing list