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
6c11c08a
Commit
6c11c08a
authored
Aug 04, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Partially abstract module_t: add module_IsCapable()
parent
4c4c4ce2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
4 deletions
+15
-4
include/vlc_modules.h
include/vlc_modules.h
+4
-2
src/libvlc.sym
src/libvlc.sym
+1
-0
src/modules/modules.c
src/modules/modules.c
+10
-2
No files found.
include/vlc_modules.h
View file @
6c11c08a
...
@@ -46,6 +46,7 @@ typedef shl_t module_handle_t;
...
@@ -46,6 +46,7 @@ typedef shl_t module_handle_t;
/**
/**
* Module descriptor
* Module descriptor
*/
*/
/* FIXME: scheduled for privatization */
struct
module_t
struct
module_t
{
{
VLC_COMMON_MEMBERS
VLC_COMMON_MEMBERS
...
@@ -65,7 +66,7 @@ struct module_t
...
@@ -65,7 +66,7 @@ struct module_t
/** Shortcuts to the module */
/** Shortcuts to the module */
const
char
*
pp_shortcuts
[
MODULE_SHORTCUT_MAX
];
const
char
*
pp_shortcuts
[
MODULE_SHORTCUT_MAX
];
c
onst
char
*
psz_capability
;
/**< Capability */
c
har
*
psz_capability
;
/**< Capability */
int
i_score
;
/**< Score for the capability */
int
i_score
;
/**< Score for the capability */
uint32_t
i_cpu
;
/**< Required CPU capabilities */
uint32_t
i_cpu
;
/**< Required CPU capabilities */
...
@@ -110,7 +111,7 @@ VLC_EXPORT( module_t *, vlc_module_create, ( vlc_object_t * ) );
...
@@ -110,7 +111,7 @@ 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
)
);
enum
enum
vlc_module_properties
{
{
/* DO NOT EVER REMOVE, INSERT OR REPLACE ANY ITEM! It would break the ABI!
/* DO NOT EVER REMOVE, INSERT OR REPLACE ANY ITEM! It would break the ABI!
* Append new items at the end ONLY. */
* Append new items at the end ONLY. */
...
@@ -128,3 +129,4 @@ enum
...
@@ -128,3 +129,4 @@ enum
VLC_MODULE_NAME
VLC_MODULE_NAME
};
};
VLC_EXPORT
(
vlc_bool_t
,
module_IsCapable
,
(
const
module_t
*
,
const
char
*
cap
)
);
src/libvlc.sym
View file @
6c11c08a
...
@@ -177,6 +177,7 @@ mdate
...
@@ -177,6 +177,7 @@ mdate
__module_Exists
__module_Exists
__module_Need
__module_Need
__module_Unneed
__module_Unneed
module_IsCapable
__msg_Dbg
__msg_Dbg
__msg_Err
__msg_Err
__msg_Generic
__msg_Generic
...
...
src/modules/modules.c
View file @
6c11c08a
...
@@ -383,6 +383,14 @@ void __module_LoadPlugins( vlc_object_t * p_this )
...
@@ -383,6 +383,14 @@ void __module_LoadPlugins( vlc_object_t * p_this )
#endif
#endif
}
}
/*****************************************************************************
* module_IsCapable: checks whether a module implements a capability.
*****************************************************************************/
vlc_bool_t
module_IsCapable
(
const
module_t
*
m
,
const
char
*
cap
)
{
return
!
strcmp
(
m
->
psz_capability
,
cap
);
}
/*****************************************************************************
/*****************************************************************************
* module_Need: return the best module function, given a capability list.
* module_Need: return the best module function, given a capability list.
*****************************************************************************
*****************************************************************************
...
@@ -479,7 +487,7 @@ module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability,
...
@@ -479,7 +487,7 @@ module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability,
p_module
=
(
module_t
*
)
p_all
->
p_values
[
i_which_module
].
p_object
;
p_module
=
(
module_t
*
)
p_all
->
p_values
[
i_which_module
].
p_object
;
/* Test that this module can do what we need */
/* Test that this module can do what we need */
if
(
strcmp
(
p_module
->
psz_capability
,
psz_capability
)
)
if
(
!
module_IsCapable
(
p_module
,
psz_capability
)
)
{
{
/* Don't recurse through the sub-modules because vlc_list_find()
/* Don't recurse through the sub-modules because vlc_list_find()
* will list them anyway. */
* will list them anyway. */
...
@@ -1199,7 +1207,7 @@ static void UndupModule( module_t *p_module )
...
@@ -1199,7 +1207,7 @@ static void UndupModule( module_t *p_module )
}
}
free
(
(
void
*
)
p_module
->
psz_object_name
);
free
(
(
void
*
)
p_module
->
psz_object_name
);
free
(
(
void
*
)
p_module
->
psz_capability
);
free
(
p_module
->
psz_capability
);
free
(
(
void
*
)
p_module
->
psz_shortname
);
free
(
(
void
*
)
p_module
->
psz_shortname
);
free
(
(
void
*
)
p_module
->
psz_longname
);
free
(
(
void
*
)
p_module
->
psz_longname
);
free
(
(
void
*
)
p_module
->
psz_help
);
free
(
(
void
*
)
p_module
->
psz_help
);
...
...
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