pub struct Import { /* private fields */ }Expand description
AAC importer.
The catalog comes from an AudioSpecificConfig (variable-length, typically extracted from an MP4
ESDS atom); build the config with config. Every AAC packet is independently decodable, so
decode marks only the first frame of each group a keyframe (the rest extend
it): frames accumulate into the current group until the caller cuts. The import::Track facade cuts once a group (one
QUIC stream) holds 100 ms, as Join says. The codec’s packet loss
concealment handles drops.
Implementations§
Source§impl Import
impl Import
Sourcepub fn new<E: CatalogExt>(
track: Producer,
reserved: Reserved<E>,
config: AudioConfig,
) -> Result<Self>
pub fn new<E: CatalogExt>( track: Producer, reserved: Reserved<E>, config: AudioConfig, ) -> Result<Self>
Publish on an existing track producer with a resolved catalog config.
Build one from an AudioSpecificConfig with config (which keeps its bytes as the catalog
description), or from an out-of-band Config via try_into() (which synthesizes the
description, refusing a channel count that does not pick a channelConfiguration). The rendition
publishes immediately.
Sourcepub fn finish(self) -> Result<Finished<Wire, AudioConfig>>
pub fn finish(self) -> Result<Finished<Wire, AudioConfig>>
Finish the track, flushing the current group, and return the Finished
track, which keeps it and its catalog rendition published.
A finish that fails ends the track with the cause instead, so it can’t be retried.
Sourcepub fn abort(self, err: Error)
pub fn abort(self, err: Error)
Abort the track with err instead of finishing it cleanly, so subscribers
see the real cause rather than [moq_net::Error::Dropped]. Consumes this importer.
Sourcepub fn cut(&mut self, end: Option<Timestamp>) -> Result<()>
pub fn cut(&mut self, end: Option<Timestamp>) -> Result<()>
Cut the current group at end without finishing the track.
Sourcepub fn discontinuity(&mut self) -> Result<()>
pub fn discontinuity(&mut self) -> Result<()>
Mark a break in the timeline by publishing a marker group. To bound the closing
group’s final frame first, cut(end) before this. See
Producer::discontinuity.
Sourcepub fn decode<B: IntoBytes>(
&mut self,
frame: B,
pts: Option<Timestamp>,
) -> Result<()>
pub fn decode<B: IntoBytes>( &mut self, frame: B, pts: Option<Timestamp>, ) -> Result<()>
Publish one AAC packet, stamping pts or a wall clock when absent.
AAC is independently decodable, so the packet is marked a keyframe only when it starts a group
(see Producer::needs_keyframe); otherwise it
extends the current group. The caller bounds groups via cut.