Crates.io | adts-reader |
lib.rs | adts-reader |
version | 0.3.0 |
source | src |
created_at | 2017-10-13 21:55:53.882509 |
updated_at | 2019-07-02 21:26:46.843854 |
description | Rust reader for Audio Data Transport Stream (ADTS) frames |
homepage | |
repository | https://github.com/dholroyd/adts-reader |
max_upload_size | |
id | 35552 |
size | 46,747 |
A Rust parser for the Audio Data Transport Stream framing format used to carry encoded AAC audio data.
👉 NB This is not an AAC decoder, nor is it able to parse the syntax of the AAC bitstream within the ADTS payload.
Calling code should,
AdtsConsumer
which will recieve callbacks as ADTS frame payloads are foundAdtsParser::push()
methodThe byte slice passed to push()
need not end exactly at the boundry of an ADTS frame. Partial ADTS data
remaining at the end of the given slice will be buffered internally in the parser, and the continuation of the ADTS
data must be provided in the subsequent call to push()
. This construction is intended to make it convinient to pass
payloads of the individual MPEG Transport Stream packets in which ADTS data is commonly embedded, without having to
pay the cost of reassembling entire PES packets.
ADTS frames include header data indicating the AAC encoder configuration, which will be made available to the calling
code through the provided implementation of AdtsConsumer::new_config()
.
Configuration data is provided at stream start, and to simplify calling code the parser will only call
AdtsConsumer::new_config()
again if and when the audio configuration is found to change.
mpeg_version
protection
audio_object_type
sampling_frequency
private_bit
channel_configuration
originality
home
copyright_identifier
/ copyright_number
- deriving these values is not supported, since I've not seen any
example bitstreams that use thembuffer_fullness
number_of_blocks
crc
- not currently available (also, the CRC does not apply to all payload bytes; cyclic reduncancy check
requires AAC bitstream parsing)&[u8]
byte slice containing a complete ADTS frame payload (which might be composed of one or more AAC blocks,
per number_of_blocks)