A simple M4A audio data demuxer which is providing AAC, MP3 and ALAC frames.
More...
#include <M4AAudioDemuxer.h>
|
| static uint32_t | readU32 (const uint32_t num) |
| |
| static uint32_t | readU32 (const uint8_t *p) |
| | Reads a 32-bit big-endian unsigned integer from a buffer.
|
| |
A simple M4A audio data demuxer which is providing AAC, MP3 and ALAC frames.
◆ FrameCallback
◆ Codec
| Enumerator |
|---|
| Unknown | |
| AAC | |
| ALAC | |
| MP3 | |
◆ M4AAudioDemuxer()
Constructor. Sets up parser callbacks.
◆ availableForWrite()
| int availableForWrite |
( |
| ) |
|
|
inline |
Returns the available space for writing.
- Returns
- Number of bytes available for writing.
◆ begin()
Initializes the demuxer and resets state.
◆ checkType()
| bool checkType |
( |
uint8_t * |
buffer, |
|
|
const char * |
type, |
|
|
int |
offset |
|
) |
| |
|
inlineprotectedinherited |
Checks if the buffer at the given offset matches the specified type.
- Parameters
-
| buffer | Pointer to the buffer. |
| type | 4-character type string (e.g. "mp4a"). |
| offset | Offset in the buffer to check. |
- Returns
- true if the type matches, false otherwise.
◆ copyFrom()
◆ getALACMagicCookie()
| Vector< uint8_t > & getALACMagicCookie |
( |
| ) |
|
|
inline |
Returns the ALAC magic cookie (codec config).
- Returns
- Reference to the ALAC magic cookie vector.
◆ getM4AAudioConfig()
◆ getSampleCount()
| uint32_t getSampleCount |
( |
| ) |
const |
|
inlineinherited |
◆ getStszFileOffset()
| uint32_t getStszFileOffset |
( |
| ) |
const |
|
inlineinherited |
◆ onAlac()
Handles the alac box.
- Parameters
-
◆ onEsds()
Handles the esds (Elementary Stream Descriptor) box.
- Parameters
-
◆ onMp4a()
Handles the mp4a box.
- Parameters
-
for mp4a we expect to contain a esds: child boxes start at 36
◆ onStsd()
◆ onStsz()
Handles the stsz (Sample Size) box.
- Parameters
-
◆ printHexDump()
◆ readU32() [1/2]
| static uint32_t readU32 |
( |
const uint32_t |
num | ) |
|
|
inlinestaticprotectedinherited |
◆ readU32() [2/2]
| static uint32_t readU32 |
( |
const uint8_t * |
p | ) |
|
|
inlinestaticprotectedinherited |
Reads a 32-bit big-endian unsigned integer from a buffer.
- Parameters
-
- Returns
- 32-bit unsigned integer.
◆ readU32Buffer()
| uint32_t readU32Buffer |
( |
| ) |
|
|
inlineprotectedinherited |
◆ resize()
| bool resize |
( |
size_t |
size | ) |
|
|
inlineinherited |
◆ setAACConfig()
| void setAACConfig |
( |
int |
profile, |
|
|
int |
srIdx, |
|
|
int |
chCfg |
|
) |
| |
|
inlineinherited |
Sets the AAC configuration for ADTS header generation.
- Parameters
-
| profile | AAC profile. |
| srIdx | Sample rate index. |
| chCfg | Channel configuration. |
◆ setCallback()
Defines the callback that returns the audio frames.
- Parameters
-
| cb | Frame callback function. |
Reimplemented from M4ACommonDemuxer.
◆ setChunkOffsetsBuffer()
| void setChunkOffsetsBuffer |
( |
BaseBuffer< uint32_t > & |
buffer | ) |
|
|
inlineinherited |
Sets the buffer to use for sample sizes.
- Parameters
-
| buffer | Reference to the buffer to use. |
◆ setM4AAudioConfig()
◆ setReference()
| void setReference |
( |
void * |
ref | ) |
|
|
inline |
Sets a reference pointer for callbacks.
- Parameters
-
◆ setSampleSizesBuffer()
Sets the buffer to use for sample sizes.
- Parameters
-
| buffer | Reference to the buffer to use. |
◆ setupParser()
|
|
inlineoverrideprotectedvirtual |
◆ write()
| void write |
( |
const uint8_t * |
data, |
|
|
size_t |
len |
|
) |
| |
|
inline |
Writes data to the demuxer for parsing.
- Parameters
-
| data | Pointer to input data. |
| len | Length of input data. |
◆ audio_config
◆ buffer
Buffer for incremental data.
◆ chunk_offsets_count
| uint32_t chunk_offsets_count = 0 |
|
protectedinherited |
◆ default_size
| size_t default_size = 2 * 1024 |
|
protectedinherited |
◆ frame_callback
◆ parser
◆ ref
Reference pointer for callbacks.
◆ sample_count
| uint32_t sample_count = 0 |
|
protectedinherited |
Number of samples in stsz.
◆ sampleExtractor
Initial value:
Extractor for audio samples.
◆ stco_processed
| bool stco_processed = false |
|
protectedinherited |
Marks the stco table as processed.
◆ stsd_processed
| bool stsd_processed = false |
|
protectedinherited |
◆ stsz_offset
◆ stsz_processed
| bool stsz_processed = false |
|
protectedinherited |
Marks the stsz table as processed.
The documentation for this class was generated from the following file: