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
fe30f8c0
Commit
fe30f8c0
authored
Mar 24, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lua: add sockets to extensions (fixes #9495)
parent
bfe17fd3
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
2 deletions
+17
-2
modules/lua/extension.c
modules/lua/extension.c
+13
-1
modules/lua/extension.h
modules/lua/extension.h
+2
-0
modules/lua/extension_thread.c
modules/lua/extension_thread.c
+1
-0
share/lua/README.txt
share/lua/README.txt
+1
-1
No files found.
modules/lua/extension.c
View file @
fe30f8c0
...
@@ -650,6 +650,8 @@ int lua_ExtensionDeactivate( extensions_manager_t *p_mgr, extension_t *p_ext )
...
@@ -650,6 +650,8 @@ int lua_ExtensionDeactivate( extensions_manager_t *p_mgr, extension_t *p_ext )
if
(
!
p_ext
->
p_sys
->
L
)
if
(
!
p_ext
->
p_sys
->
L
)
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
vlclua_fd_interrupt
(
&
p_ext
->
p_sys
->
dtable
);
// Unset and release input objects
// Unset and release input objects
if
(
p_ext
->
p_sys
->
p_input
)
if
(
p_ext
->
p_sys
->
p_input
)
{
{
...
@@ -666,6 +668,7 @@ int lua_ExtensionDeactivate( extensions_manager_t *p_mgr, extension_t *p_ext )
...
@@ -666,6 +668,7 @@ int lua_ExtensionDeactivate( extensions_manager_t *p_mgr, extension_t *p_ext )
int
i_ret
=
lua_ExecuteFunction
(
p_mgr
,
p_ext
,
"deactivate"
,
LUA_END
);
int
i_ret
=
lua_ExecuteFunction
(
p_mgr
,
p_ext
,
"deactivate"
,
LUA_END
);
/* Clear Lua State */
/* Clear Lua State */
vlclua_fd_cleanup
(
&
p_ext
->
p_sys
->
dtable
);
lua_close
(
p_ext
->
p_sys
->
L
);
lua_close
(
p_ext
->
p_sys
->
L
);
p_ext
->
p_sys
->
L
=
NULL
;
p_ext
->
p_sys
->
L
=
NULL
;
...
@@ -824,7 +827,11 @@ static lua_State* GetLuaState( extensions_manager_t *p_mgr,
...
@@ -824,7 +827,11 @@ static lua_State* GetLuaState( extensions_manager_t *p_mgr,
luaopen_dialog
(
L
,
p_ext
);
luaopen_dialog
(
L
,
p_ext
);
luaopen_input
(
L
);
luaopen_input
(
L
);
luaopen_msg
(
L
);
luaopen_msg
(
L
);
luaopen_net_generic
(
L
);
if
(
vlclua_fd_init
(
L
,
&
p_ext
->
p_sys
->
dtable
)
)
{
lua_close
(
L
);
return
NULL
;
}
luaopen_object
(
L
);
luaopen_object
(
L
);
luaopen_osd
(
L
);
luaopen_osd
(
L
);
luaopen_playlist
(
L
);
luaopen_playlist
(
L
);
...
@@ -859,6 +866,7 @@ static lua_State* GetLuaState( extensions_manager_t *p_mgr,
...
@@ -859,6 +866,7 @@ static lua_State* GetLuaState( extensions_manager_t *p_mgr,
{
{
msg_Warn
(
p_mgr
,
"Error while setting the module "
msg_Warn
(
p_mgr
,
"Error while setting the module "
"search path for %s"
,
p_ext
->
psz_name
);
"search path for %s"
,
p_ext
->
psz_name
);
vlclua_fd_cleanup
(
&
p_ext
->
p_sys
->
dtable
);
lua_close
(
L
);
lua_close
(
L
);
return
NULL
;
return
NULL
;
}
}
...
@@ -868,6 +876,7 @@ static lua_State* GetLuaState( extensions_manager_t *p_mgr,
...
@@ -868,6 +876,7 @@ static lua_State* GetLuaState( extensions_manager_t *p_mgr,
{
{
msg_Warn
(
p_mgr
,
"Error loading script %s: %s"
,
p_ext
->
psz_name
,
msg_Warn
(
p_mgr
,
"Error loading script %s: %s"
,
p_ext
->
psz_name
,
lua_tostring
(
L
,
lua_gettop
(
L
)
)
);
lua_tostring
(
L
,
lua_gettop
(
L
)
)
);
vlclua_fd_cleanup
(
&
p_ext
->
p_sys
->
dtable
);
lua_close
(
L
);
lua_close
(
L
);
return
NULL
;
return
NULL
;
}
}
...
@@ -1044,7 +1053,10 @@ static int TriggerExtension( extensions_manager_t *p_mgr,
...
@@ -1044,7 +1053,10 @@ static int TriggerExtension( extensions_manager_t *p_mgr,
/* Close lua state for trigger-only extensions */
/* Close lua state for trigger-only extensions */
if
(
p_ext
->
p_sys
->
L
)
if
(
p_ext
->
p_sys
->
L
)
{
vlclua_fd_cleanup
(
&
p_ext
->
p_sys
->
dtable
);
lua_close
(
p_ext
->
p_sys
->
L
);
lua_close
(
p_ext
->
p_sys
->
L
);
}
p_ext
->
p_sys
->
L
=
NULL
;
p_ext
->
p_sys
->
L
=
NULL
;
return
i_ret
;
return
i_ret
;
...
...
modules/lua/extension.h
View file @
fe30f8c0
...
@@ -69,6 +69,8 @@ struct extension_sys_t
...
@@ -69,6 +69,8 @@ struct extension_sys_t
/* Lua specific */
/* Lua specific */
lua_State
*
L
;
lua_State
*
L
;
vlclua_dtable_t
dtable
;
/* Thread data */
/* Thread data */
vlc_thread_t
thread
;
vlc_thread_t
thread
;
vlc_mutex_t
command_lock
;
vlc_mutex_t
command_lock
;
...
...
modules/lua/extension_thread.c
View file @
fe30f8c0
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
/* I don't want to include lua headers here */
/* I don't want to include lua headers here */
typedef
struct
lua_State
lua_State
;
typedef
struct
lua_State
lua_State
;
#include "vlc.h"
#include "extension.h"
#include "extension.h"
#include "assert.h"
#include "assert.h"
...
...
share/lua/README.txt
View file @
fe30f8c0
...
@@ -160,7 +160,7 @@ misc.quit(): Quit VLC.
...
@@ -160,7 +160,7 @@ misc.quit(): Quit VLC.
Net
Net
---
---
----------------------------------------------------------------
----------------------------------------------------------------
/!\ NB: this namespace is ONLY usable for interfaces.
/!\ NB: this namespace is ONLY usable for interfaces
and extensions
.
---
---
----------------------------------------------------------------
----------------------------------------------------------------
net.url_parse( url, [option delimiter] ): Parse URL. Returns a table with
net.url_parse( url, [option delimiter] ): Parse URL. Returns a table with
...
...
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