Commit 35b47400 authored by Christophe Massiot's avatar Christophe Massiot

* ALL: More hooks for audio volume management.

* configure.in: Fixed a typo.
parent df657969
......@@ -22,7 +22,7 @@ INTERFACE := interface intf_eject
PLAYLIST := playlist
INPUT := input input_ext-plugins input_ext-dec input_ext-intf input_dec input_programs input_clock input_info
VIDEO_OUTPUT := video_output video_text vout_pictures vout_subpictures
AUDIO_OUTPUT := audio_output filters input mixer output
AUDIO_OUTPUT := audio_output filters input mixer output intf
STREAM_OUTPUT := stream_output
MISC := mtime modules threads cpu configuration netutils iso_lang messages objects extras
......
......@@ -1392,7 +1392,7 @@ then
if test "x${with_qte}" = "x"
then
test_LDFLAGS="-L${QTDIR}/lib"
test_CFLAGS="-I$(QTDIR)/include"
test_CFLAGS="-I${QTDIR}/include"
else
test_LDFLAGS="-L${with_qte}/lib"
test_CFLAGS="-I${with_qte}/include"
......
......@@ -2,7 +2,7 @@
* aout_internal.h : internal defines for audio output
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: aout_internal.h,v 1.17 2002/09/16 20:46:37 massiot Exp $
* $Id: aout_internal.h,v 1.18 2002/09/18 21:21:23 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -210,9 +210,11 @@ struct aout_instance_t
/*****************************************************************************
* Prototypes
*****************************************************************************/
/* From input.c : */
void aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input,
aout_buffer_t * p_buffer );
/* From filters.c : */
int aout_FiltersCreatePipeline( aout_instance_t * p_aout,
aout_filter_t ** pp_filters,
int * pi_nb_filters,
......@@ -228,18 +230,21 @@ void aout_FiltersPlay( aout_instance_t * p_aout,
aout_filter_t ** pp_filters,
int i_nb_filters, aout_buffer_t ** pp_input_buffer );
/* From mixer.c : */
int aout_MixerNew( aout_instance_t * p_aout );
void aout_MixerDelete( aout_instance_t * p_aout );
void aout_MixerRun( aout_instance_t * p_aout );
int aout_MixerMultiplierSet( aout_instance_t * p_aout, float f_multiplier );
int aout_MixerMultiplierGet( aout_instance_t * p_aout, float * pf_multiplier );
/* From output.c : */
int aout_OutputNew( aout_instance_t * p_aout,
audio_sample_format_t * p_format );
void aout_OutputPlay( aout_instance_t * p_aout, aout_buffer_t * p_buffer );
void aout_OutputDelete( aout_instance_t * p_aout );
VLC_EXPORT( aout_buffer_t *, aout_OutputNextBuffer, ( aout_instance_t *, mtime_t, vlc_bool_t ) );
/* From audio_output.c : */
VLC_EXPORT( int, aout_FormatNbChannels, ( audio_sample_format_t * p_format ) );
void aout_FormatPrepare( audio_sample_format_t * p_format );
void aout_FifoInit( aout_instance_t *, aout_fifo_t *, u32 );
......@@ -250,3 +255,13 @@ void aout_FifoMoveDates( aout_instance_t *, aout_fifo_t *, mtime_t );
VLC_EXPORT( aout_buffer_t *, aout_FifoPop, ( aout_instance_t * p_aout, aout_fifo_t * p_fifo ) );
void aout_FifoDestroy( aout_instance_t * p_aout, aout_fifo_t * p_fifo );
/* From intf.c :*/
VLC_EXPORT( void, aout_VolumeSoftInit, ( aout_instance_t * ) );
int aout_VolumeSoftGet( aout_instance_t *, audio_volume_t * );
int aout_VolumeSoftSet( aout_instance_t *, audio_volume_t );
int aout_VolumeSoftInfos( aout_instance_t *, audio_volume_t *, audio_volume_t * );
VLC_EXPORT( void, aout_VolumeNoneInit, ( aout_instance_t * ) );
int aout_VolumeNoneGet( aout_instance_t *, audio_volume_t * );
int aout_VolumeNoneSet( aout_instance_t *, audio_volume_t );
int aout_VolumeNoneInfos( aout_instance_t *, audio_volume_t *, audio_volume_t * );
......@@ -2,7 +2,7 @@
* audio_output.h : audio output interface
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: audio_output.h,v 1.63 2002/09/16 20:46:37 massiot Exp $
* $Id: audio_output.h,v 1.64 2002/09/18 21:21:23 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -165,11 +165,6 @@ struct audio_date_t
u32 i_remainder;
};
/*****************************************************************************
* audio_volume_t : integer value for the audio volume
*****************************************************************************/
typedef unsigned int audio_volume_t;
/*****************************************************************************
* Prototypes
*****************************************************************************/
......@@ -192,4 +187,9 @@ VLC_EXPORT( aout_input_t *, __aout_InputNew, ( vlc_object_t *, aout_instance_t *
VLC_EXPORT( void, aout_InputDelete, ( aout_instance_t *, aout_input_t * ) );
/* From intf.c : */
VLC_EXPORT( int, aout_VolumeGet, ( aout_instance_t *, audio_volume_t * ) );
VLC_EXPORT( int, aout_VolumeSet, ( aout_instance_t *, audio_volume_t ) );
VLC_EXPORT( int, aout_VolumeInfos, ( aout_instance_t *, audio_volume_t *, audio_volume_t * ) );
VLC_EXPORT( int, aout_VolumeUp, ( aout_instance_t *, int, audio_volume_t * ) );
VLC_EXPORT( int, aout_VolumeDown, ( aout_instance_t *, int, audio_volume_t * ) );
......@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vlc_common.h,v 1.26 2002/08/30 22:22:24 massiot Exp $
* $Id: vlc_common.h,v 1.27 2002/09/18 21:21:23 massiot Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
......@@ -114,6 +114,9 @@ typedef s16 dctelem_t;
/* Video buffer types */
typedef u8 yuv_data_t;
/* Audio volume */
typedef u16 audio_volume_t;
/*****************************************************************************
* mtime_t: high precision date or time interval
*****************************************************************************
......
......@@ -38,6 +38,11 @@ struct module_symbols_t
int (* __vlc_threads_end_inner) ( vlc_object_t * ) ;
int (* __vlc_threads_init_inner) ( vlc_object_t * ) ;
int (* aout_FormatNbChannels_inner) ( audio_sample_format_t * p_format ) ;
int (* aout_VolumeDown_inner) ( aout_instance_t *, int, audio_volume_t * ) ;
int (* aout_VolumeGet_inner) ( aout_instance_t *, audio_volume_t * ) ;
int (* aout_VolumeInfos_inner) ( aout_instance_t *, audio_volume_t *, audio_volume_t * ) ;
int (* aout_VolumeSet_inner) ( aout_instance_t *, audio_volume_t ) ;
int (* aout_VolumeUp_inner) ( aout_instance_t *, int, audio_volume_t * ) ;
int (* input_AccessInit_inner) ( input_thread_t * ) ;
int (* input_AddInfo_inner) ( input_info_category_t *, char *, char *, ... ) ;
int (* input_ChangeArea_inner) ( input_thread_t *, input_area_t * ) ;
......@@ -112,6 +117,8 @@ struct module_symbols_t
void (* aout_DateSet_inner) ( audio_date_t *, mtime_t ) ;
void (* aout_DeleteInstance_inner) ( aout_instance_t * ) ;
void (* aout_InputDelete_inner) ( aout_instance_t *, aout_input_t * ) ;
void (* aout_VolumeNoneInit_inner) ( aout_instance_t * ) ;
void (* aout_VolumeSoftInit_inner) ( aout_instance_t * ) ;
void (* config_Duplicate_inner) ( module_t *, module_config_t * ) ;
void (* config_SetCallbacks_inner) ( module_config_t *, module_config_t * ) ;
void (* config_UnsetCallbacks_inner) ( module_config_t * ) ;
......@@ -228,6 +235,13 @@ struct module_symbols_t
# define aout_FormatNbChannels p_symbols->aout_FormatNbChannels_inner
# define aout_InputDelete p_symbols->aout_InputDelete_inner
# define aout_OutputNextBuffer p_symbols->aout_OutputNextBuffer_inner
# define aout_VolumeDown p_symbols->aout_VolumeDown_inner
# define aout_VolumeGet p_symbols->aout_VolumeGet_inner
# define aout_VolumeInfos p_symbols->aout_VolumeInfos_inner
# define aout_VolumeNoneInit p_symbols->aout_VolumeNoneInit_inner
# define aout_VolumeSet p_symbols->aout_VolumeSet_inner
# define aout_VolumeSoftInit p_symbols->aout_VolumeSoftInit_inner
# define aout_VolumeUp p_symbols->aout_VolumeUp_inner
# define config_Duplicate p_symbols->config_Duplicate_inner
# define config_FindConfig p_symbols->config_FindConfig_inner
# define config_GetHomeDir p_symbols->config_GetHomeDir_inner
......
......@@ -2,7 +2,7 @@
* alsa.c : alsa plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: alsa.c,v 1.10 2002/08/30 23:27:06 massiot Exp $
* $Id: alsa.c,v 1.11 2002/09/18 21:21:23 massiot Exp $
*
* Authors: Henri Fallon <henri@videolan.org> - Original Author
* Jeffrey Baker <jwbaker@acm.org> - Port to ALSA 1.0 API
......@@ -150,10 +150,14 @@ static int Open( vlc_object_t *p_this )
"iec958:AES0=0x%x,AES1=0x%x,AES2=0x%x,AES3=0x%x",
s[0], s[1], s[2], s[3] );
psz_device = psz_alsadev;
aout_VolumeNoneInit( p_aout );
}
else
{
psz_device = "default";
aout_VolumeSoftInit( p_aout );
}
}
......
......@@ -2,7 +2,7 @@
* arts.c : aRts module
*****************************************************************************
* Copyright (C) 2001-2002 VideoLAN
* $Id: arts.c,v 1.10 2002/08/30 23:27:06 massiot Exp $
* $Id: arts.c,v 1.11 2002/09/18 21:21:23 massiot Exp $
*
* Authors: Emmanuel Blindauer <manu@agat.net>
* Samuel Hocevar <sam@zoy.org>
......@@ -97,6 +97,7 @@ static int Open( vlc_object_t *p_this )
}
p_aout->output.pf_play = Play;
aout_VolumeSoftInit( p_aout );
p_sys->stream = NULL;
......
......@@ -2,7 +2,7 @@
* esd.c : EsounD module
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: esd.c,v 1.12 2002/08/30 23:27:06 massiot Exp $
* $Id: esd.c,v 1.13 2002/09/18 21:21:23 massiot Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -87,6 +87,7 @@ static int Open( vlc_object_t *p_this )
p_aout->output.p_sys = p_sys;
p_aout->output.pf_play = Play;
aout_VolumeSoftInit( p_aout );
/* Initialize some variables */
p_sys->esd_format = ESD_BITS16 | ESD_STREAM | ESD_PLAY;
......
......@@ -2,7 +2,7 @@
* file.c : audio output which writes the samples to a file
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: file.c,v 1.10 2002/08/30 23:27:06 massiot Exp $
* $Id: file.c,v 1.11 2002/09/18 21:21:23 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -92,6 +92,7 @@ static int Open( vlc_object_t * p_this )
if ( p_file == NULL ) return -1;
p_aout->output.pf_play = Play;
aout_VolumeSoftInit( p_aout );
while ( *ppsz_compare != NULL )
{
......
......@@ -2,7 +2,7 @@
* oss.c : OSS /dev/dsp module for vlc
*****************************************************************************
* Copyright (C) 2000-2002 VideoLAN
* $Id: oss.c,v 1.25 2002/09/14 20:51:11 stef Exp $
* $Id: oss.c,v 1.26 2002/09/18 21:21:23 massiot Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -164,11 +164,15 @@ static int Open( vlc_object_t *p_this )
p_aout->output.i_nb_samples = A52_FRAME_NB;
p_aout->output.output.i_bytes_per_frame = AOUT_SPDIF_SIZE;
p_aout->output.output.i_frame_length = A52_FRAME_NB;
aout_VolumeNoneInit( p_aout );
}
else
{
p_aout->output.output.i_format = i_format = AOUT_FMT_S16_NE;
p_aout->output.i_nb_samples = FRAME_SIZE;
aout_VolumeSoftInit( p_aout );
}
if( ioctl( p_sys->i_fd, SNDCTL_DSP_SETFMT, &i_format ) < 0
......
......@@ -2,7 +2,7 @@
* sdl.c : SDL audio output plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2002 VideoLAN
* $Id: sdl.c,v 1.11 2002/09/02 23:17:05 massiot Exp $
* $Id: sdl.c,v 1.12 2002/09/18 21:21:23 massiot Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -86,6 +86,7 @@ static int Open ( vlc_object_t *p_this )
p_aout->output.pf_play = Play;
aout_VolumeSoftInit( p_aout );
#ifndef WIN32
/* Win32 SDL implementation doesn't support SDL_INIT_EVENTTHREAD yet*/
i_flags |= SDL_INIT_EVENTTHREAD;
......
......@@ -2,7 +2,7 @@
* waveout.c : Windows waveOut plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: waveout.c,v 1.6 2002/08/30 23:27:06 massiot Exp $
* $Id: waveout.c,v 1.7 2002/09/18 21:21:23 massiot Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -101,6 +101,7 @@ static int Open( vlc_object_t *p_this )
}
p_aout->output.pf_play = Play;
aout_VolumeSoftInit( p_aout );
/* calculate the frame size in bytes */
p_aout->output.p_sys->i_buffer_size = FRAME_SIZE * sizeof(s16)
......
......@@ -2,7 +2,7 @@
* aout.cpp: BeOS audio output
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: AudioOutput.cpp,v 1.7 2002/08/30 23:27:06 massiot Exp $
* $Id: AudioOutput.cpp,v 1.8 2002/09/18 21:21:23 massiot Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -110,6 +110,7 @@ int E_(OpenAudio) ( vlc_object_t * p_this )
}
p_aout->output.pf_play = Play;
aout_VolumeSoftInit( p_aout );
return 0;
}
......
......@@ -2,7 +2,7 @@
* aout.m: CoreAudio output plugin
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: aout.m,v 1.9 2002/09/02 23:17:05 massiot Exp $
* $Id: aout.m,v 1.10 2002/09/18 21:21:24 massiot Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
......@@ -99,6 +99,7 @@ int E_(OpenAudio)( vlc_object_t * p_this )
}
p_aout->output.pf_play = Play;
aout_VolumeSoftInit( p_aout );
/* Get a description of the data format used by the device */
i_param_size = sizeof( p_sys->stream_format );
......
......@@ -106,6 +106,7 @@ int E_(OpenAudio)( vlc_object_t *p_this )
p_aout->output.p_sys->p_silent_buffer = malloc( DEFAULT_FRAME_SIZE * 4 );
p_aout->output.pf_play = Play;
aout_VolumeSoftInit( p_aout );
memset( &pi, 0, sizeof(pi) );
memset( &pp, 0, sizeof(pp) );
......
......@@ -2,7 +2,7 @@
* aout_dummy.c : dummy audio output plugin
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: aout.c,v 1.8 2002/08/30 23:27:06 massiot Exp $
* $Id: aout.c,v 1.9 2002/09/18 21:21:24 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -48,6 +48,7 @@ int E_(OpenAudio) ( vlc_object_t * p_this )
aout_instance_t * p_aout = (aout_instance_t *)p_this;
p_aout->output.pf_play = Play;
aout_VolumeSoftInit( p_aout );
if ( p_aout->output.output.i_format == AOUT_FMT_SPDIF )
{
......
......@@ -2,7 +2,7 @@
* aout.c: Windows DirectX audio output method
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: aout.c,v 1.9 2002/08/30 23:27:06 massiot Exp $
* $Id: aout.c,v 1.10 2002/09/18 21:21:24 massiot Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -129,6 +129,7 @@ int E_(OpenAudio) ( vlc_object_t *p_this )
vlc_mutex_init( p_aout, &p_aout->output.p_sys->buffer_lock );
p_aout->output.pf_play = Play;
aout_VolumeSoftInit( p_aout );
/* Initialise DirectSound */
if( DirectxInitDSound( p_aout ) )
......
......@@ -2,7 +2,7 @@
* intf.c : audio output API towards the interface modules
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: intf.c,v 1.1 2002/09/16 20:46:38 massiot Exp $
* $Id: intf.c,v 1.2 2002/09/18 21:21:24 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -217,7 +217,21 @@ int aout_VolumeDown( aout_instance_t * p_aout, int i_nb_steps,
/* Meant to be called by the output plug-in's Open(). */
void aout_VolumeSoftInit( aout_instance_t * p_aout )
{
p_aout->output.i_volume = AOUT_VOLUME_DEFAULT;
int i_volume;
i_volume = config_GetInt( p_aout, "volume" );
if ( i_volume == -1 )
{
p_aout->output.i_volume = AOUT_VOLUME_DEFAULT;
}
else
{
p_aout->output.i_volume = i_volume;
}
p_aout->output.pf_volume_infos = aout_VolumeSoftInfos;
p_aout->output.pf_volume_get = aout_VolumeSoftGet;
p_aout->output.pf_volume_set = aout_VolumeSoftSet;
}
/* Placeholder for pf_volume_infos(). */
......@@ -246,3 +260,37 @@ int aout_VolumeSoftSet( aout_instance_t * p_aout,
return 0;
}
/*
* The next functions are not supposed to be called by the interface, but
* are placeholders for unsupported scaling.
*/
/* Meant to be called by the output plug-in's Open(). */
void aout_VolumeNoneInit( aout_instance_t * p_aout )
{
p_aout->output.pf_volume_infos = aout_VolumeNoneInfos;
p_aout->output.pf_volume_get = aout_VolumeNoneGet;
p_aout->output.pf_volume_set = aout_VolumeNoneSet;
}
/* Placeholder for pf_volume_infos(). */
int aout_VolumeNoneInfos( aout_instance_t * p_aout,
audio_volume_t * pi_low_soft,
audio_volume_t * pi_high_soft )
{
return -1;
}
/* Placeholder for pf_volume_get(). */
int aout_VolumeNoneGet( aout_instance_t * p_aout, audio_volume_t * pi_volume )
{
return -1;
}
/* Placeholder for pf_volume_set(). */
int aout_VolumeNoneSet( aout_instance_t * p_aout, audio_volume_t i_volume )
{
return -1;
}
......@@ -182,6 +182,8 @@ static const char * module_error( char *psz_buffer )
(p_symbols)->aout_OutputNextBuffer_inner = aout_OutputNextBuffer; \
(p_symbols)->aout_FormatNbChannels_inner = aout_FormatNbChannels; \
(p_symbols)->aout_FifoPop_inner = aout_FifoPop; \
(p_symbols)->aout_VolumeSoftInit_inner = aout_VolumeSoftInit; \
(p_symbols)->aout_VolumeNoneInit_inner = aout_VolumeNoneInit; \
(p_symbols)->__aout_NewInstance_inner = __aout_NewInstance; \
(p_symbols)->aout_DeleteInstance_inner = aout_DeleteInstance; \
(p_symbols)->aout_BufferNew_inner = aout_BufferNew; \
......@@ -194,6 +196,11 @@ static const char * module_error( char *psz_buffer )
(p_symbols)->aout_DateIncrement_inner = aout_DateIncrement; \
(p_symbols)->__aout_InputNew_inner = __aout_InputNew; \
(p_symbols)->aout_InputDelete_inner = aout_InputDelete; \
(p_symbols)->aout_VolumeGet_inner = aout_VolumeGet; \
(p_symbols)->aout_VolumeSet_inner = aout_VolumeSet; \
(p_symbols)->aout_VolumeInfos_inner = aout_VolumeInfos; \
(p_symbols)->aout_VolumeUp_inner = aout_VolumeUp; \
(p_symbols)->aout_VolumeDown_inner = aout_VolumeDown; \
(p_symbols)->__config_GetInt_inner = __config_GetInt; \
(p_symbols)->__config_PutInt_inner = __config_PutInt; \
(p_symbols)->__config_GetFloat_inner = __config_GetFloat; \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment