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
d283a27b
Commit
d283a27b
authored
Aug 15, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up registration of statically linked modules
parent
21e31e34
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
31 deletions
+20
-31
src/modules/modules.c
src/modules/modules.c
+18
-31
src/modules/modules.h
src/modules/modules.h
+2
-0
No files found.
src/modules/modules.c
View file @
d283a27b
...
...
@@ -82,7 +82,7 @@ static int AllocatePluginFile( vlc_object_t *, module_bank_t *, const char *,
const
struct
stat
*
,
cache_mode_t
);
static
module_t
*
AllocatePlugin
(
vlc_object_t
*
,
const
char
*
,
bool
);
#endif
static
int
AllocateBuiltinModule
(
vlc_object_t
*
,
int
(
*
)
(
module_t
*
)
);
static
module_t
*
module_InitStatic
(
vlc_plugin_cb
);
static
void
DeleteModule
(
module_t
**
,
module_t
*
);
#undef module_InitBank
...
...
@@ -105,7 +105,7 @@ void module_InitBank( vlc_object_t *p_this )
* library just as another module, and for instance the configuration
* options of main will be available in the module bank structure just
* as for every other module. */
AllocateBuiltinModule
(
p_this
,
vlc_entry__main
);
module_InitStatic
(
vlc_entry__main
);
vlc_rwlock_init
(
&
config_lock
);
config_SortConfig
();
}
...
...
@@ -1023,42 +1023,29 @@ error:
}
#endif
/* HAVE_DYNAMIC_PLUGINS */
/*****************************************************************************
* AllocateBuiltinModule: initialize a builtin module.
*****************************************************************************
* This function registers a builtin module and allocates a structure
* for its information data. The module can then be handled by module_need
* and module_unneed. It can be removed by DeleteModule.
*****************************************************************************/
static
int
AllocateBuiltinModule
(
vlc_object_t
*
p_this
,
int
(
*
pf_entry
)
(
module_t
*
)
)
/**
* Registers a statically-linked plug-in.
*/
static
module_t
*
module_InitStatic
(
vlc_plugin_cb
entry
)
{
module_t
*
p_module
;
module_t
*
module
=
vlc_module_create
();
if
(
unlikely
(
module
==
NULL
))
return
NULL
;
/* Now that we have successfully loaded the module, we can
* allocate a structure for it */
p_module
=
vlc_module_create
();
if
(
p_module
==
NULL
)
return
-
1
;
/* Initializes the module */
if
(
entry
(
module
))
assert
(
0
);
/* Initialize the module : fill *p_module structure */
if
(
pf_entry
(
p_module
)
!=
0
)
{
/* With a well-written module we shouldn't have to print an
* additional error message here, but just make sure. */
msg_Err
(
p_this
,
"failed calling entry point in builtin module"
);
vlc_module_destroy
(
p_module
);
return
-
1
;
}
module
->
b_builtin
=
true
;
module
->
b_loaded
=
true
;
module
->
b_unloadable
=
false
;
/* Everything worked fine ! The module is ready to be added to the list. */
p_module
->
b_builtin
=
true
;
/* LOCK */
p_
module
->
next
=
modules
.
head
;
modules
.
head
=
p_
module
;
module
->
next
=
modules
.
head
;
modules
.
head
=
module
;
/* UNLOCK */
return
0
;
return
module
;
}
/*****************************************************************************
...
...
src/modules/modules.h
View file @
d283a27b
...
...
@@ -57,6 +57,8 @@ typedef void * module_handle_t;
typedef
void
*
module_handle_t
;
#endif
typedef
int
(
*
vlc_plugin_cb
)
(
module_t
*
);
/**
* Internal module descriptor
*/
...
...
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