NvNmos
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations | Functions
Networked Media Open Specifications (NMOS) API

Classes

struct  _NvNmosNodeConfig
 
struct  _NvNmosAssetConfig
 
struct  _NvNmosReceiverConfig
 
struct  _NvNmosSenderConfig
 
struct  _NvNmosNetworkServicesConfig
 
struct  _NvNmosNodeServer
 

Macros

#define NVNMOS_API
 
#define NVNMOS_ID_LEN   37
 

Typedefs

typedef struct _NvNmosNodeServer NvNmosNodeServer
 
typedef enum _NvNmosTransport NvNmosTransport
 
typedef enum _NvNmosSide NvNmosSide
 
typedef bool(* nmos_connection_activation_callback) (NvNmosNodeServer *server, NvNmosSide side, const char *name, const char *transport_file)
 
typedef void(* nmos_logging_callback) (NvNmosNodeServer *server, const char *categories, int level, const char *message)
 
typedef struct _NvNmosAssetConfig NvNmosAssetConfig
 
typedef struct _NvNmosReceiverConfig NvNmosReceiverConfig
 
typedef struct _NvNmosSenderConfig NvNmosSenderConfig
 
typedef struct _NvNmosNetworkServicesConfig NvNmosNetworkServicesConfig
 
typedef struct _NvNmosNodeConfig NvNmosNodeConfig
 

Enumerations

enum  _NvNmosTransport { NVNMOS_TRANSPORT_RTP = 0 , NVNMOS_TRANSPORT_MXL = 1 }
 
enum  _NvNmosSide { NVNMOS_SIDE_SENDER = 0 , NVNMOS_SIDE_RECEIVER = 1 }
 
enum  {
  NVNMOS_LOG_DEVEL = -40 , NVNMOS_LOG_VERBOSE = -10 , NVNMOS_LOG_INFO = 0 , NVNMOS_LOG_WARNING = 10 ,
  NVNMOS_LOG_ERROR = 20 , NVNMOS_LOG_SEVERE = 30 , NVNMOS_LOG_FATAL = 40
}
 

Functions

NVNMOS_API bool create_nmos_node_server (const NvNmosNodeConfig *config, NvNmosNodeServer *server)
 
NVNMOS_API bool destroy_nmos_node_server (NvNmosNodeServer *server)
 
NVNMOS_API bool add_nmos_receiver_to_node_server (NvNmosNodeServer *server, const NvNmosReceiverConfig *config)
 
NVNMOS_API bool remove_nmos_receiver_from_node_server (NvNmosNodeServer *server, const char *receiver_name)
 
NVNMOS_API bool add_nmos_sender_to_node_server (NvNmosNodeServer *server, const NvNmosSenderConfig *config)
 
NVNMOS_API bool remove_nmos_sender_from_node_server (NvNmosNodeServer *server, const char *sender_name)
 
NVNMOS_API bool nmos_connection_activate (NvNmosNodeServer *server, NvNmosSide side, const char *name, const char *transport_file)
 
NVNMOS_API bool nmos_make_node_id (const char *seed, char *out, size_t out_len)
 
NVNMOS_API bool nmos_make_sender_id (const char *seed, const char *sender_name, char *out, size_t out_len)
 
NVNMOS_API bool nmos_make_receiver_id (const char *seed, const char *receiver_name, char *out, size_t out_len)
 
NVNMOS_API bool nmos_get_node_id (const NvNmosNodeServer *server, char *out, size_t out_len)
 
NVNMOS_API bool nmos_get_sender_id (const NvNmosNodeServer *server, const char *sender_name, char *out, size_t out_len)
 
NVNMOS_API bool nmos_get_receiver_id (const NvNmosNodeServer *server, const char *receiver_name, char *out, size_t out_len)
 

Detailed Description

Defines the NVIDIA NMOS utility library (NvNmos) API.

The NvNmos utility library provides the APIs to create, destroy and internally manage an NMOS Node for a Media Node application.

The library can automatically discover and register with an NMOS Registry on the network using the AMWA IS-04 Registration API.

The library provides callbacks for NMOS events such as AMWA IS-05 Connection API requests from an NMOS Controller. These callbacks can be used to update running DeepStream pipelines with new transport parameters, for example.

NvNmos currently supports Senders and Receivers for video, audio, and ancillary data flows over RTP (i.e., SMPTE ST 2110-20, -22, -30, and -40 streams) and over the Media eXchange Layer (MXL).

The NvNmos library supports the following specifications, using the Sony nmos-cpp implementation:

Macro Definition Documentation

◆ NVNMOS_ID_LEN

#define NVNMOS_ID_LEN   37

