Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
b2b191a7
Commit
b2b191a7
authored
Nov 11, 2009
by
Jean-Philippe André
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lua: new function vlc.input.metas
Returns a table with (max.) 17 meta data about the current input
parent
16d88109
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
6 deletions
+59
-6
modules/misc/lua/libs/input.c
modules/misc/lua/libs/input.c
+59
-6
No files found.
modules/misc/lua/libs/input.c
View file @
b2b191a7
...
...
@@ -83,7 +83,7 @@ static int vlclua_input_info( lua_State *L )
return
1
;
}
static
int
vlclua_is_playing
(
lua_State
*
L
)
static
int
vlclua_i
nput_i
s_playing
(
lua_State
*
L
)
{
input_thread_t
*
p_input
=
vlclua_get_input_internal
(
L
);
lua_pushboolean
(
L
,
!!
p_input
);
...
...
@@ -92,7 +92,7 @@ static int vlclua_is_playing( lua_State *L )
return
1
;
}
static
int
vlclua_get_title
(
lua_State
*
L
)
static
int
vlclua_
input_
get_title
(
lua_State
*
L
)
{
input_thread_t
*
p_input
=
vlclua_get_input_internal
(
L
);
if
(
!
p_input
)
...
...
@@ -105,10 +105,62 @@ static int vlclua_get_title( lua_State *L )
return
1
;
}
static
int
vlclua_input_metas_internal
(
lua_State
*
L
,
input_item_t
*
p_item
)
{
if
(
!
p_item
)
{
lua_pushnil
(
L
);
return
1
;
}
lua_newtable
(
L
);
char
*
psz_meta
;
#define PUSH_META( n, m ) \
psz_meta = input_item_GetMeta( p_item, vlc_meta_ ## n ); \
lua_pushstring( L, psz_meta ); \
lua_setfield( L, -2, m ); \
free( psz_meta )
PUSH_META
(
Title
,
"title"
);
PUSH_META
(
Artist
,
"artist"
);
PUSH_META
(
Genre
,
"genre"
);
PUSH_META
(
Copyright
,
"copyright"
);
PUSH_META
(
Album
,
"album"
);
PUSH_META
(
TrackNumber
,
"track_number"
);
PUSH_META
(
Description
,
"description"
);
PUSH_META
(
Rating
,
"rating"
);
PUSH_META
(
Date
,
"date"
);
PUSH_META
(
Setting
,
"setting"
);
PUSH_META
(
URL
,
"url"
);
PUSH_META
(
Language
,
"language"
);
PUSH_META
(
NowPlaying
,
"now_playing"
);
PUSH_META
(
Publisher
,
"publisher"
);
PUSH_META
(
EncodedBy
,
"encoded_by"
);
PUSH_META
(
ArtworkURL
,
"artwork_url"
);
PUSH_META
(
TrackID
,
"track_id"
);
#undef PUSH_META
return
1
;
}
static
int
vlclua_input_metas
(
lua_State
*
L
)
{
input_thread_t
*
p_input
=
vlclua_get_input_internal
(
L
);
input_item_t
*
p_item
=
p_input
&&
p_input
->
p
?
input_GetItem
(
p_input
)
:
NULL
;
vlclua_input_metas_internal
(
L
,
p_item
);
if
(
p_input
)
vlc_object_release
(
p_input
);
return
1
;
}
static
int
vlclua_input_stats
(
lua_State
*
L
)
{
input_thread_t
*
p_input
=
vlclua_get_input_internal
(
L
);
input_item_t
*
p_item
=
p_input
&&
p_input
->
p
?
input_GetItem
(
p_input
)
:
NULL
;
input_item_t
*
p_item
=
p_input
&&
p_input
->
p
?
input_GetItem
(
p_input
)
:
NULL
;
lua_newtable
(
L
);
if
(
p_item
)
{
...
...
@@ -151,12 +203,13 @@ static int vlclua_input_add_subtitle( lua_State *L )
}
/*****************************************************************************
*
*
Lua bindings
*****************************************************************************/
static
const
luaL_Reg
vlclua_input_reg
[]
=
{
{
"info"
,
vlclua_input_info
},
{
"is_playing"
,
vlclua_is_playing
},
{
"get_title"
,
vlclua_get_title
},
{
"is_playing"
,
vlclua_input_is_playing
},
{
"get_title"
,
vlclua_input_get_title
},
{
"metas"
,
vlclua_input_metas
},
{
"stats"
,
vlclua_input_stats
},
{
"add_subtitle"
,
vlclua_input_add_subtitle
},
{
NULL
,
NULL
}
...
...
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