]> git.sesse.net Git - vlc/blob - include/audio_decoder.h
ad9fc38087e45277a9422817e866b15ced526212
[vlc] / include / audio_decoder.h
1 /******************************************************************************
2  * audio_decoder.h : audio decoder thread interface
3  * (c)1999 VideoLAN
4  ******************************************************************************
5  * = Prototyped functions are implemented in audio_decoder/audio_decoder.c
6  *
7  * = Required headers :
8  *   - "common.h"                                    ( u32, byte_t, boolean_t )
9  *   - "vlc_thread.h"                                          ( vlc_thread_t )
10  *   - "input.h"                                ( ts_packet_t, input_thread_t )
11  *   - "decoder_fifo.h"                                      ( decoder_fifo_t )
12  *   - "audio_output.h"                          ( aout_fifo_t, aout_thread_t )
13  *
14  * = - LSb = Least Significant bit
15  *   - LSB = Least Significant Byte
16  *
17  * = - MSb = Most Significant bit
18  *   - MSB = Most Significant Byte
19  ******************************************************************************/
20
21 /*
22  * TODO :
23  * - Etudier /usr/include/asm/bitops.h d'un peu plus près, bien qu'il ne me
24  *   semble pas être possible d'utiliser ces fonctions ici
25  * - N'y aurait-t-il pas moyen de se passer d'un buffer de bits, en travaillant
26  *   directement sur le flux PES ?
27  */
28
29 /******************************************************************************
30  * adec_bank_t
31  ******************************************************************************/
32 typedef struct adec_bank_s
33 {
34     float               v1[512];
35     float               v2[512];
36     float *             actual;
37     int                 pos;
38
39 } adec_bank_t;
40
41 /******************************************************************************
42  * adec_thread_t : audio decoder thread descriptor
43  ******************************************************************************
44  * This type describes an audio decoder thread
45  ******************************************************************************/
46 typedef struct adec_thread_s
47 {
48     /*
49      * Thread properties
50      */
51     vlc_thread_t        thread_id;                 /* id for thread functions */
52     boolean_t           b_die;                                  /* `die' flag */
53     boolean_t           b_error;                              /* `error' flag */
54
55     /*
56      * Input properties
57      */
58     decoder_fifo_t      fifo;                   /* stores the PES stream data */
59     /* The bit stream structure handles the PES stream at the bit level */
60     bit_stream_t        bit_stream;
61
62     /*
63      * Decoder properties
64      */
65     adec_bank_t         bank_0;
66     adec_bank_t         bank_1;
67
68     /*
69      * Output properties
70      */
71     aout_fifo_t *       p_aout_fifo;  /* stores the decompressed audio frames */
72     aout_thread_t *     p_aout;            /* needed to create the audio fifo */
73
74 } adec_thread_t;
75
76 /******************************************************************************
77  * Prototypes
78  ******************************************************************************/
79 adec_thread_t * adec_CreateThread       ( input_thread_t * p_input /* !! , aout_thread_t * p_aout !! */ );
80 void            adec_DestroyThread      ( adec_thread_t * p_adec );