]> git.sesse.net Git - vlc/blob - modules/audio_output/adummy.c
Update NEWS, LIST and po for DASH
[vlc] / modules / audio_output / adummy.c
1 /*****************************************************************************
2  * adummy.c : dummy audio output plugin
3  *****************************************************************************
4  * Copyright (C) 2002 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Christophe Massiot <massiot@via.ecp.fr>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 /*****************************************************************************
25  * Preamble
26  *****************************************************************************/
27
28 #ifdef HAVE_CONFIG_H
29 # include "config.h"
30 #endif
31
32 #include <vlc_common.h>
33 #include <vlc_plugin.h>
34 #include <vlc_aout.h>
35 #include <vlc_cpu.h>
36
37 static int Open( vlc_object_t * p_this );
38
39 vlc_module_begin ()
40     set_shortname( N_("Dummy") )
41     set_description( N_("Dummy audio output") )
42     set_capability( "audio output", 0 )
43     set_callbacks( Open, NULL )
44     add_shortcut( "dummy" )
45 vlc_module_end ()
46
47 #define A52_FRAME_NB 1536
48
49 /*****************************************************************************
50  * Local prototypes.
51  *****************************************************************************/
52 static void Play( audio_output_t *, block_t * );
53
54 /*****************************************************************************
55  * OpenAudio: open a dummy audio device
56  *****************************************************************************/
57 static int Open( vlc_object_t * p_this )
58 {
59     audio_output_t * p_aout = (audio_output_t *)p_this;
60
61     p_aout->pf_play = Play;
62     p_aout->pf_pause = NULL;
63     p_aout->pf_flush = NULL;
64     aout_VolumeSoftInit( p_aout );
65
66     if( AOUT_FMT_SPDIF( &p_aout->format )
67      && var_InheritBool( p_this, "spdif" ) )
68     {
69         p_aout->format.i_format = VLC_CODEC_SPDIFL;
70         p_aout->format.i_bytes_per_frame = AOUT_SPDIF_SIZE;
71         p_aout->format.i_frame_length = A52_FRAME_NB;
72     }
73     else
74         p_aout->format.i_format = HAVE_FPU ? VLC_CODEC_FL32 : VLC_CODEC_S16N;
75
76     /* Create the variable for the audio-device */
77     var_Create( p_aout, "audio-device", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
78
79     return VLC_SUCCESS;
80 }
81
82 /*****************************************************************************
83  * Play: pretend to play a sound
84  *****************************************************************************/
85 static void Play( audio_output_t *aout, block_t *block )
86 {
87     block_Release( block );
88     (void) aout;
89 }