/*1* AAC ADTS header decoding prototypes and structures2* 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_AACADTSDEC_H23#define AVCODEC_AACADTSDEC_H2425#include <stdint.h>26#include "get_bits.h"2728#define AAC_ADTS_HEADER_SIZE 72930typedef struct AACADTSHeaderInfo {31uint32_t sample_rate;32uint32_t samples;33uint32_t bit_rate;34uint8_t crc_absent;35uint8_t object_type;36uint8_t sampling_index;37uint8_t chan_config;38uint8_t num_aac_frames;39} AACADTSHeaderInfo;4041/**42* Parse AAC frame header.43* Parse the ADTS frame header to the end of the variable header, which is44* the first 54 bits.45* @param[in] gbc BitContext containing the first 54 bits of the frame.46* @param[out] hdr Pointer to struct where header info is written.47* @return Returns 0 on success, -1 if there is a sync word mismatch,48* -2 if the version element is invalid, -3 if the sample rate49* element is invalid, or -4 if the bit rate element is invalid.50*/51int avpriv_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr);5253#endif /* AVCODEC_AACADTSDEC_H */545556