mx_remote/types/multiviewer.rs
1// Author: Lars Op den Kamp (lars@opdenkamp-it.nl)
2// Copyright (c) 2026 Op den Kamp IT Solutions
3
4//! The state a OneIP multiviewer reports.
5
6use crate::wire::{
7 DeviceUid, MultiviewerAspectRatio, MultiviewerBool, MultiviewerEdidTemplate,
8 MultiviewerHdcpMode, MultiviewerItcMode, MultiviewerOutputMode, MultiviewerPipPosition,
9 MultiviewerPipSize, MultiviewerSource, MultiviewerViewMode,
10};
11
12/// How many windows a multiviewer can show, and how many sources it maps.
13pub const MULTIVIEWER_INPUTS: usize = 4;
14
15/// A multiviewer's complete reported state.
16///
17/// Every enumerated field passes an unrecognised wire value through as it
18/// arrived, so a firmware that adds a mode reaches the caller as a value it
19/// does not know rather than as whichever mode happens to be zero.
20#[derive(Clone, Debug, Default, PartialEq, Eq)]
21pub struct MultiviewerStatus {
22 /// The multiviewer this report describes.
23 pub uid: DeviceUid,
24 /// The source device mapped to each of the four inputs.
25 pub mappings: [DeviceUid; MULTIVIEWER_INPUTS],
26 /// The MCU firmware version.
27 pub mcu_version: String,
28 /// The scaler firmware version.
29 pub scaler_version: String,
30 /// The layout the hardware reports, which the firmware maps to `view_mode`.
31 pub hw_view_mode: u8,
32 /// The window layout.
33 pub view_mode: MultiviewerViewMode,
34 /// Where the picture-in-picture window sits.
35 pub pip_position: MultiviewerPipPosition,
36 /// How large the picture-in-picture window is.
37 pub pip_size: MultiviewerPipSize,
38 /// The output resolution and refresh rate.
39 pub output_mode: MultiviewerOutputMode,
40 /// The HDCP version negotiated on the output.
41 pub hdcp_mode: MultiviewerHdcpMode,
42 /// The IT-content flag set on the output.
43 pub output_itc: MultiviewerItcMode,
44 /// The EDID template presented to the sources.
45 pub edid_template: MultiviewerEdidTemplate,
46 /// The aspect ratio the windows are scaled to.
47 pub aspect_ratio: MultiviewerAspectRatio,
48 /// Whether the multiviewer switches windows on its own.
49 pub auto_switch: MultiviewerBool,
50 /// The window whose audio is being output.
51 pub audio_source: MultiviewerSource,
52 /// Output volume as a percentage, or `None` when the device reported a
53 /// value outside 0..=100.
54 pub audio_volume: Option<u8>,
55 /// Whether the output is muted.
56 pub audio_muted: MultiviewerBool,
57 /// The source shown in each of the four windows.
58 pub video_sources: [MultiviewerSource; MULTIVIEWER_INPUTS],
59 /// The window receiving remote-control passthrough.
60 pub remote_control: MultiviewerSource,
61}