#[non_exhaustive]pub struct Snapshot {
pub streams: BTreeMap<u16, Stream>,
pub crc_error: u64,
pub ts_sync_loss: u64,
pub sync_byte_error: u64,
pub pat_error: u64,
pub continuity_count_error: u64,
pub pmt_error: u64,
pub transport_error: u64,
pub pcr_repetition_error: u64,
pub pcr_discontinuity_indicator_error: u64,
pub pts_error: u64,
}Expand description
What each demuxed elementary stream delivered, and the audio frame sync it lost or could not verify, keyed by elementary stream PID; the PSI sections the stream as a whole lost to corruption; and its TR 101 290 errors.
Take one with Import::stats. Every count is cumulative for the
life of the importer, so what an operator alarms on is the rate: a feed that resyncs once an
hour is healthy, one that resyncs every second is losing audio, and one whose access units
stop advancing while the mux keeps flowing has lost that stream.
The fields named for ETSI TR 101 290 (V1.4.1) checks count them at that standard’s fixed
limits. They grade the stream as the importer received it, not the wire a receiver sees
downstream. TR 101 290’s PID_error is covered, more strictly, by each row’s units and
quiet: a dead video path behind a live mux still sends PCR-only packets on its PID, which
a packet count reads as live. PCR_accuracy_error is not measured.
Export carries the same rows for the streams an exporter writes, so one schema reads
both edges.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.streams: BTreeMap<u16, Stream>One row per PID, ordered by PID: each elementary stream the PMT lists, carried or
refused, and each PID no table claims that the importer dropped packets on. A dropped
PID’s row names no track, is Class::Data, and counts its packets in
Stream::refused. A PID keeps one row for its life: a PMT that claims it, releases it,
or claims it again moves the row with its counters, and while dropped it names no track.
Packets before every listed PMT has arrived are acquisition and not counted; so are null
packets. An import of one program from a multiplex that lists
others counts no PID no table claims, since another program’s PMT may. An SI PID has a
.si row only once it counts Stream::unplaced sections.
crc_error: u64PAT and PMT sections dropped because their CRC-32 did not match. Each one left the
table already in force standing, or, before any, delayed the program’s start to the
next good repetition. Counted for the stream rather than per elementary stream, since
the PSI PIDs have no row of their own. TR 101 290 2.2 CRC_error, on the PAT and PMT
only: the reduced-SI set of its table 5.1b. Captured SI is not CRC-checked.
ts_sync_loss: u641.1 TS_sync_loss: sync lost after two consecutive corrupt sync bytes on the packet
grid, and acquired again after five correct ones (ISO/IEC 13818-1 G.1).
sync_byte_error: u641.2 Sync_byte_error: a byte other than 0x47 where the grid expects a sync byte, while
in sync.
pat_error: u641.3 PAT_error_2: each 0.5 s of health clock without a PAT section on PID 0, and each
packet on PID 0 that is scrambled or starts a section other than a PAT.
continuity_count_error: u641.4 Continuity_count_error, on every PID but the null PID: a counter gap, or a third
copy of a packet. A gap declared by discontinuity_indicator, the one duplicate ISO/IEC
13818-1 2.4.3.3 permits, and a payload-less packet repeating its counter are not errors.
A loss of exactly 16 packets leaves the counter in step, and only a byte comparison
tells a loss of 15 from a duplicate, so the count is a floor.
pmt_error: u641.5 PMT_error_2: each 0.5 s of health clock without a PMT section on a PMT PID the
PAT names for the imported program, and each scrambled packet on one.
transport_error: u642.1 Transport_error: packets with transport_error_indicator set, on any PID. Such a
packet counts nothing else.
pcr_repetition_error: u642.3a PCR_repetition_error: consecutive PCR values more than 100 ms apart, or no
advancing PCR for over 100 ms of health clock, counted once until the PCR advances.
The health clock follows the PCR and, across a stall, the packets the multiplex carries
at the constant rate the PCR measured, so it grades the encoder’s insertion however the
input is batched. Without a measured rate it falls back to arrival, read once per input
chunk, which includes upstream delays. A PCR-bearing signalled discontinuity resets the
outage, and its PCR value difference is not graded.
pcr_discontinuity_indicator_error: u642.3b PCR_discontinuity_indicator_error: consecutive PCR values outside 0 to 100 ms
apart, backwards included, without discontinuity_indicator. On values a run of missing
PCRs and an unsignalled jump are the same difference, so a forward step over 100 ms
counts here and as a repetition error both.
pts_error: u642.5 PTS_error: each 700 ms of health clock without a PTS on an elementary stream
that has carried one. Verbatim streams are not graded: SCTE-35 and subtitles have no
cadence to hold.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Snapshot
impl<'de> Deserialize<'de> for Snapshot
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Snapshot
Source§impl From<Export> for Snapshot
An export’s rows with every stream-wide counter zero, so one Log reads either edge.
impl From<Export> for Snapshot
An export’s rows with every stream-wide counter zero, so one Log reads either edge.
impl StructuralPartialEq for Snapshot
Auto Trait Implementations§
impl Freeze for Snapshot
impl RefUnwindSafe for Snapshot
impl Send for Snapshot
impl Sync for Snapshot
impl Unpin for Snapshot
impl UnsafeUnpin for Snapshot
impl UnwindSafe for Snapshot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> CatalogExt for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.