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
0b81004e
Commit
0b81004e
authored
Feb 27, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aout: revector
parent
7e4e3a43
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
120 additions
and
99 deletions
+120
-99
src/audio_output/output.c
src/audio_output/output.c
+120
-99
No files found.
src/audio_output/output.c
View file @
0b81004e
...
@@ -270,105 +270,6 @@ static void aout_Destructor (vlc_object_t *obj)
...
@@ -270,105 +270,6 @@ static void aout_Destructor (vlc_object_t *obj)
vlc_mutex_destroy
(
&
owner
->
lock
);
vlc_mutex_destroy
(
&
owner
->
lock
);
}
}
/**
* Gets the volume of the audio output stream (independent of mute).
* \return Current audio volume (0. = silent, 1. = nominal),
* or a strictly negative value if undefined.
*/
float
aout_VolumeGet
(
audio_output_t
*
aout
)
{
return
var_GetFloat
(
aout
,
"volume"
);
}
/**
* Sets the volume of the audio output stream.
* \note The mute status is not changed.
* \return 0 on success, -1 on failure.
*/
int
aout_VolumeSet
(
audio_output_t
*
aout
,
float
vol
)
{
int
ret
=
-
1
;
aout_OutputLock
(
aout
);
if
(
aout
->
volume_set
!=
NULL
)
ret
=
aout
->
volume_set
(
aout
,
vol
);
aout_OutputUnlock
(
aout
);
return
ret
;
}
/**
* Gets the audio output stream mute flag.
* \return 0 if not muted, 1 if muted, -1 if undefined.
*/
int
aout_MuteGet
(
audio_output_t
*
aout
)
{
return
var_InheritBool
(
aout
,
"mute"
);
}
/**
* Sets the audio output stream mute flag.
* \return 0 on success, -1 on failure.
*/
int
aout_MuteSet
(
audio_output_t
*
aout
,
bool
mute
)
{
int
ret
=
-
1
;
aout_OutputLock
(
aout
);
if
(
aout
->
mute_set
!=
NULL
)
ret
=
aout
->
mute_set
(
aout
,
mute
);
aout_OutputUnlock
(
aout
);
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_OutputLock
(
aout
);
if
(
aout
->
device_select
!=
NULL
)
ret
=
aout
->
device_select
(
aout
,
id
);
aout_OutputUnlock
(
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_OutputLock
(
aout
);
if
(
aout
->
device_enum
!=
NULL
)
ret
=
aout
->
device_enum
(
aout
,
ids
,
names
);
aout_OutputUnlock
(
aout
);
return
ret
;
}
/**
/**
* Starts an audio output stream.
* Starts an audio output stream.
* \param fmt audio output stream format [IN/OUT]
* \param fmt audio output stream format [IN/OUT]
...
@@ -530,6 +431,32 @@ void aout_OutputFlush( audio_output_t *aout, bool wait )
...
@@ -530,6 +431,32 @@ void aout_OutputFlush( audio_output_t *aout, bool wait )
aout
->
flush
(
aout
,
wait
);
aout
->
flush
(
aout
,
wait
);
}
}
static
int
aout_OutputVolumeSet
(
audio_output_t
*
aout
,
float
vol
)
{
aout_OutputAssertLocked
(
aout
);
return
(
aout
->
volume_set
!=
NULL
)
?
aout
->
volume_set
(
aout
,
vol
)
:
-
1
;
}
static
int
aout_OutputMuteSet
(
audio_output_t
*
aout
,
bool
mute
)
{
aout_OutputAssertLocked
(
aout
);
return
(
aout
->
mute_set
!=
NULL
)
?
aout
->
mute_set
(
aout
,
mute
)
:
-
1
;
}
static
int
aout_OutputDeviceSet
(
audio_output_t
*
aout
,
const
char
*
id
)
{
aout_OutputAssertLocked
(
aout
);
return
(
aout
->
device_select
!=
NULL
)
?
aout
->
device_select
(
aout
,
id
)
:
-
1
;
}
static
int
aout_OutputDevicesEnum
(
audio_output_t
*
aout
,
char
***
ids
,
char
***
names
)
{
aout_OutputAssertLocked
(
aout
);
return
(
aout
->
device_enum
!=
NULL
)
?
aout
->
device_enum
(
aout
,
ids
,
names
)
:
-
1
;
}
void
aout_OutputLock
(
audio_output_t
*
aout
)
void
aout_OutputLock
(
audio_output_t
*
aout
)
{
{
aout_owner_t
*
owner
=
aout_owner
(
aout
);
aout_owner_t
*
owner
=
aout_owner
(
aout
);
...
@@ -543,3 +470,97 @@ void aout_OutputUnlock (audio_output_t *aout)
...
@@ -543,3 +470,97 @@ void aout_OutputUnlock (audio_output_t *aout)
vlc_mutex_unlock
(
&
owner
->
lock
);
vlc_mutex_unlock
(
&
owner
->
lock
);
}
}
/**
* Gets the volume of the audio output stream (independent of mute).
* \return Current audio volume (0. = silent, 1. = nominal),
* or a strictly negative value if undefined.
*/
float
aout_VolumeGet
(
audio_output_t
*
aout
)
{
return
var_GetFloat
(
aout
,
"volume"
);
}
/**
* Sets the volume of the audio output stream.
* \note The mute status is not changed.
* \return 0 on success, -1 on failure.
*/
int
aout_VolumeSet
(
audio_output_t
*
aout
,
float
vol
)
{
int
ret
;
aout_OutputLock
(
aout
);
ret
=
aout_OutputVolumeSet
(
aout
,
vol
);
aout_OutputUnlock
(
aout
);
return
ret
;
}
/**
* Gets the audio output stream mute flag.
* \return 0 if not muted, 1 if muted, -1 if undefined.
*/
int
aout_MuteGet
(
audio_output_t
*
aout
)
{
return
var_InheritBool
(
aout
,
"mute"
);
}
/**
* Sets the audio output stream mute flag.
* \return 0 on success, -1 on failure.
*/
int
aout_MuteSet
(
audio_output_t
*
aout
,
bool
mute
)
{
int
ret
;
aout_OutputLock
(
aout
);
ret
=
aout_OutputMuteSet
(
aout
,
mute
);
aout_OutputUnlock
(
aout
);
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
;
aout_OutputLock
(
aout
);
ret
=
aout_OutputDeviceSet
(
aout
,
id
);
aout_OutputUnlock
(
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
;
aout_OutputLock
(
aout
);
ret
=
aout_OutputDevicesEnum
(
aout
,
ids
,
names
);
aout_OutputUnlock
(
aout
);
return
ret
;
}
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