FFmpeg
Data Structures | Enumerations | Functions
adts_header.h File Reference
#include "adts_parser.h"
#include "defs.h"

Go to the source code of this file.

Data Structures

struct  AACADTSHeaderInfo
 

Enumerations

enum  AACParseError { AAC_PARSE_ERROR_SYNC = -0x1030c0a, AAC_PARSE_ERROR_SAMPLE_RATE = -0x3030c0a, AAC_PARSE_ERROR_FRAME_SIZE = -0x4030c0a }
 

Functions

int ff_adts_header_parse (struct GetBitContext *gbc, AACADTSHeaderInfo *hdr)
 Parse the ADTS frame header to the end of the variable header, which is the first 54 bits. More...
 
int ff_adts_header_parse_buf (const uint8_t buf[AV_AAC_ADTS_HEADER_SIZE+AV_INPUT_BUFFER_PADDING_SIZE], AACADTSHeaderInfo *hdr)
 Wrapper around ff_adts_header_parse() for users that don't already have a suitable GetBitContext. More...
 
int avpriv_adts_header_parse (AACADTSHeaderInfo **phdr, const uint8_t *buf, size_t size)
 Parse the ADTS frame header contained in the buffer, which is the first 54 bits. More...
 

Enumeration Type Documentation

◆ AACParseError

Enumerator
AAC_PARSE_ERROR_SYNC 
AAC_PARSE_ERROR_SAMPLE_RATE 
AAC_PARSE_ERROR_FRAME_SIZE 

Definition at line 29 of file adts_header.h.

Function Documentation

◆ ff_adts_header_parse()

int ff_adts_header_parse ( struct GetBitContext gbc,
AACADTSHeaderInfo hdr 
)

Parse the ADTS frame header to the end of the variable header, which is the first 54 bits.

Parameters
[in]gbcBitContext containing the first 54 bits of the frame.
[out]hdrPointer to struct where header info is written.
Returns
the size in bytes of the header parsed on success and AAC_PARSE_ERROR_* values otherwise.

Definition at line 30 of file adts_header.c.

Referenced by ff_adts_header_parse_buf(), ftr_decode_frame(), and parse_adts_frame_header().

◆ ff_adts_header_parse_buf()

int ff_adts_header_parse_buf ( const uint8_t  buf[AV_AAC_ADTS_HEADER_SIZE+AV_INPUT_BUFFER_PADDING_SIZE],
AACADTSHeaderInfo hdr 
)

Wrapper around ff_adts_header_parse() for users that don't already have a suitable GetBitContext.

Definition at line 76 of file adts_header.c.

Referenced by aac_adtstoasc_filter(), aac_sync(), av_adts_header_parse(), avpriv_adts_header_parse(), ff_aac_ac3_parse(), and ftr_parse().

◆ avpriv_adts_header_parse()

int avpriv_adts_header_parse ( AACADTSHeaderInfo **  phdr,
const uint8_t *  buf,
size_t  size 
)

Parse the ADTS frame header contained in the buffer, which is the first 54 bits.

Parameters
[in]bufPointer to buffer containing the first 54 bits of the frame.
[in]sizeSize of buffer containing the first 54 bits of the frame.
[out]phdrPointer to pointer to struct AACADTSHeaderInfo for which memory is allocated and header info is written into it. After using the header information, the allocated memory must be freed by using av_free.
Returns
0 on success, AAC_PARSE_ERROR_* values on invalid input and ordinary AVERROR codes otherwise.

Definition at line 50 of file adts_parser.c.

Referenced by get_next_adts_frame().