Mercurial > libavcodec.hg
comparison ac3_parser.h @ 6661:a409fbf1f42b libavcodec
change ff_ac3_parse_header() to take a GetBitContext instead of const char*
author | bwolowiec |
---|---|
date | Tue, 22 Apr 2008 11:14:01 +0000 |
parents | b0d44aec1ec0 |
children | 2d0b86dfe5bb |
comparison
equal
deleted
inserted
replaced
6660:582712867474 | 6661:a409fbf1f42b |
---|---|
22 | 22 |
23 #ifndef FFMPEG_AC3_PARSER_H | 23 #ifndef FFMPEG_AC3_PARSER_H |
24 #define FFMPEG_AC3_PARSER_H | 24 #define FFMPEG_AC3_PARSER_H |
25 | 25 |
26 #include "ac3.h" | 26 #include "ac3.h" |
27 #include "bitstream.h" | |
27 | 28 |
28 typedef enum { | 29 typedef enum { |
29 AC3_PARSE_ERROR_SYNC = -1, | 30 AC3_PARSE_ERROR_SYNC = -1, |
30 AC3_PARSE_ERROR_BSID = -2, | 31 AC3_PARSE_ERROR_BSID = -2, |
31 AC3_PARSE_ERROR_SAMPLE_RATE = -3, | 32 AC3_PARSE_ERROR_SAMPLE_RATE = -3, |
35 | 36 |
36 /** | 37 /** |
37 * Parses AC-3 frame header. | 38 * Parses AC-3 frame header. |
38 * Parses the header up to the lfeon element, which is the first 52 or 54 bits | 39 * Parses the header up to the lfeon element, which is the first 52 or 54 bits |
39 * depending on the audio coding mode. | 40 * depending on the audio coding mode. |
40 * @param buf[in] Array containing the first 7 bytes of the frame. | 41 * @param gbc[in] BitContext containing the first 54 bits of the frame. |
41 * @param hdr[out] Pointer to struct where header info is written. | 42 * @param hdr[out] Pointer to struct where header info is written. |
42 * @return Returns 0 on success, -1 if there is a sync word mismatch, | 43 * @return Returns 0 on success, -1 if there is a sync word mismatch, |
43 * -2 if the bsid (version) element is invalid, -3 if the fscod (sample rate) | 44 * -2 if the bsid (version) element is invalid, -3 if the fscod (sample rate) |
44 * element is invalid, or -4 if the frmsizecod (bit rate) element is invalid. | 45 * element is invalid, or -4 if the frmsizecod (bit rate) element is invalid. |
45 */ | 46 */ |
46 int ff_ac3_parse_header(const uint8_t buf[7], AC3HeaderInfo *hdr); | 47 int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr); |
47 | 48 |
48 #endif /* FFMPEG_AC3_PARSER_H */ | 49 #endif /* FFMPEG_AC3_PARSER_H */ |