comparison parser.h @ 4855:40f3a7f2b1fd libavcodec

Move AC3 header parsing code together with the rest of the AC3 parsing code.
author diego
date Sun, 15 Apr 2007 12:32:36 +0000
parents 522e52c630bd
children b6a4f6c5623c
comparison
equal deleted inserted replaced
4854:9f1c90ce5d9d 4855:40f3a7f2b1fd
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */ 21 */
22 22
23 #ifndef FFMPEG_PARSER_H 23 #ifndef FFMPEG_PARSER_H
24 #define FFMPEG_PARSER_H 24 #define FFMPEG_PARSER_H
25
26 #include "ac3.h"
25 27
26 typedef struct ParseContext{ 28 typedef struct ParseContext{
27 uint8_t *buffer; 29 uint8_t *buffer;
28 int index; 30 int index;
29 int last_index; 31 int last_index;
58 void ff_parse1_close(AVCodecParserContext *s); 60 void ff_parse1_close(AVCodecParserContext *s);
59 61
60 /* h263dec.c */ 62 /* h263dec.c */
61 int ff_mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size); 63 int ff_mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size);
62 64
65 /**
66 * Parses AC-3 frame header.
67 * Parses the header up to the lfeon element, which is the first 52 or 54 bits
68 * depending on the audio coding mode.
69 * @param buf[in] Array containing the first 7 bytes of the frame.
70 * @param hdr[out] Pointer to struct where header info is written.
71 * @return Returns 0 on success, -1 if there is a sync word mismatch,
72 * -2 if the bsid (version) element is invalid, -3 if the fscod (sample rate)
73 * element is invalid, or -4 if the frmsizecod (bit rate) element is invalid.
74 */
75 int ff_ac3_parse_header(const uint8_t buf[7], AC3HeaderInfo *hdr);
76
63 #endif /* !FFMPEG_PARSER_H */ 77 #endif /* !FFMPEG_PARSER_H */