Skip to main content

Release

Struct Release 

Source
pub struct Release { /* private fields */ }
Expand description

Writes the multiplex a broadcast’s passthrough track carries back out byte-identical, each packet a fixed delay after its time on the source’s PCR, like an SRT receiver.

The importer stamps each object, the packets from one PCR to the next, with the PCR time of its first byte on the catalog clock. The release holds every object until that time plus the delay on the jitter buffer’s clock, which follows the source’s, then spreads its packets evenly up to the next object’s time, seven at a time (a UDP datagram’s worth), so the output keeps the source’s rate whatever the arrival jitter. An object whose successor is not yet buffered when it comes due, follows a loss, or is more than ISO 13818-1’s 100 ms PCR interval ahead, goes out whole, as does every object under no delay. Two releases that each receive every object before its deadline write the same bytes; where each held an object’s successor when it came due, at the same times too, so a delay longer than the arrival jitter by a PCR interval keeps them in step. An object that arrives past its deadline is dropped and counted; the output shows a continuity error there, since nothing is rewritten, and carries on with the next object. A PCR clock break, which the importer declares with a discontinuity marker, opens a new clock, so the output does not wait out a jump; the bytes carry the break as the source sent it.

A Follower carries it across its broadcast’s returns and, when stitching, onto another publisher identity, whose track it reads from the first group its live subscription delivers, after what was already buffered has gone out. Its packets follow verbatim, so the output shows the seam as each PID’s continuity break, as the source would show a splice, and they go out on a clock of their own, as after an encoder changeover.

Implementations§

Source§

impl Release

Source

pub async fn new( source: Source, catalog_format: CatalogFormat, delay: Duration, ) -> Result<Self>

Subscribe to the catalog of source, in either format, waiting for the mpegts section to name its passthrough track.

Each object is written delay after its PCR time; late objects are dropped.

Source

pub fn dropped(&self) -> u64

How many objects were dropped for missing their deadline.

Source

pub fn drift(&self) -> Option<f64>

The source’s clock rate off ours, as last measured, as a fraction: positive runs fast.

Source

pub fn out_of_tolerance(&self) -> u64

How many times the source’s clock was measured further off ours than the release follows.

Source

pub fn stats(&self) -> Release

Snapshot how the release clock is keeping up with the source.

Source

pub fn poll_next(&mut self, waiter: &Waiter) -> Poll<Result<Option<Frame>>>

The next run of packets, at its time: whole TS packets, verbatim, stamped with the PCR time of its first byte. Returns None once the track, or a catalog that never named one, ends.

Source

pub async fn next(&mut self) -> Result<Option<Frame>>

The next run of packets, at its time: whole TS packets, verbatim, stamped with the PCR time of its first byte. Returns None once the track, or a catalog that never named one, ends.

Awaits poll_next.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Followed for T
where T: Followed,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more