1 /*****************************************************************************
2 * audio_decoder.h : audio decoder thread interface
3 *****************************************************************************
4 * Copyright (C) 1999, 2000 VideoLAN
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public
19 * License along with this program; if not, write to the
20 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 * Boston, MA 02111-1307, USA.
22 *****************************************************************************/
24 /*****************************************************************************
25 * = Prototyped functions are implemented in audio_decoder/audio_decoder.c
27 * = Required headers :
28 * - "common.h" ( u32, byte_t, boolean_t )
29 * - "threads.h" ( vlc_thread_t )
30 * - "input.h" ( ts_packet_t, input_thread_t )
31 * - "decoder_fifo.h" ( decoder_fifo_t )
32 * - "audio_output.h" ( aout_fifo_t, aout_thread_t )
34 * = - LSb = Least Significant bit
35 * - LSB = Least Significant Byte
37 * = - MSb = Most Significant bit
38 * - MSB = Most Significant Byte
39 *****************************************************************************/
43 * - Etudier /usr/include/asm/bitops.h d'un peu plus près, bien qu'il ne me
44 * semble pas être possible d'utiliser ces fonctions ici
45 * - N'y aurait-t-il pas moyen de se passer d'un buffer de bits, en travaillant
46 * directement sur le flux PES ?
49 #define ADEC_FRAME_SIZE 384
51 /*****************************************************************************
53 *****************************************************************************/
54 typedef s16 adec_frame_t[ ADEC_FRAME_SIZE ];
56 /*****************************************************************************
58 *****************************************************************************/
59 typedef struct adec_bank_s
68 /*****************************************************************************
69 * adec_thread_t : audio decoder thread descriptor
70 *****************************************************************************
71 * This type describes an audio decoder thread
72 *****************************************************************************/
73 typedef struct adec_thread_s
78 vlc_thread_t thread_id; /* id for thread functions */
79 boolean_t b_die; /* `die' flag */
80 boolean_t b_error; /* `error' flag */
85 decoder_fifo_t fifo; /* stores the PES stream data */
86 /* The bit stream structure handles the PES stream at the bit level */
87 bit_stream_t bit_stream;
98 aout_fifo_t * p_aout_fifo; /* stores the decompressed audio frames */
99 aout_thread_t * p_aout; /* needed to create the audio fifo */
103 /*****************************************************************************
105 *****************************************************************************/
106 adec_thread_t * adec_CreateThread ( input_thread_t * p_input /* !! , aout_thread_t * p_aout !! */ );
107 void adec_DestroyThread ( adec_thread_t * p_adec );