Skip to main content

Crate mx_remote_ffi

Crate mx_remote_ffi 

Source
Expand description

C ABI for mx_remote.

The whole of this crate is one translation: it holds every unsafe in the workspace, and adds no protocol logic of its own. Anything a caller can do here is something the core crate already does; if a rule is not enforced in mx_remote, it is not enforced at all.

Three conventions run through the header, and knowing them is most of knowing the API:

  • A device is addressed by value. There is no handle for a device or a bay: a device is a mxr_uid_t, a bay is a mxr_bay_uid_t, and state is read by passing one in and having a struct filled out. Nothing hands back a pointer into state that a lock protects.
  • Every call returns, whatever happens. An unwind across the boundary is undefined behaviour, so each entry point catches: a panic becomes mxr_result_t::MXR_ERR_PANIC rather than a corrupted stack.
  • A borrowed pointer lives for one call. Strings and arrays handed to a callback point into memory the library owns and reuses. A caller that needs one afterwards copies it.

Every failure code is negative and mxr_result_t::MXR_OK is zero, so if (rc < 0) is a complete test, and a code added later cannot turn a failure into a success.

§From C

#include <mx_remote.h>

/* The client cannot be its own userdata: it does not exist when the table
 * is handed over, so it reaches the callbacks through a struct that does. */
struct app { mxr_remote_t *remote; };

static void on_device_update(void *userdata, mxr_uid_t device) {
    mxr_device_info_t info;
    if (mxr_device(((struct app *)userdata)->remote, device, &info) == MXR_OK)
        printf("%s %s\n", info.model, info.name);
}

int main(void) {
    struct app app = {0};
    mxr_callbacks_t cb = {0};
    cb.on_device_update = on_device_update;

    /* Zeroing a config asks for every default; NULL does the same. */
    app.remote = mxr_remote_new(NULL, &cb, &app);
    mxr_remote_start(app.remote);
    /* ... */
    mxr_remote_free(app.remote);
    return 0;
}

include/mx_remote.h is generated from this source by cbindgen and checked into the repository. include/mx_remote.hpp is a hand-written header-only C++ layer over it, with a move-only mxr::Remote that closes and joins in its destructor and an mxr::Handler base class carrying a virtual method per event.

Structs§

mxr_action_transmit_request_t
Asks one device to perform a remote-control action.
mxr_amp_zone_settings_t
A ProAmp8 zone’s gain, delay, tone and power settings.
mxr_audio_change_source_t
Which source endpoint an audio sink endpoint was switched to.
mxr_audio_details_t
The audio a bay signal report describes.
mxr_audio_endpoint_t
One node of a device’s audio tree.
mxr_audio_format_t
A stream’s sample rate and channel count.
mxr_bay_info_t
What a bay is, and what is connected to it.
mxr_bay_name_change_t
Asks a device to rename one of its bays.
mxr_bay_uid_t
A single bay: the device it is on, and its port number there.
mxr_blacklist_change_t
Registers or unregisters a device on the source blacklist.
mxr_cable_status_t
The diagnostic result for one UTP cable pair.
mxr_callbacks_t
What to call when something happens.
mxr_config_t
How a client finds the network.
mxr_device_info_t
What a device is, and what it is doing.
mxr_dolby_settings_t
A ProAmp8’s Dolby settings.
mxr_edid_profile_change_t
Asks a device to switch its input EDID profile.
mxr_edid_record_t
One EDID block from a device’s reply.
mxr_edid_request_t
Asks one device for its EDID.
mxr_factory_reset_request_t
Asks peers to factory-reset.
mxr_firmware_version_t
One firmware component a device reports.
mxr_ir_capture_t
Raw IR captured on a bay of the sending device.
mxr_ir_meta_t
The metadata shared by the raw-IR capture and transmit frames.
mxr_ir_transmit_request_t
Asks one device to blast raw IR on one of its local bays.
mxr_key_transmit_request_t
Asks one device to send a remote-control key on a bay.
mxr_multiviewer_command_t
A command addressed to a multiviewer.
mxr_multiviewer_status_t
What a multiviewer reports about itself.
mxr_network_port_t
The link state and diagnostics of one network port.
mxr_power_save_request_t
Asks a sink to enter or leave power save.
mxr_rc_settings_t
The remote-control configuration of a source bay.
mxr_remote_t
A running client. Opaque: everything about it is reached through the functions below.
mxr_set_route_request_t
Asks a device, addressed by serial, to switch a sink.
mxr_signal_details_t
The signal a bay measures, beyond the description in mxr_bay_info_t::signal_type.
mxr_stream_addr_t
One stream of a route the caller assembles.
mxr_stream_source_t
One multicast stream address.
mxr_stream_sources_t
The streams one V2IP source advertises.
mxr_tiling_config_t
The window a sink is currently told to show.
mxr_time_zone_t
The time zone a device announces for its mesh. An empty name and rule mean the controller has none, and the devices keep UTC.
mxr_topology_entry_t
One device in a topology report.
mxr_uid_t
The 16-byte identifier of a device on the network.
mxr_unit_status_t
A unit’s health and IP configuration, as it last reported them. Addresses are dotted quads.
mxr_v2ip_decoder_t
What a sink’s decoder recovered from the codestream it is being given.
mxr_v2ip_details_t
A V2IP device’s own encoder configuration.
mxr_v2ip_device_settings_t
A V2IP device’s settings.
mxr_v2ip_output_mode_t
The output format to scale a V2IP sink to.
mxr_v2ip_power_save_t
A V2IP device’s power save settings, beside mxr_v2ip_device_settings_t rather than in it so that struct keeps its size.
mxr_v2ip_ptp_settings_t
A V2IP device’s PTP settings, beside mxr_v2ip_device_settings_t rather than in it so that struct keeps its size.
mxr_v2ip_ptp_t
A V2IP device’s PTP state, as it reported it about itself.
mxr_v2ip_route_t
The three streams a manual route points a V2IP sink at.
mxr_v2ip_rx_stats_t
Receiver stream statistics.
mxr_v2ip_sink_t
The streams a V2IP sink is subscribed to.
mxr_v2ip_stats_t
A device’s V2IP statistics, cumulative and over the last minute.
mxr_v2ip_test_sync_t
A V2IP sink’s lip-sync flash: a pattern frame is marked every period, the frame lead after a mark flashes white, and a beep tone starts offset sample periods after it.
mxr_v2ip_test_tone_t
A V2IP sink’s test tone.
mxr_v2ip_testcard_t
The test card a V2IP sink last reported. The counters run free and wrap.
mxr_v2ip_tx_stats_t
Transmitter stream statistics.
mxr_v2ip_vlan_t
VLAN tagging on a V2IP device’s uplink.
mxr_video_wall_command_t
Asks one sink to crop its source to a wall window.
mxr_video_wall_window_t
Where a video-wall sink’s window sits, and the picture it was measured against.

