00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef AVCODEC_AAC_AC3_PARSER_H
00024 #define AVCODEC_AAC_AC3_PARSER_H
00025
00026 #include <stdint.h>
00027 #include "avcodec.h"
00028 #include "parser.h"
00029
00030 typedef enum {
00031 AAC_AC3_PARSE_ERROR_SYNC = -1,
00032 AAC_AC3_PARSE_ERROR_BSID = -2,
00033 AAC_AC3_PARSE_ERROR_SAMPLE_RATE = -3,
00034 AAC_AC3_PARSE_ERROR_FRAME_SIZE = -4,
00035 AAC_AC3_PARSE_ERROR_FRAME_TYPE = -5,
00036 AAC_AC3_PARSE_ERROR_CRC = -6,
00037 AAC_AC3_PARSE_ERROR_CHANNEL_CFG = -7,
00038 } AACAC3ParseError;
00039
00040 typedef struct AACAC3ParseContext {
00041 ParseContext pc;
00042 int frame_size;
00043 int header_size;
00044 int (*sync)(uint64_t state, struct AACAC3ParseContext *hdr_info,
00045 int *need_next_header, int *new_frame_start);
00046
00047 int channels;
00048 int sample_rate;
00049 int bit_rate;
00050 int samples;
00051 int64_t channel_layout;
00052 int service_type;
00053
00054 int remaining_size;
00055 uint64_t state;
00056
00057 int need_next_header;
00058 enum CodecID codec_id;
00059 } AACAC3ParseContext;
00060
00061 int ff_aac_ac3_parse(AVCodecParserContext *s1,
00062 AVCodecContext *avctx,
00063 const uint8_t **poutbuf, int *poutbuf_size,
00064 const uint8_t *buf, int buf_size);
00065
00066 #endif