yading@10: /* yading@10: * Common AAC and AC-3 parser prototypes yading@10: * Copyright (c) 2003 Fabrice Bellard yading@10: * Copyright (c) 2003 Michael Niedermayer yading@10: * yading@10: * This file is part of FFmpeg. yading@10: * yading@10: * FFmpeg is free software; you can redistribute it and/or yading@10: * modify it under the terms of the GNU Lesser General Public yading@10: * License as published by the Free Software Foundation; either yading@10: * version 2.1 of the License, or (at your option) any later version. yading@10: * yading@10: * FFmpeg is distributed in the hope that it will be useful, yading@10: * but WITHOUT ANY WARRANTY; without even the implied warranty of yading@10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU yading@10: * Lesser General Public License for more details. yading@10: * yading@10: * You should have received a copy of the GNU Lesser General Public yading@10: * License along with FFmpeg; if not, write to the Free Software yading@10: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA yading@10: */ yading@10: yading@10: #ifndef AVCODEC_AAC_AC3_PARSER_H yading@10: #define AVCODEC_AAC_AC3_PARSER_H yading@10: yading@10: #include yading@10: #include "avcodec.h" yading@10: #include "parser.h" yading@10: yading@10: typedef enum { yading@10: AAC_AC3_PARSE_ERROR_SYNC = -1, yading@10: AAC_AC3_PARSE_ERROR_BSID = -2, yading@10: AAC_AC3_PARSE_ERROR_SAMPLE_RATE = -3, yading@10: AAC_AC3_PARSE_ERROR_FRAME_SIZE = -4, yading@10: AAC_AC3_PARSE_ERROR_FRAME_TYPE = -5, yading@10: AAC_AC3_PARSE_ERROR_CRC = -6, yading@10: AAC_AC3_PARSE_ERROR_CHANNEL_CFG = -7, yading@10: } AACAC3ParseError; yading@10: yading@10: typedef struct AACAC3ParseContext { yading@10: ParseContext pc; yading@10: int frame_size; yading@10: int header_size; yading@10: int (*sync)(uint64_t state, struct AACAC3ParseContext *hdr_info, yading@10: int *need_next_header, int *new_frame_start); yading@10: yading@10: int channels; yading@10: int sample_rate; yading@10: int bit_rate; yading@10: int samples; yading@10: uint64_t channel_layout; yading@10: int service_type; yading@10: yading@10: int remaining_size; yading@10: uint64_t state; yading@10: yading@10: int need_next_header; yading@10: enum AVCodecID codec_id; yading@10: } AACAC3ParseContext; yading@10: yading@10: int ff_aac_ac3_parse(AVCodecParserContext *s1, yading@10: AVCodecContext *avctx, yading@10: const uint8_t **poutbuf, int *poutbuf_size, yading@10: const uint8_t *buf, int buf_size); yading@10: yading@10: #endif /* AVCODEC_AAC_AC3_PARSER_H */