Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
f8fa7854
Commit
f8fa7854
authored
Jan 16, 2012
by
Gaurav Narula
Committed by
Jean-Baptiste Kempf
Jan 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LUA: add support for category field in SD nodes and items
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
04c1aeb2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
modules/lua/libs/sd.c
modules/lua/libs/sd.c
+11
-3
share/lua/README.txt
share/lua/README.txt
+3
-1
No files found.
modules/lua/libs/sd.c
View file @
f8fa7854
...
...
@@ -186,7 +186,9 @@ static int vlclua_sd_add_node( lua_State *L )
input_item_SetArtURL
(
p_input
,
psz_value
);
free
(
psz_value
);
}
services_discovery_AddItem
(
p_sd
,
p_input
,
NULL
);
lua_pop
(
L
,
1
);
lua_getfield
(
L
,
-
1
,
"category"
);
services_discovery_AddItem
(
p_sd
,
p_input
,
luaL_checkstring
(
L
,
-
1
)
);
input_item_t
**
udata
=
(
input_item_t
**
)
lua_newuserdata
(
L
,
sizeof
(
input_item_t
*
)
);
*
udata
=
p_input
;
...
...
@@ -218,8 +220,12 @@ static int vlclua_sd_add_item( lua_State *L )
char
**
ppsz_options
=
NULL
;
int
i_options
=
0
;
const
char
*
psz_path
=
lua_tostring
(
L
,
-
1
);
vlclua_read_options
(
p_sd
,
L
,
&
i_options
,
&
ppsz_options
);
input_item_t
*
p_input
=
input_item_NewExt
(
psz_path
,
psz_path
,
lua_pop
(
L
,
1
);
lua_getfield
(
L
,
-
1
,
"title"
);
const
char
*
psz_title
=
luaL_checkstring
(
L
,
-
1
)
?
luaL_checkstring
(
L
,
-
1
)
:
psz_path
;
input_item_t
*
p_input
=
input_item_NewExt
(
psz_path
,
psz_title
,
i_options
,
(
const
char
**
)
ppsz_options
,
VLC_INPUT_OPTION_TRUSTED
,
-
1
);
...
...
@@ -237,7 +243,9 @@ static int vlclua_sd_add_item( lua_State *L )
else
if
(
!
lua_isnil
(
L
,
-
1
)
)
msg_Warn
(
p_sd
,
"Item duration should be a number (in seconds)."
);
lua_pop
(
L
,
1
);
services_discovery_AddItem
(
p_sd
,
p_input
,
NULL
);
lua_getfield
(
L
,
-
1
,
"category"
);
services_discovery_AddItem
(
p_sd
,
p_input
,
luaL_checkstring
(
L
,
-
1
)
);
lua_pop
(
L
,
1
);
input_item_t
**
udata
=
(
input_item_t
**
)
lua_newuserdata
(
L
,
sizeof
(
input_item_t
*
)
);
*
udata
=
p_input
;
...
...
share/lua/README.txt
View file @
f8fa7854
...
...
@@ -329,8 +329,10 @@ sd.add_node( ... ): Add a node to the service discovery.
The node object has the following members:
.title: the node's name
.arturl: the node's ArtURL (OPTIONAL)
.category: the node's category (OPTIONAL)
sd.add_item( ... ): Add an item to the service discovery.
The item object has the same members as the one in playlist.add().
The item object has the same members as the one in playlist.add() along with:
.category: the item's category (OPTIONAL)
Returns the input item.
sd.remove_item( item ): remove the item.
...
...
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