]> git.sesse.net Git - vlc/blob - plugins/ac3_spdif/ac3_spdif.h
3a6edffef293cd28ffc60bd9d290d04b18e99a53
[vlc] / plugins / ac3_spdif / ac3_spdif.h
1 /*****************************************************************************
2  * ac3_spdif.h: header for ac3 pass-through
3  *****************************************************************************
4  * Copyright (C) 2001 VideoLAN
5  * $Id: ac3_spdif.h,v 1.3 2002/03/15 01:47:16 stef Exp $
6  *
7  * Authors: Stéphane Borel <stef@via.ecp.fr>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  * 
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 General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  ****************************************************************************/
23
24 /****************************************************************************
25  * information about ac3 frame
26  ****************************************************************************/
27 typedef struct sync_frame_s
28 {
29     struct syncinfo
30     {
31         u8      syncword[2];
32         u8      crc1[2];
33         u8      code;
34     } syncinfo;
35
36     struct bsi
37     {
38         u8      bsidmod;
39         u8      acmod;
40     } bsi;
41 } sync_frame_t;
42
43 typedef struct frame_size_s
44 {
45     u16     i_bit_rate;
46     u16     i_frame_size[3];
47 } frame_size_t;                
48
49 typedef struct ac3_info_s
50 {
51     int i_bit_rate;
52     int i_frame_size;
53     int i_sample_rate;
54     int i_bs_mod;
55 } ac3_info_t;
56
57 /*****************************************************************************
58  * ac3_spdif_thread_t : ac3 pass-through thread descriptor
59  *****************************************************************************/
60 typedef struct ac3_spdif_thread_s
61 {
62     /*
63      * Thread properties
64      */
65     vlc_thread_t        thread_id;                /* id for thread functions */
66
67     /*
68      * Input properties
69      */
70     decoder_fifo_t *    p_fifo;                /* stores the PES stream data */
71     decoder_config_t *  p_config;
72
73     /* The bit stream structure handles the PES stream at the bit level */
74     bit_stream_t        bit_stream;
75     int                 i_available;
76
77     /*
78      * Decoder properties
79      */
80     ac3_info_t          ac3_info;
81     u8 *                p_ac3;
82
83     /* current pes date */
84     mtime_t             i_pts;
85     mtime_t             i_real_pts;
86
87     /*
88      * Output properties
89      */
90     int                 i_previous_format;
91     aout_fifo_t *       p_aout_fifo; /* stores the decompressed audio frames */
92
93 } ac3_spdif_thread_t;
94