Buffer size, in bytes, that is always sufficient to hold an NMOS resource id (a UUID in canonical 8-4-4-4-12 hex form) including the terminating null character. Callers may pass buffers of this size or larger to the id accessor functions defined below.

Typedef Documentation

◆ nmos_connection_activation_callback

typedef bool(* nmos_connection_activation_callback) (NvNmosNodeServer *server, NvNmosSide side, const char *name, const char *transport_file)

Type for a callback from NvNmos library when an IS-05 Connection API activation occurs.

Parameters
[in]serverA pointer to the server issuing the callback.
[in]sideWhether the activation is for a Sender or a Receiver.
[in]nameThe caller-chosen name for the sender or receiver to be activated or deactivated. This is the same name originally supplied via the configuration's transport file (see NvNmosSenderConfig::transport_file and NvNmosReceiverConfig::transport_file). Unique for the given side on the Node.
[in]transport_fileThe updated transport file data for the sender or receiver, or a null pointer when the sender or receiver is being deactivated.

For an RTP sender or receiver this is an SDP file. The 'inactive' media-level attribute is used to indicate a disabled leg. The 'x-nvnmos-name' session-level attribute specifies the name of the sender or receiver, name. For a receiver, the 'x-nvnmos-iface-ip' media-level attribute is used to specify the interface IP address on which the stream is received. For a sender, the 'x-nvnmos-src-port' media-level attribute is used to specify the source port from which the stream is transmitted.

For an MXL sender or receiver this is an MXL flow definition (JSON). The 'urn:x-nvnmos:tag:name' tag in the 'tags' property specifies the name of the sender or receiver, name; the 'mxl_domain_id' and 'mxl_flow_id' IS-05 transport parameters are reflected in the 'urn:x-nvnmos:tag:mxl-domain-id' tag (also in 'tags') and the JSON document's top-level 'id' field respectively. The application is expected to dispatch on (side, name) (both of which it specified) to determine the transport, if needed.

Returns
Whether the activation could be applied.

◆ nmos_logging_callback

typedef void(* nmos_logging_callback) (NvNmosNodeServer *server, const char *categories, int level, const char *message)

Type for a callback from NvNmos library for log messages.

Parameters
[in]serverA pointer to the server issuing the callback.
[in]categoriesA comma separated list of topics, indicating e.g. the submodule originating the log message.
[in]levelThe severity/verbosity level. Values greater than zero are warnings and errors. Values less than zero are debugging or trace messages.
[in]messageThe message itself.

◆ NvNmosAssetConfig

Defines asset distinguishing information for BCP-002-02 tags in an NvNmosNodeServer.

◆ NvNmosNetworkServicesConfig

Defines configuration settings for network services to use in an NvNmosNodeServer. The structure should be zero initialized.

◆ NvNmosNodeConfig

Defines configuration settings used to create an NvNmosNodeServer. The structure should be zero initialized.

◆ NvNmosNodeServer

Holds the implementation details of a running NvNmos server. The structure should be zero initialized, with the possible exception of the user_data member.

◆ NvNmosReceiverConfig

Defines configuration settings used to create receivers in an NvNmosNodeServer.

◆ NvNmosSenderConfig

Defines configuration settings used to create senders in an NvNmosNodeServer.

◆ NvNmosSide

typedef enum _NvNmosSide NvNmosSide

Identifies a resource as either a Sender or a Receiver. Used by nmos_connection_activate and nmos_connection_activation_callback to disambiguate a name that may be shared between a Sender and a Receiver on the same Node (caller-chosen names are unique within a given side on a Node, but a Sender and a Receiver are permitted to use the same name).

◆ NvNmosTransport

Identifies the transport used by an NvNmos Sender or Receiver. Stored in NvNmosSenderConfig::transport and NvNmosReceiverConfig::transport, it corresponds to the base URN of the transport of the NMOS Sender or Receiver resource.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Defines some common severity/logging levels for log messages from the NvNmos library.

Enumerator
NVNMOS_LOG_DEVEL 

Low level debugging information.

NVNMOS_LOG_VERBOSE 

Chatty messages such as detailed API request/response tracking.

NVNMOS_LOG_INFO 

Higher level information about expected API events.

NVNMOS_LOG_WARNING 

Minor problems that could be recovered automatically by the library.

NVNMOS_LOG_ERROR 

More serious recoverable errors such as rejected requests.

NVNMOS_LOG_SEVERE 

Errors which are unlikely to be recoverable without restarting the server.

NVNMOS_LOG_FATAL 

Errors which are likely to cause the server to immediately terminate.

◆ _NvNmosSide

