AJA NTV2 SDK  17.1.1.1245
NTV2 SDK 17.1.1.1245
ntv2nubaccess.h File Reference

Declares NTV2 "nub" client functions. More...

#include "ntv2utils.h"
#include "ajabase/system/lock.h"
#include "ajabase/common/ajarefptr.h"
#include <string>
#include <vector>
#include <map>
Include dependency graph for ntv2nubaccess.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  NTV2Dictionary
 A simple (not thread-safe) set of key/value pairs. (New in SDK 16.3) More...
 
class  NTV2DeviceSpecParser
 One-stop shop for parsing device specifications. (New in SDK 16.3) I do very little in the way of validating semantics. I simply do the parsing & provide the info needed to load & operate plugins. More...
 
class  NTV2RPCBase
 Common base class for NTV2RPCClientAPI and NTV2RPCServerAPI. More...
 
class  NTV2RPCClientAPI
 An object that can connect to, and operate remote or fake devices. I have three general API groups: More...
 
class  NTV2RPCServerAPI
 Base class of objects that can serve device operation RPCs with NTV2RPCClientAPI instances. More...
 

Macros

#define kConnectParamScheme   "Scheme"
 URL scheme. More...
 
#define kConnectParamHost   "Host"
 DNS name, IPv4 or sw device DLL name. More...
 
#define kConnectParamPort   "Port"
 Port number (optional) More...
 
#define kConnectParamDevIndex   "DeviceIndex"
 Device having this index number. More...
 
#define kConnectParamDevSerial   "DeviceSerial"
 Device with this serial number. More...
 
#define kConnectParamDevModel   "DeviceModel"
 First device of this model (e.g. 'kona4') More...
 
#define kConnectParamDevID   "DeviceID"
 First device having this ID (e.g. '0x10518400') More...
 
