AJA NTV2 SDK  17.1.1.1245
NTV2 SDK 17.1.1.1245
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  uint64_t deviceSerialNumber;
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  info.deviceSerialNumber = tmpDev.GetSerialNumber();
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  info.deviceSerialNumber = tmpDev.GetSerialNumber();
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 = CNTV2Card::SerialNum64ToString(hwInfo.deviceSerialNumber);
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 bool CNTV2DeviceScanner::GetDeviceWithSerial (const uint64_t inSerialNumber, CNTV2Card & outDevice)
355 {
356  outDevice.Close();
357  AJAAutoLock tmpLock(&sDevInfoListLock);
358  ScanHardware();
359  for (size_t ndx(0); ndx < sDevInfoList.size(); ndx++)
360  if (sDevInfoList.at(ndx).deviceSerialNumber == inSerialNumber)
361  return outDevice.Open(UWord(ndx));
362  return false;
363 }
364 
365 
366 bool CNTV2DeviceScanner::GetFirstDeviceFromArgument (const string & inArgument, CNTV2Card & outDevice)
367 {
368  outDevice.Close();
369  if (inArgument.empty())
370  return false;
371 
372  // Special case: 'LIST' or '?' --- print an enumeration of available devices to stdout, then bail
373  AJAAutoLock tmpLock(&sDevInfoListLock);
374  ScanHardware();
375  string upperArg(inArgument); aja::upper(upperArg);
376  if (upperArg == "LIST" || upperArg == "?")
377  {
378  if (sDevInfoList.empty())
379  cout << "No devices detected" << endl;
380  else
381  cout << DEC(sDevInfoList.size()) << " available " << (sDevInfoList.size() == 1 ? "device:" : "devices:") << endl;
382  for (size_t ndx(0); ndx < sDevInfoList.size(); ndx++)
383  {
384  cout << DECN(ndx,2) << " | " << setw(8) << ::NTV2DeviceIDToString(sDevInfoList.at(ndx).deviceID);
385  const string serNum(CNTV2Card::SerialNum64ToString(sDevInfoList.at(ndx).deviceSerialNumber));
386  if (!serNum.empty())
387  cout << " | " << setw(9) << serNum << " | " << HEX0N(sDevInfoList.at(ndx).deviceSerialNumber,8);
388  cout << endl;
389  }
390 #if defined(VIRTUAL_DEVICES_SUPPORT)
391  if (iter != sDevInfoList.end())
392  {
393  cout << "*** Virtual Devices ***" << endl;
394  while (iter != sDevInfoList.end())
395  {
396  const string serNum(CNTV2Card::SerialNum64ToString(iter->deviceSerialNumber));
397  cout << DECN(iter->deviceIndex,2) << " | " << setw(15) << iter->virtualDeviceName;// NTV2DeviceIDToString(iter->deviceID);
398  cout << " | " << iter->virtualDeviceID;
399  cout << " (" << NTV2DeviceIDToString(iter->deviceID);
400  if (!serNum.empty())
401  cout << " " << serNum;
402  cout << ")" << endl;
403  iter++;
404  }
405  }
406 #endif // defined(VIRTUAL_DEVICES_SUPPORT)
407  return false;
408  }
409 
410 #if defined(VIRTUAL_DEVICES_SUPPORT)
411  // See if any virtual devices are being referenced by their Index or VD Name.
412  // If so, convert the argument to the RPC URL and open it.
413  string cp2ConfigPath;
414  GetCP2ConfigPath(cp2ConfigPath);
415  std::ifstream cfgJsonfile(cp2ConfigPath); //VDTODO, error handling
416  for (NTV2DeviceInfoListConstIter iter(sDevInfoList.begin()); iter != sDevInfoList.end(); ++iter)
417  {
418  if (iter->isVirtualDevice)
419  {
420  if ( (std::to_string(iter->deviceIndex) == inArgument ) ||
421  iter->virtualDeviceName == inArgument ||
422  iter->virtualDeviceID == inArgument)
423  {
424  string inVDSpec = "ntv2virtualdev://localhost/?CP2ConfigPath=" + cp2ConfigPath +
425  "&DeviceSN=" + CNTV2Card::SerialNum64ToString(iter->deviceSerialNumber) +
426  "&vdid=" + iter->virtualDeviceID +
427  "&verbose";
428  return outDevice.Open(inVDSpec);
429  }
430  }
431  }
432 
433 #endif // defined(VIRTUAL_DEVICES_SUPPORT)
434  return outDevice.Open(inArgument);
435 
436 } // GetFirstDeviceFromArgument
437 
438 
440 { // Name that will find given device via CNTV2DeviceScanner::GetFirstDeviceFromArgument
441  if (!inDevice.IsOpen())
442  return string();
443  // Nub address 1st...
444  if (!inDevice.GetHostName().empty() && inDevice.IsRemote())
445  return inDevice.GetHostName(); // Nub host/device
446 
447  // Serial number 2nd...
448  string str;
449  if (inDevice.GetSerialNumberString(str))
450  return str;
451 
452  // Model name 3rd...
453  str = ::NTV2DeviceIDToString(inDevice.GetDeviceID(), false);
454  if (!str.empty() && str != "???")
455  return str;
456 
457  // Index number last...
458  ostringstream oss; oss << DEC(inDevice.GetIndexNumber());
459  return oss.str();
460 }
461 
462 
463 #if !defined(NTV2_DEPRECATE_17_1)
464 ostream & operator << (ostream & inOutStr, const NTV2DeviceInfoList & inList)
465 {
466  for (NTV2DeviceInfoListConstIter iter(inList.begin()); iter != inList.end(); ++iter)
467  inOutStr << " " << *iter;
468  return inOutStr;
469 
470 } // NTV2DeviceInfoList ostream operator <<
471 
472 
474 {
475  const NTV2DeviceInfo & first (*this);
476  size_t diffs (0);
477 
478  // 'memcmp' would be simpler, but because NTV2DeviceInfo has no constructor, the unfilled bytes in
479  // its "boardIdentifier" field are indeterminate, making it worthless for accurate comparisons.
480  // "boardSerialNumber" and boardNumber are the only required comparisons, but I also check boardType,
481  // boardID, and pciSlot for good measure...
482  if (first.deviceID != second.deviceID) diffs++;
483  if (first.deviceIndex != second.deviceIndex) diffs++;
484  if (first.deviceSerialNumber != second.deviceSerialNumber) diffs++;
485  if (first.pciSlot != second.pciSlot) diffs++;
486 
487  // Needs to be fixed now that deviceIdentifier is a std::string
488  //#if defined (AJA_DEBUG)
489  // if (::strncmp (first.deviceIdentifier.c_str (), second.deviceIdentifier.c_str (), first.deviceIdentifier.length ()))) diffs++;
490  // if (diffs)
491  // {cout << "## DEBUG: " << diffs << " diff(s):" << endl << "#### first ####" << endl << first << "#### second ####" << endl << second << endl;}
492  //#endif // AJA_DEBUG
493 
494  return diffs ? false : true;
495 
496 } // equality operator
497 
499 {
500  deviceID = DEVICE_ID_INVALID;
501  deviceIndex = 0;
502  pciSlot = 0;
503  deviceSerialNumber = 0;
504  numVidInputs = 0;
505  numVidOutputs = 0;
506  numAnlgVidInputs = 0;
507  numAnlgVidOutputs = 0;
508  numHDMIVidInputs = 0;
509  numHDMIVidOutputs = 0;
510  numInputConverters = 0;
511  numOutputConverters = 0;
512  numUpConverters = 0;
513  numDownConverters = 0;
514  downConverterDelay = 0;
515  isoConvertSupport = false;
516  rateConvertSupport = false;
517  dvcproHDSupport = false;
518  qrezSupport = false;
519  hdvSupport = false;
520  quarterExpandSupport = false;
521  vidProcSupport = false;
522  dualLinkSupport = false;
523  colorCorrectionSupport = false;
524  programmableCSCSupport = false;
525  rgbAlphaOutputSupport = false;
526  breakoutBoxSupport = false;
527  procAmpSupport = false;
528  has2KSupport = false;
529  has4KSupport = false;
530  has8KSupport = false;
531  has3GLevelConversion = false;
532  proResSupport = false;
533  sdi3GSupport = false;
534  sdi12GSupport = false;
535  ipSupport = false;
536  biDirectionalSDI = false;
537  ltcInSupport = false;
538  ltcOutSupport = false;
539  ltcInOnRefPort = false;
540  stereoOutSupport = false;
541  stereoInSupport = false;
542  multiFormat = false;
543  numAudioStreams = 0;
544  numAnalogAudioInputChannels = 0;
545  numAESAudioInputChannels = 0;
546  numEmbeddedAudioInputChannels = 0;
547  numHDMIAudioInputChannels = 0;
548  numAnalogAudioOutputChannels = 0;
549  numAESAudioOutputChannels = 0;
550  numEmbeddedAudioOutputChannels = 0;
551  numHDMIAudioOutputChannels = 0;
552  numDMAEngines = 0;
553  numSerialPorts = 0;
554  pingLED = 0;
555  deviceIdentifier.clear();
556  audioSampleRateList.clear();
557  audioNumChannelsList.clear();
558  audioBitsPerSampleList.clear();
559  audioInSourceList.clear();
560  audioOutSourceList.clear();
561 }
562 
564 {
565  if (&info != this)
566  *this = info;
567 }
568 
569 
571  const NTV2DeviceInfoList & inNewList,
572  NTV2DeviceInfoList & outBoardsAdded,
573  NTV2DeviceInfoList & outBoardsRemoved)
574 {
575  NTV2DeviceInfoListConstIter oldIter (inOldList.begin ());
576  NTV2DeviceInfoListConstIter newIter (inNewList.begin ());
577 
578  outBoardsAdded.clear ();
579  outBoardsRemoved.clear ();
580 
581  while (true)
582  {
583  if (oldIter == inOldList.end () && newIter == inNewList.end ())
584  break; // Done -- exit
585 
586  if (oldIter != inOldList.end () && newIter != inNewList.end ())
587  {
588  const NTV2DeviceInfo & oldInfo (*oldIter), newInfo (*newIter);
589 
590  if (oldInfo != newInfo)
591  {
592  // Out with the old...
593  outBoardsRemoved.push_back (oldInfo);
594 
595  // In with the new...
596  if (newInfo.deviceID && newInfo.deviceID != NTV2DeviceID(0xFFFFFFFF))
597  outBoardsAdded.push_back (newInfo);
598  } // if mismatch
599 
600  ++oldIter;
601  ++newIter;
602  continue; // Move along
603 
604  } // if both valid
605 
606  if (oldIter != inOldList.end () && newIter == inNewList.end ())
607  {
608  outBoardsRemoved.push_back (*oldIter);
609  ++oldIter;
610  continue; // Move along
611  } // old is valid, new is not valid
612 
613  if (oldIter == inOldList.end () && newIter != inNewList.end ())
614  {
615  if (newIter->deviceID && newIter->deviceID != NTV2DeviceID(0xFFFFFFFF))
616  outBoardsAdded.push_back (*newIter);
617  ++newIter;
618  continue; // Move along
619  } // old is not valid, new is valid
620 
621  NTV2_ASSERT(false && "should never get here");
622 
623  } // loop til break
624 
625  // Return 'true' if there were any changes...
626  return !outBoardsAdded.empty () || !outBoardsRemoved.empty ();
627 
628 } // CompareDeviceInfoLists
629 
630 
631 ostream & operator << (ostream & inOutStr, const NTV2AudioSampleRateList & inList)
632 {
633  for (NTV2AudioSampleRateListConstIter iter (inList.begin ()); iter != inList.end (); ++iter)
634  inOutStr << " " << *iter;
635 
636  return inOutStr;
637 }
638 
639 
640 ostream & operator << (ostream & inOutStr, const NTV2AudioChannelsPerFrameList & inList)
641 {
642  for (NTV2AudioChannelsPerFrameListConstIter iter (inList.begin ()); iter != inList.end (); ++iter)
643  inOutStr << " " << *iter;
644 
645  return inOutStr;
646 }
647 
648 
649 ostream & operator << (ostream & inOutStr, const NTV2AudioSourceList & inList)
650 {
651  for (NTV2AudioSourceListConstIter iter(inList.begin()); iter != inList.end(); ++iter)
652  switch (*iter) // AudioSourceEnum
653  {
654  case kSourceSDI: return inOutStr << " SDI";
655  case kSourceAES: return inOutStr << " AES";
656  case kSourceADAT: return inOutStr << " ADAT";
657  case kSourceAnalog: return inOutStr << " Analog";
658  case kSourceNone: return inOutStr << " None";
659  case kSourceAll: return inOutStr << " All";
660  }
661  return inOutStr << " ???";
662 }
663 
664 
665 ostream & operator << (ostream & inOutStr, const NTV2AudioBitsPerSampleList & inList)
666 {
667  for (NTV2AudioBitsPerSampleListConstIter iter (inList.begin ()); iter != inList.end (); ++iter)
668  inOutStr << " " << *iter;
669 
670  return inOutStr;
671 }
672 
673 
674 ostream & operator << (ostream & inOutStr, const NTV2DeviceInfo & inInfo)
675 {
676  inOutStr << "Device Info for '" << inInfo.deviceIdentifier << "'" << endl
677  << " Device Index Number: " << inInfo.deviceIndex << endl
678  << " Device ID: 0x" << hex << inInfo.deviceID << dec << endl
679  << " Serial Number: 0x" << hex << inInfo.deviceSerialNumber << dec << endl
680  << " PCI Slot: 0x" << hex << inInfo.pciSlot << dec << endl
681  << " Video Inputs: " << inInfo.numVidInputs << endl
682  << " Video Outputs: " << inInfo.numVidOutputs << endl
683  #if defined (_DEBUG)
684  << " Analog Video Inputs: " << inInfo.numAnlgVidInputs << endl
685  << " Analog Video Outputs: " << inInfo.numAnlgVidOutputs << endl
686  << " HDMI Video Inputs: " << inInfo.numHDMIVidInputs << endl
687  << " HDMI Video Outputs: " << inInfo.numHDMIVidOutputs << endl
688  << " Input Converters: " << inInfo.numInputConverters << endl
689  << " Output Converters: " << inInfo.numOutputConverters << endl
690  << " Up Converters: " << inInfo.numUpConverters << endl
691  << " Down Converters: " << inInfo.numDownConverters << endl
692  << " Down Converter Delay: " << inInfo.downConverterDelay << endl
693  << " DVCProHD: " << (inInfo.dvcproHDSupport ? "Y" : "N") << endl
694  << " Qrez: " << (inInfo.qrezSupport ? "Y" : "N") << endl
695  << " HDV: " << (inInfo.hdvSupport ? "Y" : "N") << endl
696  << " Quarter Expand: " << (inInfo.quarterExpandSupport ? "Y" : "N") << endl
697  << " ISO Convert: " << (inInfo.isoConvertSupport ? "Y" : "N") << endl
698  << " Rate Convert: " << (inInfo.rateConvertSupport ? "Y" : "N") << endl
699  << " VidProc: " << (inInfo.vidProcSupport ? "Y" : "N") << endl
700  << " Dual-Link: " << (inInfo.dualLinkSupport ? "Y" : "N") << endl
701  << " Color-Correction: " << (inInfo.colorCorrectionSupport ? "Y" : "N") << endl
702  << " Programmable CSC: " << (inInfo.programmableCSCSupport ? "Y" : "N") << endl
703  << " RGB Alpha Output: " << (inInfo.rgbAlphaOutputSupport ? "Y" : "N") << endl
704  << " Breakout Box: " << (inInfo.breakoutBoxSupport ? "Y" : "N") << endl
705  << " ProcAmp: " << (inInfo.procAmpSupport ? "Y" : "N") << endl
706  << " 2K: " << (inInfo.has2KSupport ? "Y" : "N") << endl
707  << " 4K: " << (inInfo.has4KSupport ? "Y" : "N") << endl
708  << " 8K: " << (inInfo.has8KSupport ? "Y" : "N") << endl
709  << " 3G Level Conversion: " << (inInfo.has3GLevelConversion ? "Y" : "N") << endl
710  << " ProRes: " << (inInfo.proResSupport ? "Y" : "N") << endl
711  << " SDI 3G: " << (inInfo.sdi3GSupport ? "Y" : "N") << endl
712  << " SDI 12G: " << (inInfo.sdi12GSupport ? "Y" : "N") << endl
713  << " IP: " << (inInfo.ipSupport ? "Y" : "N") << endl
714  << " SDI Bi-Directional: " << (inInfo.biDirectionalSDI ? "Y" : "N") << endl
715  << " LTC In: " << (inInfo.ltcInSupport ? "Y" : "N") << endl
716  << " LTC Out: " << (inInfo.ltcOutSupport ? "Y" : "N") << endl
717  << " LTC In on Ref Port: " << (inInfo.ltcInOnRefPort ? "Y" : "N") << endl
718  << " Stereo Out: " << (inInfo.stereoOutSupport ? "Y" : "N") << endl
719  << " Stereo In: " << (inInfo.stereoInSupport ? "Y" : "N") << endl
720  << " Audio Sample Rates: " << inInfo.audioSampleRateList << endl
721  << " AudioNumChannelsList: " << inInfo.audioNumChannelsList << endl
722  << " AudioBitsPerSampleList: " << inInfo.audioBitsPerSampleList << endl
723  << " AudioInSourceList: " << inInfo.audioInSourceList << endl
724  << " AudioOutSourceList: " << inInfo.audioOutSourceList << endl
725  << " Audio Streams: " << inInfo.numAudioStreams << endl
726  << " Analog Audio Input Channels: " << inInfo.numAnalogAudioInputChannels << endl
727  << " Analog Audio Output Channels: " << inInfo.numAnalogAudioOutputChannels << endl
728  << " AES Audio Input Channels: " << inInfo.numAESAudioInputChannels << endl
729  << " AES Audio Output Channels: " << inInfo.numAESAudioOutputChannels << endl
730  << " Embedded Audio Input Channels: " << inInfo.numEmbeddedAudioInputChannels << endl
731  << " Embedded Audio Output Channels: " << inInfo.numEmbeddedAudioOutputChannels << endl
732  << " HDMI Audio Input Channels: " << inInfo.numHDMIAudioInputChannels << endl
733  << " HDMI Audio Output Channels: " << inInfo.numHDMIAudioOutputChannels << endl
734  << " DMA Engines: " << inInfo.numDMAEngines << endl
735  << " Serial Ports: " << inInfo.numSerialPorts << endl
736  #endif // AJA_DEBUG
737  << "";
738 
739  return inOutStr;
740 
741 } // NTV2DeviceInfo ostream operator <<
742 
743 
744 ostream & operator << (ostream & inOutStr, const NTV2AudioPhysicalFormat & inFormat)
745 {
746  inOutStr << "AudioPhysicalFormat:" << endl
747  << " boardNumber: " << inFormat.boardNumber << endl
748  << " sampleRate: " << inFormat.sampleRate << endl
749  << " numChannels: " << inFormat.numChannels << endl
750  << " bitsPerSample: " << inFormat.bitsPerSample << endl
751  #if defined (DEBUG) || defined (AJA_DEBUG)
752  << " sourceIn: 0x" << hex << inFormat.sourceIn << dec << endl
753  << " sourceOut: 0x" << hex << inFormat.sourceOut << dec << endl
754  #endif // DEBUG or AJA_DEBUG
755  ;
756 
757  return inOutStr;
758 
759 } // AudioPhysicalFormat ostream operator <<
760 
761 
762 std::ostream & operator << (std::ostream & inOutStr, const NTV2AudioPhysicalFormatList & inList)
763 {
764  for (NTV2AudioPhysicalFormatListConstIter iter (inList.begin ()); iter != inList.end (); ++iter)
765  inOutStr << *iter;
766 
767  return inOutStr;
768 
769 } // AudioPhysicalFormatList ostream operator <<
770 
771 
772 // Private methods
773 
774 void CNTV2DeviceScanner::SetAudioAttributes (NTV2DeviceInfo & info, CNTV2Card & inBoard)
775 {
776  // Start with empty lists...
777  info.audioSampleRateList.clear();
778  info.audioNumChannelsList.clear();
779  info.audioBitsPerSampleList.clear();
780  info.audioInSourceList.clear();
781  info.audioOutSourceList.clear();
782 
783 
785  {
786  ULWord audioControl;
787  inBoard.ReadRegister(kRegAud1Control, audioControl);
788 
789  //audioSampleRateList
790  info.audioSampleRateList.push_back(k48KHzSampleRate);
791  if (inBoard.IsSupported(kDeviceCanDoAudio96K))
792  info.audioSampleRateList.push_back(k96KHzSampleRate);
793 
794  //audioBitsPerSampleList
796 
797  //audioInSourceList
798  info.audioInSourceList.push_back(kSourceSDI);
799  if (audioControl & BIT(21))
800  info.audioInSourceList.push_back(kSourceAES);
802  info.audioInSourceList.push_back(kSourceAnalog);
803 
804  //audioOutSourceList
805  info.audioOutSourceList.push_back(kSourceAll);
806 
807  //audioNumChannelsList
814 
816  }
817 
826 
827 } // SetAudioAttributes
828 
829 
830 #if defined(VIRTUAL_DEVICES_SUPPORT)
831 bool CNTV2DeviceScanner::GetSerialToVirtualDeviceMap (NTV2SerialToVirtualDevices & outSerialToVirtualDevMap)
832 {
833  string cp2ConfigPath;
834  GetCP2ConfigPath(cp2ConfigPath);
835  std::ifstream cfgJsonfile(cp2ConfigPath);
836  json cp2Json;
837  if (cfgJsonfile.is_open())
838  //VDTODO: Send to debug sucessful open
839  cp2Json = json::parse(cfgJsonfile); //VDTODO handle any parse_error exception, send to error
840  else
841  //VDTODO: Send to debug fail to open
842  return false;
843  cfgJsonfile.close();
844 
845  for (const auto& hwdev : cp2Json["v2"]["deviceConfigList"])
846  {
847  std::vector<VirtualDeviceInfo> vdevs;
848  json hwdevice = hwdev;
849  for (const auto& vdev : hwdevice["virtualDevices"])
850  {
851  VirtualDeviceInfo newVDev;
852  newVDev.vdID = vdev["id"];
853  newVDev.vdName = vdev["name"];
854  vdevs.push_back(newVDev);
855  }
856  if (!vdevs.empty())
857  outSerialToVirtualDevMap[hwdev["serial"]] = vdevs;
858  }
859 
860  return true;
861 }
862 
863 bool CNTV2DeviceScanner::GetCP2ConfigPath(string & outCP2ConfigPath)
864 {
865  AJASystemInfo info;
867  outCP2ConfigPath = outCP2ConfigPath + "aja/controlpanelConfigPrimary.json";
868  return true;
869 }
870 #endif // defined(VIRTUAL_DEVICES_SUPPORT)
871 #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:200
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:107
NTV2DeviceInfo::quarterExpandSupport
bool quarterExpandSupport
Definition: ntv2devicescanner.h:80
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:109
NTV2DeviceInfo::biDirectionalSDI
bool biDirectionalSDI
Supports Bi-directional SDI.
Definition: ntv2devicescanner.h:96
NTV2DeviceInfo::audioBitsPerSampleList
NTV2AudioBitsPerSampleList audioBitsPerSampleList
My supported audio bits-per-sample.
Definition: ntv2devicescanner.h:105
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:73
NTV2DeviceInfo::numAnlgVidOutputs
UWord numAnlgVidOutputs
Total number of analog video outputs.
Definition: ntv2devicescanner.h:67
NTV2AudioPhysicalFormat::bitsPerSample
AudioBitsPerSampleEnum bitsPerSample
Definition: ntv2devicescanner.h:199
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:91
NTV2DeviceInfo::rateConvertSupport
bool rateConvertSupport
Definition: ntv2devicescanner.h:76
NTV2DeviceInfo::numHDMIVidInputs
UWord numHDMIVidInputs
Total number of HDMI inputs.
Definition: ntv2devicescanner.h:68
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:94
NTV2DeviceInfo::deviceSerialNumber
uint64_t deviceSerialNumber
Unique device serial number.
Definition: ntv2devicescanner.h:62
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:506
NTV2DeviceInfo::ltcInSupport
bool ltcInSupport
Accepts LTC input?
Definition: ntv2devicescanner.h:97
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:69
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:366
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:201
NTV2DeviceInfoList
std::vector< NTV2DeviceInfo > NTV2DeviceInfoList
I am an ordered list of NTV2DeviceInfo structs.
Definition: ntv2devicescanner.h:181
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:118
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:2869
CNTV2Card::SerialNum64ToString
static std::string SerialNum64ToString(const uint64_t inSerialNumber)
Returns a string containing the decoded, human-readable device serial number.
Definition: ntv2card.cpp:208
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:116
NTV2DeviceInfo::vidProcSupport
bool vidProcSupport
Definition: ntv2devicescanner.h:81
NTV2DeviceInfo::numAnlgVidInputs
UWord numAnlgVidInputs
Total number of analog video inputs.
Definition: ntv2devicescanner.h:66
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:196
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:570
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:197
NTV2DeviceInfo::numVidOutputs
UWord numVidOutputs
Total number of video outputs – analog, digital, whatever.
Definition: ntv2devicescanner.h:65
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:63
NTV2DeviceInfo::audioInSourceList
NTV2AudioSourceList audioInSourceList
My supported audio input sources (AES, ADAT, etc.)
Definition: ntv2devicescanner.h:106
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:89
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:253
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:71
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:251
CNTV2Card::GetSerialNumber
virtual uint64_t GetSerialNumber(void)
Answers with my serial number.
Definition: ntv2card.cpp:200
NTV2AudioPhysicalFormat
Definition: ntv2devicescanner.h:195
ntv2utils.h
Declares numerous NTV2 utility functions.
NTV2DeviceInfo::numDMAEngines
UWord numDMAEngines
Total number of DMA engines.
Definition: ntv2devicescanner.h:117
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
CNTV2DeviceScanner::GetDeviceWithSerial
static bool GetDeviceWithSerial(const uint64_t inSerialNumber, CNTV2Card &outDevice)
Rescans the host, and returns an open CNTV2Card instance for the first AJA device whose serial number...
Definition: ntv2devicescanner.cpp:354
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:85
AJA_SystemInfoTag_Path_PersistenceStoreUser
@ AJA_SystemInfoTag_Path_PersistenceStoreUser
Definition: info.h:46
DEVICE_ID_INVALID
@ DEVICE_ID_INVALID
Definition: ntv2enums.h:91
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:114
kNTV2EnumsID_WidgetID
@ kNTV2EnumsID_WidgetID
Identifies the NTV2AudioWidgetID enumerated type.
Definition: ntv2devicefeatures.h:247
CNTV2DeviceScanner::GetDeviceRefName
static std::string GetDeviceRefName(CNTV2Card &inDevice)
Definition: ntv2devicescanner.cpp:439
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:88
NTV2DeviceInfo::procAmpSupport
bool procAmpSupport
Definition: ntv2devicescanner.h:87
kDeviceGetDownConverterDelay
@ kDeviceGetDownConverterDelay
The down-converter delay on the device.
Definition: ntv2devicefeatures.h:171
NTV2DeviceInfo::proResSupport
bool proResSupport
Supports ProRes?
Definition: ntv2devicescanner.h:92
NTV2DeviceInfo::stereoOutSupport
bool stereoOutSupport
Supports stereo output?
Definition: ntv2devicescanner.h:100
kDeviceGetNumAESAudioInputChannels
@ kDeviceGetNumAESAudioInputChannels
The number of AES/EBU audio input channels on the device.
Definition: ntv2devicefeatures.h:182
NTV2DeviceInfo::qrezSupport
bool qrezSupport
Definition: ntv2devicescanner.h:78
NTV2DeviceInfo::numUpConverters
UWord numUpConverters
Total number of up-converters.
Definition: ntv2devicescanner.h:72
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:111
CNTV2DeviceScanner::IsHexDigit
static bool IsHexDigit(const char inChr)
Definition: ntv2devicescanner.cpp:35
NTV2AudioPhysicalFormat::numChannels
AudioChannelsPerFrameEnum numChannels
Definition: ntv2devicescanner.h:198
NTV2DeviceInfo::programmableCSCSupport
bool programmableCSCSupport
Programmable color space converter?
Definition: ntv2devicescanner.h:84
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:182
NTV2DeviceInfo::multiFormat
bool multiFormat
Supports multiple video formats?
Definition: ntv2devicescanner.h:102
kRegAud1Control
@ kRegAud1Control
Definition: ntv2publicinterface.h:127
NTV2DeviceInfo::isoConvertSupport
bool isoConvertSupport
Definition: ntv2devicescanner.h:75
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:113
NTV2DeviceInfo::numHDMIAudioInputChannels
UWord numHDMIAudioInputChannels
Total number of HDMI audio input channels.
Definition: ntv2devicescanner.h:112
NTV2DeviceInfo::numVidInputs
UWord numVidInputs
Total number of video inputs – analog, digital, whatever.
Definition: ntv2devicescanner.h:64
NTV2DeviceInfo::has8KSupport
bool has8KSupport
Supports 8K formats?
Definition: ntv2devicescanner.h:90
DEC
#define DEC(__x__)
Definition: ntv2publicinterface.h:5605
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
HEX0N
#define HEX0N(__x__, __n__)
Definition: debug.cpp:1175
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:464
NTV2AudioPhysicalFormatListConstIter
NTV2AudioPhysicalFormatList::const_iterator NTV2AudioPhysicalFormatListConstIter
Definition: ntv2devicescanner.h:218
NTV2DeviceInfo::audioSampleRateList
NTV2AudioSampleRateList audioSampleRateList
My supported audio sample rates.
Definition: ntv2devicescanner.h:103
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:119
CNTV2DriverInterface::GetDeviceID
virtual NTV2DeviceID GetDeviceID(void)
Definition: ntv2driverinterface.cpp:381
NTV2DeviceInfo::operator==
bool operator==(const NTV2DeviceInfo &rhs) const
Definition: ntv2devicescanner.cpp:473
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:98
kSourceAll
@ kSourceAll
Definition: ntv2audiodefines.h:71
NTV2DeviceInfo::numInputConverters
UWord numInputConverters
Total number of input converters.
Definition: ntv2devicescanner.h:70
kDeviceCanDoRateConvert
@ kDeviceCanDoRateConvert
True if device can do frame rate conversion.
Definition: ntv2devicefeatures.h:80
NTV2DeviceInfo::dvcproHDSupport
bool dvcproHDSupport
Definition: ntv2devicescanner.h:77
NTV2DeviceInfo::ipSupport
bool ipSupport
Supports IP IO?
Definition: ntv2devicescanner.h:95
NTV2DeviceInfo::colorCorrectionSupport
bool colorCorrectionSupport
Supports color correction?
Definition: ntv2devicescanner.h:83
NTV2DeviceInfo::sdi3GSupport
bool sdi3GSupport
Supports 3G?
Definition: ntv2devicescanner.h:93
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:86
NTV2DeviceInfo::NTV2DeviceInfo
NTV2DeviceInfo()
Definition: ntv2devicescanner.cpp:498
kDeviceCanDo2KVideo
@ kDeviceCanDo2KVideo
True if device can handle 2Kx1556 (film) video.
Definition: ntv2devicefeatures.h:39
BIT
#define BIT(_x_)
Definition: ajatypes.h:561
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:217
NTV2DeviceInfo::ltcInOnRefPort
bool ltcInOnRefPort
Supports LTC on reference input?
Definition: ntv2devicescanner.h:99
NTV2DeviceInfo::audioNumChannelsList
NTV2AudioChannelsPerFrameList audioNumChannelsList
My supported number of audio channels per frame.
Definition: ntv2devicescanner.h:104
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:90
NTV2DeviceInfo::downConverterDelay
UWord downConverterDelay
Definition: ntv2devicescanner.h:74
NTV2DeviceInfo::stereoInSupport
bool stereoInSupport
Supports stereo input?
Definition: ntv2devicescanner.h:101
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:110
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
CNTV2DriverInterface::Close
virtual bool Close(void)
Closes me, releasing host resources that may have been allocated in a previous Open call.
Definition: ntv2driverinterface.cpp:199
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:1382
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:108
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:82
kDeviceGetNumLTCInputs
@ kDeviceGetNumLTCInputs
The number of analog LTC inputs on the device.
Definition: ntv2devicefeatures.h:211
DECN
#define DECN(__x__, __n__)
Definition: ntv2publicinterface.h:5606
NTV2DeviceInfo::hdvSupport
bool hdvSupport
Definition: ntv2devicescanner.h:79
NTV2DeviceInfo::numEmbeddedAudioOutputChannels
UWord numEmbeddedAudioOutputChannels
Total number of embedded (SDI) audio output channels.
Definition: ntv2devicescanner.h:115
AJASystemInfo
Definition: info.h:78