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
e9571522
Commit
e9571522
authored
May 15, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
audio: support for enumerating devices of current aoout (fixes #10720)
parent
b90f1b90
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
0 deletions
+61
-0
include/vlc/libvlc_media_player.h
include/vlc/libvlc_media_player.h
+24
-0
lib/audio.c
lib/audio.c
+36
-0
lib/libvlc.sym
lib/libvlc.sym
+1
-0
No files found.
include/vlc/libvlc_media_player.h
View file @
e9571522
...
...
@@ -1473,6 +1473,27 @@ char *libvlc_audio_output_device_longname( libvlc_instance_t *, const char *,
LIBVLC_DEPRECATED
LIBVLC_API
char
*
libvlc_audio_output_device_id
(
libvlc_instance_t
*
,
const
char
*
,
int
);
/**
* Gets a list of potential audio output devices,
* \see libvlc_audio_output_device_set().
*
* \note Not all audio outputs support enumerating devices.
* The audio output may be functional even if the list is empty (NULL).
*
* \note The list may not be exhaustive.
*
* \warning Some audio output devices in the list might not actually work in
* some circumstances. By default, it is recommended to not specify any
* explicit audio device.
*
* \param mp media player
* \return A NULL-terminated linked list of potential audio output devices.
* It must be freed it with libvlc_audio_output_device_list_release()
* \version LibVLC 2.2.0 or later.
*/
LIBVLC_API
libvlc_audio_output_device_t
*
libvlc_audio_output_device_enum
(
libvlc_media_player_t
*
mp
);
/**
* Gets a list of audio output devices for a given audio output module,
* \see libvlc_audio_output_device_set().
...
...
@@ -1514,6 +1535,9 @@ LIBVLC_API void libvlc_audio_output_device_list_release(
* specified by the device identifier string immediately. This is the
* recommended usage.
*
* A list of adequate potential device strings can be obtained with
* libvlc_audio_output_device_enum().
*
* However passing NULL is supported in LibVLC version 2.2.0 and later only;
* in earlier versions, this function would have no effects when the module
* parameter was NULL.
...
...
lib/audio.c
View file @
e9571522
...
...
@@ -139,6 +139,42 @@ int libvlc_audio_output_set( libvlc_media_player_t *mp, const char *psz_name )
return
0
;
}
libvlc_audio_output_device_t
*
libvlc_audio_output_device_enum
(
libvlc_media_player_t
*
mp
)
{
audio_output_t
*
aout
=
GetAOut
(
mp
);
if
(
aout
==
NULL
)
return
NULL
;
libvlc_audio_output_device_t
*
list
=
NULL
,
**
pp
=
&
list
;
char
**
values
,
**
texts
;
int
n
=
aout_DevicesList
(
aout
,
&
values
,
&
texts
);
if
(
n
<
0
)
goto
err
;
for
(
int
i
=
0
;
i
<
n
;
i
++
)
{
libvlc_audio_output_device_t
*
item
=
malloc
(
sizeof
(
*
item
)
);
if
(
unlikely
(
item
==
NULL
)
)
{
free
(
texts
[
i
]
);
free
(
values
[
i
]
);
continue
;
}
*
pp
=
item
;
pp
=
&
item
->
p_next
;
item
->
psz_device
=
values
[
i
];
item
->
psz_description
=
texts
[
i
];
}
free
(
texts
);
free
(
values
);
err:
return
list
;
}
libvlc_audio_output_device_t
*
libvlc_audio_output_device_list_get
(
libvlc_instance_t
*
p_instance
,
const
char
*
aout
)
...
...
lib/libvlc.sym
View file @
e9571522
...
...
@@ -15,6 +15,7 @@ libvlc_audio_equalizer_release
libvlc_audio_equalizer_set_amp_at_index
libvlc_audio_equalizer_set_preamp
libvlc_audio_output_device_count
libvlc_audio_output_device_enum
libvlc_audio_output_device_id
libvlc_audio_output_device_list_get
libvlc_audio_output_device_list_release
...
...
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