Diffstat (limited to 'core/multimedia/opieplayer/libmad/stream.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/libmad/stream.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/core/multimedia/opieplayer/libmad/stream.h b/core/multimedia/opieplayer/libmad/stream.h index cf3280e..08e6dc5 100644 --- a/core/multimedia/opieplayer/libmad/stream.h +++ b/core/multimedia/opieplayer/libmad/stream.h | |||
@@ -1,14 +1,14 @@ | |||
1 | /* | 1 | /* |
2 | * mad - MPEG audio decoder | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2001 Robert Leslie |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation; either version 2 of the License, or | 7 | * the Free Software Foundation; either version 2 of the License, or |
8 | * (at your option) any later version. | 8 | * (at your option) any later version. |
9 | * | 9 | * |
10 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | 14 | * |
@@ -19,24 +19,26 @@ | |||
19 | * $Id$ | 19 | * $Id$ |
20 | */ | 20 | */ |
21 | 21 | ||
22 | # ifndef LIBMAD_STREAM_H | 22 | # ifndef LIBMAD_STREAM_H |
23 | # define LIBMAD_STREAM_H | 23 | # define LIBMAD_STREAM_H |
24 | 24 | ||
25 | # include "bit.h" | 25 | # include "bit.h" |
26 | 26 | ||
27 | # define MAD_BUFFER_GUARD8 | 27 | # define MAD_BUFFER_GUARD8 |
28 | # define MAD_BUFFER_MDLEN(511 + 2048 + MAD_BUFFER_GUARD) | 28 | # define MAD_BUFFER_MDLEN(511 + 2048 + MAD_BUFFER_GUARD) |
29 | 29 | ||
30 | enum mad_error { | 30 | enum mad_error { |
31 | MAD_ERROR_NONE = 0x0000,/* no error */ | ||
32 | |||
31 | MAD_ERROR_BUFLEN = 0x0001,/* input buffer too small (or EOF) */ | 33 | MAD_ERROR_BUFLEN = 0x0001,/* input buffer too small (or EOF) */ |
32 | MAD_ERROR_BUFPTR = 0x0002,/* invalid (null) buffer pointer */ | 34 | MAD_ERROR_BUFPTR = 0x0002,/* invalid (null) buffer pointer */ |
33 | 35 | ||
34 | MAD_ERROR_NOMEM = 0x0031,/* not enough memory */ | 36 | MAD_ERROR_NOMEM = 0x0031,/* not enough memory */ |
35 | 37 | ||
36 | MAD_ERROR_LOSTSYNC = 0x0101,/* lost synchronization */ | 38 | MAD_ERROR_LOSTSYNC = 0x0101,/* lost synchronization */ |
37 | MAD_ERROR_BADLAYER = 0x0102,/* reserved header layer value */ | 39 | MAD_ERROR_BADLAYER = 0x0102,/* reserved header layer value */ |
38 | MAD_ERROR_BADBITRATE = 0x0103,/* forbidden bitrate value */ | 40 | MAD_ERROR_BADBITRATE = 0x0103,/* forbidden bitrate value */ |
39 | MAD_ERROR_BADSAMPLERATE = 0x0104,/* reserved sample frequency value */ | 41 | MAD_ERROR_BADSAMPLERATE = 0x0104,/* reserved sample frequency value */ |
40 | MAD_ERROR_BADEMPHASIS = 0x0105,/* reserved emphasis value */ | 42 | MAD_ERROR_BADEMPHASIS = 0x0105,/* reserved emphasis value */ |
41 | 43 | ||
42 | MAD_ERROR_BADCRC = 0x0201,/* CRC check failed */ | 44 | MAD_ERROR_BADCRC = 0x0201,/* CRC check failed */ |
@@ -71,32 +73,35 @@ struct mad_stream { | |||
71 | unsigned int anc_bitlen; /* number of ancillary bits */ | 73 | unsigned int anc_bitlen; /* number of ancillary bits */ |
72 | 74 | ||
73 | unsigned char (*main_data)[MAD_BUFFER_MDLEN]; | 75 | unsigned char (*main_data)[MAD_BUFFER_MDLEN]; |
74 | /* Layer III main_data() */ | 76 | /* Layer III main_data() */ |
75 | unsigned int md_len; /* bytes in main_data */ | 77 | unsigned int md_len; /* bytes in main_data */ |
76 | 78 | ||
77 | int options; /* decoding options (see below) */ | 79 | int options; /* decoding options (see below) */ |
78 | enum mad_error error; /* error code (see above) */ | 80 | enum mad_error error; /* error code (see above) */ |
79 | }; | 81 | }; |
80 | 82 | ||
81 | enum { | 83 | enum { |
82 | MAD_OPTION_IGNORECRC = 0x0001,/* ignore CRC errors */ | 84 | MAD_OPTION_IGNORECRC = 0x0001,/* ignore CRC errors */ |
83 | MAD_OPTION_HALFSAMPLERATE = 0x0002,/* generate PCM at 1/2 sample rate */ | 85 | MAD_OPTION_HALFSAMPLERATE = 0x0002/* generate PCM at 1/2 sample rate */ |
84 | # if 0 /* not yet implemented */ | 86 | # if 0 /* not yet implemented */ |
85 | MAD_OPTION_LEFTCHANNEL = 0x0010,/* decode left channel only */ | 87 | MAD_OPTION_LEFTCHANNEL = 0x0010,/* decode left channel only */ |
86 | MAD_OPTION_RIGHTCHANNEL = 0x0020,/* decode right channel only */ | 88 | MAD_OPTION_RIGHTCHANNEL = 0x0020,/* decode right channel only */ |
87 | MAD_OPTION_SINGLECHANNEL = 0x0030,/* combine channels */ | 89 | MAD_OPTION_SINGLECHANNEL = 0x0030/* combine channels */ |
88 | # endif | 90 | # endif |
89 | }; | 91 | }; |
90 | 92 | ||
91 | void mad_stream_init(struct mad_stream *); | 93 | void mad_stream_init(struct mad_stream *); |
92 | void mad_stream_finish(struct mad_stream *); | 94 | void mad_stream_finish(struct mad_stream *); |
93 | 95 | ||
94 | # define mad_stream_options(stream, opts) ((stream)->options = (opts)) | 96 | # define mad_stream_options(stream, opts) \ |
97 | ((void) ((stream)->options = (opts))) | ||
95 | 98 | ||
96 | void mad_stream_buffer(struct mad_stream *, | 99 | void mad_stream_buffer(struct mad_stream *, |
97 | unsigned char const *, unsigned long); | 100 | unsigned char const *, unsigned long); |
98 | void mad_stream_skip(struct mad_stream *, unsigned long); | 101 | void mad_stream_skip(struct mad_stream *, unsigned long); |
99 | 102 | ||
100 | int mad_stream_sync(struct mad_stream *); | 103 | int mad_stream_sync(struct mad_stream *); |
101 | 104 | ||
105 | char const *mad_stream_errorstr(struct mad_stream const *); | ||
106 | |||
102 | # endif | 107 | # endif |