]> git.sesse.net Git - vlc/blob - src/ac3_spdif/ac3_iec958.h
025507ae670c3db381e8fe989fb0ebebdac423f4
[vlc] / src / ac3_spdif / ac3_iec958.h
1 /*****************************************************************************
2  * ac3_iec958.h: ac3 to spdif converter headers
3  *****************************************************************************
4  * Copyright (C) 2001 VideoLAN
5  * $Id: ac3_iec958.h,v 1.1 2001/04/29 02:48:51 stef Exp $
6  *
7  * Authors: Stéphane Borel <stef@via.ecp.fr>
8  *          Juha Yrjola <jyrjola@cc.hut.fi>
9  *          German Gomez Garcia <german@piraos.com>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  * 
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
24  ****************************************************************************/
25
26 #ifndef _AC3_IEC958_H
27 #define _AC3_IEC958_H
28
29 /****************************************************************************
30  * information about ac3 frame
31  ****************************************************************************/
32 typedef struct ac3_info_s
33 {
34     int i_bit_rate;
35     int i_frame_size;
36     int i_sample_rate;
37     int i_bs_mod;
38 } ac3_info_t;
39
40 typedef struct sync_frame_s
41 {
42     struct syncinfo
43     {
44         u8      syncword[2];
45         u8      crc1[2];
46         u8      code;
47     } syncinfo;
48
49     struct bsi
50     {
51         u8      bsidmod;
52         u8      acmod;
53     } bsi;
54 } sync_frame_t;
55
56 /****************************************************************************
57  * Prototypes
58  ****************************************************************************/
59 void    ac3_iec958_build_burst      ( int, u8 *, u8 * );
60 int     ac3_iec958_parse_syncinfo   ( struct ac3_spdif_thread_s *,
61                                       struct ac3_info_s *, u8 * );
62 #endif