FFmpeg
Functions | Variables
mpeg4audio.c File Reference
#include "get_bits.h"
#include "put_bits.h"
#include "mpeg4audio.h"

Go to the source code of this file.

Functions

static int parse_config_ALS (GetBitContext *gb, MPEG4AudioConfig *c, void *logctx)
 Parse MPEG-4 audio configuration for ALS object type. More...
 
static int get_object_type (GetBitContext *gb)
 
static int get_sample_rate (GetBitContext *gb, int *index)
 
int ff_mpeg4audio_get_config_gb (MPEG4AudioConfig *c, GetBitContext *gb, int sync_extension, void *logctx)
 Parse MPEG-4 systems extradata from a potentially unaligned GetBitContext to retrieve audio configuration. More...
 
int avpriv_mpeg4audio_get_config (MPEG4AudioConfig *c, const uint8_t *buf, int bit_size, int sync_extension)
 Parse MPEG-4 systems extradata from a raw buffer to retrieve audio configuration. More...
 
int avpriv_mpeg4audio_get_config2 (MPEG4AudioConfig *c, const uint8_t *buf, int size, int sync_extension, void *logctx)
 Parse MPEG-4 systems extradata from a raw buffer to retrieve audio configuration. More...
 

Variables

const int avpriv_mpeg4audio_sample_rates [16]
 
const uint8_t ff_mpeg4audio_channels [14]
 

Function Documentation

◆ parse_config_ALS()

static int parse_config_ALS ( GetBitContext gb,
MPEG4AudioConfig c,
void *  logctx 
)
static

Parse MPEG-4 audio configuration for ALS object type.

Parameters
[in]gbbit reader context
[in]cMPEG4AudioConfig structure to fill
Returns
on success 0 is returned, otherwise a value < 0

Definition at line 33 of file mpeg4audio.c.

Referenced by ff_mpeg4audio_get_config_gb().

◆ get_object_type()

static int get_object_type ( GetBitContext gb)
inlinestatic

Definition at line 84 of file mpeg4audio.c.

Referenced by ff_mpeg4audio_get_config_gb().

◆ get_sample_rate()

static int get_sample_rate ( GetBitContext gb,
int index 
)
inlinestatic

Definition at line 92 of file mpeg4audio.c.

Referenced by ff_mpeg4audio_get_config_gb().

◆ ff_mpeg4audio_get_config_gb()

int ff_mpeg4audio_get_config_gb ( MPEG4AudioConfig c,
GetBitContext gb,
int  sync_extension,
void *  logctx 
)

Parse MPEG-4 systems extradata from a potentially unaligned GetBitContext to retrieve audio configuration.

Parameters
[in]cMPEG4AudioConfig structure to fill.
[in]gbExtradata from container.
[in]sync_extensionlook for a sync extension after config if true.
[in]logctxopaque struct starting with an AVClass element, used for logging.
Returns
negative AVERROR code on error, on success AudioSpecificConfig bit index in extradata.

Definition at line 99 of file mpeg4audio.c.

Referenced by avpriv_mpeg4audio_get_config(), avpriv_mpeg4audio_get_config2(), and decode_audio_specific_config_gb().

◆ avpriv_mpeg4audio_get_config()

int avpriv_mpeg4audio_get_config ( MPEG4AudioConfig c,
const uint8_t buf,
int  bit_size,
int  sync_extension 
)

Parse MPEG-4 systems extradata from a raw buffer to retrieve audio configuration.

Parameters
[in]cMPEG4AudioConfig structure to fill.
[in]bufExtradata from container.
[in]bit_sizeExtradata size in bits.
[in]sync_extensionlook for a sync extension after config if true.
Returns
negative AVERROR code on error, on success AudioSpecificConfig bit index in extradata.

Definition at line 173 of file mpeg4audio.c.

◆ avpriv_mpeg4audio_get_config2()

int avpriv_mpeg4audio_get_config2 ( MPEG4AudioConfig c,
const uint8_t buf,
int  size,
int  sync_extension,
void *  logctx 
)

Parse MPEG-4 systems extradata from a raw buffer to retrieve audio configuration.

Parameters
[in]cMPEG4AudioConfig structure to fill.
[in]bufExtradata from container.
[in]sizeExtradata size in bytes.
[in]sync_extensionlook for a sync extension after config if true.
[in]logctxopaque struct starting with an AVClass element, used for logging.
Returns
negative AVERROR code on error, AudioSpecificConfig bit index in extradata on success.

Definition at line 190 of file mpeg4audio.c.

Referenced by aac_adtstoasc_init(), adts_decode_extradata(), ff_mp4_read_dec_config_descr(), get_aac_sample_rates(), latm_decode_extradata(), and read_specific_config().

Variable Documentation

◆ avpriv_mpeg4audio_sample_rates

const int avpriv_mpeg4audio_sample_rates[16]
Initial value:
= {
96000, 88200, 64000, 48000, 44100, 32000,
24000, 22050, 16000, 12000, 11025, 8000, 7350
}

Definition at line 62 of file mpeg4audio.c.

Referenced by aac_encode_init(), ff_adts_header_parse(), and get_sample_rate().

◆ ff_mpeg4audio_channels

const uint8_t ff_mpeg4audio_channels[14]
Initial value:
= {
0,
1,
2,
3,
4,
5,
6,
8,
0,
0,
0,
7,
8,
24
}

Definition at line 67 of file mpeg4audio.c.

Referenced by aac_decode_init(), aac_sync(), and ff_mpeg4audio_get_config_gb().