]> git.sesse.net Git - vlc/blob - include/audio_decoder.h
Encore un commit venu tout droit des abysses de l'enfer, d�sol� pour
[vlc] / include / audio_decoder.h
1 /*****************************************************************************
2  * audio_decoder.h : audio decoder thread interface
3  *****************************************************************************
4  * Copyright (C) 1999, 2000 VideoLAN
5  *
6  * Authors:
7  *
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.
12  *
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.
17  *
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  *****************************************************************************/
23
24 /*****************************************************************************
25  * = Prototyped functions are implemented in audio_decoder/audio_decoder.c
26  *
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 )
33  *
34  * = - LSb = Least Significant bit
35  *   - LSB = Least Significant Byte
36  *
37  * = - MSb = Most Significant bit
38  *   - MSB = Most Significant Byte
39  *****************************************************************************/
40
41 /*
42  * TODO :
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 ?
47  */
48
49 #define ADEC_FRAME_SIZE 384
50
51 /*****************************************************************************
52  * adec_frame_t
53  *****************************************************************************/
54 typedef s16 adec_frame_t[ ADEC_FRAME_SIZE ];
55
56 /*****************************************************************************
57  * adec_bank_t
58  *****************************************************************************/
59 typedef struct adec_bank_s
60 {
61     float               v1[512];
62     float               v2[512];
63     float *             actual;
64     int                 pos;
65
66 } adec_bank_t;
67
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
74 {
75     /*
76      * Thread properties
77      */
78     vlc_thread_t        thread_id;                /* id for thread functions */
79     boolean_t           b_die;                                 /* `die' flag */
80     boolean_t           b_error;                             /* `error' flag */
81
82     /*
83      * Input properties
84      */
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;
88
89     /*
90      * Decoder properties
91      */
92     adec_bank_t         bank_0;
93     adec_bank_t         bank_1;
94
95     /*
96      * Output properties
97      */
98     aout_fifo_t *       p_aout_fifo; /* stores the decompressed audio frames */
99     aout_thread_t *     p_aout;           /* needed to create the audio fifo */
100
101 } adec_thread_t;
102
103 /*****************************************************************************
104  * Prototypes
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 );