/*1* Common AAC and AC-3 parser prototypes2* Copyright (c) 2003 Fabrice Bellard3* Copyright (c) 2003 Michael Niedermayer4*5* This file is part of FFmpeg.6*7* FFmpeg is free software; you can redistribute it and/or8* modify it under the terms of the GNU Lesser General Public9* License as published by the Free Software Foundation; either10* 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 of14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU15* Lesser General Public License for more details.16*17* You should have received a copy of the GNU Lesser General Public18* License along with FFmpeg; if not, write to the Free Software19* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA20*/2122#ifndef AVCODEC_AAC_AC3_PARSER_H23#define AVCODEC_AAC_AC3_PARSER_H2425#include <stdint.h>26#include "avcodec.h"27#include "parser.h"2829typedef enum {30AAC_AC3_PARSE_ERROR_SYNC = -0x1030c0a,31AAC_AC3_PARSE_ERROR_BSID = -0x2030c0a,32AAC_AC3_PARSE_ERROR_SAMPLE_RATE = -0x3030c0a,33AAC_AC3_PARSE_ERROR_FRAME_SIZE = -0x4030c0a,34AAC_AC3_PARSE_ERROR_FRAME_TYPE = -0x5030c0a,35AAC_AC3_PARSE_ERROR_CRC = -0x6030c0a,36AAC_AC3_PARSE_ERROR_CHANNEL_CFG = -0x7030c0a,37} AACAC3ParseError;3839typedef struct AACAC3ParseContext {40ParseContext pc;41int frame_size;42int header_size;43int (*sync)(uint64_t state, struct AACAC3ParseContext *hdr_info,44int *need_next_header, int *new_frame_start);4546int channels;47int sample_rate;48int bit_rate;49int samples;50uint64_t channel_layout;51int service_type;5253int remaining_size;54uint64_t state;5556int need_next_header;57enum AVCodecID codec_id;58} AACAC3ParseContext;5960int ff_aac_ac3_parse(AVCodecParserContext *s1,61AVCodecContext *avctx,62const uint8_t **poutbuf, int *poutbuf_size,63const uint8_t *buf, int buf_size);6465#endif /* AVCODEC_AAC_AC3_PARSER_H */666768