src/libFLAC/stream_decoder.c : Fix buffer read overflow.
[platform/upstream/flac.git] / src / flac / decode.h
1 /* flac - Command-line FLAC encoder/decoder
2  * Copyright (C) 2000-2009  Josh Coalson
3  * Copyright (C) 2011-2013  Xiph.Org Foundation
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19
20 #ifndef flac__decode_h
21 #define flac__decode_h
22
23 #if HAVE_CONFIG_H
24 #  include <config.h>
25 #endif
26
27 #include "analyze.h"
28 #include "foreign_metadata.h"
29 #include "utils.h"
30 #include "share/replaygain_synthesis.h"
31
32
33 typedef struct {
34         FLAC__bool apply;
35         FLAC__bool use_album_gain; /* false => use track gain */
36         enum { RGSS_LIMIT__NONE, RGSS_LIMIT__PEAK, RGSS_LIMIT__HARD} limiter;
37         NoiseShaping noise_shaping;
38         double preamp;
39 } replaygain_synthesis_spec_t;
40
41 typedef struct {
42         FLAC__bool treat_warnings_as_errors;
43         FLAC__bool continue_through_decode_errors;
44         replaygain_synthesis_spec_t replaygain_synthesis_spec;
45 #if FLAC__HAS_OGG
46         FLAC__bool is_ogg;
47         FLAC__bool use_first_serial_number;
48         long serial_number;
49 #endif
50         utils__SkipUntilSpecification skip_specification;
51         utils__SkipUntilSpecification until_specification;
52         FLAC__bool has_cue_specification;
53         utils__CueSpecification cue_specification;
54         FLAC__bool channel_map_none; /* --channel-map=none specified, eventually will expand to take actual channel map */
55
56         FileFormat format;
57         union {
58                 struct {
59                         FLAC__bool is_big_endian;
60                         FLAC__bool is_unsigned_samples;
61                 } raw;
62                 struct {
63                         foreign_metadata_t *foreign_metadata; /* NULL unless --keep-foreign-metadata requested */
64                 } iff;
65         } format_options;
66 } decode_options_t;
67
68 /* outfile == 0 => test only */
69 int flac__decode_file(const char *infilename, const char *outfilename, FLAC__bool analysis_mode, analysis_options aopts, decode_options_t options);
70
71 #endif