Enums§

mxr_arc_status_t
The audio return channel a bay is carrying.
mxr_device_status_t
The high-level state of a device on the network.
mxr_power_status_t
The CEC power state of whatever is connected to a bay.
mxr_result_t
How a call ended.
mxr_stream_kind_t
Which of a V2IP device’s streams an address describes.
mxr_tribool_t
A flag a device may not have reported.
mxr_v2ip_decoder_detail_t
What a statistics report says about a sink’s decoder.

Constants§

MXR_AMP_EQ_BANDS
Number of EQ bands an amplifier zone carries.
MXR_AUDIO_AMP_OUTPUT
Is an amplifier output.
MXR_AUDIO_AUDIO_LOCK
Keeps its audio source when the video route changes, while locked.
MXR_AUDIO_GAIN_CONTROL
Has a gain control.
MXR_AUDIO_HDMI
Carries HDMI audio.
MXR_AUDIO_INPUT
Accepts audio.
MXR_AUDIO_MUTE
Can be muted.
MXR_AUDIO_OUTPUT
Produces audio.
MXR_AUDIO_RCA
Is an analogue RCA connector.
MXR_AUDIO_ROUTE_INPUT
Can be routed to as an input.
MXR_AUDIO_ROUTE_IN_NONE
Accepts “no input” as a route.
MXR_AUDIO_ROUTE_OUTPUT
Can be routed from as an output.
MXR_AUDIO_SPDIF
Is an S/PDIF connector.
MXR_AUDIO_TRIGGER
Drives a trigger output.
MXR_AUDIO_V2IP_RX
Receives a V2IP audio stream.
MXR_AUDIO_V2IP_TX
Sends a V2IP audio stream.
MXR_AUDIO_VOLUME_CONTROL
Has a volume control.
MXR_BAY_AUDIO_AMP_OUT
Amplified audio output.
MXR_BAY_AUDIO_ANA_IN
Analogue audio input.
MXR_BAY_AUDIO_ANA_OUT
Analogue audio output.
MXR_BAY_AUDIO_DIG_IN
Digital audio input.
MXR_BAY_AUDIO_DIG_OUT
Digital audio output.
MXR_BAY_AUTO_OFF
Switches itself off when idle.
MXR_BAY_DOLBY
Dolby decoding.
MXR_BAY_HDMI_IN
HDMI input.
MXR_BAY_HDMI_OUT
HDMI output.
MXR_BAY_IR_IN
Infrared input.
MXR_BAY_IR_OUT
Infrared output.
MXR_BAY_RC_IN
Remote-control input.
MXR_BAY_RC_OUT
Remote-control output.
MXR_BAY_STATUS_AUDIO_ARC_ANALOG
Audio return over analogue is active.
MXR_BAY_STATUS_AUDIO_ARC_HDMI
Audio return over HDMI is active.
MXR_BAY_STATUS_AUDIO_ARC_OPTIC
Audio return over optical is active.
MXR_BAY_STATUS_AUTO_NAME
The bay’s name was generated - a default, or taken from CEC or the EDID - rather than set by a user. A device that predates this bit never sets it, so a clear bit does not prove a user set the name.
MXR_BAY_STATUS_CEC_DETECTED
A CEC device answered.
MXR_BAY_STATUS_CEC_DISABLED
CEC is switched off for this bay.
MXR_BAY_STATUS_DECODER_DISABLE
The V2IP decoder is disabled.
MXR_BAY_STATUS_ENCODER_DISABLE
The V2IP encoder is disabled.
MXR_BAY_STATUS_ENCODER_ERROR
The V2IP encoder reports an error.
MXR_BAY_STATUS_FAULT
The bay reports a fault.
MXR_BAY_STATUS_HDBT_CONNECTED
An HDBaseT link is up.
MXR_BAY_STATUS_HIDDEN
The bay is hidden from the user interface.
MXR_BAY_STATUS_HPD_DETECTED
Hot-plug detect is asserted.
MXR_BAY_STATUS_OFFLINE
The bay is offline.
MXR_BAY_STATUS_POWERED
The bay has power.
MXR_BAY_STATUS_POWERED_OFF
The attached device was powered off.
MXR_BAY_STATUS_POWERED_ON
The attached device was powered on.
MXR_BAY_STATUS_SIGNAL_DETECTED
A signal is present.
MXR_BAY_STATUS_SIGNAL_SCRAMBLE
The signal is scrambled.
MXR_BAY_V2IP_SINK_LOCAL
Is a local V2IP sink.
MXR_BAY_V2IP_SINK_REMOTE
Is a remote V2IP sink.
MXR_BAY_V2IP_SOURCE_LOCAL
Is a local V2IP source.
MXR_BAY_V2IP_SOURCE_REMOTE
Is a remote V2IP source.
MXR_EDID_LEN
Bytes in one EDID: a base block and exactly one extension block.
MXR_FEATURE_AUDIO_AMPLIFIER
Is an audio amplifier.
MXR_FEATURE_AUDIO_RETURN
Supports audio return.
MXR_FEATURE_AUDIO_ROUTING
Routes audio.
MXR_FEATURE_BOOTING
Is still booting.
MXR_FEATURE_BOOT_BIT
Flips on every reboot, so a peer that sees it change knows the device restarted.
MXR_FEATURE_CEC
Speaks CEC.
MXR_FEATURE_CONFIG_INITIALISED
Initialises the configuration it broadcasts.
MXR_FEATURE_IR_RX
Receives infrared.
MXR_FEATURE_IR_TX
Transmits infrared.
MXR_FEATURE_MANAGER
Is a management client rather than a device.
MXR_FEATURE_MESH
Supports meshing.
MXR_FEATURE_MESH_MASTER
Is the master of its mesh.
MXR_FEATURE_MESH_MEMBER
Is a member of a mesh.
MXR_FEATURE_MULTIVIEWER
Is a multiviewer.
MXR_FEATURE_POWER_SAVE
Powers its video processor down in power save. A device without it refuses to enter power save.
MXR_FEATURE_REMOTE_CONTROL
Passes remote-control commands through.
MXR_FEATURE_SETUP_COMPLETED
Installer setup has been completed.
MXR_FEATURE_STATUS_CRASHED
Has crashed since it last booted.
MXR_FEATURE_STATUS_ERROR
Has an error pending.
MXR_FEATURE_STATUS_MCAST_FAULT
Receives one or more peers only by broadcast, because its multicast receive path is faulty.
MXR_FEATURE_STATUS_NOTIFY
Has a notification pending.
MXR_FEATURE_STATUS_POWER_SAVE
Is in power-save mode.
MXR_FEATURE_STATUS_REBOOT
Is about to reboot.
MXR_FEATURE_STATUS_WARNING
Has a warning pending.
MXR_FEATURE_V2IP_SINK
Acts as a V2IP stream sink.
MXR_FEATURE_V2IP_SOURCE
Acts as a V2IP stream source.
MXR_FEATURE_VIDEO_ROUTING
Routes video.
MXR_FEATURE_VIDEO_WALL
Supports video walls.
MXR_FEATURE_VLAN
Tags its uplink by the VLAN configuration it reports, and takes one written to it.
MXR_FEATURE_VOLUME_CONTROL
Controls volume.
MXR_IP_STRING_LEN
Bytes an IPv4 address needs when written as text, the terminator included.
MXR_KEY_BACK
Go back one step.
MXR_KEY_BLUE
Blue colour key.
MXR_KEY_CHANNEL_DOWN
Previous channel.
MXR_KEY_CHANNEL_UP
Next channel.
MXR_KEY_CONTENT_MENU
Open the content menu.
MXR_KEY_CUSTOM_CEC
Base of the range carrying a raw CEC user-control code.
MXR_KEY_CUSTOM_SKY
Base of the range carrying a raw Sky key code.
MXR_KEY_DOWN
Navigate down.
MXR_KEY_EJECT
Eject the medium.
MXR_KEY_FAST_FORWARD
Fast forward.
MXR_KEY_GREEN
Green colour key.
MXR_KEY_GUIDE
Open the programme guide.
MXR_KEY_HELP
Open help.
MXR_KEY_INFORMATION
Show information.
MXR_KEY_INPUT_SELECT
Select an input.
MXR_KEY_INTERACTIVE
Open interactive services.
MXR_KEY_LEFT
Navigate left.
MXR_KEY_MENU
Open the main menu.
MXR_KEY_MODE_3D
Toggle 3D mode.
MXR_KEY_NEXT_CHAPTER
Next chapter.
MXR_KEY_NUM0
Digit 0.
MXR_KEY_NUM1
Digit 1.
MXR_KEY_NUM2
Digit 2.
MXR_KEY_NUM3
Digit 3.
MXR_KEY_NUM4
Digit 4.
MXR_KEY_NUM5
Digit 5.
MXR_KEY_NUM6
Digit 6.
MXR_KEY_NUM7
Digit 7.
MXR_KEY_NUM8
Digit 8.
MXR_KEY_NUM9
Digit 9.
MXR_KEY_PAUSE
Pause playback.
MXR_KEY_PLAY
Start playback.
MXR_KEY_PREVIOUS_CHANNEL
Return to the previous channel.
MXR_KEY_PREV_CHAPTER
Previous chapter.
MXR_KEY_RECORD
Start recording.
MXR_KEY_RED
Red colour key.
MXR_KEY_REWIND
Rewind.
MXR_KEY_RIGHT
Navigate right.
MXR_KEY_SEARCH
Open search.
MXR_KEY_SELECT
Confirm the highlighted item.
MXR_KEY_SKY
Sky home key.
MXR_KEY_SOUND_SELECT
Select an audio track.
MXR_KEY_STOP
Stop playback.
MXR_KEY_SUBTITLE
Toggle subtitles.
MXR_KEY_TEXT
Open teletext.
MXR_KEY_UP
Navigate up.
MXR_KEY_VIDEO_ON_DEMAND
Open video on demand.
MXR_KEY_YELLOW
Yellow colour key.
MXR_MESSAGE_LEN
Bytes a device’s system-status message needs, the terminator included.
MXR_MODEL_LEN
Bytes a model name needs, the terminator included.
MXR_MULTIVIEWER_INPUTS
How many inputs a multiviewer has.
MXR_MV_ASPECT_FULL
Fill the window.
MXR_MV_ASPECT_RATIO_16_9
16:9.
MXR_MV_ASPECT_UNKNOWN
The multiviewer reports no aspect ratio.
MXR_MV_BOOL_OFF
Off.
MXR_MV_BOOL_ON
On.
MXR_MV_BOOL_UNKNOWN
The multiviewer reports no value.
MXR_MV_EDID_4K2K30_444_DOLBY_DTS_51
4K2K30 4:4:4, Dolby/DTS 5.1.
MXR_MV_EDID_4K2K30_444_HD_AUDIO_71
4K2K30 4:4:4, HD audio 7.1.
MXR_MV_EDID_4K2K30_444_STEREO
4K2K30 4:4:4, stereo 2.0.
MXR_MV_EDID_4K2K60_444_DOLBY_DTS_51
4K2K60 4:4:4, Dolby/DTS 5.1.
MXR_MV_EDID_4K2K60_444_HD_AUDIO_71
4K2K60 4:4:4, HD audio 7.1.
MXR_MV_EDID_4K2K60_444_STEREO
4K2K60 4:4:4, stereo 2.0.
MXR_MV_EDID_720P_STEREO
720p, stereo 2.0.
MXR_MV_EDID_1024X768_STEREO
1024x768, stereo 2.0.
MXR_MV_EDID_1080P_DOLBY_DTS_51
1080p, Dolby/DTS 5.1.
MXR_MV_EDID_1080P_HD_AUDIO_71
1080p, HD audio 7.1.
MXR_MV_EDID_1080P_STEREO
1080p, stereo 2.0.
MXR_MV_EDID_1280X1024_STEREO
1280x1024, stereo 2.0.
MXR_MV_EDID_1360X768_STEREO
1360x768, stereo 2.0.
MXR_MV_EDID_1440X900_STEREO
1440x900, stereo 2.0.
MXR_MV_EDID_1600X1200_STEREO
1600x1200, stereo 2.0.
MXR_MV_EDID_1680X1050_STEREO
1680x1050, stereo 2.0.
MXR_MV_EDID_1920X1200_STEREO
1920x1200, stereo 2.0.
MXR_MV_EDID_COPY_OUTPUT
Whatever the display connected to the HDMI output presents. The template a multiviewer leaves the factory with.
MXR_MV_EDID_CUSTOM
The EDID loaded onto the device.
MXR_MV_EDID_UNKNOWN
The multiviewer reports no EDID template.
MXR_MV_HDCP_OFF
Content protection off.
MXR_MV_HDCP_UNKNOWN
The multiviewer reports no HDCP mode.
MXR_MV_HDCP_V14
HDCP 1.4.
MXR_MV_HDCP_V22
HDCP 2.2.
MXR_MV_ITC_PC
PC content.
MXR_MV_ITC_UNKNOWN
The multiviewer reports no IT-content mode.
MXR_MV_ITC_VIDEO
Video content.
MXR_MV_OUTPUT_DCI4K_P50
4096x2160p50.
MXR_MV_OUTPUT_DCI4K_P60
4096x2160p60.
MXR_MV_OUTPUT_HD720_P50
1280x720p50.
MXR_MV_OUTPUT_HD720_P60
1280x720p60.
MXR_MV_OUTPUT_HD1080_P50
1920x1080p50.
MXR_MV_OUTPUT_HD1080_P60
1920x1080p60.
MXR_MV_OUTPUT_UHD_P25
3840x2160p25.
MXR_MV_OUTPUT_UHD_P30
3840x2160p30.
MXR_MV_OUTPUT_UHD_P50
3840x2160p50.
MXR_MV_OUTPUT_UHD_P60
3840x2160p60.
MXR_MV_OUTPUT_UNKNOWN
The multiviewer reports no output mode.
MXR_MV_OUTPUT_WUXGA_P60_RB
1920x1200p60, reduced blanking.
MXR_MV_OUTPUT_WXGA800_P60
1280x800p60.
MXR_MV_OUTPUT_WXGA_P60
1360x768p60.
MXR_MV_OUTPUT_XGA_P60
1024x768p60.
MXR_MV_PIP_POSITION_LEFT_BOTTOM
Bottom left.
MXR_MV_PIP_POSITION_LEFT_TOP
Top left.
MXR_MV_PIP_POSITION_RIGHT_BOTTOM
Bottom right.
MXR_MV_PIP_POSITION_RIGHT_TOP
Top right.
MXR_MV_PIP_POSITION_UNKNOWN
The multiviewer reports no picture-in-picture position.
MXR_MV_PIP_SIZE_LARGE
Large.
MXR_MV_PIP_SIZE_MEDIUM
Medium.
MXR_MV_PIP_SIZE_SMALL
Small.
MXR_MV_PIP_SIZE_UNKNOWN
The multiviewer reports no picture-in-picture size.
MXR_MV_SOURCE_INPUT_1
Input 1.
MXR_MV_SOURCE_INPUT_2
Input 2.
MXR_MV_SOURCE_INPUT_3
Input 3.
MXR_MV_SOURCE_INPUT_4
Input 4.
MXR_MV_SOURCE_UNKNOWN
The multiviewer reports no source.
MXR_MV_VIEW_MODE_FOUR_SCREEN_EQUAL
Four windows, equal size.
MXR_MV_VIEW_MODE_FOUR_SCREEN_SMALL
Four windows, small.
MXR_MV_VIEW_MODE_PIP
Picture in picture.
MXR_MV_VIEW_MODE_SINGLE
One full-screen window.
MXR_MV_VIEW_MODE_THREE_SCREEN_LARGE
Three windows, large.
MXR_MV_VIEW_MODE_THREE_SCREEN_SMALL
Three windows, small.
MXR_MV_VIEW_MODE_TWO_SCREEN_LARGE
Two windows, large.
MXR_MV_VIEW_MODE_TWO_SCREEN_SMALL
Two windows, small.
MXR_MV_VIEW_MODE_UNKNOWN
The multiviewer reports no window layout.
MXR_NAME_LEN
Bytes a device, bay or port name needs, the terminator included.
MXR_SCALING_FLAG_AUTO_SCALING
Set when the output scales automatically.
MXR_SCALING_FLAG_MATCH_SOURCE
Set when the output follows its source’s format instead of a fixed one.
MXR_SCALING_FLAG_MODE_VALID
Set when the frame carries a scaling mode and refresh rate.
MXR_SCALING_FLAG_OPTIONS2_VALID
Set when the frame carries the second group of scaling options.
MXR_SCALING_FLAG_OPTIONS_VALID
Set when the frame carries the scaling options.
MXR_SCALING_FLAG_SKIP_420
Set when the output declines 4:2:0 rather than scaling it.
MXR_SERIAL_LEN
Bytes a serial number needs, the terminator included.
MXR_SIGNAL_TYPE_LEN
Bytes a signal description such as 1080p60 444 8 needs, the terminator included.
MXR_TIME_ZONE_NAME_LEN
Bytes in mxr_time_zone_t.zone, its NUL included.
MXR_TIME_ZONE_RULE_LEN
Bytes in mxr_time_zone_t.rule, its NUL included.
MXR_UID_STRING_LEN
Bytes a mxr_uid_t needs when written as text, the terminator included.
MXR_UNIT_AUTO_DISABLE
The decoder disables itself without a display.
MXR_UNIT_AUTO_DISABLE_ACTIVE
The decoder disabled itself without a display.
MXR_UNIT_BOOT_COUNT
boot_count is reported.
MXR_UNIT_DECODER_ACTIVE
The decoder is enabled.
MXR_UNIT_DHCP
The IP configuration comes from DHCP.
MXR_UNIT_ENCODER_ACTIVE
The encoder is enabled.
MXR_UNIT_EXTERNAL_PSU
Powered by an external supply rather than PoE.
MXR_UNIT_FAN_QUIET
The fan runs in quiet mode.
MXR_UNIT_FAN_SPEED
fan_rpm is reported.
MXR_UNIT_FPGA_CONFIGURED
The video processor runs with its IP configured. Without it encoder_health and decoder_health carry nothing.
MXR_UNIT_FPGA_UPGRADE
A newer video processor image is available.
MXR_UNIT_MAX_TEMPERATURES
The most temperatures a unit reports.
MXR_UNIT_NET_PENDING
The IP configuration was changed through the mesh, and is reverted unless the mesh controller confirms it within net_revert_s.
MXR_UNIT_OFF_NO_SIGNAL
The HDMI output switches off without a signal.
MXR_UNIT_OFF_NO_SIGNAL_ACTIVE
The HDMI output switched off without a signal.
MXR_UNIT_POWER_CHECK
Display power is checked before the decoder is enabled.
MXR_UNIT_REBOOT_REQUIRED
A changed setting takes effect after a reboot.
MXR_UNIT_STATUS_MESSAGE_LEN
Bytes in mxr_unit_status_t.status_message, its NUL included.
MXR_UTP_PAIRS
How many pairs a UTP cable diagnostic covers.
MXR_V2IP_COLOUR_RGB
The colour space a V2IP sink scales its output to.
MXR_V2IP_COLOUR_YCBCR420
YCbCr 4:2:0. See MXR_V2IP_COLOUR_RGB.
MXR_V2IP_COLOUR_YCBCR422
YCbCr 4:2:2. See MXR_V2IP_COLOUR_RGB.
MXR_V2IP_COLOUR_YCBCR444
YCbCr 4:4:4. See MXR_V2IP_COLOUR_RGB.
MXR_V2IP_IR_PROFILE_MAX
One past the highest infrared profile.
MXR_V2IP_IR_PROFILE_NOT_SET
The output infrared port follows the global one.
MXR_V2IP_MINUTES_PER_DAY
Minutes in a day: every power save time is below this.
MXR_V2IP_PTP_DOMAIN_MAX
The highest PTP domain a V2IP device runs in.
MXR_V2IP_PTP_FOLLOWED
The device locked to a master since its PTP started, so its mesh holds a time.
MXR_V2IP_PTP_LOCK_LOCKED
Locked.
MXR_V2IP_PTP_LOCK_LOCKING
Locking.
MXR_V2IP_PTP_LOCK_UNLOCKED
Not locked.
MXR_V2IP_PTP_MODE_AUTO
Follows a grandmaster, or becomes one when there is none.
MXR_V2IP_PTP_MODE_FOLLOWER
Follows a grandmaster, and never becomes one.
MXR_V2IP_PTP_MODE_OFF
No PTP.
MXR_V2IP_PTP_VALID
The device runs PTP and the block holds its state.
MXR_V2IP_SCALING_REFRESH_MAX
Highest refresh rate a V2IP output stage accepts, in Hz.
MXR_V2IP_SCALING_REFRESH_MIN
Lowest refresh rate a V2IP output stage accepts, in Hz.
MXR_V2IP_SETTING_AUTO_POWER_SAVE
The idle minutes before the device powers down, carried in mxr_v2ip_power_save_t.auto_minutes.
MXR_V2IP_SETTING_CEC_COMBO_INPUT
Accepts CEC combo keys for the device’s own input.
MXR_V2IP_SETTING_CEC_COMBO_KEYS
Accepts CEC combo keys.
MXR_V2IP_SETTING_CLOCK_SET
The device’s clock has been set, on/off. Never written.
MXR_V2IP_SETTING_FAN_QUIET
Runs the fan in quiet mode.
MXR_V2IP_SETTING_IR_PROFILE
The global infrared port’s profile, carried in ir_profile.
MXR_V2IP_SETTING_IR_PROFILES
The stored infrared profiles, carried in ir_profiles. Never written.
MXR_V2IP_SETTING_IR_PROFILE_SINK
The output infrared port’s profile, carried in ir_profile_sink.
MXR_V2IP_SETTING_IR_TX_MODULATED
Sends infrared modulated.
MXR_V2IP_SETTING_NETWORK_LED
Lights the network port LEDs.
MXR_V2IP_SETTING_POWER_SAVE_SCHEDULE
The daily power save windows, carried in mxr_v2ip_power_save_t’s start and end.
MXR_V2IP_SETTING_PTP_DOMAIN
The PTP domain, carried in mxr_v2ip_ptp_settings_t’s domain.
MXR_V2IP_SETTING_PTP_MODE
The PTP mode, carried in mxr_v2ip_ptp_settings_t’s mode.
MXR_V2IP_SETTING_PTP_PRIORITY1
The PTP grandmaster priority1, carried in mxr_v2ip_ptp_settings_t’s priority1.
MXR_V2IP_SETTING_SINK_CHECK_POWER
Disables the decoder while the display is off.
MXR_V2IP_SETTING_SINK_OFF_NO_SIGNAL
Disables the HDMI output while there is no signal.
MXR_V2IP_SETTING_STATUS_LED
Lights the status LED.
MXR_V2IP_SYNC_BEEP_MS_MAX
The longest lip-sync beep, in milliseconds.
MXR_V2IP_SYNC_BEEP_MS_MIN
The shortest lip-sync beep, in milliseconds.
MXR_V2IP_SYNC_OFFSET_MAX
The largest lip-sync beep offset, in sample periods.
MXR_V2IP_TESTCARD_PATTERN_PENDING
A pattern change has yet to reach the video processor.
MXR_V2IP_TESTCARD_PLAYING
The tone plays on the output.
MXR_V2IP_TESTCARD_SHOWING
The output shows the pattern.
MXR_V2IP_TESTCARD_SUPPORTED
The sink can draw the test card.
MXR_V2IP_TESTCARD_SYNC_PENDING
A lip-sync change has yet to reach the video processor.
MXR_V2IP_TESTCARD_TONE_PENDING
A tone change has yet to reach the video processor.
MXR_V2IP_TEST_PATTERN_BARS
Colour bars.
MXR_V2IP_TEST_PATTERN_CARD
A test card.
MXR_V2IP_TEST_PATTERN_FLAT
One flat colour, the test card’s colour.
MXR_V2IP_TEST_PATTERN_GRID
A grid.
MXR_V2IP_TEST_PATTERN_OFF
No pattern.
MXR_V2IP_TEST_PATTERN_RAMP
A ramp.
MXR_V2IP_TEST_PATTERN_STRIP
A strip.
MXR_V2IP_TONE_CHANNELS_MAX
The most channels a test tone plays on.
MXR_V2IP_TONE_FREQ_MAX
The highest test tone frequency, in Hz.
MXR_V2IP_TONE_FREQ_MIN
The lowest test tone frequency, in Hz.
MXR_V2IP_TONE_LEVEL_MIN
The quietest test tone level, in dBFS.
MXR_V2IP_TONE_MODE_BEEP
A beep on each lip-sync mark.
MXR_V2IP_TONE_MODE_CONTINUOUS
A continuous tone.
MXR_V2IP_TONE_MODE_IDENT
A channel ident.
MXR_V2IP_TONE_MODE_LINEUP
A line-up tone, which needs two channels or more.
MXR_V2IP_TONE_MODE_OFF
No tone.
MXR_V2IP_VLAN_CONFIRM
Sent by the mesh controller: a pending configuration it heard, which the device then keeps.
MXR_V2IP_VLAN_HAS_SFP
Reported by the device: it has an SFP port. Never written.
MXR_V2IP_VLAN_ID_MAX
The highest VLAN id: 0 means untagged, and 4095 is reserved by IEEE 802.1Q.
MXR_V2IP_VLAN_PENDING
Reported by the device: the configuration is applied, and reverted unless the mesh controller confirms it. Never written.
MXR_V2IP_VLAN_PORTS
The ports in mxr_v2ip_vlan_t::port.
MXR_V2IP_VLAN_PORT_SFP
The index of the SFP port in mxr_v2ip_vlan_t::port.
MXR_V2IP_VLAN_TRUNK
Untagged frames arriving on the uplink are dropped instead of reaching the device.
MXR_V2IP_VLAN_VALID
The block carries a configuration. A block without it carries nothing.
MXR_VERSION_LEN
Bytes a firmware version string needs, the terminator included.
MXR_VIDEO_WALL_MIN_SIZE
Neither side of a window may be smaller than this.
MXR_VIDEO_WALL_POS_ALIGN
A window’s horizontal origin must be a multiple of this.
MXR_VIDEO_WALL_WIDTH_ALIGN
A window’s width must be a multiple of this.

