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
3f808957
Commit
3f808957
authored
Dec 20, 2010
by
Jakub Wieczorek
Committed by
Jean-Baptiste Kempf
Dec 20, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LibVLC Audio/video filters listing API
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
81758ac0
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
159 additions
and
0 deletions
+159
-0
include/vlc/libvlc.h
include/vlc/libvlc.h
+51
-0
src/control/core.c
src/control/core.c
+74
-0
src/libvlc.sym
src/libvlc.sym
+3
-0
test/libvlc/core.c
test/libvlc/core.c
+31
-0
No files found.
include/vlc/libvlc.h
View file @
3f808957
...
...
@@ -429,6 +429,57 @@ VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterat
libvlc_log_message_t
*
p_buffer
);
/** @} */
/**
* Description of a module.
*/
typedef
struct
libvlc_module_description_t
{
char
*
psz_name
;
char
*
psz_shortname
;
char
*
psz_longname
;
char
*
psz_help
;
struct
libvlc_module_description_t
*
p_next
;
}
libvlc_module_description_t
;
libvlc_module_description_t
*
libvlc_module_description_list_get
(
libvlc_instance_t
*
p_instance
,
const
char
*
capability
);
/**
* Release a list of module descriptions.
*
* \param p_list the list to be released
*/
VLC_PUBLIC_API
void
libvlc_module_description_list_release
(
libvlc_module_description_t
*
p_list
);
/**
* Returns a list of audio filters that are available.
*
* \param p_instance libvlc instance
*
* \return a list of module descriptions. It should be freed with libvlc_module_description_list_release().
* In case of an error, NULL is returned.
*
* \see libvlc_module_description_t
* \see libvlc_module_description_list_release
*/
VLC_PUBLIC_API
libvlc_module_description_t
*
libvlc_audio_filter_list_get
(
libvlc_instance_t
*
p_instance
);
/**
* Returns a list of video filters that are available.
*
* \param p_instance libvlc instance
*
* \return a list of module descriptions. It should be freed with libvlc_module_description_list_release().
* In case of an error, NULL is returned.
*
* \see libvlc_module_description_t
* \see libvlc_module_description_list_release
*/
VLC_PUBLIC_API
libvlc_module_description_t
*
libvlc_video_filter_list_get
(
libvlc_instance_t
*
p_instance
);
/** @} */
/** @} */
...
...
src/control/core.c
View file @
3f808957
...
...
@@ -26,6 +26,7 @@
#endif
#include "libvlc_internal.h"
#include <vlc_modules.h>
#include <vlc/libvlc.h>
#include <vlc_interface.h>
...
...
@@ -171,3 +172,76 @@ void libvlc_free( void *ptr )
{
free
(
ptr
);
}
libvlc_module_description_t
*
libvlc_module_description_list_get
(
libvlc_instance_t
*
p_instance
,
const
char
*
capability
)
{
VLC_UNUSED
(
p_instance
);
libvlc_module_description_t
*
p_list
=
NULL
,
*
p_actual
=
NULL
,
*
p_previous
=
NULL
;
module_t
**
module_list
=
module_list_get
(
NULL
);
for
(
size_t
i
=
0
;
module_list
[
i
];
i
++
)
{
module_t
*
p_module
=
module_list
[
i
];
if
(
!
module_provides
(
p_module
,
capability
)
)
continue
;
p_actual
=
(
libvlc_module_description_t
*
)
malloc
(
sizeof
(
libvlc_module_description_t
)
);
if
(
p_actual
==
NULL
)
{
libvlc_printerr
(
"Not enough memory"
);
libvlc_module_description_list_release
(
p_list
);
module_list_free
(
module_list
);
return
NULL
;
}
if
(
p_list
==
NULL
)
p_list
=
p_actual
;
const
char
*
name
=
module_get_object
(
p_module
);
const
char
*
shortname
=
module_get_name
(
p_module
,
false
);
const
char
*
longname
=
module_get_name
(
p_module
,
true
);
const
char
*
help
=
module_get_help
(
p_module
);
p_actual
->
psz_name
=
name
?
strdup
(
name
)
:
NULL
;
p_actual
->
psz_shortname
=
shortname
?
strdup
(
shortname
)
:
NULL
;
p_actual
->
psz_longname
=
longname
?
strdup
(
longname
)
:
NULL
;
p_actual
->
psz_help
=
help
?
strdup
(
help
)
:
NULL
;
p_actual
->
p_next
=
NULL
;
if
(
p_previous
)
p_previous
->
p_next
=
p_actual
;
p_previous
=
p_actual
;
}
module_list_free
(
module_list
);
return
p_list
;
}
void
libvlc_module_description_list_release
(
libvlc_module_description_t
*
p_list
)
{
libvlc_module_description_t
*
p_actual
,
*
p_before
;
p_actual
=
p_list
;
while
(
p_actual
)
{
free
(
p_actual
->
psz_name
);
free
(
p_actual
->
psz_shortname
);
free
(
p_actual
->
psz_longname
);
free
(
p_actual
->
psz_help
);
p_before
=
p_actual
;
p_actual
=
p_before
->
p_next
;
free
(
p_before
);
}
}
libvlc_module_description_t
*
libvlc_audio_filter_list_get
(
libvlc_instance_t
*
p_instance
)
{
return
libvlc_module_description_list_get
(
p_instance
,
"audio filter"
);
}
libvlc_module_description_t
*
libvlc_video_filter_list_get
(
libvlc_instance_t
*
p_instance
)
{
return
libvlc_module_description_list_get
(
p_instance
,
"video filter2"
);
}
src/libvlc.sym
View file @
3f808957
...
...
@@ -233,3 +233,6 @@ libvlc_vlm_show_media
libvlc_vlm_stop_media
libvlc_set_exit_handler
libvlc_wait
libvlc_audio_filter_list_get
libvlc_video_filter_list_get
libvlc_module_description_list_release
test/libvlc/core.c
View file @
3f808957
...
...
@@ -23,6 +23,8 @@
#include "test.h"
#include <string.h>
static
void
test_core
(
const
char
**
argv
,
int
argc
)
{
libvlc_instance_t
*
vlc
;
...
...
@@ -37,12 +39,41 @@ static void test_core (const char ** argv, int argc)
libvlc_release
(
vlc
);
}
static
void
test_moduledescriptionlist
(
libvlc_module_description_t
*
list
)
{
libvlc_module_description_t
*
module
=
list
;
while
(
module
)
{
assert
(
strlen
(
module
->
psz_name
)
);
assert
(
strlen
(
module
->
psz_shortname
)
);
assert
(
module
->
psz_longname
==
NULL
||
strlen
(
module
->
psz_longname
));
assert
(
module
->
psz_help
==
NULL
||
strlen
(
module
->
psz_help
));
module
=
module
->
p_next
;
}
libvlc_module_description_list_release
(
list
);
}
static
void
test_audiovideofilterlists
(
const
char
**
argv
,
int
argc
)
{
libvlc_instance_t
*
vlc
;
log
(
"Testing libvlc_(audio|video)_filter_list_get()
\n
"
);
vlc
=
libvlc_new
(
argc
,
argv
);
assert
(
vlc
!=
NULL
);
test_moduledescriptionlist
(
libvlc_audio_filter_list_get
(
vlc
));
test_moduledescriptionlist
(
libvlc_video_filter_list_get
(
vlc
));
libvlc_release
(
vlc
);
}
int
main
(
void
)
{
test_init
();
test_core
(
test_defaults_args
,
test_defaults_nargs
);
test_audiovideofilterlists
(
test_defaults_args
,
test_defaults_nargs
);
return
0
;
}
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