Abstract base class for M4A/MP4 demuxers. Provides shared functionality for both file-based and stream-based demuxers.
More...
#include <M4ACommonDemuxer.h>
|
struct | ESDSParser |
| A parser for the ESDS segment to extract the relevant aac information. More...
|
|
struct | Frame |
|
struct | M4AAudioConfig |
|
class | SampleExtractor |
| Extracts audio data based on the sample sizes defined in the stsz box. It collects the data from the mdat box and calls the callback with the extracted frames. More...
|
|
|
enum class | Codec { Unknown
, AAC
, ALAC
, MP3
} |
|
using | FrameCallback = std::function< void(const Frame &, void *ref)> |
|
|
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.
|
|
|
M4AAudioConfig | audio_config |
|
SingleBuffer< uint8_t > | buffer |
| Buffer for incremental data.
|
|
uint32_t | chunk_offsets_count = 0 |
|
size_t | default_size = 2 * 1024 |
| Default buffer size.
|
|
FrameCallback | frame_callback = nullptr |
|
MP4Parser | parser |
| Underlying MP4 parser.
|
|
uint32_t | sample_count = 0 |
| Number of samples in stsz.
|
|
SampleExtractor | sampleExtractor |
| Extractor for audio samples.
|
|
bool | stco_processed = false |
| Marks the stco table as processed.
|
|
bool | stsd_processed = false |
|
uint32_t | stsz_offset = 0 |
|
bool | stsz_processed = false |
| Marks the stsz table as processed.
|
|
Abstract base class for M4A/MP4 demuxers. Provides shared functionality for both file-based and stream-based demuxers.
◆ checkType()
bool checkType |
( |
uint8_t * |
buffer, |
|
|
const char * |
type, |
|
|
int |
offset |
|
) |
| |
|
inlineprotected |
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.
◆ 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
◆ onStsz()
Handles the stsz (Sample Size) box.
- Parameters
-
◆ readU32()
static uint32_t readU32 |
( |
const uint8_t * |
p | ) |
|
|
inlinestaticprotected |
Reads a 32-bit big-endian unsigned integer from a buffer.
- Parameters
-
- Returns
- 32-bit unsigned integer.
◆ setAACConfig()
void setAACConfig |
( |
int |
profile, |
|
|
int |
srIdx, |
|
|
int |
chCfg |
|
) |
| |
|
inline |
Sets the AAC configuration for ADTS header generation.
- Parameters
-
profile | AAC profile. |
srIdx | Sample rate index. |
chCfg | Channel configuration. |
◆ setCallback()
virtual void setCallback |
( |
FrameCallback |
cb | ) |
|
|
inlinevirtual |
◆ setChunkOffsetsBuffer()
void setChunkOffsetsBuffer |
( |
BaseBuffer< uint32_t > & |
buffer | ) |
|
|
inline |
Sets the buffer to use for sample sizes.
- Parameters
-
buffer | Reference to the buffer to use. |
◆ setSampleSizesBuffer()
Sets the buffer to use for sample sizes.
- Parameters
-
buffer | Reference to the buffer to use. |
◆ setupParser()
virtual void setupParser |
( |
| ) |
|
|
pure virtual |
◆ sampleExtractor
Initial value:
Extractor for audio samples.
The documentation for this class was generated from the following file: