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
7a5fd4be
Commit
7a5fd4be
authored
Apr 14, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Further hide module_t layout from plugins
parent
c6170002
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
33 deletions
+67
-33
include/vlc_modules.h
include/vlc_modules.h
+3
-1
include/vlc_modules_macros.h
include/vlc_modules_macros.h
+28
-28
src/modules/entry.c
src/modules/entry.c
+35
-0
src/modules/modules.c
src/modules/modules.c
+1
-4
No files found.
include/vlc_modules.h
View file @
7a5fd4be
...
@@ -111,6 +111,7 @@ VLC_EXPORT( void, __module_Unneed, ( vlc_object_t *, module_t * ) );
...
@@ -111,6 +111,7 @@ VLC_EXPORT( void, __module_Unneed, ( vlc_object_t *, module_t * ) );
#define module_Exists(a,b) __module_Exists(VLC_OBJECT(a),b)
#define module_Exists(a,b) __module_Exists(VLC_OBJECT(a),b)
VLC_EXPORT
(
vlc_bool_t
,
__module_Exists
,
(
vlc_object_t
*
,
const
char
*
)
);
VLC_EXPORT
(
vlc_bool_t
,
__module_Exists
,
(
vlc_object_t
*
,
const
char
*
)
);
VLC_EXPORT
(
module_t
*
,
vlc_module_create
,
(
vlc_object_t
*
)
);
VLC_EXPORT
(
module_t
*
,
vlc_submodule_create
,
(
module_t
*
)
);
VLC_EXPORT
(
module_t
*
,
vlc_submodule_create
,
(
module_t
*
)
);
VLC_EXPORT
(
int
,
vlc_module_set
,
(
module_t
*
module
,
int
propid
,
void
*
value
)
);
VLC_EXPORT
(
int
,
vlc_module_set
,
(
module_t
*
module
,
int
propid
,
void
*
value
)
);
...
@@ -128,6 +129,7 @@ enum
...
@@ -128,6 +129,7 @@ enum
VLC_MODULE_PROGRAM
,
VLC_MODULE_PROGRAM
,
VLC_MODULE_CB_OPEN
,
VLC_MODULE_CB_OPEN
,
VLC_MODULE_CB_CLOSE
,
VLC_MODULE_CB_CLOSE
,
VLC_MODULE_UNLOADABLE
VLC_MODULE_UNLOADABLE
,
VLC_MODULE_NAME
};
};
include/vlc_modules_macros.h
View file @
7a5fd4be
...
@@ -117,22 +117,9 @@ E_(vlc_entry) ( module_t *p_module );
...
@@ -117,22 +117,9 @@ E_(vlc_entry) ( module_t *p_module );
size_t i_config = (size_t)(-1); \
size_t i_config = (size_t)(-1); \
module_config_t *p_config = NULL; \
module_config_t *p_config = NULL; \
STORE_SYMBOLS; \
STORE_SYMBOLS; \
p_module->b_submodule = VLC_FALSE; \
if (vlc_module_set (p_module, VLC_MODULE_NAME, \
p_module->b_unloadable = VLC_TRUE; \
(void *)(MODULE_STRING))) \
p_module->b_reentrant = VLC_TRUE; \
goto error; \
p_module->psz_object_name = MODULE_STRING; \
p_module->psz_shortname = NULL; \
p_module->psz_longname = MODULE_STRING; \
p_module->psz_help = NULL; \
p_module->pp_shortcuts[ 0 ] = MODULE_STRING; \
for( unsigned i = 1; i < MODULE_SHORTCUT_MAX; i++ ) \
p_module->pp_shortcuts[i] = NULL; \
p_module->i_cpu = 0; \
p_module->psz_program = NULL; \
p_module->psz_capability = ""; \
p_module->i_score = 1; \
p_module->pf_activate = NULL; \
p_module->pf_deactivate = NULL; \
{ \
{ \
module_t *p_submodule = p_module
/* the ; gets added */
module_t *p_submodule = p_module
/* the ; gets added */
...
@@ -153,6 +140,11 @@ E_(vlc_entry) ( module_t *p_module );
...
@@ -153,6 +140,11 @@ E_(vlc_entry) ( module_t *p_module );
return res; \
return res; \
(void)i_shortcut; \
(void)i_shortcut; \
return VLC_SUCCESS; \
return VLC_SUCCESS; \
\
error: \
free( p_config ); \
/* FIXME: cleanup submodules objects ??? */
\
return VLC_EGENERIC; \
} \
} \
struct _u_n_u_s_e_d_
/* the ; gets added */
struct _u_n_u_s_e_d_
/* the ; gets added */
...
@@ -161,32 +153,40 @@ E_(vlc_entry) ( module_t *p_module );
...
@@ -161,32 +153,40 @@ E_(vlc_entry) ( module_t *p_module );
p_submodule = vlc_submodule_create( p_module )
p_submodule = vlc_submodule_create( p_module )
#define add_requirement( cap ) \
#define add_requirement( cap ) \
vlc_module_set (p_module, VLC_MODULE_CPU_REQUIREMENT, \
if (
vlc_module_set (p_module, VLC_MODULE_CPU_REQUIREMENT, \
(void *)(CPU_CAPABILITY_##cap))
(void *)(CPU_CAPABILITY_##cap))) goto error
#define add_shortcut( shortcut ) \
#define add_shortcut( shortcut ) \
vlc_module_set (p_submodule, VLC_MODULE_SHORTCUT, (void*)(shortcut))
if (vlc_module_set (p_submodule, VLC_MODULE_SHORTCUT, (void*)(shortcut))) \
goto error
#define set_shortname( shortname ) \
#define set_shortname( shortname ) \
vlc_module_set (p_submodule, VLC_MODULE_SHORTNAME, (void*)(shortname))
if (vlc_module_set (p_submodule, VLC_MODULE_SHORTNAME, \
(void*)(shortname))) goto error;
#define set_description( desc ) \
#define set_description( desc ) \
vlc_module_set (p_submodule, VLC_MODULE_DESCRIPTION, (void*)(desc))
if (vlc_module_set (p_submodule, VLC_MODULE_DESCRIPTION, (void*)(desc))) \
goto error;
#define set_help( help ) \
#define set_help( help ) \
vlc_module_set (p_submodule, VLC_MODULE_HELP, (void*)(help))
if (vlc_module_set (p_submodule, VLC_MODULE_HELP, (void*)(help))) \
goto error
#define set_capability( cap, score ) \
#define set_capability( cap, score ) \
vlc_module_set (p_submodule, VLC_MODULE_CAPABILITY, (void *)(cap)); \
if (vlc_module_set (p_submodule, VLC_MODULE_CAPABILITY, (void *)(cap)) \
vlc_module_set (p_submodule, VLC_MODULE_SCORE, (void *)(score))
|| vlc_module_set (p_submodule, VLC_MODULE_SCORE, (void *)(score))) \
goto error
#define set_program( program ) \
#define set_program( program ) \
vlc_module_set (p_submodule, VLC_MODULE_PROGRAM, (void *)(program))
if (vlc_module_set (p_submodule, VLC_MODULE_PROGRAM, (void *)(program))) \
goto error
#define set_callbacks( activate, deactivate ) \
#define set_callbacks( activate, deactivate ) \
vlc_module_set (p_submodule, VLC_MODULE_CB_OPEN, (void *)(activate)); \
if (vlc_module_set (p_submodule, VLC_MODULE_CB_OPEN, (void *)(activate)) \
vlc_module_set (p_submodule, VLC_MODULE_CB_CLOSE, (void *)(deactivate))
|| vlc_module_set (p_submodule, VLC_MODULE_CB_CLOSE, \
(void *)(deactivate))) \
goto error
#define linked_with_a_crap_library_which_uses_atexit( ) \
#define linked_with_a_crap_library_which_uses_atexit( ) \
vlc_module_set (p_submodule, VLC_MODULE_UNLOADABLE, NULL)
if (vlc_module_set (p_submodule, VLC_MODULE_UNLOADABLE, NULL)) goto error
src/modules/entry.c
View file @
7a5fd4be
...
@@ -21,6 +21,34 @@
...
@@ -21,6 +21,34 @@
#include <vlc/vlc.h>
#include <vlc/vlc.h>
#include <assert.h>
#include <assert.h>
static
const
char
default_name
[]
=
"unnamed"
;
module_t
*
vlc_module_create
(
vlc_object_t
*
obj
)
{
module_t
*
module
=
vlc_object_create
(
obj
,
VLC_OBJECT_MODULE
);
if
(
module
==
NULL
)
return
NULL
;
#ifndef HAVE_SHARED_LIBVLC
module
->
p_symbols
=
&
obj
->
p_libvlc_global
->
p_module_bank
->
symbols
;
#endif
module
->
b_loaded
=
module
->
b_submodule
=
VLC_FALSE
;
module
->
b_reentrant
=
module
->
b_unloadable
=
VLC_TRUE
;
module
->
psz_object_name
=
module
->
psz_longname
=
default_name
;
module
->
psz_help
=
module
->
psz_shortname
=
NULL
;
module
->
pp_shortcuts
[
0
]
=
default_name
;
for
(
unsigned
i
=
1
;
i
<
MODULE_SHORTCUT_MAX
;
i
++
)
module
->
pp_shortcuts
[
i
]
=
NULL
;
module
->
i_cpu
=
0
;
module
->
psz_program
=
NULL
;
module
->
psz_capability
=
""
;
module
->
i_score
=
1
;
module
->
pf_activate
=
NULL
;
module
->
pf_deactivate
=
NULL
;
return
module
;
}
module_t
*
vlc_submodule_create
(
module_t
*
module
)
module_t
*
vlc_submodule_create
(
module_t
*
module
)
{
{
...
@@ -51,6 +79,7 @@ module_t *vlc_submodule_create (module_t *module)
...
@@ -51,6 +79,7 @@ module_t *vlc_submodule_create (module_t *module)
return
submodule
;
return
submodule
;
}
}
int
vlc_module_set
(
module_t
*
module
,
int
propid
,
void
*
value
)
int
vlc_module_set
(
module_t
*
module
,
int
propid
,
void
*
value
)
{
{
switch
(
propid
)
switch
(
propid
)
...
@@ -107,6 +136,12 @@ int vlc_module_set (module_t *module, int propid, void *value)
...
@@ -107,6 +136,12 @@ int vlc_module_set (module_t *module, int propid, void *value)
module
->
b_unloadable
=
(
value
!=
NULL
);
module
->
b_unloadable
=
(
value
!=
NULL
);
break
;
break
;
case
VLC_MODULE_NAME
:
module
->
pp_shortcuts
[
0
]
=
module
->
psz_object_name
=
(
char
*
)
value
;
if
(
module
->
psz_longname
==
default_name
)
module
->
psz_longname
=
(
char
*
)
value
;
break
;
default:
default:
msg_Err
(
module
,
"unknown module property %d"
,
propid
);
msg_Err
(
module
,
"unknown module property %d"
,
propid
);
msg_Err
(
module
,
"LibVLC might be too old to use this module."
);
msg_Err
(
module
,
"LibVLC might be too old to use this module."
);
...
...
src/modules/modules.c
View file @
7a5fd4be
...
@@ -1119,7 +1119,7 @@ static module_t * AllocatePlugin( vlc_object_t * p_this, char * psz_file )
...
@@ -1119,7 +1119,7 @@ static module_t * AllocatePlugin( vlc_object_t * p_this, char * psz_file )
/* Now that we have successfully loaded the module, we can
/* Now that we have successfully loaded the module, we can
* allocate a structure for it */
* allocate a structure for it */
p_module
=
vlc_
object_create
(
p_this
,
VLC_OBJECT_MODULE
);
p_module
=
vlc_
module_create
(
p_this
);
if
(
p_module
==
NULL
)
if
(
p_module
==
NULL
)
{
{
msg_Err
(
p_this
,
"out of memory"
);
msg_Err
(
p_this
,
"out of memory"
);
...
@@ -1130,9 +1130,6 @@ static module_t * AllocatePlugin( vlc_object_t * p_this, char * psz_file )
...
@@ -1130,9 +1130,6 @@ static module_t * AllocatePlugin( vlc_object_t * p_this, char * psz_file )
/* We need to fill these since they may be needed by CallEntry() */
/* We need to fill these since they may be needed by CallEntry() */
p_module
->
psz_filename
=
psz_file
;
p_module
->
psz_filename
=
psz_file
;
p_module
->
handle
=
handle
;
p_module
->
handle
=
handle
;
#ifndef HAVE_SHARED_LIBVLC
p_module
->
p_symbols
=
&
p_this
->
p_libvlc_global
->
p_module_bank
->
symbols
;
#endif
p_module
->
b_loaded
=
VLC_TRUE
;
p_module
->
b_loaded
=
VLC_TRUE
;
/* Initialize the module: fill p_module, default config */
/* Initialize the module: fill p_module, default config */
...
...
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