AJA NTV2 SDK  17.5.0.1242
NTV2 SDK 17.5.0.1242
ntv2devicescanner.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 #include "ntv2devicescanner.h"
9 #include "ntv2devicefeatures.h"
10 #include "ntv2utils.h"
11 #include "ajabase/common/common.h"
12 #include "ajabase/system/lock.h"
13 #include <sstream>
14 
15 using namespace std;
16 
17 
18 #if defined(NTV2_DEPRECATE_17_1)
19  // Abbreviated device info struct
20  typedef struct NTV2DeviceInfo
21  {
22  NTV2DeviceID deviceID;
23  string serialNumber;
24  string deviceIdentifier;
25  #if defined(VIRTUAL_DEVICES_SUPPORT)
26  bool isVirtualDevice=false;
27  std::string virtualDeviceName;
28  std::string virtualDeviceID;
29  #endif // defined(VIRTUAL_DEVICES_SUPPORT)
31 
32  typedef vector <NTV2DeviceInfo> NTV2DeviceInfoList;
33  typedef NTV2DeviceInfoList::const_iterator NTV2DeviceInfoListConstIter;
34 #else
35  bool CNTV2DeviceScanner::IsHexDigit (const char inChr)
36  { static const string sHexDigits("0123456789ABCDEFabcdef");
37  return sHexDigits.find(inChr) != string::npos;
38  }
39 
40  bool CNTV2DeviceScanner::IsDecimalDigit (const char inChr)
41  { static const string sDecDigits("0123456789");
42  return sDecDigits.find(inChr) != string::npos;
43  }
44 
45  bool CNTV2DeviceScanner::IsAlphaNumeric (const char inChr)
46  { static const string sLegalChars("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
47  return sLegalChars.find(inChr) != string::npos;
48  }
49 
50  bool CNTV2DeviceScanner::IsLegalDecimalNumber (const string & inStr, const size_t inMaxLength)
51  {
52  if (inStr.length() > inMaxLength)
53  return false; // Too long
54  for (size_t ndx(0); ndx < inStr.size(); ndx++)
55  if (!aja::is_decimal_digit(inStr.at(ndx)))
56  return false;
57  return true;
58  }
59 
60  uint64_t CNTV2DeviceScanner::IsLegalHexSerialNumber (const string & inStr) // 0x3236333331375458
61  {
62  if (inStr.length() < 3)
63  return 0ULL; // Too small
64  string hexStr(inStr); aja::lower(hexStr);
65  if (hexStr[0] == '0' && hexStr[1] == 'x')
66  hexStr.erase(0, 2); // Remove '0x' if present
67  if (hexStr.length() > 16)
68  return 0ULL; // Too big
69  for (size_t ndx(0); ndx < hexStr.size(); ndx++)
70  if (!aja::is_hex_digit(hexStr.at(ndx)))
71  return 0ULL; // Invalid hex digit
72  while (hexStr.length() != 16)
73  hexStr = '0' + hexStr; // prepend another '0'
74  istringstream iss(hexStr);
75  uint64_t u64(0);
76  iss >> hex >> u64;
77  return u64;
78  }
79 
80  bool CNTV2DeviceScanner::IsAlphaNumeric (const string & inStr)
81  {
82  for (size_t ndx(0); ndx < inStr.size(); ndx++)
83  if (!aja::is_alpha_numeric(inStr.at(ndx)))
84  return false;
85  return true;
86  }
87 #endif // !defined(NTV2_DEPRECATE_17_1)
88 
89 bool CNTV2DeviceScanner::IsLegalSerialNumber (const string & inStr)
90 {
91  if (inStr.length() != 8 && inStr.length() != 9)
92  return false;
93  return aja::is_alpha_numeric(inStr);
94 }
95 
98 
100 {
101  AJAAutoLock tmpLock(&sDevInfoListLock);
102  return sDevInfoList.size();
103 }
104 
105 #if defined(NTV2_DEPRECATE_17_1)
106  void ScanHardware (void)
107  {
108  AJAAutoLock tmpLock(&sDevInfoListLock);
109  sDevInfoList.clear();
110  UWord ndx(0);
111  do
112  {
113  CNTV2Card tmpDev(ndx);
114  if (!tmpDev.IsOpen())
115  break;
116  NTV2DeviceInfo info;
117  info.deviceID = tmpDev.GetDeviceID();
118  tmpDev.GetSerialNumberString(info.serialNumber);
119  info.deviceIdentifier = tmpDev.GetDisplayName();
120  sDevInfoList.push_back(info);
121  ndx++;
122  } while (ndx < 16);
123  }
124 #else // !defined(NTV2_DEPRECATE_17_1)
126 {
127  if (inScanNow)
128  ScanHardware();
129 }
130 
131  #if !defined(NTV2_DEPRECATE_16_3)
132  CNTV2DeviceScanner::CNTV2DeviceScanner (bool inScanNow, UWord inDeviceMask)
133  {
134  (void)inDeviceMask;
135  if (inScanNow)
136  ScanHardware();
137  }
138  #endif // !defined(NTV2_DEPRECATE_16_3)
139 
141 {
142  AJAAutoLock tmpLock(&sDevInfoListLock);
143  return sDevInfoList;
144 }
145 
146 
148 {
149  AJAAutoLock tmpLock(&sDevInfoListLock);
150  sDevInfoList.clear();
151 
152  for (UWord boardNum(0); ; boardNum++)
153  {
154  CNTV2Card tmpDev(boardNum);
155  if (!tmpDev.IsOpen())
156  break;
157  const NTV2DeviceID deviceID (tmpDev.GetDeviceID());
158 
159  if (deviceID != DEVICE_ID_NOTFOUND)
160  {
161  ostringstream oss;
162  NTV2DeviceInfo info;
163  info.deviceIndex = boardNum;
164  info.deviceID = deviceID;
165  tmpDev.GetSerialNumberString(info.serialNumber);
166 
167  oss << ::NTV2DeviceIDToString (deviceID, tmpDev.IsSupported(kDeviceHasMicrophoneInput)) << " - " << boardNum;
168 
169  const ULWordSet wgtIDs (tmpDev.GetSupportedItems(kNTV2EnumsID_WidgetID));
170  info.deviceIdentifier = oss.str();
184  info.hdvSupport = tmpDev.IsSupported(kDeviceCanDoHDV);
201  info.sdi3GSupport = wgtIDs.find(NTV2_Wgt3GSDIOut1) != wgtIDs.end();
203  info.ipSupport = tmpDev.IsSupported(kDeviceCanDoIP);
212  info.procAmpSupport = false;
213  SetAudioAttributes(info, tmpDev);
214  sDevInfoList.push_back(info);
215  }
216  tmpDev.Close();
217  } // boardNum loop
218 
219 #if defined(VIRTUAL_DEVICES_SUPPORT)
220  NTV2SerialToVirtualDevices vdMap;
221  GetSerialToVirtualDeviceMap(vdMap);
223  int vdIndex = 100;
224  for (auto hwInfo : hwList)
225  {
226  string hwSN = hwInfo.serialNumber;
227  auto it = vdMap.find(hwSN);
228  if (it != vdMap.end())
229  {
230  std::vector<VirtualDeviceInfo> vdevs = it->second;
231  for (const auto& vdev : vdevs)
232  {
233  hwInfo.deviceIndex = vdIndex++;
234  hwInfo.isVirtualDevice = true;
235  hwInfo.virtualDeviceID = vdev.vdID;
236  hwInfo.virtualDeviceName = vdev.vdName;
237  GetDeviceInfoList().push_back(hwInfo);
238  }
239  }
240  }
241 #endif // defined(VIRTUAL_DEVICES_SUPPORT)
242 } // ScanHardware
243 
244 bool CNTV2DeviceScanner::DeviceIDPresent (const NTV2DeviceID inDeviceID, const bool inRescan)
245 {
246  AJAAutoLock tmpLock(&sDevInfoListLock);
247  if (inRescan)
248  ScanHardware();
249 
250  for (NTV2DeviceInfoListConstIter iter(sDevInfoList.begin()); iter != sDevInfoList.end(); ++iter)
251  if (iter->deviceID == inDeviceID)
252  return true; // Found!
253  return false; // Not found
254 
255 } // DeviceIDPresent
256 
257 
258 bool CNTV2DeviceScanner::GetDeviceInfo (const ULWord inDeviceIndexNumber, NTV2DeviceInfo & outDeviceInfo, const bool inRescan)
259 {
260  AJAAutoLock tmpLock(&sDevInfoListLock);
261  if (inRescan)
262  ScanHardware();
263 
264  if (inDeviceIndexNumber < sDevInfoList.size())
265  {
266  outDeviceInfo = sDevInfoList[inDeviceIndexNumber];
267  return outDeviceInfo.deviceIndex == inDeviceIndexNumber;
268  }
269  return false; // No devices with this index number
270 
271 } // GetDeviceInfo
272 #endif // !defined(NTV2_DEPRECATE_17_1)
273 
274 bool CNTV2DeviceScanner::GetDeviceAtIndex (const ULWord inDeviceIndexNumber, CNTV2Card & outDevice)
275 {
276  outDevice.Close();
277  AJAAutoLock tmpLock(&sDevInfoListLock);
278  ScanHardware();
279  return size_t(inDeviceIndexNumber) < sDevInfoList.size()
280  ? outDevice.Open(UWord(inDeviceIndexNumber))
281  : false;
282 
283 } // GetDeviceAtIndex
284 
285 
287 {
288  outDevice.Close();
289  AJAAutoLock tmpLock(&sDevInfoListLock);
290  ScanHardware();
291  for (size_t ndx(0); ndx < sDevInfoList.size(); ndx++)
292  if (sDevInfoList.at(ndx).deviceID == inDeviceID)
293  return outDevice.Open(UWord(ndx)); // Found!
294  return false; // Not found
295 
296 } // GetFirstDeviceWithID
297 
298 
299 bool CNTV2DeviceScanner::GetFirstDeviceWithName (const string & inNameSubString, CNTV2Card & outDevice)
300 {
301  outDevice.Close();
302  if (!aja::is_alpha_numeric(inNameSubString))
303  {
304  if (inNameSubString.find(":") != string::npos)
305  return outDevice.Open(inNameSubString);
306  return false;
307  }
308 
309  AJAAutoLock tmpLock(&sDevInfoListLock);
310  ScanHardware();
311  string nameSubString(inNameSubString); aja::lower(nameSubString);
312  for (size_t ndx(0); ndx < sDevInfoList.size(); ndx++)
313  {
314  string deviceName(sDevInfoList.at(ndx).deviceIdentifier); aja::lower(deviceName);
315  if (deviceName.find(nameSubString) != string::npos)
316  return outDevice.Open(UWord(ndx)); // Found!
317  }
318  if (nameSubString == "io4kplus")
319  { // Io4K+ == DNXIV...
320  nameSubString = "avid dnxiv";
321  for (size_t ndx(0); ndx < sDevInfoList.size(); ndx++)
322  {
323  string deviceName(sDevInfoList.at(ndx).deviceIdentifier); aja::lower(deviceName);
324  if (deviceName.find(nameSubString) != string::npos)
325  return outDevice.Open(UWord(ndx)); // Found!
326  }
327  }
328  return false; // Not found
329 
330 } // GetFirstDeviceWithName
331 
332 
333 bool CNTV2DeviceScanner::GetFirstDeviceWithSerial (const string & inSerialStr, CNTV2Card & outDevice)
334 {
335  outDevice.Close();
336  AJAAutoLock tmpLock(&sDevInfoListLock);
337  ScanHardware();
338  string searchSerialStr(inSerialStr); aja::lower(searchSerialStr);
339  for (size_t ndx(0); ndx < sDevInfoList.size(); ndx++)
340  {
341  CNTV2Card dev(UWord(ndx+0));
342  string serNumStr;
343  if (dev.GetSerialNumberString(serNumStr))
344  {
345  aja::lower(serNumStr);
346  if (serNumStr.find(searchSerialStr) != string::npos)
347  return outDevice.Open(UWord(ndx));
348  }
349  }
350  return false;
351 }
352 
353 
354 #if !defined(NTV2_DEPRECATE_17_5)
355 bool CNTV2DeviceScanner::GetDeviceWithSerial (const uint64_t inSerialNumber, CNTV2Card & outDevice)
356 {
357  const string serNumStr(::SerialNum64ToString(inSerialNumber));
358  return GetDeviceWithSerial(serNumStr, outDevice);
359 }
360 #endif // !defined(NTV2_DEPRECATE_17_5)
361 
362 bool CNTV2DeviceScanner::GetDeviceWithSerial (const string & inSerialNumber, CNTV2Card & outDevice)
363 {
364  outDevice.Close();
365  AJAAutoLock tmpLock(&sDevInfoListLock);
366  ScanHardware();
367  for (size_t ndx(0); ndx < sDevInfoList.size(); ndx++)
368  if (sDevInfoList.at(ndx).serialNumber == inSerialNumber)
369  return outDevice.Open(UWord(ndx));
370  return false;
371 }
372 
373 
374 bool CNTV2DeviceScanner::GetFirstDeviceFromArgument (const string & inArgument, CNTV2Card & outDevice)
375 {
376  outDevice.Close();
377  if (inArgument.empty())
378  return false;
379 
380  // Special case: 'LIST' or '?' --- print an enumeration of available devices to stdout, then bail
381  AJAAutoLock tmpLock(&sDevInfoListLock);
382  ScanHardware();
383  string upperArg(inArgument); aja::upper(upperArg);
384  if (upperArg == "LIST" || upperArg == "?")
385  {
386  if (sDevInfoList.empty())
387  cout << "No local devices detected" << endl;
388  else
389  cout << DEC(sDevInfoList.size()) << " available local " << (sDevInfoList.size() == 1 ? "device:" : "devices:") << endl;
390  for (size_t ndx(0); ndx < sDevInfoList.size(); ndx++)
391  {
392  cout << DECN(ndx,2) << " | " << setw(16) << ::NTV2DeviceIDToString(sDevInfoList.at(ndx).deviceID);
393  const string serNum(sDevInfoList.at(ndx).serialNumber);
394  if (!serNum.empty())
395  cout << " | " << setw(10) << serNum;
396  cout << endl;
397  }
398 #if defined(VIRTUAL_DEVICES_SUPPORT)
399  if (iter != sDevInfoList.end())
400  {
401  cout << "*** Virtual Devices ***" << endl;
402  while (iter != sDevInfoList.end())
403  {
404  const string serNum(iter->serialNumber);
405  cout << DECN(iter->deviceIndex,2) << " | " << setw(15) << iter->virtualDeviceName;// NTV2DeviceIDToString(iter->deviceID);
406  cout << " | " << iter->virtualDeviceID;
407  cout << " (" << NTV2DeviceIDToString(iter->deviceID);
408  if (!serNum.empty())
409  cout << " " << serNum;
410  cout << ")" << endl;
411  iter++;
412  }
413  }
414 #endif // defined(VIRTUAL_DEVICES_SUPPORT)
415  return false;
416  }
417 
418 #if defined(VIRTUAL_DEVICES_SUPPORT)
419  // See if any virtual devices are being referenced by their Index or VD Name.
420  // If so, convert the argument to the RPC URL and open it.
421  string cp2ConfigPath;
422  GetCP2ConfigPath(cp2ConfigPath);
423  std::ifstream cfgJsonfile(cp2ConfigPath); //VDTODO, error handling
424  for (NTV2DeviceInfoListConstIter iter(sDevInfoList.begin()); iter != sDevInfoList.end(); ++iter)
425  {
426  if (iter->isVirtualDevice)
427  {
428  if ( (std::to_string(iter->deviceIndex) == inArgument ) ||
429  iter->virtualDeviceName == inArgument ||
430  iter->virtualDeviceID == inArgument)
431  {
432  string inVDSpec = "ntv2virtualdev://localhost/?CP2ConfigPath=" + cp2ConfigPath +
433  "&DeviceSN=" + iter->serialNumber +
434  "&vdid=" + iter->virtualDeviceID +
435  "&verbose";
436  return outDevice.Open(inVDSpec);
437  }
438  }
439  }
440 
441 #endif // defined(VIRTUAL_DEVICES_SUPPORT)
442  return outDevice.Open(inArgument);
443 
444 } // GetFirstDeviceFromArgument
445 
446 
448 { // Name that will find given device via CNTV2DeviceScanner::GetFirstDeviceFromArgument
449  if (!inDevice.IsOpen())
450  return string();
451  // Nub address 1st...
452  if (!inDevice.GetHostName().empty() && inDevice.IsRemote())
453  return inDevice.GetHostName(); // Nub host/device
454 
455  // Serial number 2nd...
456  string str;
457  if (inDevice.GetSerialNumberString(str))
458  return str;
459 
460  // Model name 3rd...
461  str = ::NTV2DeviceIDToString(inDevice.GetDeviceID(), false);
462  if (!str.empty() && str != "???")
463  return str;
464 
465  // Index number last...
466  ostringstream oss; oss << DEC(inDevice.GetIndexNumber());
467  return oss.str();
468 }
469 
470 
471 #if !defined(NTV2_DEPRECATE_17_1)
472 ostream & operator << (ostream & inOutStr, const NTV2DeviceInfoList & inList)
473 {
474  for (NTV2DeviceInfoListConstIter iter(inList.begin()); iter != inList.end(); ++iter)
475  inOutStr << " " << *iter;
476  return inOutStr;
477 
478 } // NTV2DeviceInfoList ostream operator <<
479 
480 
482 {
483  const NTV2DeviceInfo & first (*this);
484  size_t diffs (0);
485 
486  // 'memcmp' would be simpler, but because NTV2DeviceInfo has no constructor, the unfilled bytes in
487  // its "boardIdentifier" field are indeterminate, making it worthless for accurate comparisons.
488  // "boardSerialNumber" and boardNumber are the only required comparisons, but I also check boardType,
489  // boardID, and pciSlot for good measure...
490  if (first.deviceID != second.deviceID) diffs++;
491  if (first.deviceIndex != second.deviceIndex) diffs++;
492  if (first.serialNumber != second.serialNumber) diffs++;
493  if (first.pciSlot != second.pciSlot) diffs++;
494 
495  // Needs to be fixed now that deviceIdentifier is a std::string
496  //#if defined (AJA_DEBUG)
497  // if (::strncmp (first.deviceIdentifier.c_str (), second.deviceIdentifier.c_str (), first.deviceIdentifier.length ()))) diffs++;
498  // if (diffs)
499  // {cout << "## DEBUG: " << diffs << " diff(s):" << endl << "#### first ####" << endl << first << "#### second ####" << endl << second << endl;}
500  //#endif // AJA_DEBUG
501 
502  return diffs ? false : true;
503 
504 } // equality operator
505 
507 {
508  deviceID = DEVICE_ID_INVALID;
509  deviceIndex = 0;
510  pciSlot = 0;
511  deviceSerialNumber = 0;
512  serialNumber = "";
513  numVidInputs = 0;
514  numVidOutputs = 0;
515  numAnlgVidInputs = 0;
516  numAnlgVidOutputs = 0;
517  numHDMIVidInputs = 0;
518  numHDMIVidOutputs = 0;
519  numInputConverters = 0;
520  numOutputConverters = 0;
521  numUpConverters = 0;
522  numDownConverters = 0;
523  downConverterDelay = 0;
524  isoConvertSupport = false;
525  rateConvertSupport = false;
526  dvcproHDSupport = false;
527  qrezSupport = false;
528  hdvSupport = false;
529  quarterExpandSupport = false;
530  vidProcSupport = false;
531  dualLinkSupport = false;
532  colorCorrectionSupport = false;
533  programmableCSCSupport = false;
534  rgbAlphaOutputSupport = false;
535  breakoutBoxSupport = false;
536  procAmpSupport = false;
537  has2KSupport = false;
538  has4KSupport = false;
539  has8KSupport = false;
540  has3GLevelConversion = false;
541  proResSupport = false;
542  sdi3GSupport = false;
543  sdi12GSupport = false;
544  ipSupport = false;
545  biDirectionalSDI = false;
546  ltcInSupport = false;
547  ltcOutSupport = false;
548  ltcInOnRefPort = false;
549  stereoOutSupport = false;
550  stereoInSupport = false;
551  multiFormat = false;
552  numAudioStreams = 0;
553  numAnalogAudioInputChannels = 0;
554  numAESAudioInputChannels = 0;
555  numEmbeddedAudioInputChannels = 0;
556  numHDMIAudioInputChannels = 0;
557  numAnalogAudioOutputChannels = 0;
558  numAESAudioOutputChannels = 0;
559  numEmbeddedAudioOutputChannels = 0;
560  numHDMIAudioOutputChannels = 0;
561  numDMAEngines = 0;
562  numSerialPorts = 0;
563  pingLED = 0;
564  deviceIdentifier.clear();
565  audioSampleRateList.clear();
566  audioNumChannelsList.clear();
567  audioBitsPerSampleList.clear();
568  audioInSourceList.clear();
569  audioOutSourceList.clear();
570 }
571 
573 {
574  if (&info != this)
575  *this = info;
576 }
577 
578 
580  const NTV2DeviceInfoList & inNewList,
581  NTV2DeviceInfoList & outBoardsAdded,
582  NTV2DeviceInfoList & outBoardsRemoved)
583 {
584  NTV2DeviceInfoListConstIter oldIter (inOldList.begin ());
585  NTV2DeviceInfoListConstIter newIter (inNewList.begin ());
586 
587  outBoardsAdded.clear ();
588  outBoardsRemoved.clear ();
589 
590  while (true)
591  {
592  if (oldIter == inOldList.end () && newIter == inNewList.end ())
593  break; // Done -- exit
594 
595  if (oldIter != inOldList.end () && newIter != inNewList.end ())
596  {
597  const NTV2DeviceInfo & oldInfo (*oldIter), newInfo (*newIter);
598 
599  if (oldInfo != newInfo)
600  {
601  // Out with the old...
602  outBoardsRemoved.push_back (oldInfo);
603 
604  // In with the new...
605  if (newInfo.deviceID && newInfo.deviceID != NTV2DeviceID(0xFFFFFFFF))
606  outBoardsAdded.push_back (newInfo);
607  } // if mismatch
608 
609  ++oldIter;
610  ++newIter;
611  continue; // Move along
612 
613  } // if both valid
614 
615  if (oldIter != inOldList.end () && newIter == inNewList.end ())
616  {
617  outBoardsRemoved.push_back (*oldIter);
618  ++oldIter;
619  continue; // Move along
620  } // old is valid, new is not valid
621 
622  if (oldIter == inOldList.end () && newIter != inNewList.end ())
623  {
624  if (newIter->deviceID && newIter->deviceID != NTV2DeviceID(0xFFFFFFFF))
625  outBoardsAdded.push_back (*newIter);
626  ++newIter;
627  continue; // Move along
628  } // old is not valid, new is valid
629 
630  NTV2_ASSERT(false && "should never get here");
631 
632  } // loop til break
633 
634  // Return 'true' if there were any changes...
635  return !outBoardsAdded.empty () || !outBoardsRemoved.empty ();
636 
637 } // CompareDeviceInfoLists
638 
639 
640 ostream & operator << (ostream & inOutStr, const NTV2AudioSampleRateList & inList)
641 {
642  for (NTV2AudioSampleRateListConstIter iter (inList.begin ()); iter != inList.end (); ++iter)
643  inOutStr << " " << *iter;
644 
645  return inOutStr;
646 }
647 
648 
649 ostream & operator << (ostream & inOutStr, const NTV2AudioChannelsPerFrameList & inList)
650 {
651  for (NTV2AudioChannelsPerFrameListConstIter iter (inList.begin ()); iter != inList.end (); ++iter)
652  inOutStr << " " << *iter;
653 
654  return inOutStr;
655 }
656 
657 
658 ostream & operator << (ostream & inOutStr, const NTV2AudioSourceList & inList)
659 {
660  for (NTV2AudioSourceListConstIter iter(inList.begin()); iter != inList.end(); ++iter)
661  switch (*iter) // AudioSourceEnum
662  {
663  case kSourceSDI: return inOutStr << " SDI";
664  case kSourceAES: return inOutStr << " AES";
665  case kSourceADAT: return inOutStr << " ADAT";
666  case kSourceAnalog: return inOutStr << " Analog";
667  case kSourceNone: return inOutStr << " None";
668  case kSourceAll: return inOutStr << " All";
669  }
670  return inOutStr << " ???";
671 }
672 
673 
674 ostream & operator << (ostream & inOutStr, const NTV2AudioBitsPerSampleList & inList)
675 {
676  for (NTV2AudioBitsPerSampleListConstIter iter (inList.begin ()); iter != inList.end (); ++iter)
677  inOutStr << " " << *iter;
678 
679  return inOutStr;
680 }
681 
682 
683 ostream & operator << (ostream & inOutStr, const NTV2DeviceInfo & inInfo)
684 {
685  inOutStr << "Device Info for '" << inInfo.deviceIdentifier << "'" << endl
686  << " Device Index Number: " << inInfo.deviceIndex << endl
687  << " Device ID: 0x" << hex << inInfo.deviceID << dec << endl
688  << " Serial Number: " << inInfo.serialNumber << endl
689  << " PCI Slot: 0x" << hex << inInfo.pciSlot << dec << endl
690  << " Video Inputs: " << inInfo.numVidInputs << endl
691  << " Video Outputs: " << inInfo.numVidOutputs << endl
692  #if defined (_DEBUG)
693  << " Analog Video Inputs: " << inInfo.numAnlgVidInputs << endl
694  << " Analog Video Outputs: " << inInfo.numAnlgVidOutputs << endl
695  << " HDMI Video Inputs: " << inInfo.numHDMIVidInputs << endl
696  << " HDMI Video Outputs: " << inInfo.numHDMIVidOutputs << endl
697  << " Input Converters: " << inInfo.numInputConverters << endl
698  << " Output Converters: " << inInfo.numOutputConverters << endl
699  << " Up Converters: " << inInfo.numUpConverters << endl
700  << " Down Converters: " << inInfo.numDownConverters << endl
701  << " Down Converter Delay: " << inInfo.downConverterDelay << endl
702  << " DVCProHD: " << (inInfo.dvcproHDSupport ? "Y" : "N") << endl
703  << " Qrez: " << (inInfo.qrezSupport ? "Y" : "N") << endl
704  << " HDV: " << (inInfo.hdvSupport ? "Y" : "N") << endl
705  << " Quarter Expand: " << (inInfo.quarterExpandSupport ? "Y" : "N") << endl
706  << " ISO Convert: " << (inInfo.isoConvertSupport ? "Y" : "N") << endl
707  << " Rate Convert: " << (inInfo.rateConvertSupport ? "Y" : "N") << endl
708  << " VidProc: " << (inInfo.vidProcSupport ? "Y" : "N") << endl
709  << " Dual-Link: " << (inInfo.dualLinkSupport ? "Y" : "N") << endl
710  << " Color-Correction: " << (inInfo.colorCorrectionSupport ? "Y" : "N") << endl
711  << " Programmable CSC: " << (inInfo.programmableCSCSupport ? "Y" : "N") << endl
712  << " RGB Alpha Output: " << (inInfo.rgbAlphaOutputSupport ? "Y" : "N") << endl
713  << " Breakout Box: " << (inInfo.breakoutBoxSupport ? "Y" : "N") << endl
714  << " ProcAmp: " << (inInfo.procAmpSupport ? "Y" : "N") << endl
715  << " 2K: " << (inInfo.has2KSupport ? "Y" : "N") << endl
716  << " 4K: " << (inInfo.has4KSupport ? "Y" : "N") << endl
717  << " 8K: " << (inInfo.has8KSupport ? "Y" : "N") << endl
718  << " 3G Level Conversion: " << (inInfo.has3GLevelConversion ? "Y" : "N") << endl
719  << " ProRes: " << (inInfo.proResSupport ? "Y" : "N") << endl
720  << " SDI 3G: " << (inInfo.sdi3GSupport ? "Y" : "N") << endl
721  << " SDI 12G: " << (inInfo.sdi12GSupport ? "Y" : "N") << endl
722  << " IP: " << (inInfo.ipSupport ? "Y" : "N") << endl
723  << " SDI Bi-Directional: " << (inInfo.biDirectionalSDI ? "Y" : "N") << endl
724  << " LTC In: " << (inInfo.ltcInSupport ? "Y" : "N") << endl
725  << " LTC Out: " << (inInfo.ltcOutSupport ? "Y" : "N") << endl
726  << " LTC In on Ref Port: " << (inInfo.ltcInOnRefPort ? "Y" : "N") << endl
727  << " Stereo Out: " << (inInfo.stereoOutSupport ? "Y" : "N") << endl
728  << " Stereo In: " << (inInfo.stereoInSupport ? "Y" : "N") << endl
729  << " Audio Sample Rates: " << inInfo.audioSampleRateList << endl
730  << " AudioNumChannelsList: " << inInfo.audioNumChannelsList << endl
731  << " AudioBitsPerSampleList: " << inInfo.audioBitsPerSampleList << endl
732  << " AudioInSourceList: " << inInfo.audioInSourceList << endl
733  << " AudioOutSourceList: " << inInfo.audioOutSourceList << endl
734  << " Audio Streams: " << inInfo.numAudioStreams << endl
735  << " Analog Audio Input Channels: " << inInfo.numAnalogAudioInputChannels << endl
736  << " Analog Audio Output Channels: " << inInfo.numAnalogAudioOutputChannels << endl
737  << " AES Audio Input Channels: " << inInfo.numAESAudioInputChannels << endl
738  << " AES Audio Output Channels: " << inInfo.numAESAudioOutputChannels << endl
739  << " Embedded Audio Input Channels: " << inInfo.numEmbeddedAudioInputChannels << endl
740  << " Embedded Audio Output Channels: " << inInfo.numEmbeddedAudioOutputChannels << endl
741  << " HDMI Audio Input Channels: " << inInfo.numHDMIAudioInputChannels << endl
742  << " HDMI Audio Output Channels: " << inInfo.numHDMIAudioOutputChannels << endl
743  << " DMA Engines: " << inInfo.numDMAEngines << endl
744  << " Serial Ports: " << inInfo.numSerialPorts << endl
745  #endif // AJA_DEBUG
746  << "";
747 
748  return inOutStr;
749 
750 } // NTV2DeviceInfo ostream operator <<
751 
752 
753 ostream & operator << (ostream & inOutStr, const NTV2AudioPhysicalFormat & inFormat)
754 {
755  inOutStr << "AudioPhysicalFormat:" << endl
756  << " boardNumber: " << inFormat.boardNumber << endl
757  << " sampleRate: " << inFormat.sampleRate << endl
758  << " numChannels: " << inFormat.numChannels << endl
759  << " bitsPerSample: " << inFormat.bitsPerSample << endl
760  #if defined (DEBUG) || defined (AJA_DEBUG)
761  << " sourceIn: 0x" << hex << inFormat.sourceIn << dec << endl
762  << " sourceOut: 0x" << hex << inFormat.sourceOut << dec << endl
763  #endif // DEBUG or AJA_DEBUG
764  ;
765 
766  return inOutStr;
767 
768 } // AudioPhysicalFormat ostream operator <<
769 
770 
771 std::ostream & operator << (std::ostream & inOutStr, const NTV2AudioPhysicalFormatList & inList)
772 {
773  for (NTV2AudioPhysicalFormatListConstIter iter (inList.begin ()); iter != inList.end (); ++iter)
774  inOutStr << *iter;
775 
776  return inOutStr;
777 
778 } // AudioPhysicalFormatList ostream operator <<
779 
780 
781 // Private methods
782 
783 void CNTV2DeviceScanner::SetAudioAttributes (NTV2DeviceInfo & info, CNTV2Card & inBoard)
784 {
785  // Start with empty lists...
786  info.audioSampleRateList.clear();
787  info.audioNumChannelsList.clear();
788  info.audioBitsPerSampleList.clear();
789  info.audioInSourceList.clear();
790  info.audioOutSourceList.clear();
791 
792 
794  {
795  ULWord audioControl;
796  inBoard.ReadRegister(kRegAud1Control, audioControl);
797 
798  //audioSampleRateList
799  info.audioSampleRateList.push_back(k48KHzSampleRate);
800  if (inBoard.IsSupported(kDeviceCanDoAudio96K))
801  info.audioSampleRateList.push_back(k96KHzSampleRate);
802 
803  //audioBitsPerSampleList
805 
806  //audioInSourceList
807  info.audioInSourceList.push_back(kSourceSDI);
808  if (audioControl & BIT(21))
809  info.audioInSourceList.push_back(kSourceAES);
811  info.audioInSourceList.push_back(kSourceAnalog);
812 
813  //audioOutSourceList
814  info.audioOutSourceList.push_back(kSourceAll);
815 
816  //audioNumChannelsList
823 
825  }
826 
835 
836 } // SetAudioAttributes
837 
838 
839 #if defined(VIRTUAL_DEVICES_SUPPORT)
840 bool CNTV2DeviceScanner::GetSerialToVirtualDeviceMap (NTV2SerialToVirtualDevices & outSerialToVirtualDevMap)
841 {
842  string cp2ConfigPath;
843  GetCP2ConfigPath(cp2ConfigPath);
844  std::ifstream cfgJsonfile(cp2ConfigPath);
845  json cp2Json;
846  if (cfgJsonfile.is_open())
847  //VDTODO: Send to debug sucessful open
848  cp2Json = json::parse(cfgJsonfile); //VDTODO handle any parse_error exception, send to error
849  else
850  //VDTODO: Send to debug fail to open
851  return false;
852  cfgJsonfile.close();
853 
854  for (const auto& hwdev : cp2Json["v2"]["deviceConfigList"])
855  {
856  std::vector<VirtualDeviceInfo> vdevs;
857  json hwdevice = hwdev;
858  for (const auto& vdev : hwdevice["virtualDevices"])
859  {
860  VirtualDeviceInfo newVDev;
861  newVDev.vdID = vdev["id"];
862  newVDev.vdName = vdev["name"];
863  vdevs.push_back(newVDev);
864  }
865  if (!vdevs.empty())
866  outSerialToVirtualDevMap[hwdev["serial"]] = vdevs;
867  }
868 
869  return true;
870 }
871 
872 bool CNTV2DeviceScanner::GetCP2ConfigPath(string & outCP2ConfigPath)
873 {
874  AJASystemInfo info;
876  outCP2ConfigPath = outCP2ConfigPath + "aja/controlpanelConfigPrimary.json";
877  return true;
878 }
879 #endif // defined(VIRTUAL_DEVICES_SUPPORT)
880 #endif // !defined(NTV2_DEPRECATE_17_1)
CNTV2DeviceScanner::IsLegalHexSerialNumber
static uint64_t IsLegalHexSerialNumber(const std::string &inStr)
Definition: ntv2devicescanner.cpp:60
kDeviceGetNumVideoInputs
@ kDeviceGetNumVideoInputs
The number of SDI video inputs on the device.
Definition: ntv2devicefeatures.h:207
kDeviceHasBiDirectionalSDI
@ kDeviceHasBiDirectionalSDI
True if device SDI connectors are bi-directional.
Definition: ntv2devicefeatures.h:92
NTV2AudioPhysicalFormat::sourceIn
AudioSourceEnum sourceIn
Definition: ntv2devicescanner.h:201
kDeviceCanDoAudio6Channels
@ kDeviceCanDoAudio6Channels
True if audio system(s) support 6 or more audio channels.
Definition: ntv2devicefeatures.h:49
kNumAudioChannels6
@ kNumAudioChannels6
Definition: ntv2audiodefines.h:41
NTV2DeviceInfo::audioOutSourceList
NTV2AudioSourceList audioOutSourceList
My supported audio output destinations (AES, etc.)
Definition: ntv2devicescanner.h:108
NTV2DeviceInfo::quarterExpandSupport
bool quarterExpandSupport
Definition: ntv2devicescanner.h:81
CNTV2DeviceScanner::DeviceIDPresent
static bool DeviceIDPresent(const NTV2DeviceID inDeviceID, const bool inRescan=(0))
Definition: ntv2devicescanner.cpp:244
NTV2DeviceInfo::numAnalogAudioInputChannels
UWord numAnalogAudioInputChannels
Total number of analog audio input channels.
Definition: ntv2devicescanner.h:110
NTV2DeviceInfo::biDirectionalSDI
bool biDirectionalSDI
Supports Bi-directional SDI.
Definition: ntv2devicescanner.h:97
NTV2DeviceInfo::audioBitsPerSampleList
NTV2AudioBitsPerSampleList audioBitsPerSampleList
My supported audio bits-per-sample.
Definition: ntv2devicescanner.h:106
kDeviceCanDoIP
@ kDeviceCanDoIP
True if device has SFP connectors.
Definition: ntv2devicefeatures.h:127
kSourceAnalog
@ kSourceAnalog
Definition: ntv2audiodefines.h:69
kDeviceCanDoVideoProcessing
@ kDeviceCanDoVideoProcessing
True if device can do video processing.
Definition: ntv2devicefeatures.h:89
NTV2DeviceInfo::numDownConverters
UWord numDownConverters
Total number of down-converters.
Definition: ntv2devicescanner.h:74
NTV2DeviceInfo::numAnlgVidOutputs
UWord numAnlgVidOutputs
Total number of analog video outputs.
Definition: ntv2devicescanner.h:68
NTV2AudioPhysicalFormat::bitsPerSample
AudioBitsPerSampleEnum bitsPerSample
Definition: ntv2devicescanner.h:200
ntv2devicefeatures.h
Declares device capability functions.
CNTV2MacDriverInterface::ReadRegister
virtual bool ReadRegister(const ULWord inRegNum, ULWord &outValue, const ULWord inMask=0xFFFFFFFF, const ULWord inShift=0)
Reads all or part of the 32-bit contents of a specific register (real or virtual) on the AJA device....
Definition: ntv2macdriverinterface.cpp:389
NTV2DeviceInfo::has3GLevelConversion
bool has3GLevelConversion
Supports 3G Level Conversion?
Definition: ntv2devicescanner.h:92
NTV2DeviceInfo::rateConvertSupport
bool rateConvertSupport
Definition: ntv2devicescanner.h:77
NTV2DeviceInfo::numHDMIVidInputs
UWord numHDMIVidInputs
Total number of HDMI inputs.
Definition: ntv2devicescanner.h:69
kDeviceGetNumDownConverters
@ kDeviceGetNumDownConverters
The number of down-converters on the device.
Definition: ntv2devicefeatures.h:191
kDeviceCanDoHDV
@ kDeviceCanDoHDV
True if device can squeeze/stretch between 1920x1080 and 1440x1080.
Definition: ntv2devicefeatures.h:64
aja::is_hex_digit
bool is_hex_digit(const char inChr)
Definition: common.cpp:511
NTV2DeviceInfo::sdi12GSupport
bool sdi12GSupport
Supports 12G?
Definition: ntv2devicescanner.h:95
kDeviceGetNumAnalogAudioInputChannels
@ kDeviceGetNumAnalogAudioInputChannels
The number of analog audio input channels on the device.
Definition: ntv2devicefeatures.h:184
NTV2_ASSERT
#define NTV2_ASSERT(_expr_)
Definition: ajatypes.h:508
NTV2DeviceInfo::ltcInSupport
bool ltcInSupport
Accepts LTC input?
Definition: ntv2devicescanner.h:98
kDeviceGetNumEmbeddedAudioOutputChannels
@ kDeviceGetNumEmbeddedAudioOutputChannels
The number of SDI-embedded output audio channels supported by the device.
Definition: ntv2devicefeatures.h:193
GetDeviceInfoList
NTV2DeviceInfoList GetDeviceInfoList(void)
Definition: ntv2devicescanner.cpp:140
kSourceSDI
@ kSourceSDI
Definition: ntv2audiodefines.h:66
NTV2AudioSourceListConstIter
NTV2AudioSourceList::const_iterator NTV2AudioSourceListConstIter
Definition: ntv2devicescanner.h:47
NTV2DeviceInfo::numHDMIVidOutputs
UWord numHDMIVidOutputs
Total number of HDMI outputs.
Definition: ntv2devicescanner.h:70
sDevInfoListLock
static AJALock sDevInfoListLock
Definition: ntv2devicescanner.cpp:97
CNTV2DeviceScanner::GetFirstDeviceFromArgument
static bool GetFirstDeviceFromArgument(const std::string &inArgument, CNTV2Card &outDevice)
Rescans the host, and returns an open CNTV2Card instance for the AJA device that matches a command li...
Definition: ntv2devicescanner.cpp:374
CNTV2DeviceScanner::GetFirstDeviceWithID
static bool GetFirstDeviceWithID(const NTV2DeviceID inDeviceID, CNTV2Card &outDevice)
Rescans the host, and returns an open CNTV2Card instance for the first AJA device found on the host t...
Definition: ntv2devicescanner.cpp:286
k48KHzSampleRate
@ k48KHzSampleRate
Definition: ntv2audiodefines.h:59
NTV2AudioPhysicalFormat::sourceOut
AudioSourceEnum sourceOut
Definition: ntv2devicescanner.h:202
NTV2DeviceInfoList
std::vector< NTV2DeviceInfo > NTV2DeviceInfoList
I am an ordered list of NTV2DeviceInfo structs.
Definition: ntv2devicescanner.h:182
kDeviceCanDo4KVideo
@ kDeviceCanDo4KVideo
True if the device can handle 4K/UHD video.
Definition: ntv2devicefeatures.h:43
NTV2DeviceInfo::numSerialPorts
UWord numSerialPorts
Total number of serial ports.
Definition: ntv2devicescanner.h:119
kDeviceCanDoAudio96K
@ kDeviceCanDoAudio96K
True if Audio System(s) support a 96kHz sample rate.
Definition: ntv2devicefeatures.h:51
kDeviceCanDo3GLevelConversion
@ kDeviceCanDo3GLevelConversion
True if device can do 3G level B to 3G level A conversion.
Definition: ntv2devicefeatures.h:40
kNumAudioChannels2
@ kNumAudioChannels2
Definition: ntv2audiodefines.h:39
kDeviceCanDoQuarterExpand
@ kDeviceCanDoQuarterExpand
True if device can handle quarter-sized frames (pixel-halving and line-halving during input,...
Definition: ntv2devicefeatures.h:79
NTV2DeviceID
NTV2DeviceID
Identifies a specific AJA NTV2 device model number. The NTV2DeviceID is actually the PROM part number...
Definition: ntv2enums.h:20
kDeviceGetNumVideoOutputs
@ kDeviceGetNumVideoOutputs
The number of SDI video outputs on the device.
Definition: ntv2devicefeatures.h:208
CNTV2DeviceScanner::CNTV2DeviceScanner
CNTV2DeviceScanner(const bool inScanNow=(!(0)))
Definition: ntv2devicescanner.cpp:125
NTV2_Wgt3GSDIOut1
@ NTV2_Wgt3GSDIOut1
Definition: ntv2enums.h:2900
CNTV2DeviceScanner::GetDeviceWithSerial
static bool GetDeviceWithSerial(const std::string &inSerialNumber, CNTV2Card &outDevice)
Rescans the host, and returns an open CNTV2Card instance for the first AJA device whose serial number...
kDeviceGetNumAESAudioOutputChannels
@ kDeviceGetNumAESAudioOutputChannels
The number of AES/EBU audio output channels on the device.
Definition: ntv2devicefeatures.h:183
kDeviceCanDoColorCorrection
@ kDeviceCanDoColorCorrection
True if device has any LUTs.
Definition: ntv2devicefeatures.h:55
kDeviceCanDoDualLink
@ kDeviceCanDoDualLink
True if device supports 10-bit RGB input/output over 2-wire SDI.
Definition: ntv2devicefeatures.h:58
k96KHzSampleRate
@ k96KHzSampleRate
Definition: ntv2audiodefines.h:60
CNTV2DeviceScanner::GetNumDevices
static size_t GetNumDevices(void)
Definition: ntv2devicescanner.cpp:99
CNTV2DeviceScanner::GetFirstDeviceWithSerial
static bool GetFirstDeviceWithSerial(const std::string &inSerialStr, CNTV2Card &outDevice)
Rescans the host, and returns an open CNTV2Card instance for the first AJA device whose serial number...
Definition: ntv2devicescanner.cpp:333
nlohmann::json_abiNLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON_v3_11_NLOHMANN_JSON_VERSION_PATCH::detail::void
j template void())
Definition: json.hpp:4893
kDeviceGetNumAnalogAudioOutputChannels
@ kDeviceGetNumAnalogAudioOutputChannels
The number of analog audio output channels on the device.
Definition: ntv2devicefeatures.h:185
k32bitsPerSample
@ k32bitsPerSample
Definition: ntv2audiodefines.h:52
kDeviceGetNumDMAEngines
@ kDeviceGetNumDMAEngines
The number of DMA engines on the device.
Definition: ntv2devicefeatures.h:177
NTV2DeviceInfo::numHDMIAudioOutputChannels
UWord numHDMIAudioOutputChannels
Total number of HDMI audio output channels.
Definition: ntv2devicescanner.h:117
NTV2DeviceInfo::vidProcSupport
bool vidProcSupport
Definition: ntv2devicescanner.h:82
NTV2DeviceInfo::numAnlgVidInputs
UWord numAnlgVidInputs
Total number of analog video inputs.
Definition: ntv2devicescanner.h:67
NTV2AudioChannelsPerFrameListConstIter
NTV2AudioChannelsPerFrameList::const_iterator NTV2AudioChannelsPerFrameListConstIter
Definition: ntv2devicescanner.h:43
CNTV2DriverInterface::IsSupported
virtual bool IsSupported(const NTV2BoolParamID inParamID)
Definition: ntv2driverinterface.h:422
kDeviceCanDoDVCProHD
@ kDeviceCanDoDVCProHD
True if device can squeeze/stretch between 1920x1080/1280x1080 and 1280x720/960x720.
Definition: ntv2devicefeatures.h:59
NTV2AudioPhysicalFormat::boardNumber
ULWord boardNumber
Definition: ntv2devicescanner.h:197
NTV2AudioBitsPerSampleList
std::vector< AudioBitsPerSampleEnum > NTV2AudioBitsPerSampleList
Definition: ntv2devicescanner.h:50
NTV2AudioSampleRateList
std::vector< AudioSampleRateEnum > NTV2AudioSampleRateList
Definition: ntv2devicescanner.h:38
CNTV2DeviceScanner::CompareDeviceInfoLists
static bool CompareDeviceInfoLists(const NTV2DeviceInfoList &inOldList, const NTV2DeviceInfoList &inNewList, NTV2DeviceInfoList &outDevicesAdded, NTV2DeviceInfoList &outDevicesRemoved)
Definition: ntv2devicescanner.cpp:579
kSourceADAT
@ kSourceADAT
Definition: ntv2audiodefines.h:68
kDeviceCanDoAnalogAudio
@ kDeviceCanDoAnalogAudio
True if device has any analog inputs or outputs.
Definition: ntv2devicefeatures.h:45
NTV2AudioPhysicalFormat::sampleRate
AudioSampleRateEnum sampleRate
Definition: ntv2devicescanner.h:198
NTV2DeviceInfo::numVidOutputs
UWord numVidOutputs
Total number of video outputs – analog, digital, whatever.
Definition: ntv2devicescanner.h:66
aja::lower
std::string & lower(std::string &str)
Definition: common.cpp:436
kDeviceGetNumAudioSystems
@ kDeviceGetNumAudioSystems
The number of independent Audio Systems on the device.
Definition: ntv2devicefeatures.h:188
NTV2DeviceInfo::deviceIdentifier
std::string deviceIdentifier
Device name as seen in Control Panel, Watcher, Cables, etc.
Definition: ntv2devicescanner.h:64
NTV2DeviceInfo::audioInSourceList
NTV2AudioSourceList audioInSourceList
My supported audio input sources (AES, ADAT, etc.)
Definition: ntv2devicescanner.h:107
ULWordSet
std::set< ULWord > ULWordSet
A collection of unique ULWord (uint32_t) values.
Definition: ntv2publicinterface.h:54
lock.h
Declares the AJALock class.
NTV2DeviceInfo::has4KSupport
bool has4KSupport
Supports 4K formats?
Definition: ntv2devicescanner.h:90
AJASystemInfo::GetValue
virtual AJAStatus GetValue(const AJASystemInfoTag inTag, std::string &outValue) const
Answers with the host system info value string for the given AJASystemInfoTag.
Definition: info.cpp:151
ULWord
uint32_t ULWord
Definition: ajatypes.h:255
kDeviceCanDoProRes
@ kDeviceCanDoProRes
True if device can can accommodate Apple ProRes-compressed video in its frame buffers.
Definition: ntv2devicefeatures.h:77
kDeviceGetNumAnalogVideoInputs
@ kDeviceGetNumAnalogVideoInputs
The number of analog video inputs on the device.
Definition: ntv2devicefeatures.h:186
ntv2devicescanner.h
Declares the CNTV2DeviceScanner class.
NTV2DeviceInfo::numOutputConverters
UWord numOutputConverters
Total number of output converters.
Definition: ntv2devicescanner.h:72
kDeviceCanDoLTCInOnRefPort
@ kDeviceCanDoLTCInOnRefPort
True if device can read LTC (Linear TimeCode) from its reference input.
Definition: ntv2devicefeatures.h:68
NTV2DeviceIDToString
std::string NTV2DeviceIDToString(const NTV2DeviceID inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:4673
CNTV2DeviceScanner::ScanHardware
static void ScanHardware(void)
Definition: ntv2devicescanner.cpp:147
CNTV2DeviceScanner::GetDeviceInfo
static bool GetDeviceInfo(const ULWord inDeviceIndexNumber, NTV2DeviceInfo &outDeviceInfo, const bool inRescan=(0))
Definition: ntv2devicescanner.cpp:258
CNTV2Card::GetSerialNumberString
virtual bool GetSerialNumberString(std::string &outSerialNumberString)
Answers with a string that contains my human-readable serial number.
Definition: ntv2card.cpp:214
kDeviceGetNumInputConverters
@ kDeviceGetNumInputConverters
The number of input converter widgets on the device.
Definition: ntv2devicefeatures.h:200
aja::upper
std::string & upper(std::string &str)
Definition: common.cpp:442
UWord
uint16_t UWord
Definition: ajatypes.h:253
NTV2AudioPhysicalFormat
Definition: ntv2devicescanner.h:196
ntv2utils.h
Declares numerous NTV2 utility functions.
NTV2DeviceInfo::numDMAEngines
UWord numDMAEngines
Total number of DMA engines.
Definition: ntv2devicescanner.h:118
CNTV2DeviceScanner::GetFirstDeviceWithName
static bool GetFirstDeviceWithName(const std::string &inNameSubString, CNTV2Card &outDevice)
Rescans the host, and returns an open CNTV2Card instance for the first AJA device whose device identi...
Definition: ntv2devicescanner.cpp:299
aja::is_decimal_digit
bool is_decimal_digit(const char inChr)
Definition: common.cpp:516
CNTV2Card
I interrogate and control an AJA video/audio capture/playout device.
Definition: ntv2card.h:28
NTV2DeviceInfo::rgbAlphaOutputSupport
bool rgbAlphaOutputSupport
Supports RGB alpha channel?
Definition: ntv2devicescanner.h:86
AJA_SystemInfoTag_Path_PersistenceStoreUser
@ AJA_SystemInfoTag_Path_PersistenceStoreUser
Definition: info.h:46
DEVICE_ID_INVALID
@ DEVICE_ID_INVALID
Definition: ntv2enums.h:93
sDevInfoList
static NTV2DeviceInfoList sDevInfoList
Definition: ntv2devicescanner.cpp:96
kDeviceCanDoBreakoutBox
@ kDeviceCanDoBreakoutBox
True if device supports an AJA breakout box.
Definition: ntv2devicefeatures.h:53
NTV2DeviceInfo::numAESAudioOutputChannels
UWord numAESAudioOutputChannels
Total number of AES audio output channels.
Definition: ntv2devicescanner.h:115
kNTV2EnumsID_WidgetID
@ kNTV2EnumsID_WidgetID
Identifies the NTV2AudioWidgetID enumerated type.
Definition: ntv2devicefeatures.h:247
CNTV2DeviceScanner::GetDeviceRefName
static std::string GetDeviceRefName(CNTV2Card &inDevice)
Definition: ntv2devicescanner.cpp:447
kDeviceGetPingLED
@ kDeviceGetPingLED
The highest bit number of the LED bits in the Global Control Register on the device.
Definition: ntv2devicefeatures.h:179
kDeviceCanDoStereoIn
@ kDeviceCanDoStereoIn
True if device supports 3D video input over dual-stream SDI.
Definition: ntv2devicefeatures.h:86
CNTV2DriverInterface::GetNumSupported
virtual ULWord GetNumSupported(const NTV2NumericParamID inParamID)
Definition: ntv2driverinterface.h:433
AJALock
Definition: lock.h:30
NTV2DeviceInfo::has2KSupport
bool has2KSupport
Supports 2K formats?
Definition: ntv2devicescanner.h:89
NTV2DeviceInfo::procAmpSupport
bool procAmpSupport
Definition: ntv2devicescanner.h:88
kDeviceGetDownConverterDelay
@ kDeviceGetDownConverterDelay
The down-converter delay on the device.
Definition: ntv2devicefeatures.h:171
NTV2DeviceInfo::proResSupport
bool proResSupport
Supports ProRes?
Definition: ntv2devicescanner.h:93
NTV2DeviceInfo::stereoOutSupport
bool stereoOutSupport
Supports stereo output?
Definition: ntv2devicescanner.h:101
kDeviceGetNumAESAudioInputChannels
@ kDeviceGetNumAESAudioInputChannels
The number of AES/EBU audio input channels on the device.
Definition: ntv2devicefeatures.h:182
NTV2DeviceInfo::qrezSupport
bool qrezSupport
Definition: ntv2devicescanner.h:79
NTV2DeviceInfo::numUpConverters
UWord numUpConverters
Total number of up-converters.
Definition: ntv2devicescanner.h:73
kDeviceGetNumHDMIVideoInputs
@ kDeviceGetNumHDMIVideoInputs
The number of HDMI video inputs on the device.
Definition: ntv2devicefeatures.h:198
AJAAutoLock
Definition: lock.h:91
NTV2DeviceInfo::numEmbeddedAudioInputChannels
UWord numEmbeddedAudioInputChannels
Total number of embedded (SDI) audio input channels.
Definition: ntv2devicescanner.h:112
CNTV2DeviceScanner::IsHexDigit
static bool IsHexDigit(const char inChr)
Definition: ntv2devicescanner.cpp:35
NTV2AudioPhysicalFormat::numChannels
AudioChannelsPerFrameEnum numChannels
Definition: ntv2devicescanner.h:199
NTV2DeviceInfo::programmableCSCSupport
bool programmableCSCSupport
Programmable color space converter?
Definition: ntv2devicescanner.h:85
kDeviceCanDoRGBPlusAlphaOut
@ kDeviceCanDoRGBPlusAlphaOut
True if device has CSCs capable of splitting the key (alpha) and YCbCr (fill) from RGB frame buffers ...
Definition: ntv2devicefeatures.h:81
NTV2DeviceInfoListConstIter
NTV2DeviceInfoList::const_iterator NTV2DeviceInfoListConstIter
Definition: ntv2devicescanner.h:183
NTV2DeviceInfo::multiFormat
bool multiFormat
Supports multiple video formats?
Definition: ntv2devicescanner.h:103
kRegAud1Control
@ kRegAud1Control
Definition: ntv2publicinterface.h:127
NTV2DeviceInfo::isoConvertSupport
bool isoConvertSupport
Definition: ntv2devicescanner.h:76
NTV2DeviceInfo::deviceIndex
ULWord deviceIndex
Device index number – this will be phased out someday.
Definition: ntv2devicescanner.h:60
NTV2DeviceInfo::numAnalogAudioOutputChannels
UWord numAnalogAudioOutputChannels
Total number of analog audio output channels.
Definition: ntv2devicescanner.h:114
NTV2DeviceInfo::numHDMIAudioInputChannels
UWord numHDMIAudioInputChannels
Total number of HDMI audio input channels.
Definition: ntv2devicescanner.h:113
NTV2DeviceInfo::numVidInputs
UWord numVidInputs
Total number of video inputs – analog, digital, whatever.
Definition: ntv2devicescanner.h:65
NTV2DeviceInfo::has8KSupport
bool has8KSupport
Supports 8K formats?
Definition: ntv2devicescanner.h:91
DEC
#define DEC(__x__)
Definition: ntv2publicinterface.h:5606
NTV2AudioSourceList
std::vector< AudioSourceEnum > NTV2AudioSourceList
Definition: ntv2devicescanner.h:46
kDeviceGetNumHDMIVideoOutputs
@ kDeviceGetNumHDMIVideoOutputs
The number of HDMI video outputs on the device.
Definition: ntv2devicefeatures.h:199
false
#define false
Definition: ntv2devicefeatures.h:25
common.h
Private include file for all ajabase sources.
CNTV2DeviceScanner::GetDeviceAtIndex
static bool GetDeviceAtIndex(const ULWord inDeviceIndexNumber, CNTV2Card &outDevice)
Rescans the host, and returns an open CNTV2Card instance for the AJA device having the given zero-bas...
Definition: ntv2devicescanner.cpp:274
kDeviceGetNumHDMIAudioOutputChannels
@ kDeviceGetNumHDMIAudioOutputChannels
The number of HDMI audio output channels on the device.
Definition: ntv2devicefeatures.h:197
kDeviceGetNumHDMIAudioInputChannels
@ kDeviceGetNumHDMIAudioInputChannels
The number of HDMI audio input channels on the device.
Definition: ntv2devicefeatures.h:196
NTV2DeviceInfo
Definition: ntv2devicescanner.h:57
aja::is_alpha_numeric
bool is_alpha_numeric(const char inChr)
Definition: common.cpp:521
std
Definition: json.hpp:5362
operator<<
ostream & operator<<(ostream &inOutStr, const NTV2DeviceInfoList &inList)
Definition: ntv2devicescanner.cpp:472
NTV2AudioPhysicalFormatListConstIter
NTV2AudioPhysicalFormatList::const_iterator NTV2AudioPhysicalFormatListConstIter
Definition: ntv2devicescanner.h:219
NTV2DeviceInfo::audioSampleRateList
NTV2AudioSampleRateList audioSampleRateList
My supported audio sample rates.
Definition: ntv2devicescanner.h:104
kDeviceCanDo8KVideo
@ kDeviceCanDo8KVideo
True if device supports 8K video formats.
Definition: ntv2devicefeatures.h:118
kDeviceHasMicrophoneInput
@ kDeviceHasMicrophoneInput
True if device has a microphone input connector.
Definition: ntv2devicefeatures.h:141
kSourceAES
@ kSourceAES
Definition: ntv2audiodefines.h:67
NTV2DeviceInfo::pingLED
ULWord pingLED
Definition: ntv2devicescanner.h:120
CNTV2DriverInterface::GetDeviceID
virtual NTV2DeviceID GetDeviceID(void)
Definition: ntv2driverinterface.cpp:407
NTV2DeviceInfo::operator==
bool operator==(const NTV2DeviceInfo &rhs) const
Definition: ntv2devicescanner.cpp:481
NTV2DeviceInfo::pciSlot
ULWord pciSlot
PCI slot (if applicable and/or known)
Definition: ntv2devicescanner.h:61
kDeviceCanDoAudio2Channels
@ kDeviceCanDoAudio2Channels
True if audio system(s) support 2 or more audio channels.
Definition: ntv2devicefeatures.h:48
kDeviceCanDo12GSDI
@ kDeviceCanDo12GSDI
True if device has 12G SDI connectors.
Definition: ntv2devicefeatures.h:116
NTV2AudioSampleRateListConstIter
NTV2AudioSampleRateList::const_iterator NTV2AudioSampleRateListConstIter
Definition: ntv2devicescanner.h:39
NTV2DeviceInfo::ltcOutSupport
bool ltcOutSupport
Supports LTC output?
Definition: ntv2devicescanner.h:99
kSourceAll
@ kSourceAll
Definition: ntv2audiodefines.h:71
NTV2DeviceInfo::numInputConverters
UWord numInputConverters
Total number of input converters.
Definition: ntv2devicescanner.h:71
kDeviceCanDoRateConvert
@ kDeviceCanDoRateConvert
True if device can do frame rate conversion.
Definition: ntv2devicefeatures.h:80
NTV2DeviceInfo::dvcproHDSupport
bool dvcproHDSupport
Definition: ntv2devicescanner.h:78
NTV2DeviceInfo::ipSupport
bool ipSupport
Supports IP IO?
Definition: ntv2devicescanner.h:96
NTV2DeviceInfo::colorCorrectionSupport
bool colorCorrectionSupport
Supports color correction?
Definition: ntv2devicescanner.h:84
NTV2DeviceInfo::sdi3GSupport
bool sdi3GSupport
Supports 3G?
Definition: ntv2devicescanner.h:94
kDeviceCanDoProgrammableCSC
@ kDeviceCanDoProgrammableCSC
True if device has at least one programmable color space converter widget.
Definition: ntv2devicefeatures.h:75
kDeviceCanDoAudio8Channels
@ kDeviceCanDoAudio8Channels
True if audio system(s) support 8 or more audio channels.
Definition: ntv2devicefeatures.h:50
aja::to_string
std::string to_string(bool val)
Definition: common.cpp:180
NTV2DeviceInfo::breakoutBoxSupport
bool breakoutBoxSupport
Can support a breakout box?
Definition: ntv2devicescanner.h:87
NTV2DeviceInfo::NTV2DeviceInfo
NTV2DeviceInfo()
Definition: ntv2devicescanner.cpp:506
kDeviceCanDo2KVideo
@ kDeviceCanDo2KVideo
True if device can handle 2Kx1556 (film) video.
Definition: ntv2devicefeatures.h:39
BIT
#define BIT(_x_)
Definition: ajatypes.h:563
NTV2DeviceInfo
struct NTV2DeviceInfo NTV2DeviceInfo
kDeviceGetNumUpConverters
@ kDeviceGetNumUpConverters
The number of up-converters on the device.
Definition: ntv2devicefeatures.h:206
kSourceNone
@ kSourceNone
Definition: ntv2audiodefines.h:70
NTV2AudioPhysicalFormatList
std::vector< NTV2AudioPhysicalFormat > NTV2AudioPhysicalFormatList
I am an ordered list of NTV2AudioPhysicalFormat structs.
Definition: ntv2devicescanner.h:218
NTV2DeviceInfo::ltcInOnRefPort
bool ltcInOnRefPort
Supports LTC on reference input?
Definition: ntv2devicescanner.h:100
NTV2DeviceInfo::audioNumChannelsList
NTV2AudioChannelsPerFrameList audioNumChannelsList
My supported number of audio channels per frame.
Definition: ntv2devicescanner.h:105
NTV2AudioChannelsPerFrameList
std::vector< AudioChannelsPerFrameEnum > NTV2AudioChannelsPerFrameList
Definition: ntv2devicescanner.h:42
kDeviceGetNumAnalogVideoOutputs
@ kDeviceGetNumAnalogVideoOutputs
The number of analog video outputs on the device.
Definition: ntv2devicefeatures.h:187
kDeviceGetNumOutputConverters
@ kDeviceGetNumOutputConverters
The number of output converter widgets on the device.
Definition: ntv2devicefeatures.h:203
CNTV2DriverInterface::Open
virtual bool Open(const UWord inDeviceIndex)
Opens a local/physical AJA device so it can be monitored/controlled.
Definition: ntv2driverinterface.cpp:131
kDeviceGetNumEmbeddedAudioInputChannels
@ kDeviceGetNumEmbeddedAudioInputChannels
The number of SDI-embedded input audio channels supported by the device.
Definition: ntv2devicefeatures.h:192
kDeviceGetNumSerialPorts
@ kDeviceGetNumSerialPorts
The number of RS-422 serial ports on the device.
Definition: ntv2devicefeatures.h:205
nlohmann::json_abiNLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON_v3_11_NLOHMANN_JSON_VERSION_PATCH::json
basic_json<> json
default specialization
Definition: json.hpp:3422
DEVICE_ID_NOTFOUND
@ DEVICE_ID_NOTFOUND
Invalid or "not found".
Definition: ntv2enums.h:92
NTV2DeviceInfo::downConverterDelay
UWord downConverterDelay
Definition: ntv2devicescanner.h:75
NTV2DeviceInfo::stereoInSupport
bool stereoInSupport
Supports stereo input?
Definition: ntv2devicescanner.h:102
kDeviceCanDoQREZ
@ kDeviceCanDoQREZ
True if device can handle QRez.
Definition: ntv2devicefeatures.h:78
CNTV2DeviceScanner::IsDecimalDigit
static bool IsDecimalDigit(const char inChr)
Definition: ntv2devicescanner.cpp:40
NTV2DeviceInfo::numAESAudioInputChannels
UWord numAESAudioInputChannels
Total number of AES audio input channels.
Definition: ntv2devicescanner.h:111
NTV2DeviceInfo::serialNumber
std::string serialNumber
Unique device serial number (new in SDK 17.5)
Definition: ntv2devicescanner.h:63
kDeviceCanDoIsoConvert
@ kDeviceCanDoIsoConvert
True if device can do ISO conversion.
Definition: ntv2devicefeatures.h:66
kDeviceCanDoMultiFormat
@ kDeviceCanDoMultiFormat
True if device can simultaneously handle different video formats on more than one SDI input or output...
Definition: ntv2devicefeatures.h:70
NTV2DeviceInfo::deviceID
NTV2DeviceID deviceID
Device ID/species (e.g., DEVICE_ID_KONA3G, DEVICE_ID_IOXT, etc.)
Definition: ntv2devicescanner.h:59
SerialNum64ToString
std::string SerialNum64ToString(const uint64_t &inSerNum)
Definition: ntv2utils.cpp:8158
CNTV2DriverInterface::Close
virtual bool Close(void)
Closes me, releasing host resources that may have been allocated in a previous Open call.
Definition: ntv2driverinterface.cpp:227
CNTV2DeviceScanner::IsAlphaNumeric
static bool IsAlphaNumeric(const char inStr)
Definition: ntv2devicescanner.cpp:45
CNTV2DeviceScanner::IsLegalSerialNumber
static bool IsLegalSerialNumber(const std::string &inStr)
Definition: ntv2devicescanner.cpp:89
kDeviceGetNumLTCOutputs
@ kDeviceGetNumLTCOutputs
The number of analog LTC outputs on the device.
Definition: ntv2devicefeatures.h:212
CNTV2DriverInterface::GetSupportedItems
virtual ULWordSet GetSupportedItems(const NTV2EnumsID inEnumsID)
Definition: ntv2driverinterface.cpp:1410
NTV2AudioBitsPerSampleListConstIter
NTV2AudioBitsPerSampleList::const_iterator NTV2AudioBitsPerSampleListConstIter
Definition: ntv2devicescanner.h:51
kNumAudioChannels8
@ kNumAudioChannels8
Definition: ntv2audiodefines.h:42
CNTV2DeviceScanner::IsLegalDecimalNumber
static bool IsLegalDecimalNumber(const std::string &inStr, const size_t maxLen=2)
Definition: ntv2devicescanner.cpp:50
NTV2DeviceInfo::numAudioStreams
UWord numAudioStreams
Maximum number of independent audio streams.
Definition: ntv2devicescanner.h:109
kDeviceCanDoStereoOut
@ kDeviceCanDoStereoOut
True if device supports 3D video output over dual-stream SDI.
Definition: ntv2devicefeatures.h:87
NTV2DeviceInfo::dualLinkSupport
bool dualLinkSupport
Supports dual-link?
Definition: ntv2devicescanner.h:83
kDeviceGetNumLTCInputs
@ kDeviceGetNumLTCInputs
The number of analog LTC inputs on the device.
Definition: ntv2devicefeatures.h:211
DECN
#define DECN(__x__, __n__)
Definition: ntv2publicinterface.h:5607
NTV2DeviceInfo::hdvSupport
bool hdvSupport
Definition: ntv2devicescanner.h:80
NTV2DeviceInfo::numEmbeddedAudioOutputChannels
UWord numEmbeddedAudioOutputChannels
Total number of embedded (SDI) audio output channels.
Definition: ntv2devicescanner.h:116
AJASystemInfo
Definition: info.h:78