Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
b1666e22
Commit
b1666e22
authored
Nov 01, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aout: remove old aout_(Volume|Mute)(Get|Set)() functions
And remove the other instance of find-input-callback.
parent
7dba440e
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
49 additions
and
208 deletions
+49
-208
include/vlc_aout.h
include/vlc_aout.h
+5
-0
include/vlc_aout_intf.h
include/vlc_aout_intf.h
+0
-41
lib/audio.c
lib/audio.c
+34
-7
lib/media_player.c
lib/media_player.c
+0
-9
po/POTFILES.in
po/POTFILES.in
+0
-1
src/Makefile.am
src/Makefile.am
+0
-2
src/audio_output/aout_internal.h
src/audio_output/aout_internal.h
+0
-4
src/audio_output/intf.c
src/audio_output/intf.c
+0
-134
src/audio_output/output.c
src/audio_output/output.c
+4
-4
src/playlist/aout.c
src/playlist/aout.c
+6
-6
No files found.
include/vlc_aout.h
View file @
b1666e22
...
...
@@ -224,6 +224,11 @@ VLC_API void aout_FormatPrint(vlc_object_t *, const char *,
#define aout_FormatPrint(o, t, f) aout_FormatPrint(VLC_OBJECT(o), t, f)
VLC_API
const
char
*
aout_FormatPrintChannels
(
const
audio_sample_format_t
*
)
VLC_USED
;
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
);
/**
* Report change of configured audio volume to the core and UI.
*/
...
...
include/vlc_aout_intf.h
deleted
100644 → 0
View file @
7dba440e
/*****************************************************************************
* vlc_aout_intf.h : audio output control
*****************************************************************************
* Copyright (C) 2002-2011 VLC authors and VideoLAN
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef VLC_AOUT_INTF_H
#define VLC_AOUT_INTF_H 1
/**
* \file
* This file defines functions, structures and macros for audio output object
*/
#define AOUT_VOLUME_DEFAULT 256
#define AOUT_VOLUME_MAX 512
VLC_API
float
aout_VolumeGet
(
vlc_object_t
*
);
#define aout_VolumeGet(a) aout_VolumeGet(VLC_OBJECT(a))
VLC_API
int
aout_VolumeSet
(
vlc_object_t
*
,
float
);
#define aout_VolumeSet(a, b) aout_VolumeSet(VLC_OBJECT(a), b)
VLC_API
int
aout_MuteSet
(
vlc_object_t
*
,
bool
);
#define aout_MuteSet(a, b) aout_MuteSet(VLC_OBJECT(a), b)
VLC_API
int
aout_MuteGet
(
vlc_object_t
*
);
#define aout_MuteGet(a) aout_MuteGet(VLC_OBJECT(a))
#endif
/* _VLC_AOUT_H */
lib/audio.c
View file @
b1666e22
...
...
@@ -35,7 +35,6 @@
#include <vlc_common.h>
#include <vlc_input.h>
#include <vlc_aout_intf.h>
#include <vlc_aout.h>
#include <vlc_modules.h>
...
...
@@ -256,18 +255,39 @@ void libvlc_audio_toggle_mute( libvlc_media_player_t *mp )
int
libvlc_audio_get_mute
(
libvlc_media_player_t
*
mp
)
{
return
aout_MuteGet
(
mp
);
int
mute
=
-
1
;
audio_output_t
*
aout
=
GetAOut
(
mp
);
if
(
aout
!=
NULL
)
{
mute
=
aout_MuteGet
(
aout
);
vlc_object_release
(
aout
);
}
return
mute
;
}
void
libvlc_audio_set_mute
(
libvlc_media_player_t
*
mp
,
int
mute
)
{
aout_MuteSet
(
VLC_OBJECT
(
mp
),
mute
!=
0
);
audio_output_t
*
aout
=
GetAOut
(
mp
);
if
(
aout
!=
NULL
)
{
mute
=
aout_MuteSet
(
aout
,
mute
);
vlc_object_release
(
aout
);
}
}
int
libvlc_audio_get_volume
(
libvlc_media_player_t
*
mp
)
{
float
vol
=
aout_VolumeGet
(
mp
);
return
(
vol
>=
0
.
f
)
?
lroundf
(
vol
*
100
.
f
)
:
-
1
;
int
volume
=
-
1
;
audio_output_t
*
aout
=
GetAOut
(
mp
);
if
(
aout
!=
NULL
)
{
float
vol
=
aout_VolumeGet
(
aout
);
vlc_object_release
(
aout
);
volume
=
lroundf
(
vol
*
100
.
f
);
}
return
volume
;
}
int
libvlc_audio_set_volume
(
libvlc_media_player_t
*
mp
,
int
volume
)
...
...
@@ -278,8 +298,15 @@ int libvlc_audio_set_volume( libvlc_media_player_t *mp, int volume )
libvlc_printerr
(
"Volume out of range"
);
return
-
1
;
}
aout_VolumeSet
(
mp
,
vol
);
return
0
;
int
ret
=
-
1
;
audio_output_t
*
aout
=
GetAOut
(
mp
);
if
(
aout
!=
NULL
)
{
ret
=
aout_VolumeSet
(
aout
,
vol
);
vlc_object_release
(
aout
);
}
return
ret
;
}
/*****************************************************************************
...
...
lib/media_player.c
View file @
b1666e22
...
...
@@ -357,13 +357,6 @@ static int snapshot_was_taken(vlc_object_t *p_this, char const *psz_cmd,
return
VLC_SUCCESS
;
}
static
input_thread_t
*
find_input
(
vlc_object_t
*
obj
)
{
libvlc_media_player_t
*
mp
=
(
libvlc_media_player_t
*
)
obj
;
return
libvlc_get_input_thread
(
mp
);
}
/* */
static
void
libvlc_media_player_destroy
(
libvlc_media_player_t
*
);
...
...
@@ -466,8 +459,6 @@ libvlc_media_player_new( libvlc_instance_t *instance )
var_Create
(
mp
,
"aout"
,
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
var_Create
(
mp
,
"mute"
,
VLC_VAR_BOOL
);
var_Create
(
mp
,
"volume"
,
VLC_VAR_FLOAT
);
var_Create
(
mp
,
"find-input-callback"
,
VLC_VAR_ADDRESS
);
var_SetAddress
(
mp
,
"find-input-callback"
,
find_input
);
var_Create
(
mp
,
"corks"
,
VLC_VAR_INTEGER
);
var_Create
(
mp
,
"amem-data"
,
VLC_VAR_ADDRESS
);
var_Create
(
mp
,
"amem-setup"
,
VLC_VAR_ADDRESS
);
...
...
po/POTFILES.in
View file @
b1666e22
...
...
@@ -67,7 +67,6 @@ src/audio_output/common.c
src/audio_output/dec.c
src/audio_output/filters.c
src/audio_output/input.c
src/audio_output/intf.c
src/audio_output/output.c
src/config/chain.c
src/config/cmdline.c
...
...
src/Makefile.am
View file @
b1666e22
...
...
@@ -24,7 +24,6 @@ pluginsincludedir = $(pkgincludedir)/plugins
pluginsinclude_HEADERS
=
\
../include/vlc_access.h
\
../include/vlc_aout.h
\
../include/vlc_aout_intf.h
\
../include/vlc_aout_volume.h
\
../include/vlc_arrays.h
\
../include/vlc_art_finder.h
\
...
...
@@ -412,7 +411,6 @@ SOURCES_libvlc_common = \
audio_output/input.c
\
audio_output/output.c
\
audio_output/volume.c
\
audio_output/intf.c
\
osd/osd.c
\
osd/osd_text.c
\
network/getaddrinfo.c
\
...
...
src/audio_output/aout_internal.h
View file @
b1666e22
...
...
@@ -139,10 +139,6 @@ void aout_volume_Delete(aout_volume_t *);
audio_output_t
*
aout_New
(
vlc_object_t
*
);
#define aout_New(a) aout_New(VLC_OBJECT(a))
void
aout_Destroy
(
audio_output_t
*
);
float
aout_OutputVolumeGet
(
audio_output_t
*
);
int
aout_OutputVolumeSet
(
audio_output_t
*
,
float
);
int
aout_OutputMuteGet
(
audio_output_t
*
);
int
aout_OutputMuteSet
(
audio_output_t
*
,
bool
);
int
aout_OutputNew
(
audio_output_t
*
p_aout
,
const
audio_sample_format_t
*
p_format
);
...
...
src/audio_output/intf.c
deleted
100644 → 0
View file @
7dba440e
/*****************************************************************************
* intf.c : audio output API towards the interface modules
*****************************************************************************
* Copyright (C) 2002-2007 VLC authors and VideoLAN
* $Id$
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_aout_intf.h>
#include <stdio.h>
#include <stdlib.h>
/* calloc(), malloc(), free() */
#include <string.h>
#include <math.h>
#include <vlc_aout.h>
#include "aout_internal.h"
#include <vlc_playlist.h>
static
audio_output_t
*
findAout
(
vlc_object_t
*
obj
)
{
input_thread_t
*
(
*
pf_find_input
)
(
vlc_object_t
*
);
pf_find_input
=
var_GetAddress
(
obj
,
"find-input-callback"
);
if
(
unlikely
(
pf_find_input
==
NULL
))
return
NULL
;
input_thread_t
*
p_input
=
pf_find_input
(
obj
);
if
(
p_input
==
NULL
)
return
NULL
;
audio_output_t
*
p_aout
=
input_GetAout
(
p_input
);
vlc_object_release
(
p_input
);
return
p_aout
;
}
#define findAout(o) findAout(VLC_OBJECT(o))
#undef aout_VolumeGet
/**
* Gets the volume of the output device (independent of mute).
* \return Current audio volume (0 = silent, 1 = nominal),
* or a strictly negative value if undefined.
*/
float
aout_VolumeGet
(
vlc_object_t
*
obj
)
{
audio_output_t
*
aout
=
findAout
(
obj
);
if
(
aout
==
NULL
)
return
-
1
.
f
;
float
volume
=
aout_OutputVolumeGet
(
aout
);
vlc_object_release
(
aout
);
return
volume
;
}
#undef aout_VolumeSet
/**
* Sets the volume of the output device.
* \note The mute status is not changed.
*/
int
aout_VolumeSet
(
vlc_object_t
*
obj
,
float
vol
)
{
int
ret
=
-
1
;
audio_output_t
*
aout
=
findAout
(
obj
);
if
(
aout
!=
NULL
)
{
ret
=
aout_OutputVolumeSet
(
aout
,
vol
);
vlc_object_release
(
aout
);
}
return
ret
;
}
#undef aout_MuteGet
/**
* Gets the output mute status.
* \return 0 if not muted, 1 if muted, -1 if undefined.
*/
int
aout_MuteGet
(
vlc_object_t
*
obj
)
{
audio_output_t
*
aout
=
findAout
(
obj
);
if
(
aout
==
NULL
)
return
-
1
.
f
;
bool
mute
=
aout_OutputMuteGet
(
aout
);
vlc_object_release
(
aout
);
return
mute
;
}
#undef aout_MuteSet
/**
* Sets mute status.
*/
int
aout_MuteSet
(
vlc_object_t
*
obj
,
bool
mute
)
{
int
ret
=
-
1
;
audio_output_t
*
aout
=
findAout
(
obj
);
if
(
aout
!=
NULL
)
{
ret
=
aout_OutputMuteSet
(
aout
,
mute
);
vlc_object_release
(
aout
);
if
(
ret
==
0
)
var_SetBool
(
obj
,
"mute"
,
mute
);
}
return
ret
;
}
src/audio_output/output.c
View file @
b1666e22
...
...
@@ -255,7 +255,7 @@ static void aout_Destructor (vlc_object_t *obj)
* \return Current audio volume (0. = silent, 1. = nominal),
* or a strictly negative value if undefined.
*/
float
aout_
Output
VolumeGet
(
audio_output_t
*
aout
)
float
aout_VolumeGet
(
audio_output_t
*
aout
)
{
return
var_GetFloat
(
aout
,
"volume"
);
}
...
...
@@ -265,7 +265,7 @@ float aout_OutputVolumeGet (audio_output_t *aout)
* \note The mute status is not changed.
* \return 0 on success, -1 on failure.
*/
int
aout_
Output
VolumeSet
(
audio_output_t
*
aout
,
float
vol
)
int
aout_VolumeSet
(
audio_output_t
*
aout
,
float
vol
)
{
int
ret
=
-
1
;
...
...
@@ -280,7 +280,7 @@ int aout_OutputVolumeSet (audio_output_t *aout, float vol)
* Gets the audio output stream mute flag.
* \return 0 if not muted, 1 if muted, -1 if undefined.
*/
int
aout_
Output
MuteGet
(
audio_output_t
*
aout
)
int
aout_MuteGet
(
audio_output_t
*
aout
)
{
return
var_InheritBool
(
aout
,
"mute"
);
}
...
...
@@ -289,7 +289,7 @@ int aout_OutputMuteGet (audio_output_t *aout)
* Sets the audio output stream mute flag.
* \return 0 on success, -1 on failure.
*/
int
aout_
Output
MuteSet
(
audio_output_t
*
aout
,
bool
mute
)
int
aout_MuteSet
(
audio_output_t
*
aout
,
bool
mute
)
{
int
ret
=
-
1
;
...
...
src/playlist/aout.c
View file @
b1666e22
...
...
@@ -47,7 +47,7 @@ float playlist_VolumeGet (playlist_t *pl)
audio_output_t
*
aout
=
findAout
(
pl
);
if
(
aout
!=
NULL
)
{
volume
=
aout_
Output
VolumeGet
(
aout
);
volume
=
aout_VolumeGet
(
aout
);
vlc_object_release
(
aout
);
}
return
volume
;
...
...
@@ -60,7 +60,7 @@ int playlist_VolumeSet (playlist_t *pl, float vol)
audio_output_t
*
aout
=
findAout
(
pl
);
if
(
aout
!=
NULL
)
{
ret
=
aout_
Output
VolumeSet
(
aout
,
vol
);
ret
=
aout_VolumeSet
(
aout
,
vol
);
vlc_object_release
(
aout
);
}
return
ret
;
...
...
@@ -80,7 +80,7 @@ int playlist_VolumeUp (playlist_t *pl, int value, float *volp)
audio_output_t
*
aout
=
findAout
(
pl
);
if
(
aout
!=
NULL
)
{
float
vol
=
aout_
Output
VolumeGet
(
aout
);
float
vol
=
aout_VolumeGet
(
aout
);
if
(
vol
>=
0
.)
{
vol
+=
value
/
(
float
)
AOUT_VOLUME_DEFAULT
;
...
...
@@ -90,7 +90,7 @@ int playlist_VolumeUp (playlist_t *pl, int value, float *volp)
vol
=
2
.;
if
(
volp
!=
NULL
)
*
volp
=
vol
;
ret
=
aout_
Output
VolumeSet
(
aout
,
vol
);
ret
=
aout_VolumeSet
(
aout
,
vol
);
}
vlc_object_release
(
aout
);
}
...
...
@@ -104,7 +104,7 @@ int playlist_MuteGet (playlist_t *pl)
audio_output_t
*
aout
=
findAout
(
pl
);
if
(
aout
!=
NULL
)
{
mute
=
aout_
Output
MuteGet
(
aout
);
mute
=
aout_MuteGet
(
aout
);
vlc_object_release
(
aout
);
}
return
mute
;
...
...
@@ -117,7 +117,7 @@ int playlist_MuteSet (playlist_t *pl, bool mute)
audio_output_t
*
aout
=
findAout
(
pl
);
if
(
aout
!=
NULL
)
{
ret
=
aout_
Output
MuteSet
(
aout
,
mute
);
ret
=
aout_MuteSet
(
aout
,
mute
);
vlc_object_release
(
aout
);
if
(
ret
==
0
)
var_SetBool
(
pl
,
"mute"
,
mute
);
...
...
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