#define kConnectParamResource   "ResourcePath"
 Resource path – everything past URL [scheme://host[:port]/], excluding [?query]. More...
 
#define kConnectParamQuery   "Query"
 Query – everything past '?' in URL. More...
 
#define kQParamVerboseLogging   "verbose"
 Query parameter option that enables verbose message logging. More...
 
#define kQParamLogToStdout   "stdout"
 Query parameter option that logs messages to standard output. More...
 
#define kQParamShowX509Cert   "showcert"
 Query parameter option that dumps X509 certificate info into message log. More...
 
#define kQParamShowParams   "showparams"
 Query parameter option that dumps parameters into message log. More...
 
#define kQParamDebugRegistry   "debugregistry"
 Query parameter option that enables debugging of PluginRegistry. More...
 
#define kLegalSchemeNTV2   "ntv2"
 
#define kLegalSchemeNTV2Local   "ntv2local"
 
#define kFuncNameCreateClient   "CreateClient"
 Create an NTV2RPCClientAPI instance. More...
 
#define kFuncNameCreateServer   "CreateServer"
 Create an NTV2RPCServerAPI instance. More...
 
#define kFuncNameGetRegInfo   "GetRegistrationInfo"
 Answers with plugin registration info. More...
 
#define kNTV2PluginInfoKey_PluginsPath   "PluginsPath"
 Local host full path to folder containing plugins. More...
 
#define kNTV2PluginInfoKey_PluginPath   "PluginPath"
 Local host full path to plugin file. More...
 
#define kNTV2PluginInfoKey_PluginSigPath   "PluginSigPath"
 Local host full path to plugin signature file. More...
 
#define kNTV2PluginInfoKey_PluginBaseName   "PluginBaseName"
 Plugin base name (i.e. without extension) More...
 
#define kNTV2PluginInfoKey_Fingerprint   "serial number"
 Issuer cert fingerprint. More...
 
#define kNTV2PluginRegInfoKey_Vendor   "Vendor"
 Plugin vendor (manufacturer) name. More...
 
#define kNTV2PluginRegInfoKey_CommonName   "CommonName"
 Plugin vendor domain name. More...
 
#define kNTV2PluginRegInfoKey_OrgUnit   "OrgUnit"
 Plugin organization unit (to match certificate subject OU) More...
 
#define kNTV2PluginRegInfoKey_ShortName   "ShortName"
 Plugin short name. More...
 
#define kNTV2PluginRegInfoKey_LongName   "LongName"
 Plugin long name. More...
 
#define kNTV2PluginRegInfoKey_Description   "Description"
 Brief plugin description. More...
 
#define kNTV2PluginRegInfoKey_Copyright   "Copyright"
 Plugin copyright notice. More...
 
#define kNTV2PluginRegInfoKey_NTV2SDKVersion   "NTV2SDKVersion"
 NTV2 SDK version that plugin was compiled with. More...
 
#define kNTV2PluginRegInfoKey_Version   "Version"
 Plugin version (string) More...
 
#define kNTV2PluginRegInfoKey_CommitSHA   "CommitSHA"
 Plugin last commit SHA. More...
 
#define kNTV2PluginSigFileKey_X509Certificate   "X509Certificate"
 X509 certificate (encoded as hex string) More...
 
#define kNTV2PluginSigFileKey_Signature   "Signature"
 X509 digital signature (encoded as hex string) More...
 
#define kNTV2PluginX500AttrKey_CommonName   "CN"
 
#define kNTV2PluginX500AttrKey_LocalityName   "L"
 
#define kNTV2PluginX500AttrKey_StateOrProvinceName   "ST"
 
#define kNTV2PluginX500AttrKey_OrganizationName   "O"
 
#define kNTV2PluginX500AttrKey_OrganizationalUnitName   "OU"
 
#define kNTV2PluginX500AttrKey_CountryName   "C"
 

Typedefs

typedef std::pair< NTV2DeviceID, ULWord64NTV2DeviceIDSerialPair
 Identifies a device by its NTV2DeviceID and serial number. More...
 
typedef std::vector< NTV2DeviceIDSerialPairNTV2DeviceIDSerialPairs
 An ordered sequence of NTV2DeviceIDSerialPairs. More...
 
typedef NTV2DeviceIDSerialPairs::iterator NTV2DeviceIDSerialPairsIter
 
typedef NTV2DeviceIDSerialPairs::const_iterator NTV2DeviceIDSerialPairsConstIter
 
typedef NTV2Dictionary NTV2Dict
 
typedef NTV2Dictionary NTV2ConnectParams
 A dictionary of parameters used to connect to remote/fake devices. More...
 
typedef NTV2Dictionary NTV2ConfigParams
 A dictionary of parameters used to configure an RPC server. More...
 
typedef std::pair< std::string, std::string > NTV2DictionaryEntry
 
typedef std::pair< std::string, std::string > NTV2DictEntry
 
typedef std::pair< std::string, std::string > NTV2ConnectParam
 A parameter used to connect to remote/fake devices. More...
 
typedef NTV2RPCClientAPI NTV2RPCAPI
 
typedef bool(* fpGetRegistrationInfo) (const uint32_t, NTV2Dictionary &)
 Obtains a plugin's registration information. Starting in SDK 17.1, all plugins must implement this function, or they will not be allowed to load. More...
 
typedef NTV2RPCClientAPI *(* fpCreateClient) (void *, const NTV2ConnectParams &, const uint32_t)
 Instantiates a new client instance to talk to a remote server. More...
 
typedef NTV2RPCServerAPI *(* fpCreateServer) (void *, const NTV2ConfigParams &, const uint32_t)
 Instantiates a new server instance for talking to clients. More...
 
typedef NTV2RPCAPI *(* fpCreateNTV2SoftwareDevice) (void *, const std::string &, const uint32_t)
 

Functions

std::ostream & operator<< (std::ostream &oss, const NTV2Dictionary &inDict)
 
std::ostream & operator<< (std::ostream &oss, const NTV2RPCClientAPI &inObj)
 
std::ostream & operator<< (std::ostream &oss, const NTV2RPCServerAPI &inObj)
 

Detailed Description

Declares NTV2 "nub" client functions.

Definition in file ntv2nubaccess.h.

Macro Definition Documentation

◆ kConnectParamDevID

#define kConnectParamDevID   "DeviceID"

First device having this ID (e.g. '0x10518400')

Definition at line 31 of file ntv2nubaccess.h.

◆ kConnectParamDevIndex

#define kConnectParamDevIndex   "DeviceIndex"

Device having this index number.

Definition at line 28 of file ntv2nubaccess.h.

◆ kConnectParamDevModel

#define kConnectParamDevModel   "DeviceModel"

First device of this model (e.g. 'kona4')

Definition at line 30 of file ntv2nubaccess.h.

◆ kConnectParamDevSerial

#define kConnectParamDevSerial   "DeviceSerial"

Device with this serial number.

Definition at line 29 of file ntv2nubaccess.h.

◆ kConnectParamHost

#define kConnectParamHost   "Host"

DNS name, IPv4 or sw device DLL name.

Definition at line 26 of file ntv2nubaccess.h.

◆ kConnectParamPort

#define kConnectParamPort   "Port"

Port number (optional)

Definition at line 27 of file ntv2nubaccess.h.

◆ kConnectParamQuery

#define kConnectParamQuery   "Query"

Query – everything past '?' in URL.

Definition at line 33 of file ntv2nubaccess.h.

◆ kConnectParamResource

#define kConnectParamResource   "ResourcePath"

Resource path – everything past URL [scheme://host[:port]/], excluding [?query].

Definition at line 32 of file ntv2nubaccess.h.

◆ kConnectParamScheme

#define kConnectParamScheme   "Scheme"

URL scheme.

Definition at line 25 of file ntv2nubaccess.h.

◆ kFuncNameCreateClient

#define kFuncNameCreateClient   "CreateClient"

Create an NTV2RPCClientAPI instance.

Definition at line 47 of file ntv2nubaccess.h.

◆ kFuncNameCreateServer

#define kFuncNameCreateServer   "CreateServer"

Create an NTV2RPCServerAPI instance.

Definition at line 48 of file ntv2nubaccess.h.

◆ kFuncNameGetRegInfo

#define kFuncNameGetRegInfo   "GetRegistrationInfo"

Answers with plugin registration info.

Definition at line 49 of file ntv2nubaccess.h.

◆ kLegalSchemeNTV2

#define kLegalSchemeNTV2   "ntv2"

Definition at line 43 of file ntv2nubaccess.h.

◆ kLegalSchemeNTV2Local

#define kLegalSchemeNTV2Local   "ntv2local"

Definition at line 44 of file ntv2nubaccess.h.

◆ kNTV2PluginInfoKey_Fingerprint

#define kNTV2PluginInfoKey_Fingerprint   "serial number"

Issuer cert fingerprint.

Definition at line 56 of file ntv2nubaccess.h.

◆ kNTV2PluginInfoKey_PluginBaseName

#define kNTV2PluginInfoKey_PluginBaseName   "PluginBaseName"

Plugin base name (i.e. without extension)

Definition at line 55 of file ntv2nubaccess.h.

◆ kNTV2PluginInfoKey_PluginPath

#define kNTV2PluginInfoKey_PluginPath   "PluginPath"

Local host full path to plugin file.

Definition at line 53 of file ntv2nubaccess.h.

◆ kNTV2PluginInfoKey_PluginSigPath

#define kNTV2PluginInfoKey_PluginSigPath   "PluginSigPath"

Local host full path to plugin signature file.

Definition at line 54 of file ntv2nubaccess.h.

◆ kNTV2PluginInfoKey_PluginsPath

#define kNTV2PluginInfoKey_PluginsPath   "PluginsPath"

Local host full path to folder containing plugins.

Definition at line 52 of file ntv2nubaccess.h.

◆ kNTV2PluginRegInfoKey_CommitSHA

#define kNTV2PluginRegInfoKey_CommitSHA   "CommitSHA"

Plugin last commit SHA.

Definition at line 68 of file ntv2nubaccess.h.

◆ kNTV2PluginRegInfoKey_CommonName

#define kNTV2PluginRegInfoKey_CommonName   "CommonName"

Plugin vendor domain name.

Definition at line 60 of file ntv2nubaccess.h.

◆ kNTV2PluginRegInfoKey_Copyright

#define kNTV2PluginRegInfoKey_Copyright   "Copyright"

Plugin copyright notice.

Definition at line 65 of file ntv2nubaccess.h.

◆ kNTV2PluginRegInfoKey_Description

#define kNTV2PluginRegInfoKey_Description   "Description"

Brief plugin description.

Definition at line 64 of file ntv2nubaccess.h.

◆ kNTV2PluginRegInfoKey_LongName

#define kNTV2PluginRegInfoKey_LongName   "LongName"

Plugin long name.

Definition at line 63 of file ntv2nubaccess.h.

◆ kNTV2PluginRegInfoKey_NTV2SDKVersion

#define kNTV2PluginRegInfoKey_NTV2SDKVersion   "NTV2SDKVersion"

NTV2 SDK version that plugin was compiled with.

Definition at line 66 of file ntv2nubaccess.h.

◆ kNTV2PluginRegInfoKey_OrgUnit

#define kNTV2PluginRegInfoKey_OrgUnit   "OrgUnit"

Plugin organization unit (to match certificate subject OU)

Definition at line 61 of file ntv2nubaccess.h.

◆ kNTV2PluginRegInfoKey_ShortName

#define kNTV2PluginRegInfoKey_ShortName   "ShortName"

Plugin short name.

Definition at line 62 of file ntv2nubaccess.h.

◆ kNTV2PluginRegInfoKey_Vendor

#define kNTV2PluginRegInfoKey_Vendor   "Vendor"

Plugin vendor (manufacturer) name.

Definition at line 59 of file ntv2nubaccess.h.

◆ kNTV2PluginRegInfoKey_Version

#define kNTV2PluginRegInfoKey_Version   "Version"

Plugin version (string)

Definition at line 67 of file ntv2nubaccess.h.

◆ kNTV2PluginSigFileKey_Signature

#define kNTV2PluginSigFileKey_Signature   "Signature"

X509 digital signature (encoded as hex string)

Definition at line 72 of file ntv2nubaccess.h.

◆ kNTV2PluginSigFileKey_X509Certificate

#define kNTV2PluginSigFileKey_X509Certificate   "X509Certificate"

X509 certificate (encoded as hex string)

Definition at line 71 of file ntv2nubaccess.h.

◆ kNTV2PluginX500AttrKey_CommonName

#define kNTV2PluginX500AttrKey_CommonName   "CN"

Definition at line 75 of file ntv2nubaccess.h.

◆ kNTV2PluginX500AttrKey_CountryName

#define kNTV2PluginX500AttrKey_CountryName   "C"

Definition at line 80 of file ntv2nubaccess.h.

◆ kNTV2PluginX500AttrKey_LocalityName

#define kNTV2PluginX500AttrKey_LocalityName   "L"

Definition at line 76 of file ntv2nubaccess.h.

◆ kNTV2PluginX500AttrKey_OrganizationalUnitName

#define kNTV2PluginX500AttrKey_OrganizationalUnitName   "OU"

Definition at line 79 of file ntv2nubaccess.h.

◆ kNTV2PluginX500AttrKey_OrganizationName

#define kNTV2PluginX500AttrKey_OrganizationName   "O"

Definition at line 78 of file ntv2nubaccess.h.

◆ kNTV2PluginX500AttrKey_StateOrProvinceName

#define kNTV2PluginX500AttrKey_StateOrProvinceName   "ST"

Definition at line 77 of file ntv2nubaccess.h.

◆ kQParamDebugRegistry

#define kQParamDebugRegistry   "debugregistry"

Query parameter option that enables debugging of PluginRegistry.

Definition at line 40 of file ntv2nubaccess.h.

◆ kQParamLogToStdout

#define kQParamLogToStdout   "stdout"

Query parameter option that logs messages to standard output.

Definition at line 37 of file ntv2nubaccess.h.

◆ kQParamShowParams

#define kQParamShowParams   "showparams"

Query parameter option that dumps parameters into message log.

Definition at line 39 of file ntv2nubaccess.h.

◆ kQParamShowX509Cert

#define kQParamShowX509Cert   "showcert"

Query parameter option that dumps X509 certificate info into message log.

Definition at line 38 of file ntv2nubaccess.h.

◆ kQParamVerboseLogging

#define kQParamVerboseLogging   "verbose"

Query parameter option that enables verbose message logging.

Definition at line 36 of file ntv2nubaccess.h.

Typedef Documentation

◆ fpCreateClient

typedef NTV2RPCClientAPI*(* fpCreateClient) (void *, const NTV2ConnectParams &, const uint32_t)

Instantiates a new client instance to talk to a remote server.

  • pRefCon: For reference counting.
  • inParams: The NTV2ConnectParams that specifies the client connection configuration.
  • inHostSDKVersion: Specifies the NTV2 SDK version the caller was compiled with.
    Returns
    A pointer to the new client instance if successful, or nullptr (zero) upon failure.

Definition at line 453 of file ntv2nubaccess.h.

◆ fpCreateNTV2SoftwareDevice

typedef NTV2RPCAPI*(* fpCreateNTV2SoftwareDevice) (void *, const std::string &, const uint32_t)

Definition at line 466 of file ntv2nubaccess.h.

◆ fpCreateServer

typedef NTV2RPCServerAPI*(* fpCreateServer) (void *, const NTV2ConfigParams &, const uint32_t)

Instantiates a new server instance for talking to clients.

  • pHandle: For reference counting.
  • inParams: The NTV2ConfigParams that specify how to configure the server.
  • inHostSDKVersion: Specifies the NTV2 SDK version the caller was compiled with.
    Returns
    A pointer to the new server instance if successful, or nullptr (zero) upon failure.
    Note
    Do not implement this function if a server implementation is not required.

Definition at line 463 of file ntv2nubaccess.h.

◆ fpGetRegistrationInfo

typedef bool(* fpGetRegistrationInfo) (const uint32_t, NTV2Dictionary &)

Obtains a plugin's registration information. Starting in SDK 17.1, all plugins must implement this function, or they will not be allowed to load.

The scheme specified in a device specifier URL identifies the plugin (dynamically-loaded library) to load in order to provide a requested NTV2RPCClientAPI or NTV2RPCServerAPI. These are the functions the library must provide that instantiate the client or server instance.

  • inHostSDKVers Specifies the caller's NTV2 SDK version.
  • outInfo Receives the NTV2Dictionary that contains the registration info, which must include:
    • Vendor
    • LongPluginName
    • ShortPluginName
    • Description
    • Copyright
    • any other key/value pairs deemed requisite by AJA Video Systems
      Returns
      True if successful; otherwise false.

Definition at line 444 of file ntv2nubaccess.h.

◆ NTV2ConfigParams

A dictionary of parameters used to configure an RPC server.

Definition at line 131 of file ntv2nubaccess.h.

◆ NTV2ConnectParam

typedef std::pair<std::string, std::string> NTV2ConnectParam

A parameter used to connect to remote/fake devices.

Definition at line 132 of file ntv2nubaccess.h.

◆ NTV2ConnectParams

A dictionary of parameters used to connect to remote/fake devices.

Definition at line 130 of file ntv2nubaccess.h.

◆ NTV2DeviceIDSerialPair

Identifies a device by its NTV2DeviceID and serial number.

Definition at line 19 of file ntv2nubaccess.h.

◆ NTV2DeviceIDSerialPairs

An ordered sequence of NTV2DeviceIDSerialPairs.

Definition at line 20 of file ntv2nubaccess.h.

◆ NTV2DeviceIDSerialPairsConstIter

typedef NTV2DeviceIDSerialPairs::const_iterator NTV2DeviceIDSerialPairsConstIter

Definition at line 22 of file ntv2nubaccess.h.

◆ NTV2DeviceIDSerialPairsIter

typedef NTV2DeviceIDSerialPairs::iterator NTV2DeviceIDSerialPairsIter

Definition at line 21 of file ntv2nubaccess.h.

◆ NTV2Dict

Definition at line 129 of file ntv2nubaccess.h.

◆ NTV2DictEntry

typedef std::pair<std::string, std::string> NTV2DictEntry

Definition at line 132 of file ntv2nubaccess.h.

◆ NTV2DictionaryEntry

typedef std::pair<std::string, std::string> NTV2DictionaryEntry

Definition at line 132 of file ntv2nubaccess.h.

◆ NTV2RPCAPI

Definition at line 355 of file ntv2nubaccess.h.

Function Documentation

◆ operator<<() [1/3]

std::ostream& operator<< ( std::ostream &  oss,
const NTV2Dictionary inDict 
)
inline

Definition at line 134 of file ntv2nubaccess.h.

◆ operator<<() [2/3]

std::ostream& operator<< ( std::ostream &  oss,
const NTV2RPCClientAPI inObj 
)
inline

Definition at line 357 of file ntv2nubaccess.h.

◆ operator<<() [3/3]

std::ostream& operator<< ( std::ostream &  oss,
const NTV2RPCServerAPI inObj 
)
inline

Definition at line 422 of file ntv2nubaccess.h.