Skip to main content

Mpegts

Struct Mpegts 

Source
#[non_exhaustive]
pub struct Mpegts { pub tracks: BTreeMap<String, Track>, pub program_descriptors: Vec<Descriptor>, pub program: Option<Program>, pub si: BTreeMap<u16, BTreeMap<u8, SiEntry>>, pub mux_rate: Option<u64>, pub passthrough: Option<PassthroughTrack>, }
Expand description

The mpegts catalog section.

Omitted from the catalog when empty, so a broadcast that needs none of it stays byte-identical to one without the extension. Reading refuses a section that names its passthrough track in tracks or si too.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§tracks: BTreeMap<String, Track>

Per-track MPEG-TS info, keyed by MoQ track name. Media tracks record their PID and PMT descriptors; undecoded tracks add a Verbatim or PesPacket carriage record.

§program_descriptors: Vec<Descriptor>

PMT program-level descriptors (program_info), carried verbatim. Export re-emits these; the SCTE-35 ‘CUEI’ registration is derived when absent.

§program: Option<Program>

Program identity from the PAT. Present only for a source that carries one (a TS input); omitted for media-only broadcasts, so export then synthesizes a minimal identity.

§si: BTreeMap<u16, BTreeMap<u8, SiEntry>>

Standalone SI tables, keyed by the PID they ride on (0x0011 SDT, 0x0010 NIT, 0x0012 EIT, …) and then by table_id. The section bytes themselves live on each entry’s snapshot track; the catalog only maps where they are and how often export must re-emit them. Export re-emits each entry’s sections byte-for-byte on its PID, so the service name, provider, network, and EPG survive without anyone parsing them.

table_id is byte 0 of generic section syntax (ISO 13818-1), so the key is no less generic than the PID: which ranges mean what is a DVB convention, and none appears here.

JSON object keys are strings, so both keys are written in decimal ("17") rather than as numbers. The catalog is parsed via serde_json::Value, which will not coerce a string key back to an integer on its own.

Reading also accepts the form every published moq-cli through 0.11 wrote, {"17": {"interval": 2000, "sections": ["<base64>"]}}: the sections inline under the PID with no table_id level. Those decode into one entry per table_id (byte 0 of each section) carrying its sections in SiEntry::sections and naming no track. Nothing writes that form: serializing such an entry fails rather than emit a dangling track reference.

§mux_rate: Option<u64>

The rate the PCR clock paces the whole multiplex at, in bits per second: every PID plus PSI plus null stuffing, measured between PCRs on import. Not a sum of elementary streams; each rendition’s bitrate keeps its codec meaning. Present only while the source is constant-rate, so a VBR or file-paced input leaves it absent. Export pads its output with null packets to this rate.

§passthrough: Option<PassthroughTrack>

The track carrying the multiplex whole, when a Passthrough publishes it rather than demultiplexing it.

Implementations§

Source§

impl Mpegts

Source

pub fn serialize<__S>( __self: &Mpegts, __serializer: __S, ) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Source§

impl<'de> Mpegts

Source

pub fn deserialize<__D>(__deserializer: __D) -> Result<Mpegts, __D::Error>
where __D: Deserializer<'de>,

Source§

impl Mpegts

Source

pub fn is_empty(&self) -> bool

True when the section carries nothing, so it’s omitted from the catalog.

Trait Implementations§

Source§

impl Clone for Mpegts

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Mpegts

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Mpegts

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Mpegts

Source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Mpegts

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Mpegts

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Mpegts

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
§

impl<T> CatalogExt for T
where T: Serialize + DeserializeOwned + Default + Clone + Send + Unpin + 'static,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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