LUA as GUI and C as logic

Discuss your Lua playlist, album art and interface scripts.
ASantosVal
New Cone
New Cone
Posts: 9
Joined: 18 Jan 2017 12:27

LUA as GUI and C as logic

Postby ASantosVal » 22 Feb 2017 10:09

Short version of the question:
Can I make a LUA user interface as an extension which communicates with C, so C does the real work?

Long version of the question:
I'm currently developing a LUA extension that it's meant to stream local media to uPnP renderers on the LAN. The problem is that the actual streaming code it's way easier to develop in C, which already has libraries for that. So what I need is a way to make LUA and C communicate.

I have found this documentation about the LUA and C API: https://www.lua.org/pil/24.html

The problem I see with that is that the C code would work "out of VLC" and I wouldn't reuse the useful code already integrated in VLC. (Not sure about this, please correct me if I'm wrong)

Another option I am considering is to extend VLC's LUA API so it can access the code I develop, but seems really complicated.

Has somebody ever tried something similar? Any thoughts or recommendations?

Etoh
Blank Cone
Blank Cone
Posts: 60
Joined: 12 Jan 2013 16:33

Re: LUA as GUI and C as logic

Postby Etoh » 22 Feb 2017 10:54

"stream local media to uPnP renderers on the LAN" - not sure what role VLC has in all this.

Depending on what you are doing, you might just be able to create a server/client that VLC can connect with and avoid Lua altogether.

What sort of communication bandwidth were you thinking of? You can make a Lua script a host script, but that might not be great for lots of data transfer.

ASantosVal
New Cone
New Cone
Posts: 9
Joined: 18 Jan 2017 12:27

Re: LUA as GUI and C as logic

Postby ASantosVal » 22 Feb 2017 11:03

Sorry if it wasn't well explained. The idea is to take a file that it's been played on VLC and stream it easily to a smart TV or something similar. Lua would be just the way to select the device you want to stream to and then offer some basic control (play, pause, volume up/down, etc.). VLC should control the stream.

I hope I have explained myself, English is not my main language. :(


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 19 guests