|
RAVENNAKIT
|
Implements the NMOS node as defined in the NMOS specifications. More...
#include <nmos_node.hpp>
Classes | |
| struct | Configuration |
| The configuration of the NMOS node. More... | |
| struct | StatusInfo |
Public Types | |
| enum class | Status { disabled , discovering , connecting , connected , registered , p2p , error } |
Public Member Functions | |
| Node (boost::asio::io_context &io_context, ptp::Instance &ptp_instance, std::unique_ptr< RegistryBrowserBase > registry_browser=nullptr, std::unique_ptr< HttpClientBase > http_client=nullptr) | |
| ~Node () override | |
| boost::system::result< void, Error > | start () |
| Starts the services of this node (HTTP server, advertisements, etc.). | |
| void | stop () |
| Stops all the operations of this node (HTTP server, advertisements, etc.). | |
| tl::expected< void, Error > | set_configuration (Configuration new_configuration, bool force_update=false) |
| Sets the configuration of the NMOS node. | |
| const Configuration & | get_configuration () const |
| boost::asio::ip::tcp::endpoint | get_local_endpoint () const |
| bool | add_or_update_device (Device *device) |
| Adds the given device to the node or updates an existing device if it already exists (based on the uuid). | |
| const Device * | find_device (const boost::uuids::uuid &uuid) const |
| Finds a device by its uuid. | |
| bool | remove_device (Device *device) |
| Removes a device from the node by its uuid. | |
| bool | add_or_update_flow (FlowAudioRaw *flow) |
| Adds the given flow to the node or updates an existing flow if it already exists (based on the uuid). | |
| const FlowAudioRaw * | find_flow (const boost::uuids::uuid &uuid) const |
| Finds a flow by its uuid. | |
| bool | remove_flow (FlowAudioRaw *flow) |
| Removes a flow from the node by its uuid. | |
| bool | add_or_update_receiver (ReceiverAudio *receiver) |
| Adds the given receiver to the node or updates an existing receiver if it already exists (based on the uuid). | |
| const ReceiverAudio * | find_receiver (const boost::uuids::uuid &uuid) const |
| Finds a receiver by its uuid. | |
| bool | remove_receiver (ReceiverAudio *receiver) |
| Removes a receiver from the node by its uuid. | |
| bool | add_or_update_sender (Sender *sender) |
| Adds the given sender to the node or updates an existing sender if it already exists (based on the uuid). | |
| Sender * | find_sender (const boost::uuids::uuid &uuid) const |
| Finds a sender by its uuid. | |
| bool | remove_sender (Sender *sender) |
| Removes a sender from the node by its uuid. | |
| bool | add_or_update_source (SourceAudio *source) |
| Adds the given source to the node or updates an existing source if it already exists (based on the uuid). | |
| const SourceAudio * | find_source (const boost::uuids::uuid &uuid) const |
| Finds a source by its uuid. | |
| bool | remove_source (SourceAudio *source) |
| Removes a source from the node by its uuid. | |
| const boost::uuids::uuid & | get_uuid () const |
| const std::vector< Device * > & | get_devices () const |
| const std::vector< FlowAudioRaw * > & | get_flows () const |
| const std::vector< ReceiverAudio * > & | get_receivers () const |
| const std::vector< Sender * > & | get_senders () const |
| const std::vector< SourceAudio * > & | get_sources () const |
| const Status & | get_status () const |
| const StatusInfo & | get_registry_info () const |
| void | set_network_interface_config (NetworkInterfaceConfig config) |
| Updates the node based on given network interface configuration. | |
| void | ptp_parent_changed (const ptp::ParentDs &parent) override |
| Called when the parent of the PTP instance changes. | |
| void | ptp_port_changed_state (const ptp::Port &port) override |
| Called when the state of a port changes. | |
| Public Member Functions inherited from rav::ptp::Instance::Subscriber | |
| virtual | ~Subscriber ()=default |
| virtual void | ptp_port_removed (const uint16_t port_number) |
| Called when a port was removed. | |
| virtual void | ptp_configuration_updated (const Configuration &config) |
| Called when the configuration was updated. | |
| virtual void | ptp_stats_updated (const Stats &ptp_stats) |
| Called at a regular interval when the PTP stats are updated. | |
| const LocalClock & | get_local_clock () |
Static Public Member Functions | |
| static std::optional< size_t > | index_of_supported_api_version (const ApiVersion &version) |
Public Attributes | |
| SafeFunction< void(const Status &status, const StatusInfo &status_info)> | on_status_changed |
| SafeFunction< void(const Configuration &config)> | on_configuration_changed |
Static Public Attributes | |
| static std::array< ApiVersion, 2 > | k_node_api_versions |
| static std::array< ApiVersion, 2 > | k_connection_api_versions |
| static constexpr auto | k_default_timeout = std::chrono::milliseconds(2000) |
| static constexpr auto | k_internal_clock_name = "clk0" |
| static constexpr auto | k_ptp_clock_name = "clk1" |
Implements the NMOS node as defined in the NMOS specifications.
https://specs.amwa.tv/nmos/branches/main/docs/Technical_Overview.html#nmos-model-and-terminology
Definition at line 55 of file nmos_node.hpp.
|
strong |
| Enumerator | |
|---|---|
| disabled | |
| discovering | |
| connecting | |
| connected | |
| registered | |
| p2p | |
| error | |
Definition at line 113 of file nmos_node.hpp.
|
explicit |
|
override |
|
nodiscard |
Adds the given device to the node or updates an existing device if it already exists (based on the uuid).
The node if of the device is set to the node's uuid.
| device | The device to set or update. |
|
nodiscard |
Adds the given flow to the node or updates an existing flow if it already exists (based on the uuid).
| flow | The flow to set. |
|
nodiscard |
Adds the given receiver to the node or updates an existing receiver if it already exists (based on the uuid).
| receiver | The receiver to set. |
|
nodiscard |
Adds the given sender to the node or updates an existing sender if it already exists (based on the uuid).
| sender | The sender to set. |
|
nodiscard |
Adds the given source to the node or updates an existing source if it already exists (based on the uuid).
| source | The source to set. |
|
nodiscard |
Finds a device by its uuid.
| uuid | The uuid of the device to find. |
|
nodiscard |
Finds a flow by its uuid.
| uuid | The uuid of the flow to find. |
|
nodiscard |
Finds a receiver by its uuid.
| uuid | The uuid of the receiver to find. |
|
nodiscard |
Finds a sender by its uuid.
| uuid | The uuid of the sender to find. |
|
nodiscard |
Finds a source by its uuid.
| uuid | The uuid of the source to find. |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
staticnodiscard |
| version | The API version to check. |
|
overridevirtual |
Called when the parent of the PTP instance changes.
| parent | The new parent data set. |
Reimplemented from rav::ptp::Instance::Subscriber.
|
overridevirtual |
Called when the state of a port changes.
| port | The port that changed state. |
Reimplemented from rav::ptp::Instance::Subscriber.
|
nodiscard |
Removes a device from the node by its uuid.
Resources associated with the device will be removed as well.
| device | The uuid of the device to remove. |
|
nodiscard |
Removes a flow from the node by its uuid.
| flow | The uuid of the flow to remove. |
|
nodiscard |
Removes a receiver from the node by its uuid.
| receiver | The uuid of the receiver to remove. |
|
nodiscard |
Removes a sender from the node by its uuid.
| sender | The uuid of the sender to remove. |
|
nodiscard |
Removes a source from the node by its uuid.
| source | The uuid of the source to remove. |
|
nodiscard |
Sets the configuration of the NMOS node.
| new_configuration | The configuration to update. |
| force_update | Whether to force the update even if the configuration didn't change. |
| void rav::nmos::Node::set_network_interface_config | ( | NetworkInterfaceConfig | config | ) |
Updates the node based on given network interface configuration.
| config | The network interface configuration to apply. |
|
nodiscard |
Starts the services of this node (HTTP server, advertisements, etc.).
| void rav::nmos::Node::stop | ( | ) |
Stops all the operations of this node (HTTP server, advertisements, etc.).
|
static |
Definition at line 58 of file nmos_node.hpp.
|
staticconstexpr |
Definition at line 59 of file nmos_node.hpp.
|
staticconstexpr |
Definition at line 60 of file nmos_node.hpp.
|
static |
Definition at line 57 of file nmos_node.hpp.
|
staticconstexpr |
Definition at line 61 of file nmos_node.hpp.
| SafeFunction<void(const Configuration& config)> rav::nmos::Node::on_configuration_changed |
Definition at line 116 of file nmos_node.hpp.
| SafeFunction<void(const Status& status, const StatusInfo& status_info)> rav::nmos::Node::on_status_changed |
Definition at line 115 of file nmos_node.hpp.