Skip to main content

moq_audio/
frame.rs

1use bytes::Bytes;
2use moq_net::Timestamp;
3
4/// One unit of raw PCM crossing the codec boundary: what
5/// [`encode::Producer::write`](crate::encode::Producer::write) takes and what
6/// [`decode::Consumer::read`](crate::decode::Consumer::read) returns.
7///
8/// Just a payload and a presentation timestamp. PCM layout (format / sample rate
9/// / channel count) is fixed by the producer or consumer at construction time,
10/// never per frame, so callers can't accidentally drift the format mid-stream.
11#[derive(Clone, Debug)]
12pub struct Frame {
13	/// Presentation timestamp of the first sample.
14	pub timestamp: Timestamp,
15	/// The samples, in the layout the producer or consumer was built with.
16	pub data: Bytes,
17}