Functions§

mxr_audio_endpoint_children⚠
Writes the endpoints hanging off one audio endpoint, and returns how many there are.
mxr_audio_endpoint_status⚠
Fills out with the state an audio endpoint reports, on the bits of its features: MXR_AUDIO_MUTE while it is muted, MXR_AUDIO_TRIGGER while its trigger is active, and MXR_AUDIO_AUDIO_LOCK while its source is locked. Beside mxr_audio_endpoint_t rather than in it, so that struct keeps its size.
mxr_audio_endpoints⚠
Writes a device’s audio endpoints, in the order it reported them, and returns how many there are.
mxr_auto_assign_v2ip_source_addresses⚠
Hands a V2IP source’s stream addresses back to automatic assignment, undoing addresses that were set on it by hand. The device’s next configuration report carries the addresses it ends up with.
mxr_bay⚠
Fills out with what is known about a bay.
mxr_bay_amp_settings⚠
Fills out with an amplifier zone’s settings.
mxr_bay_audio_details⚠
Fills out with the audio a bay’s signal report describes.
mxr_bay_by_name⚠
Finds a bay on a device by the name the device gives its port.
mxr_bay_by_stream_ip⚠
Finds the source bay advertising a multicast group.
mxr_bay_filtered⚠
Writes the devices whose signals a bay refuses, and returns how many there are.
mxr_bay_signal_details⚠
Fills out with the signal a bay measures.
mxr_bay_status_hdcp
The HDCP version a bay status word carries in bits 22-23.
mxr_bay_status_rc_type
The remote-control type a bay status word carries in bits 16-19.
mxr_clear_mesh_time_zone⚠
Clears the time zone of every device that hears it, which then keeps UTC: mxr_set_mesh_time_zone() with an empty name and rule, which that call refuses.
mxr_clear_unit_status⚠
Clears a unit’s current system status. As mxr_upgrade_unit_fpga().
mxr_clear_v2ip_output_mode⚠
Clears the output format a V2IP sink is configured to scale to.
mxr_confirm_unit_network⚠
Keeps a unit’s pending IP configuration, as its mesh controller does when it hears the unit at its new address. As mxr_upgrade_unit_fpga().
mxr_device⚠
Fills out with what is known about a device.
mxr_device_bays⚠
Writes a device’s bays in port order, and returns how many there are.
mxr_device_by_serial⚠
Finds a device by its serial number.
mxr_device_clock⚠
Fills out with a device’s clock as of now, in seconds since 1970 UTC: the time it last announced, advanced by how long ago that arrived.
mxr_device_edid⚠
Copies the EDID a device last reported into out.
mxr_device_firmware⚠
Writes the firmware versions a device reports, and returns how many there are.
mxr_device_temperatures⚠
Writes the temperatures a device reports, in its own order, in degrees Celsius, and returns how many there are.
mxr_devices⚠
Writes every device heard from, and returns how many there are.
mxr_discover⚠
Asks every device on the network to announce itself.
mxr_dolby_settings⚠
Fills out with a ProAmp8’s Dolby settings.
mxr_frames_received⚠
Writes how many frames from other senders have parsed since mxr_remote_start().
mxr_last_error
Why the last call on this thread failed, or an empty string.
mxr_multiviewer_auto_route⚠
Asks a multiviewer to map its inputs to the sources it can see.
mxr_multiviewer_status⚠
Fills out with what a multiviewer reports about itself.
mxr_network_status⚠
Writes a device’s network ports, and returns how many there are.
mxr_ping⚠
Asks a device to announce itself now, so a device suspected to be gone is confirmed or ruled out within a second or two.
mxr_power_off⚠
Powers off what is attached to a bay.
mxr_power_on⚠
Powers on what is attached to a bay.
mxr_preview_video_wall⚠
Shows a window on a sink’s video wall without storing it.
mxr_rc_settings⚠
Fills out with a source bay’s remote-control configuration.
mxr_reboot⚠
Reboots a device.
mxr_remote_close⚠
Stops the threads and closes the socket. Idempotent.
mxr_remote_free⚠
Closes the client and releases it. Null is ignored.
mxr_remote_name⚠
Writes the name this client advertises.
mxr_remote_new⚠
Creates a client, without opening a socket yet.
mxr_remote_start⚠
Opens the socket and starts the receive and timer threads.
mxr_remote_target⚠
Writes the address this client sends to.
mxr_remote_uid⚠
Writes this client’s own identifier.
mxr_remote_update_config⚠
Reopens the socket on a different interface, or in the other mode.
mxr_request_edid⚠
Asks a device for an EDID: the one the display on its output publishes, or the one the device presents to the source on its input.
mxr_request_signal_status⚠
Asks for a detailed signal report from every bay of one device, or - with the zero uid - from every bay on the network.
mxr_request_v2ip_testcard⚠
Asks a V2IP sink for its test card, which it reports straight back; mxr_v2ip_testcard() reads it.
mxr_resolve_device⚠
Finds a device by serial number, name or identifier, in that order.
mxr_revert_video_wall⚠
Restores the window a sink has stored, discarding a preview.
mxr_select_audio_endpoint_input⚠
Points one device’s audio endpoint at another device’s.
mxr_select_audio_source⚠
Routes a V2IP sink’s audio to the stream a source port advertises, leaving its video where it is.
mxr_select_audio_source_addr⚠
Routes a V2IP sink’s audio to a multicast group directly, for a source this client has not heard advertise it.
mxr_select_audio_source_by_name⚠
Routes a V2IP sink’s audio to the source bay with this user-assigned name.
mxr_select_edid_profile⚠
Switches an input bay’s EDID profile.
mxr_select_source_addr⚠
Routes a V2IP sink’s video, audio and ancillary streams to multicast groups the caller names.
mxr_select_video_source⚠
Routes a V2IP sink’s video to the stream a source port advertises.
mxr_select_video_source_by_name⚠
Routes a V2IP sink’s video to the source bay with this user-assigned name.
mxr_send_action⚠
Sends a remote-control action to whatever is attached to a bay.
mxr_send_key⚠
Sends a remote-control key press to whatever is attached to a bay.
mxr_send_monitoring_pulse⚠
Sends the monitoring pulse that tells devices this client is watching.
mxr_set_all_v2ip_device_settings⚠
Changes settings on every V2IP device of the mesh with one frame.
mxr_set_all_v2ip_ptp_settings⚠
Changes PTP settings on every V2IP device of the mesh with one frame.
mxr_set_amp_zone_settings⚠
Writes an amplifier zone’s gain, delay, tone and power settings.
mxr_set_audio_endpoint_locked⚠
Locks or unlocks an audio endpoint’s source: while it is locked, a video route change leaves the endpoint’s audio source alone.
mxr_set_audio_endpoint_muted⚠
Mutes or unmutes one of a device’s audio endpoints.
mxr_set_audio_endpoint_trigger⚠
Activates or clears an audio endpoint’s trigger.
mxr_set_audio_endpoint_volume⚠
Sets an audio endpoint’s volume.
mxr_set_bay_hidden⚠
Hides a bay from the installation’s user interface, or shows it again.
mxr_set_bay_name⚠
Renames a bay. The device stores the first 16 bytes.
mxr_set_mesh_time⚠
Sets the clock of every device that hears it to utc, in seconds since 1970 UTC. A device keeps its own clock where that is within 2s.
mxr_set_mesh_time_zone⚠
Sets the time zone of every device that hears it: zone an IANA name such as Europe/Amsterdam, rule the POSIX TZ rule the devices keep time by.
mxr_set_multiviewer_aspect_ratio⚠
Sets how a multiviewer fits a source into its window.
mxr_set_multiviewer_audio_source⚠
Chooses which window a multiviewer takes its audio from.
mxr_set_multiviewer_audio_volume⚠
Sets a multiviewer’s output volume and mute state.
mxr_set_multiviewer_auto_switch⚠
Turns a multiviewer’s automatic source switching on or off.
mxr_set_multiviewer_edid_template⚠
Switches the EDID a multiviewer presents to its sources.
mxr_set_multiviewer_hdcp_mode⚠
Switches a multiviewer’s HDCP mode.
mxr_set_multiviewer_input_source⚠
Maps one of a multiviewer’s inputs to a source device.
mxr_set_multiviewer_output_itc⚠
Sets a multiviewer’s IT content flag.
mxr_set_multiviewer_output_mode⚠
Switches a multiviewer’s output resolution.
mxr_set_multiviewer_pip_position⚠
Sets which corner a multiviewer’s picture-in-picture window sits in.
mxr_set_multiviewer_pip_size⚠
Sets the size of a multiviewer’s picture-in-picture window.
mxr_set_multiviewer_remote_control⚠
Chooses which window a multiviewer forwards remote control to.
mxr_set_multiviewer_video_source⚠
Puts a source in one of a multiviewer’s windows.
mxr_set_multiviewer_view_mode⚠
Switches a multiviewer’s window layout.
mxr_set_muted⚠
Mutes or unmutes a bay, leaving its volume alone.
mxr_set_unit_dhcp⚠
Switches a unit to an IP configuration from DHCP. As mxr_set_unit_network().
mxr_set_unit_network⚠
Gives a unit a static IP configuration, each address a dotted quad.
mxr_set_v2ip_auto_power_save⚠
Sets how many idle minutes a V2IP device waits before it powers down by itself, 0 for never. Otherwise as mxr_set_v2ip_device_setting().
mxr_set_v2ip_auto_scaling⚠
Turns a V2IP sink’s automatic scaling on or off.
mxr_set_v2ip_device_setting⚠
Switches on/off settings of a V2IP device, all to the same value.
mxr_set_v2ip_ir_profile⚠
Sets the infrared profile of a V2IP device’s global infrared port.
mxr_set_v2ip_output_mode⚠
Sets the output format a V2IP sink scales to.
mxr_set_v2ip_power_save_schedule⚠
Sets a V2IP device’s daily power save windows from schedule’s start and end; its auto_minutes is not sent.
mxr_set_v2ip_ptp_domain⚠
Sets the PTP domain a V2IP device runs in. MXR_ERR_INVALID_ARGUMENT above MXR_V2IP_PTP_DOMAIN_MAX. Otherwise as mxr_set_v2ip_device_setting().
mxr_set_v2ip_ptp_mode⚠
Sets the PTP mode a V2IP device runs, MXR_V2IP_PTP_MODE_*. MXR_ERR_INVALID_ARGUMENT for a mode with no name. Otherwise as mxr_set_v2ip_device_setting().
mxr_set_v2ip_ptp_priority1⚠
Sets the priority1 a V2IP device announces as a PTP grandmaster, lower winning. Otherwise as mxr_set_v2ip_device_setting().
mxr_set_v2ip_sink_ir_profile⚠
Sets the infrared profile of a V2IP device’s output infrared port.
mxr_set_v2ip_test_pattern⚠
Shows MXR_V2IP_TEST_PATTERN_* on a V2IP sink’s output; colour is 0xRRGGBB, used by a flat pattern. The pattern runs until it is turned off, and holds the output on while it does.
mxr_set_v2ip_test_sync⚠
Sets a V2IP sink’s lip-sync flash.
mxr_set_v2ip_test_tone⚠
Plays a test tone on a V2IP sink’s output.
mxr_set_v2ip_vlan⚠
Changes a V2IP device’s VLAN configuration.
mxr_set_volume⚠
Sets a bay’s volume percentage, and its mute state when muted is not MXR_UNKNOWN.
mxr_signal_type_bpp
The bit depth in bits per component, zero where the word names none.
mxr_signal_type_bpp_index
The raw bit-depth index, for a caller that wants the wire value.
mxr_signal_type_colour_space
The colour space: 0 RGB, 1 4:4:4, 2 4:2:2, 3 4:2:0.
mxr_signal_type_is_set
Whether the word names a signal format at all.
mxr_signal_type_non_integer
Whether the frame rate carries a 1000/1001 clock.
mxr_signal_type_svd
The CTA-861 short video descriptor, zero when the signal is not HDMI.
mxr_store_video_wall⚠
Stores a window as a sink’s video wall.
mxr_subscribe_v2ip_stats⚠
Subscribes to, or unsubscribes from, a device’s V2IP statistics.
mxr_time_zone⚠
Fills out with the time zone a device announced for its mesh.
mxr_topology⚠
Writes a device’s view of the mesh topology, and returns how many entries there are.
mxr_uid_from_string⚠
Reads the dotted-hex form mxr_uid_to_string() writes.
mxr_uid_is_zero
Reports whether uid is the empty identifier.
mxr_uid_to_string⚠
Writes uid as dotted hex into out, which needs MXR_UID_STRING_LEN bytes.
mxr_unit_status⚠
Fills out with the health and IP configuration a unit last reported.
mxr_upgrade_unit_fpga⚠
Upgrades a unit’s video processor to the latest image it holds, or flashes that image again when force is set and it already runs it.
mxr_v2ip_details⚠
Fills out with a V2IP device’s own encoder configuration.
mxr_v2ip_device_settings⚠
Fills out with a V2IP device’s settings.
mxr_v2ip_features⚠
Fills out with what a V2IP device’s video processor supports.
mxr_v2ip_power_save⚠
Fills out with a V2IP device’s power save settings.
mxr_v2ip_ptp⚠
Fills out with the PTP state a V2IP device last reported about itself.
mxr_v2ip_ptp_settings⚠
Fills out with a V2IP device’s PTP settings.
mxr_v2ip_sink⚠
Fills out with the streams a V2IP sink is subscribed to.
mxr_v2ip_sources⚠
Writes the streams a device’s source bays advertise, and returns how many there are.
mxr_v2ip_stats⚠
Fills out with a device’s V2IP statistics.
mxr_v2ip_testcard⚠
Fills out with the test card a V2IP sink last reported.
mxr_v2ip_tiling⚠
Fills out with the window a sink is told to show.
mxr_v2ip_vlan⚠
Fills out with the VLAN configuration a V2IP device last reported.
mxr_version
This library’s version, as MAJOR.MINOR.PATCH.
mxr_volume_down⚠
Asks a bay to step its volume down.
mxr_volume_up⚠
Asks a bay to step its volume up.

