 |
AJA NTV2 SDK
17.6.0.2675
NTV2 SDK 17.6.0.2675
|
Go to the documentation of this file.
8 #ifndef NTV2NUBACCESS_H
9 #define NTV2NUBACCESS_H
24 #define kConnectParamScheme "scheme"
25 #define kConnectParamHost "host"
26 #define kConnectParamPort "port"
27 #define kConnectParamDevIndex "deviceindex"
28 #define kConnectParamDevSerial "deviceserial"
29 #define kConnectParamDevModel "devicemodel"
30 #define kConnectParamDevID "deviceid"
31 #define kConnectParamResource "resourcePath"
32 #define kConnectParamQuery "query"
35 #define kQParamVerboseLogging "verbose"
36 #define kQParamLogToStdout "stdout"
37 #define kQParamShowX509Cert "showcert"
38 #define kQParamShowParams "showparams"
39 #define kQParamDebugRegistry "debugregistry"
42 #define kLegalSchemeNTV2 "ntv2"
43 #define kLegalSchemeNTV2Local "ntv2local"
46 #define kFuncNameCreateClient "CreateClient"
47 #define kFuncNameCreateServer "CreateServer"
48 #define kFuncNameGetRegInfo "GetRegistrationInfo"
51 #define kNTV2PluginInfoKey_PluginsPath "PluginsPath"
52 #define kNTV2PluginInfoKey_PluginPath "PluginPath"
53 #define kNTV2PluginInfoKey_PluginSigPath "PluginSigPath"
54 #define kNTV2PluginInfoKey_PluginBaseName "PluginBaseName"
55 #define kNTV2PluginInfoKey_Fingerprint "serial number"
56 #define kNTV2PluginInfoKey_Errors "errors"
59 #define kNTV2PluginRegInfoKey_Vendor "Vendor"
60 #define kNTV2PluginRegInfoKey_CommonName "CommonName"
61 #define kNTV2PluginRegInfoKey_OrgUnit "OrgUnit"
62 #define kNTV2PluginRegInfoKey_ShortName "ShortName"
63 #define kNTV2PluginRegInfoKey_LongName "LongName"
64 #define kNTV2PluginRegInfoKey_Description "Description"
65 #define kNTV2PluginRegInfoKey_Copyright "Copyright"
66 #define kNTV2PluginRegInfoKey_NTV2SDKVersion "NTV2SDKVersion"
67 #define kNTV2PluginRegInfoKey_Version "Version"
68 #define kNTV2PluginRegInfoKey_CommitSHA "CommitSHA"
69 #define kNTV2PluginRegInfoKey_ReqParams "RequiredParams"
70 #define kNTV2PluginRegInfoKey_OptParams "OptionalParams"
73 #define kNTV2PluginSigFileKey_X509Certificate "X509Certificate"
74 #define kNTV2PluginSigFileKey_Signature "Signature"
77 #define kNTV2PluginX500AttrKey_CommonName "CN"
78 #define kNTV2PluginX500AttrKey_LocalityName "L"
79 #define kNTV2PluginX500AttrKey_StateOrProvinceName "ST"
80 #define kNTV2PluginX500AttrKey_OrganizationName "O"
81 #define kNTV2PluginX500AttrKey_OrganizationalUnitName "OU"
82 #define kNTV2PluginX500AttrKey_CountryName "C"
104 inline size_t size (
void)
const {
return mDict.size();}
106 inline bool empty (
void)
const {
return mDict.empty();}
107 inline bool hasKey (
const std::string & inKey)
const {
return mDict.find(inKey) != mDict.end();}
108 std::string valueForKey (
const std::string & inKey)
const;
109 uint16_t u16ValueForKey (
const std::string & inKey,
const uint16_t inDefault = 0)
const;
111 size_t largestKeySize (
void)
const;
112 size_t largestValueSize (
void)
const;
113 std::ostream & Print (std::ostream & oss,
const bool inCompact =
true)
const;
114 bool serialize (std::string & outStr)
const;
120 inline void clear (
void) {mDict.clear();}
122 bool insert (
const std::string & inKey,
const std::string & inValue);
123 inline size_t erase (
const std::string & inKey) {
return hasKey(inKey) ? mDict.erase(inKey) : 0;}
126 bool deserialize (
const std::string & inStr);
127 #if !defined(NTV2_DEPRECATE_17_1)
130 #endif // !defined(NTV2_DEPRECATE_17_1)
134 typedef std::map<std::string, std::string>
Dict;
159 void Reset (
const std::string inSpec =
"");
160 inline const std::string & DeviceSpec (
void)
const {
return mSpec;}
161 inline bool HasDeviceSpec (
void)
const {
return !DeviceSpec().empty();}
162 inline bool Successful (
void)
const {
return !Failed();}
163 inline bool Failed (
void)
const {
return DeviceSpec().empty() ?
true : HasErrors();}
167 inline size_t ErrorCount (
void)
const {
return mErrors.size();}
168 inline bool HasErrors (
void)
const {
return ErrorCount() > 0;}
169 inline std::string Error (
const size_t inIndex = 0)
const {
if (inIndex < mErrors.size())
return mErrors.at(inIndex);
return "";}
172 inline bool HasResult (
const std::string & inKey)
const {
return mResult.hasKey(inKey);}
173 std::string Result (
const std::string & inKey)
const {
return mResult.
valueForKey(inKey);}
174 std::string Resource (
const bool inStripLeadSlash =
true)
const;
175 std::ostream & PrintErrors (std::ostream & oss)
const;
176 std::ostream & Print (std::ostream & oss,
const bool inDumpResults =
false)
const;
177 std::string InfoString (
void)
const;
181 UWord DeviceIndex (
void)
const;
182 inline const NTV2Dictionary & QueryParams (
void)
const {
return mQueryParams;}
183 inline std::string QueryParam (
const std::string & inKey)
const {
return mQueryParams.
valueForKey(inKey);}
185 static void test (
void);
186 #endif // defined(_DEBUG)
190 bool ParseHexNumber (
size_t & pos, std::string & outToken);
191 bool ParseDecNumber (
size_t & pos, std::string & outToken);
192 bool ParseAlphaNumeric (
size_t & pos, std::string & outToken,
const std::string & inOtherChars =
"");
193 bool ParseScheme (
size_t & pos, std::string & outToken);
194 bool ParseSerialNum (
size_t & pos, std::string & outToken);
195 bool ParseDeviceID (
size_t & pos, std::string & outToken);
196 bool ParseModelName (
size_t & pos, std::string & outToken);
197 bool ParseDNSName (
size_t & pos, std::string & outDNSName);
198 bool ParseIPv4Address (
size_t & pos, std::string & outIPv4);
199 bool ParseHostAddressAndPortNumber (
size_t & pos, std::string & outAddr, std::string & outPort);
200 bool ParseResourcePath (
size_t & pos, std::string & outRsrc);
201 bool ParseParamAssignment (
size_t & pos, std::string & outKey, std::string & outValue);
203 inline int LargestResultKey (
void)
const {
return int(mResult.largestKeySize());}
204 inline int LargestResultValue (
void)
const {
return int(mResult.largestValueSize());}
205 inline char CharAt (
const size_t inPos) {
return inPos < mSpec.length() ? mSpec.at(inPos) : 0;}
206 inline size_t SpecLength (
void)
const {
return mSpec.length();}
207 inline size_t CurrentPosition (
void)
const {
return mPos;}
208 inline void AddError (
const std::string & inError) {mErrors.push_back(inError);}
209 static bool IsUpperLetter (
const char inChar);
210 static bool IsLowerLetter (
const char inChar);
211 static bool IsLetter (
const char inChar,
const bool inIncludeUnderscore =
false);
212 static bool IsDecimalDigit (
const char inChar);
213 static bool IsHexDigit (
const char inChar);
214 static bool IsLegalSerialNumChar (
const char inChar);
231 static std::string ShortSDKVersion (
void);
232 static std::string AJAFingerprint (
const bool inLowerCase =
false,
const bool inStripColons =
false);
237 bool SetParams (
const NTV2ConfigParams & inNewParams,
const bool inAugment =
false);
272 virtual std::string HostName (
void)
const {
return ConnectParam(
kConnectParamHost);}
274 virtual std::string Name (
void)
const {
return "";}
275 virtual std::string Description (
void)
const;
276 virtual std::ostream & Print (std::ostream & oss)
const;
282 virtual bool NTV2Connect (
void);
284 virtual bool NTV2Disconnect (
void);
285 virtual bool IsConnected (
void)
const {
return false;}
293 virtual bool HasConnectParam (
const std::string & inParam)
const;
294 virtual std::string ConnectParam (
const std::string & inParam)
const;
295 virtual bool ConnectHasScheme (
void)
const;
296 virtual inline bool SetConnectParams (
const NTV2ConnectParams & inNewParams,
const bool inAugment =
false) {
return !IsConnected() &&
SetParams(inNewParams, inAugment);}
302 virtual bool NTV2ReadRegisterRemote (
const ULWord regNum,
ULWord & outRegValue,
const ULWord regMask,
const ULWord regShift);
304 virtual bool NTV2WriteRegisterRemote (
const ULWord regNum,
const ULWord regValue,
const ULWord regMask,
const ULWord regShift);
307 virtual bool NTV2DMATransferRemote (
const NTV2DMAEngine inDMAEngine,
const bool inIsRead,
309 const ULWord inCardOffsetBytes,
const ULWord inNumSegments,
310 const ULWord inSegmentHostPitch,
const ULWord inSegmentCardPitch,
311 const bool inSynchronous);
312 virtual bool NTV2MessageRemote (
NTV2_HEADER * pInMessage);
318 virtual bool NTV2GetBoolParamRemote (
const ULWord inParamID,
ULWord & outValue);
320 virtual bool NTV2GetNumericParamRemote (
const ULWord inParamID,
ULWord & outValue);
321 virtual bool NTV2GetSupportedRemote (
const ULWord inEnumsID,
ULWordSet & outSupported);
341 outDeviceInfos.clear();
345 #if !defined(NTV2_DEPRECATE_16_3) // These functions are going away
347 virtual bool NTV2DriverGetBuildInformationRemote (
BUILD_INFO_STRUCT & buildInfo);
349 const UWord signalMask,
const bool testPatDMAEnb,
const ULWord testPatNum);
350 virtual bool NTV2ReadRegisterMultiRemote (
const ULWord numRegs,
ULWord & outFailedRegNum,
NTV2RegInfo outRegs[]);
351 virtual bool NTV2GetDriverVersionRemote (
ULWord & outDriverVersion);
352 #endif // !defined(NTV2_DEPRECATE_16_3)
359 virtual bool NTV2OpenRemote (
void);
360 virtual bool NTV2CloseRemote (
void);
363 uint32_t mSpare[1024];
400 virtual std::ostream & Print (std::ostream & oss)
const;
402 virtual inline bool IsRunning (
void)
const {
return mRunning;}
410 virtual bool HasConfigParam (
const std::string & inParam)
const;
411 virtual std::string ConfigParam (
const std::string & inParam)
const;
412 virtual inline bool SetConfigParams (
const NTV2ConfigParams & inNewParams,
const bool inAugment =
false) {
return SetParams(inNewParams, inAugment);}
418 virtual void RunServer (
void);
420 virtual inline void Stop (
void) {mTerminate =
true;}
430 uint32_t mSpare[1024];
476 #if !defined(NTV2_DEPRECATE_16_3) // Don't use these functions going forward
477 typedef NTV2RPCAPI* (*fpCreateNTV2SoftwareDevice) (
void * ,
const std::string & ,
const uint32_t );
478 #endif // !defined(NTV2_DEPRECATE_16_3)
481 #endif // NTV2NUBACCESS_H
NTV2Dictionary NTV2ConfigParams
A dictionary of parameters used to configure an RPC server.
#define kLegalSchemeNTV2Local
enum _INTERRUPT_ENUMS_ INTERRUPT_ENUMS
uint32_t gClientConstructCount
std::pair< NTV2DeviceID, ULWord64 > NTV2DeviceIDSerialPair
Identifies a device by its NTV2DeviceID and serial number.
std::set< std::string > NTV2StringSet
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
Describes a user-space buffer on the host computer. I have an address and a length,...
size_t initializeFrom(const Dict &inDict)
Base class of objects that can serve device operation RPCs with NTV2RPCClientAPI instances.
Common base class for NTV2RPCClientAPI and NTV2RPCServerAPI.
NTV2DeviceIDSerialPairs::const_iterator NTV2DeviceIDSerialPairsConstIter
bool SetParams(const NTV2ConfigParams &inNewParams, const bool inAugment=false)
NTV2DeviceID
Identifies a specific AJA NTV2 device model number. The NTV2DeviceID is actually the PROM part number...
NTV2FrameBufferFormat
Identifies a particular video frame buffer format. See Device Frame Buffer Formats for details.
std::ostream & Print(std::ostream &oss, const bool inCompact=true) const
Prints human-readable representation to ostream.
uint32_t gClientDestructCount
uint32_t gServerDestructCount
std::string DeviceModel(void) const
NTV2RPCClientAPI NTV2RPCAPI
uint32_t gLoaderConstructCount
#define kConnectParamDevModel
First device of this model (e.g. 'kona4')
NTV2Dictionary mParams
Copy of config params passed to my constructor.
std::set< ULWord > ULWordSet
A collection of unique ULWord (uint32_t) values.
Declares the AJALock class.
NTV2Dictionary NTV2ConnectParams
A dictionary of parameters used to connect to remote/fake devices.
std::vector< NTV2DeviceIDSerialPair > NTV2DeviceIDSerialPairs
An ordered sequence of NTV2DeviceIDSerialPairs.
#define kConnectParamHost
DNS name, IPv4 or sw device DLL name.
virtual std::ostream & Print(std::ostream &oss) const
bool mTerminate
Set true to stop server.
virtual bool NTV2QueryDevices(NTV2StringList &outDeviceInfos, std::string &outErrMsg)
Queries the devices that are accessible on the remote host.
All new NTV2 structs start with this common header.
Declares numerous NTV2 utility functions.
uint32_t gServerConstructCount
AJALock mParamLock
Mutex to protect mParams.
uint32_t gBaseConstructCount
Dict::const_iterator DictConstIter
std::vector< std::string > NTV2StringList
#define kConnectParamScheme
URL scheme.
One-stop shop for parsing device specifications. (New in SDK 16.3) I do very little in the way of val...
std::pair< std::string, std::string > NTV2DictEntry
std::pair< std::string, std::string > NTV2DictionaryEntry
uint32_t gPluginConstructCount
#define NTV2_DEPRECATED_f(__f__)
Everything needed to call CNTV2Card::ReadRegister or CNTV2Card::WriteRegister functions.
std::pair< std::string, std::string > NTV2ConnectParam
A parameter used to connect to remote/fake devices.
uint32_t gPluginDestructCount
uint32_t gBaseDestructCount
NTV2DeviceIDSerialPairs::iterator NTV2DeviceIDSerialPairsIter
std::string DeviceSerial(void) const
virtual std::ostream & Print(std::ostream &oss) const
#define kConnectParamDevSerial
Device with this serial number.
bool(* fpGetRegistrationInfo)(const uint32_t, NTV2Dictionary &)
Obtains a plugin's registration information. Starting in SDK 17.1, all plugins must implement this fu...
An object that can connect to, and operate remote or fake devices. I have three general API groups:
std::string valueForKey(const std::string &inKey) const
uint32_t * mpRefCon
Reserved for internal use.
A simple (not thread-safe) set of key/value pairs. (New in SDK 16.3)
std::map< std::string, std::string > Dict
uint32_t gLoaderDestructCount
std::ostream & operator<<(std::ostream &oss, const NTV2Dictionary &inDict)