Skip to main content

mxr_v2ip_decoder_t

Struct mxr_v2ip_decoder_t 

Source
#[repr(C)]
pub struct mxr_v2ip_decoder_t { pub detail: mxr_v2ip_decoder_detail_t, pub reason: u8, pub blocking: bool, pub width: u16, pub height: u16, pub format: u16, pub updates: u16, pub flags: u32, pub blocked_count: u32, }
Expand description

What a sink’s decoder recovered from the codestream it is being given.

This is what the decoder understood, read ahead of the scaler: the geometry is unrounded and is not what the display is being sent. Every field but detail is zero unless detail is MXR_V2IP_DECODER_ANSWERED.

detail follows the sink being configured rather than the sink being enabled, so a sink that is switched off still reports - as reason 10, or from an older sender as reason 1, which is the same reading a sink whose source has died produces. Nothing here answers whether a sink is enabled.

Colour depth is absent on purpose and will stay absent: the video processor answers that from a driver constant rather than from the codestream, so there is no reading to carry. Assert depth at the encoder’s input bay instead.

Fields§

§detail: mxr_v2ip_decoder_detail_t

Which of the three states this report is in.

§reason: u8

The primary cause of the state the decoder is in, by the sender’s own names: 0 OK, 1 NO_PACKETS, 2 PACKETS_DEGRADED, 3 NO_FORMAT, 4 FORMAT_MISMATCH, 5 FORMAT_REJECTED, 6 DECODER_BLOCKED, 7 SWITCH_PENDING, 8 PTP_UNLOCKED, 9 TX_BRIDGE_UNLOCKED, 10 IDLE. Firmware adds causes, so an unrecognised value is passed through as it arrived.

The primary cause only, and the numbers are identities rather than ranks: several causes can be true at once and a fixed priority order in the firmware decides which lands here. Classify on flags, which carries all of them; a test against this field asks which cause won instead. Reason 10 is the exception and is read here: it outranks the whole word, and testing it first is what stops a switched-off sink being reported as broken. Reason 9 is the one most often hidden here — see flags.

A pending switch is a step in an operation someone asked for rather than a fault, and PTP unlocked costs audio alone: audio cannot enable and the picture is unaffected, so reporting it as a fault puts an overlay over a good picture. Reason 10 says the sink is switched off, and carries no implication about width and height: those are read before any cause is decided, so a switched-off sink still detecting a codestream reports a real geometry. An older sender reports reason 1 for the same sink, so an absent reason 10 is not evidence a sink is enabled - nothing here answers that, which comes from mxr_v2ip_details() or the device’s HTTP status.

§blocking: bool

The converter watchdog is holding the stream back.

§width: u16

The recovered picture width, and 0 when none was recovered.

§height: u16

The recovered picture height, and 0 when none was recovered.

§format: u16

The recovered colour space: 0 RGB, 1 YCbCr 4:4:4, 2 YCbCr 4:2:2, 3 YCbCr 4:2:0, 255 the decoder cannot name it.

No value here means “no signal”: a decoder with nothing to decode reports 0, which is indistinguishable from a real RGB reading. A zero width or height is what says the decoder recovered nothing - which is not the same as the sink being switched off, and does not imply it. The 255 is its own value rather than the 0xF a signal report uses for an unknown colour space.

§updates: u16

How many readings the sink has stored. Monotonic, wrapping at 65535 after some 36 hours, and never reset.

A sink reads its video processor every two seconds and reports every second, so roughly every other report repeats a reading already seen: a frame arriving says nothing about how fresh the values in it are. This counter moves only when a reading is stored, so a processor that stopped answering leaves it still rather than implying a refresh.

After pointing a sink at something else, wait for this to advance by two before trusting the geometry. It ticks when a reply lands rather than when a query is sent, so the first tick can carry an answer the processor read fractionally before the switch; the second cannot, because at most one query is outstanding at a time.

§flags: u32

Every cause that applies, as bit N for reason N, where reason carries the primary one. Bit 0 is cleared by the sender, so an empty word means nothing beyond the primary cause applies.

This is what to classify on, once reason 10 has been ruled out. That cause outranks the whole word and leaves the bits below it set - a sink switched off while running keeps the bits the decoder genuinely saw on the way down - so a fault mask over flags reports a deliberately disabled sink as broken.

A cause that is true can be missing from reason and present here: reason 9, the pipeline rebuilding after the transmitter bridge stayed unlocked, sits below every input-side cause, so a pipeline restarting in a loop shows an input-side cause in reason and bit 9 here alone - always, rather than briefly. Bit 9 needs a sustained five seconds to appear at all, and sustained across reports it means a restart loop rather than one event, because the sender’s debounce restarts each time it elapses.

Reasons 3 and 4 are the two arms of one decision and never appear together.

§blocked_count: u32

How many times the converter watchdog has triggered.

Trait Implementations§

Source§

impl Clone for mxr_v2ip_decoder_t

Source§

fn clone(&self) -> mxr_v2ip_decoder_t

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 Copy for mxr_v2ip_decoder_t

Source§

impl From<V2ipDecoderDetail> for mxr_v2ip_decoder_t

Source§

fn from(detail: V2ipDecoderDetail) -> Self

Converts to this type from the input type.

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> 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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.