comparison flac.h @ 9054:7eedb5796dd8 libavcodec

Use a shared function to validate FLAC extradata.
author jbr
date Thu, 26 Feb 2009 02:29:24 +0000
parents e9d9d946f213
children 4984f305def8
comparison
equal deleted inserted replaced
9053:c6bd71120376 9054:7eedb5796dd8
40 FLAC_METADATA_TYPE_CUESHEET, 40 FLAC_METADATA_TYPE_CUESHEET,
41 FLAC_METADATA_TYPE_PICTURE, 41 FLAC_METADATA_TYPE_PICTURE,
42 FLAC_METADATA_TYPE_INVALID = 127 42 FLAC_METADATA_TYPE_INVALID = 127
43 }; 43 };
44 44
45 enum FLACExtradataFormat {
46 FLAC_EXTRADATA_FORMAT_STREAMINFO = 0,
47 FLAC_EXTRADATA_FORMAT_FULL_HEADER = 1
48 };
49
45 /** 50 /**
46 * Data needed from the Streaminfo header for use by the raw FLAC demuxer 51 * Data needed from the Streaminfo header for use by the raw FLAC demuxer
47 * and/or the FLAC decoder. 52 * and/or the FLAC decoder.
48 */ 53 */
49 #define FLACSTREAMINFO \ 54 #define FLACSTREAMINFO \
66 * @param[in] buffer pointer to start of 34-byte streaminfo data 71 * @param[in] buffer pointer to start of 34-byte streaminfo data
67 */ 72 */
68 void ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s, 73 void ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s,
69 const uint8_t *buffer); 74 const uint8_t *buffer);
70 75
76 /**
77 * Validate the FLAC extradata.
78 * @param[in] avctx codec context containing the extradata.
79 * @param[out] format extradata format.
80 * @param[out] streaminfo_start pointer to start of 34-byte STREAMINFO data.
81 * @return 1 if valid, 0 if not valid.
82 */
83 int ff_flac_is_extradata_valid(AVCodecContext *avctx,
84 enum FLACExtradataFormat *format,
85 uint8_t **streaminfo_start);
86
71 #endif /* AVCODEC_FLAC_H */ 87 #endif /* AVCODEC_FLAC_H */