Type Aliases§

mxr_action_transmit_cb
Carries a request to perform a remote-control action.
mxr_arc_cb
Names a bay and its audio return channel.
mxr_audio_select_cb
Carries an audio input selection.
mxr_bay_bay_cb
Names a bay and another bay, the zero device standing for none.
mxr_bay_bool_cb
Names a bay and a flag.
mxr_bay_cb
Names only the bay the event concerns.
mxr_bay_linked_cb
Names a bay and the link that was made to it.
mxr_bay_name_change_cb
Carries a request to rename a bay.
mxr_bay_str_cb
Names a bay and a string, borrowed for the call.
mxr_bay_u8_cb
Names a bay and an 8-bit value.
mxr_bay_u16_cb
Names a bay and a 16-bit value.
mxr_bay_unlinked_cb
Names a bay and the link that was removed from it.
mxr_blacklist_cb
Carries a blacklist change.
mxr_device_bool_cb
Names a device and a flag.
mxr_device_cb
Names only the device the event concerns.
mxr_device_u16_cb
Names a device and a 16-bit value.
mxr_device_uid_cb
Names a device and a second device.
mxr_edid_profile_change_cb
Carries a request to switch an EDID profile.
mxr_edid_record_cb
Carries one EDID block a device replied with.
mxr_edid_request_cb
Carries a request for a device’s EDID.
mxr_endpoint_bool_cb
Names a device, one of its audio endpoints, and a flag.
mxr_endpoint_u32_cb
Names a device, one of its audio endpoints, and a 32-bit value.
mxr_factory_reset_cb
Carries a factory-reset request.
mxr_ir_capture_cb
Carries raw infrared captured on a bay.
mxr_ir_transmit_cb
Carries a request to blast raw infrared.
mxr_key_transmit_cb
Carries a request to send a remote-control key.
mxr_multiviewer_command_cb
Carries a multiviewer command.
mxr_power_cb
Names a bay and the power state of what is connected to it.
mxr_power_save_cb
Carries a power-save request.
mxr_set_route_cb
Carries a request addressed to a device.
mxr_signal_type_t
The signal format a device reports, packed into one 16-bit word.
mxr_system_status_cb
Names a device, a status code and a message.
mxr_video_wall_cb
Carries a video wall command.
mxr_volume_cb
Names a bay, its combined volume percentage and its mute state.