What can stream objects do?

Discuss your Lua playlist, album art and interface scripts.
Vhati
Blank Cone
Blank Cone
Posts: 16
Joined: 06 Apr 2011 08:07

What can stream objects do?

Postby Vhati » 25 May 2012 01:07

According to the lua readme, vlc.stream() objects can be opened, read, and filtered(?).
If you neglect to read for a while, does a buffer fill to capacity and error out, or grow and eat memory?

Can they be closed or polled?
Are streams a subclass of something with more methods?

If they don't have a close method, can the garbage collector take care of them if you set the variable to nil?


I'm mainly interested in closing a stream, but the rest would be handy to know.

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: What can stream objects do?

Postby mederi » 27 May 2012 13:17

Hi! There is some demonstration of vlc.tream() usage in Allociné (french) VLC Extension. You can also check similar scripts around there fetching informations from Internet. Perhaps this could help you to reveal undocumented secrets.

Vhati
Blank Cone
Blank Cone
Posts: 16
Joined: 06 Apr 2011 08:07

Re: What can stream objects do?

Postby Vhati » 28 May 2012 22:25

Thanks. I missed that one.

Learned a couple things...
A) There's a second returned value for reporting errors, when the stream is nil: "local s, err = vlc.stream(...)"
B) Add "vlc.keep_alive()" after creating the stream and after each read, to keep VLC from getting bored and terminating the script for taking too long to return when the network lags.

Vhati
Blank Cone
Blank Cone
Posts: 16
Joined: 06 Apr 2011 08:07

Re: What can stream objects do?

Postby Vhati » 03 Jun 2012 22:51

stream:addfilter("comma,separated,list")

I think these are the only relevant ones, which extract from a single-file archive as you read:
  • zip
  • stream_filter_rar
A full list of modules, some of which may be stream filters can be found here:
http://130.75.2.12/source/xref/vlc/modules/LIST


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 13 guests