[vlc-devel] [PATCH] lua: http: Expose renderers

Hugo Beauzée-Luyssen hugo at beauzee.fr
Wed Aug 12 11:07:53 CEST 2020

> It seems rather weird to store state inside a module. Also, this works
> currently because of the particular way that the lua http interface runs
> server-side scripting, but it doesn't seem like a great idea to rely on
> or create bounds to this implementation.

I agree but since the renderer discovery API is stateless and only propagate information through callbacks, there is no way of fetching the renderers at any time. 
With the current core API, if we want to be able to list the renderers through the HTTP interface, we have to instantiate an object that will store the renderers as they come and go.
Some alternatives could be to do something like the media sources API, allowing the users to fetch the currently known renderers, or to forward the events to the HTTP interface, but that probably means it would complexify this interface quite a lot.
I'm not sure those alternatives are worth the time, to be fair.

> I'm not sure I understand this API correctly (it's not documented in
> share/lua/README.txt - would be nice if it was), but this seems like a

That can be arranged for sure.

> strange place to instantiate the RD. It seems awkward for getstatus() to
> change or create new state; and that's a place that doesn't provide for

Fair enough, I suppose I could split the renderers listing to a different request, or explicitly require the user to enable renderer discovery instead of doing it automatically.
I'm perfectly fine with moving the instantiating somewhere else

> choosing a particular module by name. Also if the RD needs some time to
> get populated, it shouldn't be created right before getting used in the
> same request - and if it doesn't need time, then it might be possible to
> use temporary instances instead of storing a persistent one.

Creating a renderer discoverer doesn't do much beside spawning its thread, and its list gets populated asynchronously, but you can't know how long to wait for all renderers to appear so it's not viable to spawn a temporary RD and wait for some results to appear IMO.

> For comparison, the VLM is instantiated by http.lua itself upon load, in
> custom.lua - which sucks too in different ways.

On Wed, Aug 12, 2020, at 3:20 AM, Pierre Ynard via vlc-devel wrote:
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
> Attachments:
> * Email.eml

  Hugo Beauzée-Luyssen
  hugo at beauzee.fr

More information about the vlc-devel mailing list