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
a249b33b
Commit
a249b33b
authored
Dec 16, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aout: external functions for devices selection
parent
b2b4c52a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
0 deletions
+55
-0
include/vlc_aout.h
include/vlc_aout.h
+3
-0
src/audio_output/output.c
src/audio_output/output.c
+49
-0
src/libvlccore.sym
src/libvlccore.sym
+3
-0
No files found.
include/vlc_aout.h
View file @
a249b33b
...
...
@@ -277,6 +277,9 @@ VLC_API float aout_VolumeGet (audio_output_t *);
VLC_API
int
aout_VolumeSet
(
audio_output_t
*
,
float
);
VLC_API
int
aout_MuteGet
(
audio_output_t
*
);
VLC_API
int
aout_MuteSet
(
audio_output_t
*
,
bool
);
VLC_API
char
*
aout_DeviceGet
(
audio_output_t
*
);
VLC_API
int
aout_DeviceSet
(
audio_output_t
*
,
const
char
*
);
VLC_API
int
aout_DevicesList
(
audio_output_t
*
,
char
***
,
char
***
);
/**
* Report change of configured audio volume to the core and UI.
...
...
src/audio_output/output.c
View file @
a249b33b
...
...
@@ -361,6 +361,55 @@ int aout_MuteSet (audio_output_t *aout, bool mute)
return
ret
;
}
/**
* Gets the currently selected device.
* \return the selected device ID (caller must free() it)
* NULL if no device is selected or in case of error.
*/
char
*
aout_DeviceGet
(
audio_output_t
*
aout
)
{
return
var_GetNonEmptyString
(
aout
,
"device"
);
}
/**
* Selects an audio output device.
* \param id device ID to select, or NULL for the default device
* \return zero on success, non-zero on error.
*/
int
aout_DeviceSet
(
audio_output_t
*
aout
,
const
char
*
id
)
{
int
ret
=
-
1
;
aout_lock
(
aout
);
if
(
aout
->
device_select
!=
NULL
)
ret
=
aout
->
device_select
(
aout
,
id
);
aout_unlock
(
aout
);
return
ret
;
}
/**
* Enumerates possible audio output devices.
*
* The function will heap-allocate two tables of heap-allocated strings;
* the caller is responsible for freeing all strings and both tables.
*
* \param ids pointer to a table of device identifiers [OUT]
* \param names pointer to a table of device human-readable descriptions [OUT]
* \return the number of devices, or negative on error.
* \note In case of error, *ids and *names are undefined.
*/
int
aout_DevicesList
(
audio_output_t
*
aout
,
char
***
ids
,
char
***
names
)
{
int
ret
=
-
1
;
aout_lock
(
aout
);
if
(
aout
->
device_enum
!=
NULL
)
ret
=
aout
->
device_enum
(
aout
,
ids
,
names
);
aout_unlock
(
aout
);
return
ret
;
}
/**
* Starts an audio output stream.
* \param fmt audio output stream format [IN/OUT]
...
...
src/libvlccore.sym
View file @
a249b33b
...
...
@@ -14,6 +14,9 @@ aout_VolumeGet
aout_VolumeSet
aout_MuteSet
aout_MuteGet
aout_DeviceGet
aout_DeviceSet
aout_DevicesList
block_Alloc
block_FifoCount
block_FifoEmpty
...
...
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