26# ifndef LIBMAD_STREAM_H
27# define LIBMAD_STREAM_H
31# define MAD_BUFFER_GUARD 8
32# define MAD_BUFFER_MDLEN (511 + 2048 + MAD_BUFFER_GUARD)
35 MAD_ERROR_NONE = 0x0000,
37 MAD_ERROR_BUFLEN = 0x0001,
38 MAD_ERROR_BUFPTR = 0x0002,
40 MAD_ERROR_NOMEM = 0x0031,
42 MAD_ERROR_LOSTSYNC = 0x0101,
43 MAD_ERROR_BADLAYER = 0x0102,
44 MAD_ERROR_BADBITRATE = 0x0103,
45 MAD_ERROR_BADSAMPLERATE = 0x0104,
46 MAD_ERROR_BADEMPHASIS = 0x0105,
48 MAD_ERROR_BADCRC = 0x0201,
49 MAD_ERROR_BADBITALLOC = 0x0211,
50 MAD_ERROR_BADSCALEFACTOR = 0x0221,
51 MAD_ERROR_BADMODE = 0x0222,
52 MAD_ERROR_BADFRAMELEN = 0x0231,
53 MAD_ERROR_BADBIGVALUES = 0x0232,
54 MAD_ERROR_BADBLOCKTYPE = 0x0233,
55 MAD_ERROR_BADSCFSI = 0x0234,
56 MAD_ERROR_BADDATAPTR = 0x0235,
57 MAD_ERROR_BADPART3LEN = 0x0236,
58 MAD_ERROR_BADHUFFTABLE = 0x0237,
59 MAD_ERROR_BADHUFFDATA = 0x0238,
60 MAD_ERROR_BADSTEREO = 0x0239
63# define MAD_RECOVERABLE(error) ((error) & 0xff00)
66 unsigned char const *buffer;
67 unsigned char const *bufend;
68 unsigned long skiplen;
71 unsigned long freerate;
73 unsigned char const *this_frame;
74 unsigned char const *next_frame;
75 struct mad_bitptr ptr;
77 struct mad_bitptr anc_ptr;
78 unsigned int anc_bitlen;
80 unsigned char (*main_data)[MAD_BUFFER_MDLEN];
89 MAD_OPTION_IGNORECRC = 0x0001,
90 MAD_OPTION_HALFSAMPLERATE = 0x0002
92 MAD_OPTION_LEFTCHANNEL = 0x0010,
93 MAD_OPTION_RIGHTCHANNEL = 0x0020,
94 MAD_OPTION_SINGLECHANNEL = 0x0030
101# define mad_stream_options(stream, opts) \
102 ((void) ((stream)->options = (opts)))
105 unsigned char const *,
unsigned long);
106void mad_stream_skip(
struct mad_stream *,
unsigned long);
110char const *mad_stream_errorstr(
struct mad_stream const *);