00001 /***************************************************************************** 00002 * aout_dummy.c : dummy audio output plugin 00003 ***************************************************************************** 00004 * Copyright (C) 2002 the VideoLAN team 00005 * $Id: aout.c 11664 2005-07-09 06:17:09Z courmisch $ 00006 * 00007 * Authors: Christophe Massiot <[email protected]> 00008 * 00009 * This program is free software; you can redistribute it and/or modify 00010 * it under the terms of the GNU General Public License as published by 00011 * the Free Software Foundation; either version 2 of the License, or 00012 * (at your option) any later version. 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 * GNU General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU General Public License 00020 * along with this program; if not, write to the Free Software 00021 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. 00022 *****************************************************************************/ 00023 00024 /***************************************************************************** 00025 * Preamble 00026 *****************************************************************************/ 00027 #include <string.h> 00028 #include <stdlib.h> 00029 00030 #include <vlc/vlc.h> 00031 #include <vlc/aout.h> 00032 00033 #include "aout_internal.h" 00034 00035 #define FRAME_SIZE 2048 00036 #define A52_FRAME_NB 1536 00037 00038 /***************************************************************************** 00039 * Local prototypes. 00040 *****************************************************************************/ 00041 static void Play ( aout_instance_t * ); 00042 00043 /***************************************************************************** 00044 * OpenAudio: open a dummy audio device 00045 *****************************************************************************/ 00046 int E_(OpenAudio) ( vlc_object_t * p_this ) 00047 { 00048 aout_instance_t * p_aout = (aout_instance_t *)p_this; 00049 00050 p_aout->output.pf_play = Play; 00051 aout_VolumeSoftInit( p_aout ); 00052 00053 if ( p_aout->output.output.i_format == VLC_FOURCC('s','p','d','i') ) 00054 { 00055 p_aout->output.i_nb_samples = A52_FRAME_NB; 00056 p_aout->output.output.i_bytes_per_frame = AOUT_SPDIF_SIZE; 00057 p_aout->output.output.i_frame_length = A52_FRAME_NB; 00058 } 00059 else 00060 { 00061 p_aout->output.i_nb_samples = FRAME_SIZE; 00062 } 00063 return 0; 00064 } 00065 00066 /***************************************************************************** 00067 * Play: pretend to play a sound 00068 *****************************************************************************/ 00069 static void Play( aout_instance_t * p_aout ) 00070 { 00071 aout_buffer_t * p_buffer = aout_FifoPop( p_aout, &p_aout->output.fifo ); 00072 aout_BufferFree( p_buffer ); 00073 } 00074