annotate flac.h @ 9083:bf274494b66e libavcodec

Change a bunch of codec long_names to be more consistent and descriptive.
author diego
date Mon, 02 Mar 2009 05:18:33 +0000
parents 7eedb5796dd8
children 4984f305def8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6728
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
1 /*
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
2 * FLAC (Free Lossless Audio Codec) decoder/demuxer common functions
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
3 * Copyright (c) 2008 Justin Ruggles
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
4 *
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
5 * This file is part of FFmpeg.
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
6 *
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
11 *
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
15 * Lesser General Public License for more details.
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
16 *
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
20 */
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
21
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
22 /**
8718
e9d9d946f213 Use full internal pathname in doxygen @file directives.
diego
parents: 8661
diff changeset
23 * @file libavcodec/flac.h
6728
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
24 * FLAC (Free Lossless Audio Codec) decoder/demuxer common functions
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
25 */
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
26
7760
c4a4495715dd Globally rename the header inclusion guard names.
stefano
parents: 6732
diff changeset
27 #ifndef AVCODEC_FLAC_H
c4a4495715dd Globally rename the header inclusion guard names.
stefano
parents: 6732
diff changeset
28 #define AVCODEC_FLAC_H
6728
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
29
6732
dc4f5c55af40 include avcodec.h
jbr
parents: 6729
diff changeset
30 #include "avcodec.h"
dc4f5c55af40 include avcodec.h
jbr
parents: 6729
diff changeset
31
8660
4f1525c698e9 move FLAC_STREAMINFO_SIZE to flac.h
jbr
parents: 8659
diff changeset
32 #define FLAC_STREAMINFO_SIZE 34
4f1525c698e9 move FLAC_STREAMINFO_SIZE to flac.h
jbr
parents: 8659
diff changeset
33
8659
61ae841cd13e define FLAC metadata types in flac.h
jbr
parents: 7760
diff changeset
34 enum {
61ae841cd13e define FLAC metadata types in flac.h
jbr
parents: 7760
diff changeset
35 FLAC_METADATA_TYPE_STREAMINFO = 0,
61ae841cd13e define FLAC metadata types in flac.h
jbr
parents: 7760
diff changeset
36 FLAC_METADATA_TYPE_PADDING,
61ae841cd13e define FLAC metadata types in flac.h
jbr
parents: 7760
diff changeset
37 FLAC_METADATA_TYPE_APPLICATION,
61ae841cd13e define FLAC metadata types in flac.h
jbr
parents: 7760
diff changeset
38 FLAC_METADATA_TYPE_SEEKTABLE,
61ae841cd13e define FLAC metadata types in flac.h
jbr
parents: 7760
diff changeset
39 FLAC_METADATA_TYPE_VORBIS_COMMENT,
61ae841cd13e define FLAC metadata types in flac.h
jbr
parents: 7760
diff changeset
40 FLAC_METADATA_TYPE_CUESHEET,
61ae841cd13e define FLAC metadata types in flac.h
jbr
parents: 7760
diff changeset
41 FLAC_METADATA_TYPE_PICTURE,
61ae841cd13e define FLAC metadata types in flac.h
jbr
parents: 7760
diff changeset
42 FLAC_METADATA_TYPE_INVALID = 127
61ae841cd13e define FLAC metadata types in flac.h
jbr
parents: 7760
diff changeset
43 };
61ae841cd13e define FLAC metadata types in flac.h
jbr
parents: 7760
diff changeset
44
9054
7eedb5796dd8 Use a shared function to validate FLAC extradata.
jbr
parents: 8718
diff changeset
45 enum FLACExtradataFormat {
7eedb5796dd8 Use a shared function to validate FLAC extradata.
jbr
parents: 8718
diff changeset
46 FLAC_EXTRADATA_FORMAT_STREAMINFO = 0,
7eedb5796dd8 Use a shared function to validate FLAC extradata.
jbr
parents: 8718
diff changeset
47 FLAC_EXTRADATA_FORMAT_FULL_HEADER = 1
7eedb5796dd8 Use a shared function to validate FLAC extradata.
jbr
parents: 8718
diff changeset
48 };
7eedb5796dd8 Use a shared function to validate FLAC extradata.
jbr
parents: 8718
diff changeset
49
6728
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
50 /**
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
51 * Data needed from the Streaminfo header for use by the raw FLAC demuxer
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
52 * and/or the FLAC decoder.
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
53 */
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
54 #define FLACSTREAMINFO \
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
55 int min_blocksize; /**< minimum block size, in samples */\
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
56 int max_blocksize; /**< maximum block size, in samples */\
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
57 int max_framesize; /**< maximum frame size, in bytes */\
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
58 int samplerate; /**< sample rate */\
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
59 int channels; /**< number of channels */\
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
60 int bps; /**< bits-per-sample */\
8661
94f7aca055d5 flacdec: get total number of samples from STREAMINFO
jbr
parents: 8660
diff changeset
61 int64_t samples; /**< total number of samples */\
6728
56c5bbd0996f split out some decoder context params to a shared macro
jbr
parents:
diff changeset
62
6729
071888974d8a share streaminfo parsing function
jbr
parents: 6728
diff changeset
63 typedef struct FLACStreaminfo {
071888974d8a share streaminfo parsing function
jbr
parents: 6728
diff changeset
64 FLACSTREAMINFO
071888974d8a share streaminfo parsing function
jbr
parents: 6728
diff changeset
65 } FLACStreaminfo;
071888974d8a share streaminfo parsing function
jbr
parents: 6728
diff changeset
66
071888974d8a share streaminfo parsing function
jbr
parents: 6728
diff changeset
67 /**
071888974d8a share streaminfo parsing function
jbr
parents: 6728
diff changeset
68 * Parse the Streaminfo metadata block
071888974d8a share streaminfo parsing function
jbr
parents: 6728
diff changeset
69 * @param[out] avctx codec context to set basic stream parameters
071888974d8a share streaminfo parsing function
jbr
parents: 6728
diff changeset
70 * @param[out] s where parsed information is stored
071888974d8a share streaminfo parsing function
jbr
parents: 6728
diff changeset
71 * @param[in] buffer pointer to start of 34-byte streaminfo data
071888974d8a share streaminfo parsing function
jbr
parents: 6728
diff changeset
72 */
071888974d8a share streaminfo parsing function
jbr
parents: 6728
diff changeset
73 void ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s,
071888974d8a share streaminfo parsing function
jbr
parents: 6728
diff changeset
74 const uint8_t *buffer);
071888974d8a share streaminfo parsing function
jbr
parents: 6728
diff changeset
75
9054
7eedb5796dd8 Use a shared function to validate FLAC extradata.
jbr
parents: 8718
diff changeset
76 /**
7eedb5796dd8 Use a shared function to validate FLAC extradata.
jbr
parents: 8718
diff changeset
77 * Validate the FLAC extradata.
7eedb5796dd8 Use a shared function to validate FLAC extradata.
jbr
parents: 8718
diff changeset
78 * @param[in] avctx codec context containing the extradata.
7eedb5796dd8 Use a shared function to validate FLAC extradata.
jbr
parents: 8718
diff changeset
79 * @param[out] format extradata format.
7eedb5796dd8 Use a shared function to validate FLAC extradata.
jbr
parents: 8718
diff changeset
80 * @param[out] streaminfo_start pointer to start of 34-byte STREAMINFO data.
7eedb5796dd8 Use a shared function to validate FLAC extradata.
jbr
parents: 8718
diff changeset
81 * @return 1 if valid, 0 if not valid.
7eedb5796dd8 Use a shared function to validate FLAC extradata.
jbr
parents: 8718
diff changeset
82 */
7eedb5796dd8 Use a shared function to validate FLAC extradata.
jbr
parents: 8718
diff changeset
83 int ff_flac_is_extradata_valid(AVCodecContext *avctx,
7eedb5796dd8 Use a shared function to validate FLAC extradata.
jbr
parents: 8718
diff changeset
84 enum FLACExtradataFormat *format,
7eedb5796dd8 Use a shared function to validate FLAC extradata.
jbr
parents: 8718
diff changeset
85 uint8_t **streaminfo_start);
7eedb5796dd8 Use a shared function to validate FLAC extradata.
jbr
parents: 8718
diff changeset
86
7760
c4a4495715dd Globally rename the header inclusion guard names.
stefano
parents: 6732
diff changeset
87 #endif /* AVCODEC_FLAC_H */