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