Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
9ceb897c
Commit
9ceb897c
authored
Jan 29, 2010
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lua/extension: Export extension_SetInput().
parent
714ef56a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
1 deletion
+44
-1
include/vlc_extensions.h
include/vlc_extensions.h
+9
-0
modules/misc/lua/extension.c
modules/misc/lua/extension.c
+16
-0
modules/misc/lua/extension.h
modules/misc/lua/extension.h
+7
-1
modules/misc/lua/libs/input.c
modules/misc/lua/libs/input.c
+12
-0
No files found.
include/vlc_extensions.h
View file @
9ceb897c
...
...
@@ -73,6 +73,7 @@ enum
EXTENSION_TRIGGER_ONLY
,
/**< arg1: extension_t*, arg2: bool* */
EXTENSION_TRIGGER
,
/**< arg1: extension_t* */
EXTENSION_TRIGGER_MENU
,
/**< arg1: extension_t*, int (uint16_t) */
EXTENSION_SET_INPUT
,
/**< arg1: extension_t*, arg2 (input_thread_t) */
};
/**
...
...
@@ -143,6 +144,14 @@ static inline int extension_TriggerMenu( extensions_manager_t *p_mgr,
return
extension_Control
(
p_mgr
,
EXTENSION_TRIGGER_MENU
,
p_ext
,
i
);
}
/** Trigger an entry of the extension menu */
static
inline
int
extension_SetInput
(
extensions_manager_t
*
p_mgr
,
extension_t
*
p_ext
,
struct
input_thread_t
*
p_input
)
{
return
extension_Control
(
p_mgr
,
EXTENSION_SET_INPUT
,
p_ext
,
p_input
);
}
/** Can this extension only be triggered but not activated?
Not compatible with HasMenu */
#define extension_TriggerOnly( mgr, ext ) \
...
...
modules/misc/lua/extension.c
View file @
9ceb897c
...
...
@@ -26,6 +26,8 @@
#include "extension.h"
#include "assert.h"
#include <vlc_input.h>
/* Functions to register */
static
const
luaL_Reg
p_reg
[]
=
{
...
...
@@ -462,6 +464,20 @@ static int Control( extensions_manager_t *p_mgr, int i_control, va_list args )
i
=
(
int
)
va_arg
(
args
,
int
);
return
TriggerMenu
(
p_ext
,
i
);
case
EXTENSION_SET_INPUT
:
{
p_ext
=
(
extension_t
*
)
va_arg
(
args
,
extension_t
*
);
input_thread_t
*
p_input
=
va_arg
(
args
,
struct
input_thread_t
*
);
bool
ok
=
LockExtension
(
p_ext
);
if
(
!
ok
)
return
VLC_EGENERIC
;
vlc_object_release
(
p_ext
->
p_sys
->
p_input
);
p_ext
->
p_sys
->
p_input
=
vlc_object_hold
(
p_input
);
UnlockExtension
(
p_ext
);
return
VLC_SUCCESS
;
}
default:
msg_Err
(
p_mgr
,
"Control '%d' not yet implemented in Extension"
,
i_control
);
...
...
modules/misc/lua/extension.h
View file @
9ceb897c
...
...
@@ -65,7 +65,11 @@ struct extension_sys_t
vlc_mutex_t
command_lock
;
vlc_mutex_t
running_lock
;
vlc_cond_t
wait
;
bool
b_exiting
;
/* The input this extension should use for vlc.input
* or NULL if it should use playlist's current input */
struct
input_thread_t
*
p_input
;
extensions_manager_t
*
p_mgr
;
///< Parent
/* Queue of commands to execute */
struct
command_t
...
...
@@ -74,6 +78,8 @@ struct extension_sys_t
void
*
data
[
10
];
///< Optional void* arguments
struct
command_t
*
next
;
///< Next command
}
*
command
;
bool
b_exiting
;
};
/* Extensions: manager functions */
...
...
modules/misc/lua/libs/input.c
View file @
9ceb897c
...
...
@@ -46,12 +46,24 @@
#include "playlist.h"
#include "../vlc.h"
#include "../libs.h"
#include "../extension.h"
static
const
luaL_Reg
vlclua_input_reg
[];
static
const
luaL_Reg
vlclua_input_item_reg
[];
input_thread_t
*
vlclua_get_input_internal
(
lua_State
*
L
)
{
extension_t
*
p_extension
=
vlclua_extension_get
(
L
);
if
(
p_extension
)
{
input_thread_t
*
p_input
=
p_extension
->
p_sys
->
p_input
;
if
(
p_input
)
{
vlc_object_hold
(
p_input
);
UnlockExtension
(
p_extension
);
return
p_input
;
}
}
playlist_t
*
p_playlist
=
vlclua_get_playlist_internal
(
L
);
input_thread_t
*
p_input
=
playlist_CurrentInput
(
p_playlist
);
vlclua_release_playlist_internal
(
p_playlist
);
...
...
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