#ifndef _AACADTSDEC_H_d019ae44_ #define _AACADTSDEC_H_d019ae44_ /* * This file was stolen from ffmpeg and modified for usability here. * The original is * * Copyright (c) 2003 Fabrice Bellard * Copyright (c) 2003 Michael Niedermayer * * This version is a derivative work of that version. It is not free * software; it is licensed under the GNU Lesser General Public * License version 2.1, which places nontrivial restrictions on what * may be done with it. (I'm not terribly happy about that, but for * my purposes accepting LGPL-infected code is a lower price than * reimplementing it all myself.) * * The LGPL v2.1 as distributed with ffmpeg is in the accompanying file * `LGPL-v2.1'. */ #include #include "get_bits.h" #define AAC_ADTS_HEADER_SIZE 7 typedef struct { uint32_t sample_rate; uint32_t samples; uint32_t bit_rate; uint8_t crc_absent; uint8_t object_type; uint8_t sampling_index; uint8_t chan_config; uint8_t num_aac_frames; } AACADTSHeaderInfo; /** * Parse AAC frame header. * Parse the ADTS frame header to the end of the variable header, which is * the first 54 bits. * @param[in] gbc BitContext containing the first 54 bits of the frame. * @param[out] hdr Pointer to struct where header info is written. * @return Returns 0 on success, -1 if there is a sync word mismatch, * -2 if the version element is invalid, -3 if the sample rate * element is invalid, or -4 if the bit rate element is invalid. */ int avpriv_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr); #endif