[vlc-devel] [vlc-commits] lua: remove add_callback and del_callback

Pierre Ynard linkfanel at yahoo.fr
Fri Mar 30 01:36:38 CEST 2012


> The _internal_ plugin API is explicitly unstable across major
> versions. As far as VLC Lua exposes (a subset of) that API, it is
> unavoidably unstable as well. So that is a red herring

Well... isn't this retarded? Shouldn't that lua API be made stable,
if we want to encourage external developers to use it? Lua functions
don't have to match plugin API functions, that's not necessarily a good
design. So ultimately that's not an excuse to be careless.

> > The next victim will be
> > the http interface, since httpd callbacks have the same problem.
> 
> "Told you so."
> [...]
> I did not remove the old HTTP, nor did I initiate or get much involved
> in Lua httpd. I do not accept any responsibility for this, and I am
> rather annoyed that you point the finger at me here.

I'm not pointing fingers at you, I'm just bringing this up to show the
importance of this issue, to the people who should feel concerned. Some
of which will never read this anyway, but whatever.

> Even if add_callback is restored, the core object variables are not
> stable. So functionally, add_callback is intrinsically unstable anyway.

That's an interesting point. Also, external developers don't know
anything about objects and variables, that are VLC internals. So this
API makes it hard for them to take advantage of all the possibilities
(for polling-free code) that this offers.

> So there would be memory barriers and mutual exclusion. That does not
> prove that the Lua interpreter can deal with this.

It seems not to explode all over the place. What could be wrong with
this, and how can we prove whether it can actually work or not?

> Also, that would turn the Lua plugin into a maintenance hell, as you
> would need locking all over the place.

That's a bit pessimistic. You could say that you only need to lock in
callback functions and functions that put the main thread to sleep.

> For extensions and only for extensions, callbacks connection could
> simply be queued instead of direct (which was buggy). Extensions
> already have a mainloop. But that won't change the fact that object
> variables are not stable. And that won't work for other types of Lua
> plugins.

I actually don't know about extensions.

-- 
Pierre Ynard
"Une âme dans un corps, c'est comme un dessin sur une feuille de papier."



More information about the vlc-devel mailing list