input: add an input_item_t arg to input_CreateFilename()
[vlc.git] / modules / audio_output / adummy.c
blobfb342fc73243657b75fd475913cc3978c97c85e5
1 /*****************************************************************************
2 * adummy.c : dummy audio output plugin
3 *****************************************************************************
4 * Copyright (C) 2002 VLC authors and VideoLAN
5 * $Id$
7 * Authors: Christophe Massiot <massiot@via.ecp.fr>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
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 Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #ifdef HAVE_CONFIG_H
25 # include "config.h"
26 #endif
28 #include <vlc_common.h>
29 #include <vlc_plugin.h>
30 #include <vlc_aout.h>
31 #include <vlc_cpu.h>
33 static int Open( vlc_object_t * p_this );
35 vlc_module_begin ()
36 set_shortname( N_("Dummy") )
37 set_description( N_("Dummy audio output") )
38 set_capability( "audio output", 0 )
39 set_callbacks( Open, NULL )
40 add_shortcut( "dummy" )
41 vlc_module_end ()
43 #define A52_FRAME_NB 1536
45 static void Play(audio_output_t *aout, block_t *block, vlc_tick_t date)
47 block_Release( block );
48 (void) aout; (void) date;
51 static void Pause(audio_output_t *aout, bool paused, vlc_tick_t date)
53 (void) aout; (void) paused; (void) date;
56 static void Flush(audio_output_t *aout, bool wait)
58 (void) aout; (void) wait;
61 static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
63 (void) aout;
65 switch (fmt->i_format)
67 case VLC_CODEC_A52:
68 case VLC_CODEC_EAC3:
69 fmt->i_format = VLC_CODEC_SPDIFL;
70 fmt->i_bytes_per_frame = 4;
71 fmt->i_frame_length = 1;
72 break;
73 case VLC_CODEC_DTS:
74 case VLC_CODEC_TRUEHD:
75 case VLC_CODEC_MLP:
76 fmt->i_format = VLC_CODEC_SPDIFL;
77 fmt->i_rate = 768000;
78 fmt->i_bytes_per_frame = 16;
79 fmt->i_frame_length = 1;
80 break;
81 default:
82 assert(AOUT_FMT_LINEAR(fmt));
83 assert(aout_FormatNbChannels(fmt) > 0);
84 fmt->i_format = HAVE_FPU ? VLC_CODEC_FL32 : VLC_CODEC_S16N;
85 fmt->channel_type = AUDIO_CHANNEL_TYPE_BITMAP;
86 break;
89 return VLC_SUCCESS;
92 static int Open(vlc_object_t *obj)
94 audio_output_t *aout = (audio_output_t *)obj;
96 aout->start = Start;
97 aout->time_get = aout_TimeGetDefault;
98 aout->play = Play;
99 aout->pause = Pause;
100 aout->flush = Flush;
101 aout->stop = NULL;
102 aout->volume_set = NULL;
103 aout->mute_set = NULL;
104 return VLC_SUCCESS;