Identifies a resource as either a Sender or a Receiver. Used by nmos_connection_activate and nmos_connection_activation_callback to disambiguate a name that may be shared between a Sender and a Receiver on the same Node (caller-chosen names are unique within a given side on a Node, but a Sender and a Receiver are permitted to use the same name).

Enumerator
NVNMOS_SIDE_SENDER 

An NMOS Sender.

NVNMOS_SIDE_RECEIVER 

An NMOS Receiver.

◆ _NvNmosTransport

Identifies the transport used by an NvNmos Sender or Receiver. Stored in NvNmosSenderConfig::transport and NvNmosReceiverConfig::transport, it corresponds to the base URN of the transport of the NMOS Sender or Receiver resource.

Enumerator
NVNMOS_TRANSPORT_RTP 

RTP, as used by SMPTE ST 2110. The associated transport file is a Session Description Protocol (SDP) file. This is the default for a zero-initialised configuration.

NVNMOS_TRANSPORT_MXL 

The Media eXchange Layer (MXL). The associated transport file is an MXL flow definition (JSON) of the form consumed by the MXL SDK.

Function Documentation

◆ add_nmos_receiver_to_node_server()

NVNMOS_API bool add_nmos_receiver_to_node_server ( NvNmosNodeServer server,
const NvNmosReceiverConfig config 
)

Add an NMOS Receiver to an NMOS Node server according to the specified configuration settings.

The receiver may be removed using remove_nmos_receiver_from_node_server.

Parameters
[in]serverPointer to the server to update.
[in]configPointer to the configuration settings.
Returns
Whether the receiver has been successfully added.

◆ add_nmos_sender_to_node_server()

NVNMOS_API bool add_nmos_sender_to_node_server ( NvNmosNodeServer server,
const NvNmosSenderConfig config 
)

Add an NMOS Sender to an NMOS Node server according to the specified configuration settings.

The sender may be removed using remove_nmos_sender_from_node_server.

Parameters
[in]serverPointer to the server to update.
[in]configPointer to the configuration settings.
Returns
Whether the sender has been successfully added.

◆ create_nmos_node_server()

NVNMOS_API bool create_nmos_node_server ( const NvNmosNodeConfig config,
NvNmosNodeServer server 
)

Initialize and start an NMOS Node server according to the specified configuration settings.

The server should be deinitialized using destroy_nmos_node_server.

Parameters
[in]configPointer to the configuration settings.
[in]serverPointer to the server to be initialized.
Returns
Whether the server has been created and successfully started.

◆ destroy_nmos_node_server()

NVNMOS_API bool destroy_nmos_node_server ( NvNmosNodeServer server)

Stop and deinitialize an NMOS Node server.

The server should have been successfully initialized using create_nmos_node_server.

Parameters
[in]serverPointer to the server to be deinitialized.
Returns
Whether the server has been successfully stopped and deinitialized.

◆ nmos_connection_activate()

NVNMOS_API bool nmos_connection_activate ( NvNmosNodeServer server,
NvNmosSide  side,
const char *  name,
const char *  transport_file 
)

Report that a sender or receiver has been activated or deactivated out of band.

Used when the application's data plane has activated (or deactivated) a sender or receiver by some means other than an IS-05 Connection API patch, so that the IS-04 Node API and IS-05 Connection API model can be updated to reflect the new state. The library does not initiate any activation on the application's behalf.

The application's nmos_connection_activation_callback is not invoked as a result of this call.

Parameters
[in]serverA pointer to the server to be updated.
[in]sideWhether the sender or receiver is a Sender or a Receiver.
[in]nameThe caller-chosen name of the sender or receiver whose state has changed. The transport is inferred from the existing sender or receiver of side with this name.
[in]transport_fileThe new transport file data reflecting the active state of the sender or receiver, or a null pointer when the sender or receiver has been deactivated. The new data only updates the transport parameters of the sender or receiver, not the media format. See NvNmosSenderConfig::transport_file and NvNmosReceiverConfig::transport_file for the recognised format (SDP for RTP, MXL flow definition JSON for MXL) and the supported NvNmos extensions.
Returns
Whether the update has been successfully applied.

◆ nmos_get_node_id()

NVNMOS_API bool nmos_get_node_id ( const NvNmosNodeServer server,
char *  out,
size_t  out_len 
)

Get the NMOS Node resource id (the '/self' UUID) of a running NvNmosNodeServer.

Parameters
[in]serverPointer to a server previously initialised by create_nmos_node_server.
[out]outBuffer to receive the id.
[in]out_lenSize of out, at least NVNMOS_ID_LEN.
Returns
Whether the id has been written to out.

◆ nmos_get_receiver_id()

