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
8c8a1cee
Commit
8c8a1cee
authored
Jan 13, 2010
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lua: Expose a "meta fetcher".
Attempt to run scripts in share/lua/meta/fetcher.
parent
b34c73d1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
3 deletions
+40
-3
modules/misc/lua/meta.c
modules/misc/lua/meta.c
+31
-0
modules/misc/lua/vlc.c
modules/misc/lua/vlc.c
+8
-2
modules/misc/lua/vlc.h
modules/misc/lua/vlc.h
+1
-1
No files found.
modules/misc/lua/meta.c
View file @
8c8a1cee
...
...
@@ -181,6 +181,19 @@ static int read_meta( vlc_object_t *p_this, const char * psz_filename,
return
1
;
}
/*****************************************************************************
* Called through lua_scripts_batch_execute to call 'fetch_meta' on the script
* pointed by psz_filename.
*****************************************************************************/
static
int
fetch_meta
(
vlc_object_t
*
p_this
,
const
char
*
psz_filename
,
lua_State
*
L
,
void
*
user_data
)
{
VLC_UNUSED
(
user_data
);
return
run
(
p_this
,
psz_filename
,
L
,
"fetch_meta"
);
}
/*****************************************************************************
* Read meta.
*****************************************************************************/
...
...
@@ -197,6 +210,24 @@ int ReadMeta( vlc_object_t *p_this )
return
i_ret
;
}
/*****************************************************************************
* Read meta.
*****************************************************************************/
int
FetchMeta
(
vlc_object_t
*
p_this
)
{
demux_meta_t
*
p_demux_meta
=
(
demux_meta_t
*
)
p_this
;
input_item_t
*
p_item
=
p_demux_meta
->
p_item
;
lua_State
*
L
=
init
(
p_this
,
p_item
);
int
i_ret
=
vlclua_scripts_batch_execute
(
p_this
,
"meta/fetcher"
,
&
fetch_meta
,
L
,
NULL
);
lua_close
(
L
);
return
i_ret
;
}
/*****************************************************************************
* Module entry point for art.
*****************************************************************************/
...
...
modules/misc/lua/vlc.c
View file @
8c8a1cee
...
...
@@ -64,8 +64,14 @@ vlc_module_begin ()
set_callbacks
(
FindArt
,
NULL
)
add_submodule
()
set_shortname
(
N_
(
"Lua Meta
Read
er"
)
)
set_shortname
(
N_
(
"Lua Meta
Fetch
er"
)
)
set_description
(
N_
(
"Fetch meta data using lua scripts"
)
)
set_capability
(
"meta fetcher"
,
10
)
set_callbacks
(
FetchMeta
,
NULL
)
add_submodule
()
set_shortname
(
N_
(
"Lua Meta Reader"
)
)
set_description
(
N_
(
"Read meta data using lua scripts"
)
)
set_capability
(
"meta reader"
,
10
)
set_callbacks
(
ReadMeta
,
NULL
)
...
...
@@ -465,7 +471,7 @@ int __vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
else
/* Play or Enqueue (preparse) */
/* FIXME: playlist_AddInput() can fail */
playlist_AddInput
(
p_playlist
,
p_input
,
PLAYLIST_APPEND
|
PLAYLIST_APPEND
|
(
b_play
?
PLAYLIST_GO
:
PLAYLIST_PREPARSE
),
PLAYLIST_END
,
true
,
false
);
i_count
++
;
/* increment counter */
...
...
modules/misc/lua/vlc.h
View file @
8c8a1cee
...
...
@@ -45,7 +45,7 @@
* Module entry points
*****************************************************************************/
int
ReadMeta
(
vlc_object_t
*
);
int
FetchMeta
(
vlc_object_t
*
);
int
FindArt
(
vlc_object_t
*
);
int
Import_LuaPlaylist
(
vlc_object_t
*
);
...
...
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