AJA NTV2 SDK  18.0.0.2122
NTV2 SDK 18.0.0.2122
ntv2devicescanner.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 #ifndef NTV2DEVICESCANNER_H
9 #define NTV2DEVICESCANNER_H
10 
11 #include "ajatypes.h"
12 #include "ntv2audiodefines.h"
13 #include "ntv2card.h"
14 #include <vector>
15 
16 typedef std::vector <AudioSampleRateEnum> NTV2AudioSampleRateList;
17 typedef NTV2AudioSampleRateList::const_iterator NTV2AudioSampleRateListConstIter;
18 typedef NTV2AudioSampleRateList::iterator NTV2AudioSampleRateListIter;
19 
20 typedef std::vector <AudioChannelsPerFrameEnum> NTV2AudioChannelsPerFrameList;
21 typedef NTV2AudioChannelsPerFrameList::const_iterator NTV2AudioChannelsPerFrameListConstIter;
22 typedef NTV2AudioChannelsPerFrameList::iterator NTV2AudioChannelsPerFrameListIter;
23 
24 typedef std::vector <AudioSourceEnum> NTV2AudioSourceList;
25 typedef NTV2AudioSourceList::const_iterator NTV2AudioSourceListConstIter;
26 typedef NTV2AudioSourceList::iterator NTV2AudioSourceListIter;
27 
28 typedef std::vector <AudioBitsPerSampleEnum> NTV2AudioBitsPerSampleList;
29 typedef NTV2AudioBitsPerSampleList::const_iterator NTV2AudioBitsPerSampleListConstIter;
30 typedef NTV2AudioBitsPerSampleList::iterator NTV2AudioBitsPerSampleListIter;
31 
35 typedef struct NTV2DeviceInfo
36 {
40  uint64_t deviceSerialNumber;
41  std::string serialNumber;
42  std::string deviceIdentifier;
58  bool hdvSupport;
67  bool has2KSupport;
68  bool has4KSupport;
69  bool has8KSupport;
72  bool sdi3GSupport;
74  bool ipSupport;
76  bool ltcInSupport;
81  bool multiFormat;
99  bool isVirtualDevice=false;
100  std::string vdevUrl;
101  std::string vdevName;
102 
103  AJAExport bool operator == (const NTV2DeviceInfo & rhs) const;
104  AJAExport inline bool operator != (const NTV2DeviceInfo & rhs) const { return !(*this == rhs); }
107 
109 
110 
111 
112 // ostream operators
113 
120 AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2AudioSampleRateList & inList);
121 
128 AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2AudioChannelsPerFrameList & inList);
129 
136 AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2AudioSourceList & inList);
137 
144 AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2AudioBitsPerSampleList & inList);
145 
152 AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2DeviceInfo & inInfo);
153 
154 
158 typedef std::vector <NTV2DeviceInfo> NTV2DeviceInfoList;
159 typedef NTV2DeviceInfoList::const_iterator NTV2DeviceInfoListConstIter; // Const iterator shorthand
160 typedef NTV2DeviceInfoList::iterator NTV2DeviceInfoListIter; // Iterator shorthand
161 
162 
169 AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2DeviceInfoList & inList);
170 
171 
172 typedef struct
173 {
181 
182 
189 AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2AudioPhysicalFormat & inFormat);
190 
191 
195 typedef std::vector <NTV2AudioPhysicalFormat> NTV2AudioPhysicalFormatList;
196 typedef NTV2AudioPhysicalFormatList::const_iterator NTV2AudioPhysicalFormatListConstIter; // Shorthand for const_iterator
197 typedef NTV2AudioPhysicalFormatList::iterator NTV2AudioPhysicalFormatListIter; // Shorthand for iterator
198 
199 
206 AJAExport std::ostream & operator << (std::ostream & inOutStr, const NTV2AudioPhysicalFormatList & inList);
207 
208 
213 {
214 // Class Methods
215 public:
222  static bool GetDeviceAtIndex (const ULWord inDeviceIndexNumber, CNTV2Card & outDevice);
223 
230  static bool GetFirstDeviceWithID (const NTV2DeviceID inDeviceID, CNTV2Card & outDevice);
231 
239  static bool GetFirstDeviceWithName (const std::string & inNameSubString, CNTV2Card & outDevice);
240 
249  static bool GetVirtualDeviceWithName (const std::string & inNameString, CNTV2Card & outDevice, const bool inRescan = true);
250 
258  static bool GetFirstDeviceWithSerial (const std::string & inSerialStr, CNTV2Card & outDevice); // New in SDK 16.0
259 
267  static bool GetDeviceWithSerial (const std::string & inSerialNumber, CNTV2Card & outDevice); // New in SDK 17.5, replaced uint64_t version
268 
281  static bool GetFirstDeviceFromArgument (const std::string & inArgument, CNTV2Card & outDevice);
282 
283  static size_t GetNumDevices (void);
284 
289  static std::string GetDeviceRefName (CNTV2Card & inDevice); // New in SDK 16.0
290 
295  static bool IsLegalSerialNumber (const std::string & inStr); // New in SDK 16.0
296 
297 #if !defined(NTV2_DEPRECATE_17_1)
298  static NTV2_DEPRECATED_17_1(bool IsLegalDecimalNumber (const std::string & inStr, const size_t maxLen = 2));
299  static NTV2_DEPRECATED_17_1(uint64_t IsLegalHexSerialNumber (const std::string & inStr));
300  static NTV2_DEPRECATED_17_1(bool IsHexDigit (const char inChr));
301  static NTV2_DEPRECATED_17_1(bool IsDecimalDigit (const char inChr));
302  static NTV2_DEPRECATED_17_1(bool IsAlphaNumeric (const char inStr));
303  static NTV2_DEPRECATED_17_1(bool IsAlphaNumeric (const std::string & inStr));
304 #endif // !defined(NTV2_DEPRECATE_17_1)
305 #if !defined(NTV2_DEPRECATE_17_5)
306  static NTV2_DEPRECATED_17_5(bool GetDeviceWithSerial (const uint64_t sn, CNTV2Card & dev));
307 #endif // !defined(NTV2_DEPRECATE_17_5)
308 
309  // Instance Methods
310  public:
311  explicit CNTV2DeviceScanner (const bool inScanNow = true);
312 #if !defined(NTV2_DEPRECATE_16_3)
313  explicit CNTV2DeviceScanner (bool inScanNow, UWord inDeviceMask);
314 #endif // !defined(NTV2_DEPRECATE_16_3)
315 
316 
317  static void ScanHardware (void);
318 #if !defined(NTV2_DEPRECATE_17_1)
319  static NTV2_DEPRECATED_17_1(void ScanHardware (const UWord inMask)) {(void)inMask; ScanHardware();}
320 #endif // !defined(NTV2_DEPRECATE_17_1)
321  static bool DeviceIDPresent (const NTV2DeviceID inDeviceID, const bool inRescan = false);
322  static bool GetDeviceInfo (const ULWord inDeviceIndexNumber, NTV2DeviceInfo & outDeviceInfo, const bool inRescan = false);
323  static NTV2DeviceInfoList GetDeviceInfoList (void);
324  static void SortDeviceInfoList (void) {}
325  static bool CompareDeviceInfoLists (const NTV2DeviceInfoList & inOldList,
326  const NTV2DeviceInfoList & inNewList,
327  NTV2DeviceInfoList & outDevicesAdded,
328  NTV2DeviceInfoList & outDevicesRemoved);
329  private:
330  static void SetDeviceAttributes (NTV2DeviceInfo & inDeviceInfo, CNTV2Card & inDevice);
331  static void SetAudioAttributes (NTV2DeviceInfo & inDeviceInfo, CNTV2Card & inDevice);
332  static bool GetCP2DevList (NTV2DeviceInfoList& outVDevList);
333  static bool GetVDevList (NTV2DeviceInfoList& outVDevList);
334 }; // CNTV2DeviceScanner
335 
336 #endif // NTV2DEVICESCANNER_H
bool programmableCSCSupport
Programmable color space converter?
NTV2DeviceInfoList GetDeviceInfoList(void)
bool ipSupport
Supports IP IO?
UWord numAnalogAudioInputChannels
Total number of analog audio input channels.
UWord numAnalogAudioOutputChannels
Total number of analog audio output channels.
This class is used to enumerate AJA devices that are attached and known to the local host computer...
I interrogate and control an AJA video/audio capture/playout device.
Definition: ntv2card.h:28
UWord numOutputConverters
Total number of output converters.
UWord numAnlgVidInputs
Total number of analog video inputs.
NTV2AudioPhysicalFormatList::const_iterator NTV2AudioPhysicalFormatListConstIter
bool ltcInOnRefPort
Supports LTC on reference input?
NTV2AudioPhysicalFormatList::iterator NTV2AudioPhysicalFormatListIter
#define NTV2_DEPRECATED_17_1(__f__)
Definition: ajatypes.h:553
NTV2DeviceInfoList::iterator NTV2DeviceInfoListIter
AudioChannelsPerFrameEnum
UWord numVidOutputs
Total number of video outputs – analog, digital, whatever.
NTV2AudioBitsPerSampleList::iterator NTV2AudioBitsPerSampleListIter
AudioSourceEnum
UWord numEmbeddedAudioInputChannels
Total number of embedded (SDI) audio input channels.
bool has2KSupport
Supports 2K formats?
Declares common audio macros and structs used in the SDK.
uint32_t ULWord
Definition: ajatypes.h:223
UWord numHDMIAudioInputChannels
Total number of HDMI audio input channels.
ULWord pciSlot
PCI slot (if applicable and/or known)
NTV2AudioSampleRateList audioSampleRateList
My supported audio sample rates.
NTV2AudioSourceList audioInSourceList
My supported audio input sources (AES, ADAT, etc.)
UWord numAnlgVidOutputs
Total number of analog video outputs.
UWord numDMAEngines
Total number of DMA engines.
bool ltcOutSupport
Supports LTC output?
bool proResSupport
Supports ProRes?
bool breakoutBoxSupport
Can support a breakout box?
NTV2DeviceID
Identifies a specific AJA NTV2 device model number. The NTV2DeviceID is actually the PROM part number...
Definition: ntv2enums.h:20
std::vector< AudioBitsPerSampleEnum > NTV2AudioBitsPerSampleList
UWord numHDMIVidOutputs
Total number of HDMI outputs.
bool ltcInSupport
Accepts LTC input?
NTV2AudioChannelsPerFrameList::const_iterator NTV2AudioChannelsPerFrameListConstIter
NTV2AudioBitsPerSampleList::const_iterator NTV2AudioBitsPerSampleListConstIter
bool has4KSupport
Supports 4K formats?
std::string serialNumber
Unique device serial number (new in SDK 17.5)
std::vector< NTV2DeviceInfo > NTV2DeviceInfoList
I am an ordered list of NTV2DeviceInfo structs.
AudioChannelsPerFrameEnum numChannels
NTV2AudioChannelsPerFrameList::iterator NTV2AudioChannelsPerFrameListIter
Declares the most fundamental data types used by NTV2. Since Windows NT was the first principal devel...
bool has8KSupport
Supports 8K formats?
bool sdi12GSupport
Supports 12G?
UWord numUpConverters
Total number of up-converters.
NTV2DeviceInfoList::const_iterator NTV2DeviceInfoListConstIter
bool colorCorrectionSupport
Supports color correction?
static void SortDeviceInfoList(void)
UWord numAESAudioInputChannels
Total number of AES audio input channels.
bool biDirectionalSDI
Supports Bi-directional SDI.
AudioSampleRateEnum
std::vector< AudioChannelsPerFrameEnum > NTV2AudioChannelsPerFrameList
ULWord deviceIndex
Device index number – this will be phased out someday.
UWord numHDMIVidInputs
Total number of HDMI inputs.
std::vector< AudioSampleRateEnum > NTV2AudioSampleRateList
UWord numVidInputs
Total number of video inputs – analog, digital, whatever.
bool operator==(const NTV2DeviceInfo &rhs) const
UWord numDownConverters
Total number of down-converters.
uint64_t deviceSerialNumber
Unique device serial number (obsolete)
NTV2AudioChannelsPerFrameList audioNumChannelsList
My supported number of audio channels per frame.
#define AJAExport
Definition: export.h:33
struct NTV2DeviceInfo NTV2DeviceInfo
UWord numSerialPorts
Total number of serial ports.
std::string vdevName
uint16_t UWord
Definition: ajatypes.h:221
bool stereoOutSupport
Supports stereo output?
UWord numAudioStreams
Maximum number of independent audio streams.
UWord numInputConverters
Total number of input converters.
AudioBitsPerSampleEnum bitsPerSample
Declares the CNTV2Card class.
bool dualLinkSupport
Supports dual-link?
std::string vdevUrl
AudioBitsPerSampleEnum
NTV2AudioSampleRateList::const_iterator NTV2AudioSampleRateListConstIter
#define NTV2_DEPRECATED_17_5(__f__)
Definition: ajatypes.h:563
UWord numEmbeddedAudioOutputChannels
Total number of embedded (SDI) audio output channels.
bool stereoInSupport
Supports stereo input?
bool rgbAlphaOutputSupport
Supports RGB alpha channel?
static void ScanHardware(const UWord inMask)
UWord numHDMIAudioOutputChannels
Total number of HDMI audio output channels.
NTV2AudioBitsPerSampleList audioBitsPerSampleList
My supported audio bits-per-sample.
NTV2DeviceID deviceID
Device ID/species (e.g., DEVICE_ID_KONA3G, DEVICE_ID_IOXT, etc.)
std::vector< NTV2AudioPhysicalFormat > NTV2AudioPhysicalFormatList
I am an ordered list of NTV2AudioPhysicalFormat structs.
std::vector< AudioSourceEnum > NTV2AudioSourceList
NTV2AudioSampleRateList::iterator NTV2AudioSampleRateListIter
bool has3GLevelConversion
Supports 3G Level Conversion?
bool multiFormat
Supports multiple video formats?
AudioSampleRateEnum sampleRate
NTV2AudioSourceList::const_iterator NTV2AudioSourceListConstIter
NTV2AudioSourceList::iterator NTV2AudioSourceListIter
NTV2AudioSourceList audioOutSourceList
My supported audio output destinations (AES, etc.)
bool operator!=(const NTV2DeviceInfo &rhs) const
UWord numAESAudioOutputChannels
Total number of AES audio output channels.
std::ostream & operator<<(std::ostream &inOutStr, const NTV2AudioSampleRateList &inList)
Streams the NTV2AudioSampleRateList to the given output stream in a human-readable format...
bool sdi3GSupport
Supports 3G?
std::string deviceIdentifier
Device name as seen in Control Panel, Watcher, Cables, etc.