NVNMOS_API bool nmos_get_receiver_id ( const NvNmosNodeServer server,
const char *  receiver_name,
char *  out,
size_t  out_len 
)

Get the NMOS Receiver resource id of a receiver currently registered with the specified server.

Looks the receiver up by its name. Returns false (without writing to out) if no receiver with the given receiver_name has been added to the server.

Parameters
[in]serverPointer to the server.
[in]receiver_nameThe caller-chosen name of the receiver (see NvNmosReceiverConfig::transport_file). Must not be null.
[out]outBuffer to receive the id.
[in]out_lenSize of out, at least NVNMOS_ID_LEN.
Returns
Whether the id has been written to out.

◆ nmos_get_sender_id()

NVNMOS_API bool nmos_get_sender_id ( const NvNmosNodeServer server,
const char *  sender_name,
char *  out,
size_t  out_len 
)

Get the NMOS Sender resource id of a sender currently registered with the specified server.

Looks the sender up by its name. Returns false (without writing to out) if no sender with the given sender_name has been added to the server.

Parameters
[in]serverPointer to the server.
[in]sender_nameThe caller-chosen name of the sender (see NvNmosSenderConfig::transport_file). Must not be null.
[out]outBuffer to receive the id.
[in]out_lenSize of out, at least NVNMOS_ID_LEN.
Returns
Whether the id has been written to out.

◆ nmos_make_node_id()

NVNMOS_API bool nmos_make_node_id ( const char *  seed,
char *  out,
size_t  out_len 
)

Compute the NMOS Node resource id (the '/self' UUID) that an NvNmosNodeServer created with the given seed will use.

Pure function of seed. The id is generated deterministically by the library, so calling this before create_nmos_node_server yields the same value as nmos_get_node_id on the resulting server. Useful for tooling that needs to pre-compute an id without standing up a server.

Parameters
[in]seedSeed string. Must not be null. The same string used in NvNmosNodeConfig::seed.
[out]outBuffer to receive the id as a null-terminated ASCII string in canonical UUID form.
[in]out_lenSize of out in bytes. Must be at least NVNMOS_ID_LEN.
Returns
Whether the id has been written to out.

◆ nmos_make_receiver_id()

NVNMOS_API bool nmos_make_receiver_id ( const char *  seed,
const char *  receiver_name,
char *  out,
size_t  out_len 
)

Compute the NMOS Receiver resource id that an NvNmosNodeServer created with the given seed will use for the receiver with the given receiver_name.

Pure function of (seed, receiver_name). See nmos_make_node_id for the contract.

Parameters
[in]seedSeed string. Must not be null.
[in]receiver_nameThe caller-chosen name of the receiver (see NvNmosReceiverConfig::transport_file). Must not be null.
[out]outBuffer to receive the id.
[in]out_lenSize of out, at least NVNMOS_ID_LEN.
Returns
Whether the id has been written to out.

◆ nmos_make_sender_id()

NVNMOS_API bool nmos_make_sender_id ( const char *  seed,
const char *  sender_name,
char *  out,
size_t  out_len 
)

Compute the NMOS Sender resource id that an NvNmosNodeServer created with the given seed will use for the sender with the given sender_name.

Pure function of (seed, sender_name). See nmos_make_node_id for the contract; the same notes apply.

Parameters
[in]seedSeed string. Must not be null.
[in]sender_nameThe caller-chosen name of the sender (see NvNmosSenderConfig::transport_file). Must not be null.
[out]outBuffer to receive the id.
[in]out_lenSize of out, at least NVNMOS_ID_LEN.
Returns
Whether the id has been written to out.

◆ remove_nmos_receiver_from_node_server()

NVNMOS_API bool remove_nmos_receiver_from_node_server ( NvNmosNodeServer server,
const char *  receiver_name 
)

Remove an NMOS Receiver from an NMOS Node server.

The receiver may have been adding using create_nmos_node_server or add_nmos_receiver_to_node_server.

Parameters
[in]serverPointer to the server to update.
[in]receiver_nameThe caller-chosen name of the receiver to be removed (see NvNmosReceiverConfig::transport_file).
Returns
Whether the receiver has been successfully removed.

◆ remove_nmos_sender_from_node_server()

NVNMOS_API bool remove_nmos_sender_from_node_server ( NvNmosNodeServer server,
const char *  sender_name 
)

Remove an NMOS Sender from an NMOS Node server.

The sender may have been adding using create_nmos_node_server or add_nmos_sender_to_node_server.

Parameters
[in]serverPointer to the server to update.
[in]sender_nameThe caller-chosen name of the sender to be removed (see NvNmosSenderConfig::transport_file).
Returns
Whether the sender has been successfully removed.