Changeset 35b474003dac21d775f8c37f0c68e40e65bf2e9b

Show
Ignore:
Timestamp:
18/09/02 23:21:24 (6 years ago)
Author:
Christophe Massiot <massiot@videolan.org>
git-committer:
Christophe Massiot <massiot@videolan.org> 1032384084 +0000
git-parent:

[df657969f789310b72a96fc5fbe227f375f4a839]

git-author:
Christophe Massiot <massiot@videolan.org> 1032384084 +0000
Message:

* ALL: More hooks for audio volume management.
* configure.in: Fixed a typo.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Makefile.old

    rc02a9ef r35b4740  
    2323INPUT := input input_ext-plugins input_ext-dec input_ext-intf input_dec input_programs input_clock input_info 
    2424VIDEO_OUTPUT := video_output video_text vout_pictures vout_subpictures 
    25 AUDIO_OUTPUT := audio_output filters input mixer output 
     25AUDIO_OUTPUT := audio_output filters input mixer output intf 
    2626STREAM_OUTPUT := stream_output 
    2727MISC := mtime modules threads cpu configuration netutils iso_lang messages objects extras 
  • configure.in

    rfd0bc41 r35b4740  
    13931393  then 
    13941394    test_LDFLAGS="-L${QTDIR}/lib" 
    1395     test_CFLAGS="-I$(QTDIR)/include" 
     1395    test_CFLAGS="-I${QTDIR}/include" 
    13961396  else 
    13971397    test_LDFLAGS="-L${with_qte}/lib" 
  • include/aout_internal.h

    rcf891ba r35b4740  
    33 ***************************************************************************** 
    44 * Copyright (C) 2002 VideoLAN 
    5  * $Id: aout_internal.h,v 1.17 2002/09/16 20:46:37 massiot Exp $ 
     5 * $Id: aout_internal.h,v 1.18 2002/09/18 21:21:23 massiot Exp $ 
    66 * 
    77 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    211211 * Prototypes 
    212212 *****************************************************************************/ 
     213/* From input.c : */ 
    213214void aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input, 
    214215                     aout_buffer_t * p_buffer ); 
    215216 
     217/* From filters.c : */ 
    216218int aout_FiltersCreatePipeline( aout_instance_t * p_aout, 
    217219                                aout_filter_t ** pp_filters, 
     
    229231                       int i_nb_filters, aout_buffer_t ** pp_input_buffer ); 
    230232 
     233/* From mixer.c : */ 
    231234int aout_MixerNew( aout_instance_t * p_aout ); 
    232235void aout_MixerDelete( aout_instance_t * p_aout ); 
     
    235238int aout_MixerMultiplierGet( aout_instance_t * p_aout, float * pf_multiplier ); 
    236239 
     240/* From output.c : */ 
    237241int aout_OutputNew( aout_instance_t * p_aout, 
    238242                    audio_sample_format_t * p_format ); 
     
    241245VLC_EXPORT( aout_buffer_t *, aout_OutputNextBuffer, ( aout_instance_t *, mtime_t, vlc_bool_t ) ); 
    242246 
     247/* From audio_output.c : */ 
    243248VLC_EXPORT( int, aout_FormatNbChannels, ( audio_sample_format_t * p_format ) ); 
    244249void aout_FormatPrepare( audio_sample_format_t * p_format ); 
     
    251256void aout_FifoDestroy( aout_instance_t * p_aout, aout_fifo_t * p_fifo ); 
    252257 
     258/* From intf.c :*/ 
     259VLC_EXPORT( void, aout_VolumeSoftInit, ( aout_instance_t * ) ); 
     260int aout_VolumeSoftGet( aout_instance_t *, audio_volume_t * ); 
     261int aout_VolumeSoftSet( aout_instance_t *, audio_volume_t ); 
     262int aout_VolumeSoftInfos( aout_instance_t *, audio_volume_t *, audio_volume_t * ); 
     263VLC_EXPORT( void, aout_VolumeNoneInit, ( aout_instance_t * ) ); 
     264int aout_VolumeNoneGet( aout_instance_t *, audio_volume_t * ); 
     265int aout_VolumeNoneSet( aout_instance_t *, audio_volume_t ); 
     266int aout_VolumeNoneInfos( aout_instance_t *, audio_volume_t *, audio_volume_t * ); 
     267 
  • include/audio_output.h

    rcf891ba r35b4740  
    33 ***************************************************************************** 
    44 * Copyright (C) 2002 VideoLAN 
    5  * $Id: audio_output.h,v 1.63 2002/09/16 20:46:37 massiot Exp $ 
     5 * $Id: audio_output.h,v 1.64 2002/09/18 21:21:23 massiot Exp $ 
    66 * 
    77 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    167167 
    168168/***************************************************************************** 
    169  * audio_volume_t : integer value for the audio volume 
    170  *****************************************************************************/ 
    171 typedef unsigned int audio_volume_t; 
    172  
    173 /***************************************************************************** 
    174169 * Prototypes 
    175170 *****************************************************************************/ 
     
    193188 
    194189/* From intf.c : */ 
     190VLC_EXPORT( int, aout_VolumeGet, ( aout_instance_t *, audio_volume_t * ) ); 
     191VLC_EXPORT( int, aout_VolumeSet, ( aout_instance_t *, audio_volume_t ) ); 
     192VLC_EXPORT( int, aout_VolumeInfos, ( aout_instance_t *, audio_volume_t *, audio_volume_t * ) ); 
     193VLC_EXPORT( int, aout_VolumeUp, ( aout_instance_t *, int, audio_volume_t * ) ); 
     194VLC_EXPORT( int, aout_VolumeDown, ( aout_instance_t *, int, audio_volume_t * ) ); 
    195195 
  • include/vlc_common.h

    r0b88e77 r35b4740  
    44 ***************************************************************************** 
    55 * Copyright (C) 1998, 1999, 2000 VideoLAN 
    6  * $Id: vlc_common.h,v 1.26 2002/08/30 22:22:24 massiot Exp $ 
     6 * $Id: vlc_common.h,v 1.27 2002/09/18 21:21:23 massiot Exp $ 
    77 * 
    88 * Authors: Samuel Hocevar <sam@via.ecp.fr> 
     
    114114/* Video buffer types */ 
    115115typedef u8                  yuv_data_t; 
     116 
     117/* Audio volume */ 
     118typedef u16                 audio_volume_t; 
    116119 
    117120/***************************************************************************** 
  • include/vlc_symbols.h

    r34c7196 r35b4740  
    3939    int (* __vlc_threads_init_inner) ( vlc_object_t * ) ; 
    4040    int (* aout_FormatNbChannels_inner) ( audio_sample_format_t * p_format ) ; 
     41    int (* aout_VolumeDown_inner) ( aout_instance_t *, int, audio_volume_t * ) ; 
     42    int (* aout_VolumeGet_inner) ( aout_instance_t *, audio_volume_t * ) ; 
     43    int (* aout_VolumeInfos_inner) ( aout_instance_t *, audio_volume_t *, audio_volume_t * ) ; 
     44    int (* aout_VolumeSet_inner) ( aout_instance_t *, audio_volume_t ) ; 
     45    int (* aout_VolumeUp_inner) ( aout_instance_t *, int, audio_volume_t * ) ; 
    4146    int (* input_AccessInit_inner) ( input_thread_t * ) ; 
    4247    int (* input_AddInfo_inner) ( input_info_category_t *, char *, char *, ... ) ; 
     
    113118    void (* aout_DeleteInstance_inner) ( aout_instance_t * ) ; 
    114119    void (* aout_InputDelete_inner) ( aout_instance_t *, aout_input_t * ) ; 
     120    void (* aout_VolumeNoneInit_inner) ( aout_instance_t * ) ; 
     121    void (* aout_VolumeSoftInit_inner) ( aout_instance_t * ) ; 
    115122    void (* config_Duplicate_inner) ( module_t *, module_config_t * ) ; 
    116123    void (* config_SetCallbacks_inner) ( module_config_t *, module_config_t * ) ; 
     
    229236#   define aout_InputDelete p_symbols->aout_InputDelete_inner 
    230237#   define aout_OutputNextBuffer p_symbols->aout_OutputNextBuffer_inner 
     238#   define aout_VolumeDown p_symbols->aout_VolumeDown_inner 
     239#   define aout_VolumeGet p_symbols->aout_VolumeGet_inner 
     240#   define aout_VolumeInfos p_symbols->aout_VolumeInfos_inner 
     241#   define aout_VolumeNoneInit p_symbols->aout_VolumeNoneInit_inner 
     242#   define aout_VolumeSet p_symbols->aout_VolumeSet_inner 
     243#   define aout_VolumeSoftInit p_symbols->aout_VolumeSoftInit_inner 
     244#   define aout_VolumeUp p_symbols->aout_VolumeUp_inner 
    231245#   define config_Duplicate p_symbols->config_Duplicate_inner 
    232246#   define config_FindConfig p_symbols->config_FindConfig_inner 
  • modules/audio_output/alsa.c

    r0699631 r35b4740  
    33 ***************************************************************************** 
    44 * Copyright (C) 2000-2001 VideoLAN 
    5  * $Id: alsa.c,v 1.10 2002/08/30 23:27:06 massiot Exp $ 
     5 * $Id: alsa.c,v 1.11 2002/09/18 21:21:23 massiot Exp $ 
    66 * 
    77 * Authors: Henri Fallon <henri@videolan.org> - Original Author 
     
    151151                     s[0], s[1], s[2], s[3] ); 
    152152            psz_device = psz_alsadev; 
     153 
     154            aout_VolumeNoneInit( p_aout ); 
    153155        } 
    154156        else 
    155157        { 
    156158            psz_device = "default"; 
     159 
     160            aout_VolumeSoftInit( p_aout ); 
    157161        } 
    158162    } 
  • modules/audio_output/arts.c

    r0699631 r35b4740  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001-2002 VideoLAN 
    5  * $Id: arts.c,v 1.10 2002/08/30 23:27:06 massiot Exp $ 
     5 * $Id: arts.c,v 1.11 2002/09/18 21:21:23 massiot Exp $ 
    66 * 
    77 * Authors: Emmanuel Blindauer <manu@agat.net> 
     
    9898 
    9999    p_aout->output.pf_play = Play; 
     100    aout_VolumeSoftInit( p_aout ); 
    100101 
    101102    p_sys->stream = NULL; 
  • modules/audio_output/esd.c

    r0699631 r35b4740  
    33 ***************************************************************************** 
    44 * Copyright (C) 2000, 2001 VideoLAN 
    5  * $Id: esd.c,v 1.12 2002/08/30 23:27:06 massiot Exp $ 
     5 * $Id: esd.c,v 1.13 2002/09/18 21:21:23 massiot Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    8888 
    8989    p_aout->output.pf_play = Play; 
     90    aout_VolumeSoftInit( p_aout ); 
    9091 
    9192    /* Initialize some variables */ 
  • modules/audio_output/file.c

    r0699631 r35b4740  
    33 ***************************************************************************** 
    44 * Copyright (C) 2002 VideoLAN 
    5  * $Id: file.c,v 1.10 2002/08/30 23:27:06 massiot Exp $ 
     5 * $Id: file.c,v 1.11 2002/09/18 21:21:23 massiot Exp $ 
    66 * 
    77 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    9393 
    9494    p_aout->output.pf_play = Play; 
     95    aout_VolumeSoftInit( p_aout ); 
    9596 
    9697    while ( *ppsz_compare != NULL ) 
  • modules/audio_output/oss.c

    r3518015 r35b4740  
    33 ***************************************************************************** 
    44 * Copyright (C) 2000-2002 VideoLAN 
    5  * $Id: oss.c,v 1.25 2002/09/14 20:51:11 stef Exp $ 
     5 * $Id: oss.c,v 1.26 2002/09/18 21:21:23 massiot Exp $ 
    66 * 
    77 * Authors: Michel Kaempf <maxx@via.ecp.fr> 
     
    165165        p_aout->output.output.i_bytes_per_frame = AOUT_SPDIF_SIZE; 
    166166        p_aout->output.output.i_frame_length = A52_FRAME_NB; 
     167 
     168        aout_VolumeNoneInit( p_aout ); 
    167169    } 
    168170    else 
     
    170172        p_aout->output.output.i_format = i_format = AOUT_FMT_S16_NE; 
    171173        p_aout->output.i_nb_samples = FRAME_SIZE; 
     174 
     175        aout_VolumeSoftInit( p_aout ); 
    172176    } 
    173177 
  • modules/audio_output/sdl.c

    r34c7196 r35b4740  
    33 ***************************************************************************** 
    44 * Copyright (C) 2000-2002 VideoLAN 
    5  * $Id: sdl.c,v 1.11 2002/09/02 23:17:05 massiot Exp $ 
     5 * $Id: sdl.c,v 1.12 2002/09/18 21:21:23 massiot Exp $ 
    66 * 
    77 * Authors: Michel Kaempf <maxx@via.ecp.fr> 
     
    8787    p_aout->output.pf_play = Play; 
    8888 
     89    aout_VolumeSoftInit( p_aout ); 
    8990#ifndef WIN32 
    9091    /* Win32 SDL implementation doesn't support SDL_INIT_EVENTTHREAD yet*/ 
  • modules/audio_output/waveout.c

    r0699631 r35b4740  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: waveout.c,v 1.6 2002/08/30 23:27:06 massiot Exp $ 
     5 * $Id: waveout.c,v 1.7 2002/09/18 21:21:23 massiot Exp $ 
    66 * 
    77 * Authors: Gildas Bazin <gbazin@netcourrier.com> 
     
    102102 
    103103    p_aout->output.pf_play = Play; 
     104    aout_VolumeSoftInit( p_aout ); 
    104105 
    105106    /* calculate the frame size in bytes */ 
  • modules/gui/beos/AudioOutput.cpp

    r0699631 r35b4740  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999, 2000, 2001 VideoLAN 
    5  * $Id: AudioOutput.cpp,v 1.7 2002/08/30 23:27:06 massiot Exp $ 
     5 * $Id: AudioOutput.cpp,v 1.8 2002/09/18 21:21:23 massiot Exp $ 
    66 * 
    77 * Authors: Jean-Marc Dressler <polux@via.ecp.fr> 
     
    111111     
    112112    p_aout->output.pf_play = Play; 
     113    aout_VolumeSoftInit( p_aout ); 
    113114 
    114115    return 0; 
  • modules/gui/macosx/aout.m

    r34c7196 r35b4740  
    33 ***************************************************************************** 
    44 * Copyright (C) 2002 VideoLAN 
    5  * $Id: aout.m,v 1.9 2002/09/02 23:17:05 massiot Exp $ 
     5 * $Id: aout.m,v 1.10 2002/09/18 21:21:24 massiot Exp $ 
    66 * 
    77 * Authors: Colin Delacroix <colin@zoy.org> 
     
    100100 
    101101    p_aout->output.pf_play = Play; 
     102    aout_VolumeSoftInit( p_aout ); 
    102103 
    103104    /* Get a description of the data format used by the device */ 
  • modules/gui/qnx/aout.c

    r0699631 r35b4740  
    107107    p_aout->output.p_sys->p_silent_buffer = malloc( DEFAULT_FRAME_SIZE * 4 ); 
    108108    p_aout->output.pf_play = Play; 
     109    aout_VolumeSoftInit( p_aout ); 
    109110 
    110111    memset( &pi, 0, sizeof(pi) ); 
  • modules/misc/dummy/aout.c

    r0699631 r35b4740  
    33 ***************************************************************************** 
    44 * Copyright (C) 2002 VideoLAN 
    5  * $Id: aout.c,v 1.8 2002/08/30 23:27:06 massiot Exp $ 
     5 * $Id: aout.c,v 1.9 2002/09/18 21:21:24 massiot Exp $ 
    66 * 
    77 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    4949 
    5050    p_aout->output.pf_play = Play; 
     51    aout_VolumeSoftInit( p_aout ); 
    5152 
    5253    if ( p_aout->output.output.i_format == AOUT_FMT_SPDIF ) 
  • modules/video_output/directx/aout.c

    r0699631 r35b4740  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: aout.c,v 1.9 2002/08/30 23:27:06 massiot Exp $ 
     5 * $Id: aout.c,v 1.10 2002/09/18 21:21:24 massiot Exp $ 
    66 * 
    77 * Authors: Gildas Bazin <gbazin@netcourrier.com> 
     
    130130 
    131131    p_aout->output.pf_play = Play; 
     132    aout_VolumeSoftInit( p_aout ); 
    132133 
    133134    /* Initialise DirectSound */ 
  • src/audio_output/intf.c

    rcf891ba r35b4740  
    33 ***************************************************************************** 
    44 * Copyright (C) 2002 VideoLAN 
    5  * $Id: intf.c,v 1.1 2002/09/16 20:46:38 massiot Exp $ 
     5 * $Id: intf.c,v 1.2 2002/09/18 21:21:24 massiot Exp $ 
    66 * 
    77 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    218218void aout_VolumeSoftInit( aout_instance_t * p_aout ) 
    219219{ 
    220     p_aout->output.i_volume = AOUT_VOLUME_DEFAULT; 
     220    int i_volume; 
     221 
     222    i_volume = config_GetInt( p_aout, "volume" ); 
     223    if ( i_volume == -1 ) 
     224    { 
     225        p_aout->output.i_volume = AOUT_VOLUME_DEFAULT; 
     226    } 
     227    else 
     228    { 
     229        p_aout->output.i_volume = i_volume; 
     230    } 
     231 
     232    p_aout->output.pf_volume_infos = aout_VolumeSoftInfos; 
     233    p_aout->output.pf_volume_get = aout_VolumeSoftGet; 
     234    p_aout->output.pf_volume_set = aout_VolumeSoftSet; 
    221235} 
    222236 
     
    247261} 
    248262 
     263/* 
     264 * The next functions are not supposed to be called by the interface, but 
     265 * are placeholders for unsupported scaling. 
     266 */ 
     267 
     268/* Meant to be called by the output plug-in's Open(). */ 
     269void aout_VolumeNoneInit( aout_instance_t * p_aout ) 
     270{ 
     271    p_aout->output.pf_volume_infos = aout_VolumeNoneInfos; 
     272    p_aout->output.pf_volume_get = aout_VolumeNoneGet; 
     273    p_aout->output.pf_volume_set = aout_VolumeNoneSet; 
     274} 
     275 
     276/* Placeholder for pf_volume_infos(). */ 
     277int aout_VolumeNoneInfos( aout_instance_t * p_aout, 
     278                          audio_volume_t * pi_low_soft, 
     279                          audio_volume_t * pi_high_soft ) 
     280{ 
     281    return -1; 
     282} 
     283 
     284/* Placeholder for pf_volume_get(). */ 
     285int aout_VolumeNoneGet( aout_instance_t * p_aout, audio_volume_t * pi_volume ) 
     286{ 
     287    return -1; 
     288} 
     289 
     290 
     291/* Placeholder for pf_volume_set(). */ 
     292int aout_VolumeNoneSet( aout_instance_t * p_aout, audio_volume_t i_volume ) 
     293{ 
     294    return -1; 
     295} 
     296 
  • src/misc/modules_plugin.h

    r34c7196 r35b4740  
    183183    (p_symbols)->aout_FormatNbChannels_inner = aout_FormatNbChannels; \ 
    184184    (p_symbols)->aout_FifoPop_inner = aout_FifoPop; \ 
     185    (p_symbols)->aout_VolumeSoftInit_inner = aout_VolumeSoftInit; \ 
     186    (p_symbols)->aout_VolumeNoneInit_inner = aout_VolumeNoneInit; \ 
    185187    (p_symbols)->__aout_NewInstance_inner = __aout_NewInstance; \ 
    186188    (p_symbols)->aout_DeleteInstance_inner = aout_DeleteInstance; \ 
     
    195197    (p_symbols)->__aout_InputNew_inner = __aout_InputNew; \ 
    196198    (p_symbols)->aout_InputDelete_inner = aout_InputDelete; \ 
     199    (p_symbols)->aout_VolumeGet_inner = aout_VolumeGet; \ 
     200    (p_symbols)->aout_VolumeSet_inner = aout_VolumeSet; \ 
     201    (p_symbols)->aout_VolumeInfos_inner = aout_VolumeInfos; \ 
     202    (p_symbols)->aout_VolumeUp_inner = aout_VolumeUp; \ 
     203    (p_symbols)->aout_VolumeDown_inner = aout_VolumeDown; \ 
    197204    (p_symbols)->__config_GetInt_inner = __config_GetInt; \ 
    198205    (p_symbols)->__config_PutInt_inner = __config_PutInt; \