Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
32601584
Commit
32601584
authored
Jun 13, 2008
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a global documentation for all the Lua modules.
parent
c0b61e8a
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
352 additions
and
92 deletions
+352
-92
modules/misc/lua/libs/misc.c
modules/misc/lua/libs/misc.c
+7
-0
modules/misc/lua/libs/stream.c
modules/misc/lua/libs/stream.c
+1
-1
share/lua/README.txt
share/lua/README.txt
+317
-0
share/lua/intf/README.txt
share/lua/intf/README.txt
+19
-0
share/lua/meta/README.txt
share/lua/meta/README.txt
+3
-48
share/lua/playlist/README.txt
share/lua/playlist/README.txt
+5
-43
No files found.
modules/misc/lua/libs/misc.c
View file @
32601584
...
...
@@ -118,6 +118,12 @@ static int vlclua_datadir( lua_State *L )
return
1
;
}
static
int
vlclua_userdatadir
(
lua_State
*
L
)
{
lua_pushstring
(
L
,
config_GetUserDataDir
()
);
return
1
;
}
static
int
vlclua_homedir
(
lua_State
*
L
)
{
lua_pushstring
(
L
,
config_GetHomeDir
()
);
...
...
@@ -198,6 +204,7 @@ static const luaL_Reg vlclua_misc_reg[] = {
{
"license"
,
vlclua_license
},
{
"datadir"
,
vlclua_datadir
},
{
"userdatadir"
,
vlclua_userdatadir
},
{
"homedir"
,
vlclua_homedir
},
{
"configdir"
,
vlclua_configdir
},
{
"cachedir"
,
vlclua_cachedir
},
...
...
modules/misc/lua/libs/stream.c
View file @
32601584
...
...
@@ -63,7 +63,7 @@ static int vlclua_stream_new( lua_State *L )
vlc_object_t
*
p_this
=
vlclua_get_this
(
L
);
stream_t
*
p_stream
;
const
char
*
psz_url
;
psz_url
=
luaL_checkstring
(
L
,
-
1
);
psz_url
=
luaL_checkstring
(
L
,
1
);
p_stream
=
stream_UrlNew
(
p_this
,
psz_url
);
if
(
!
p_stream
)
return
luaL_error
(
L
,
"Error when opening url: `%s'"
,
psz_url
);
...
...
share/lua/README.txt
0 → 100644
View file @
32601584
This diff is collapsed.
Click to expand it.
share/lua/intf/README.txt
0 → 100644
View file @
32601584
Instructions to code your own VLC Lua interface script.
$Id$
See lua/README.txt for generic documentation about Lua usage in VLC.
Examples: rc.lua, telnet.lua and http.lua
The "config" global variable is set to the value specified in the
--lua-config VLC option. For example:
--lua-config "rc={a='test',c=3},telnel{a='hello'}"
config will be set to {a='test',c=3} in the rc interface, to {a='hello'}
in the telnet interface and won't be set in other interfaces.
User defined modules stored in the share/lua/intf/modules/ directory are
available. For example, to use the sandbox module, just use
'require "sandbox"' in your interface.
VLC defines a global vlc object with the following members:
All the VLC specific Lua modules are available.
share/lua/meta/README.txt
View file @
32601584
Instructions to code your own VLC Lua meta script.
$Id$
See lua/README.txt for generic documentation about Lua usage in VLC.
Examples: See googleimage.lua .
VLC Lua meta modules should define one of the following functions:
* fetch_art(): returns a path to an artwork for the given item
* fetch_meta(): returns a table with the following items:
.path: the item's full path / URL
.name: the item's name in playlist (OPTIONAL)
.title: the item's Title (OPTIONAL, meta data)
.artist: the item's Artist (OPTIONAL, meta data)
.genre: the item's Genre (OPTIONAL, meta data)
.copyright: the item's Copyright (OPTIONAL, meta data)
.album: the item's Album (OPTIONAL, meta data)
.tracknum: the item's Tracknum (OPTIONAL, meta data)
.description: the item's Description (OPTIONAL, meta data)
.rating: the item's Rating (OPTIONAL, meta data)
.date: the item's Date (OPTIONAL, meta data)
.setting: the item's Setting (OPTIONAL, meta data)
.url: the item's URL (OPTIONAL, meta data)
.language: the item's Language (OPTIONAL, meta data)
.nowplaying: the item's NowPlaying (OPTIONAL, meta data)
.publisher: the item's Publisher (OPTIONAL, meta data)
.encodedby: the item's EncodedBy (OPTIONAL, meta data)
.arturl: the item's ArtURL (OPTIONAL, meta data)
.trackid: the item's TrackID (OPTIONAL, meta data)
.options: a list of VLC options (OPTIONAL)
example: .options = { "fullscreen" }
.duration: stream duration in seconds (OPTIONAL)
.meta: custom meta data (OPTIONAL, meta data)
A .meta field is a table of custom meta categories which
each have custom meta properties.
example: .meta = { ["Google video"] = { ["docid"] = "-5784010886294950089"; ["GVP version"] = "1.1" }; ["misc"] = { "Hello" = "World!" } }
Invalid playlist items will be discarded by VLC.
VLC defines a global vlc object with the following members:
* vlc.stream_new
* vlc.stream_delete
* vlc.stream_readline
* vlc.stream_read
* vlc.decode_uri( <string> ): decode %xy characters in a string.
* vlc.resolve_xml_special_chars( <string> ): decode &abc; characters in a
string.
* vlc.msg_dbg( <string> ): print a debug message.
* vlc.msg_warn( <string> ): print a warning message.
* vlc.msg_err( <string> ): print an error message.
* vlc.msg_info( <string> ): print an info message.
Lua scripts are tried in alphabetical order in the user's VLC config
director lua/meta/ subdirectory, then in the global VLC lua/meta/
directory.
Lua documentation is available on http://www.lua.org .
VLC uses Lua 5.1
All the Lua standard libraries are available.
Available VLC specific Lua modules: msg, stream and strings. See lua/README.txt
share/lua/playlist/README.txt
View file @
32601584
Instructions to code your own VLC Lua playlist script.
$Id$
See lua/README.txt for generic documentation about Lua usage in VLC.
Examples: See dailymotion.lua, googlevideo.lua, metacafe.lua, youbtube.lua
and youtube_homepage.lua .
VLC Lua playlist modules should define two functions:
* probe(): returns true if we want to handle the playlist in this script
* parse(): read the incoming data and return playlist item(s)
The playlist is a table of playlist objects.
A playlist object has the following members:
.path: the item's full path / URL
.name: the item's name in playlist (OPTIONAL)
.title: the item's Title (OPTIONAL, meta data)
.artist: the item's Artist (OPTIONAL, meta data)
.genre: the item's Genre (OPTIONAL, meta data)
.copyright: the item's Copyright (OPTIONAL, meta data)
.album: the item's Album (OPTIONAL, meta data)
.tracknum: the item's Tracknum (OPTIONAL, meta data)
.description: the item's Description (OPTIONAL, meta data)
.rating: the item's Rating (OPTIONAL, meta data)
.date: the item's Date (OPTIONAL, meta data)
.setting: the item's Setting (OPTIONAL, meta data)
.url: the item's URL (OPTIONAL, meta data)
.language: the item's Language (OPTIONAL, meta data)
.nowplaying: the item's NowPlaying (OPTIONAL, meta data)
.publisher: the item's Publisher (OPTIONAL, meta data)
.encodedby: the item's EncodedBy (OPTIONAL, meta data)
.arturl: the item's ArtURL (OPTIONAL, meta data)
.trackid: the item's TrackID (OPTIONAL, meta data)
.options: a list of VLC options (OPTIONAL)
example: .options = { "fullscreen" }
.duration: stream duration in seconds (OPTIONAL)
.meta: custom meta data (OPTIONAL, meta data)
A .meta field is a table of custom meta categories which
each have custom meta properties.
example: .meta = { ["Google video"] = { ["docid"] = "-5784010886294950089"; ["GVP version"] = "1.1" }; ["misc"] = { "Hello" = "World!" } }
Invalid playlist items will be discarded by VLC.
Playlist items use the same format as that expected in the
playlist.add() function (see general lua/README.txt)
VLC defines a global vlc object with the following members:
* vlc.path: the URL string (without the leading http:// or file:// element)
...
...
@@ -45,18 +20,5 @@ VLC defines a global vlc object with the following members:
THIS FUNCTION CANNOT BE USED IN peek().
* vlc.readline(): return a new line of playlist data on each call.
THIS FUNCTION CANNOT BE USED IN peek().
* vlc.decode_uri( <string> ): decode %xy characters in a string.
* vlc.resolve_xml_special_chars( <string> ): decode &abc; characters in a
string.
* vlc.msg_dbg( <string> ): print a debug message.
* vlc.msg_warn( <string> ): print a warning message.
* vlc.msg_err( <string> ): print an error message.
* vlc.msg_info( <string> ): print an info message.
Lua scripts are tried in alphabetical order in the user's VLC config
director lua/playlist/ subdirectory, then in the global VLC lua/playlist/
directory.
Lua documentation is available on http://www.lua.org .
VLC uses Lua 5.1
All the Lua standard libraries are available.
Available VLC specific Lua modules: msg and strings. See lua/README.txt.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment