pub struct Join { /* private fields */ }Expand description
Rolls an audio track’s groups by duration.
Every audio packet decodes on its own, so nothing in the media says where a group ends. A group per packet costs a QUIC stream per packet, 50 a second at 20 ms, and those tiny streams race each other and spend the peer’s stream credit. This says when a group carries its span of audio, on the packet (or container unit) that fills it, so the caller cuts right away and the relay sees the group finish without waiting for the next packet. Packets still forward as they are written.
Implementations§
Source§impl Join
impl Join
Sourcepub const DEFAULT: Duration
pub const DEFAULT: Duration
How much audio a group carries by default: a new group (one QUIC stream) every 100 ms, about as much as a player conceals, so a lost group is concealed rather than half silent.
Sourcepub fn new(span: Duration) -> Self
pub fn new(span: Duration) -> Self
Roll groups once they carry span of audio. A zero span fills every group with its first packet.
Sourcepub fn fill(&mut self, start: Timestamp, end: Timestamp) -> Option<Timestamp>
pub fn fill(&mut self, start: Timestamp, end: Timestamp) -> Option<Timestamp>
Count media from start to end into the open group, opening one when none is, and return
where the group ends once it is full, so the caller cuts it there: the furthest end of its
media, which a rewound packet’s own end can fall below.
Media starting before the group’s start also fills it, since the timeline broke. An unscaled timestamp can’t be measured, so it fills its group alone.
Sourcepub fn opens(&self, start: Timestamp) -> bool
pub fn opens(&self, start: Timestamp) -> bool
Whether media from start can’t continue the open group, since it starts a whole span past
the group’s start (a gap) or before it (a rewind), so the caller cuts before writing it.