AJA NTV2 SDK  18.0.0.2717
NTV2 SDK 18.0.0.2717
ntv2card.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
9 #include "ntv2devicefeatures.h"
10 #include "ntv2card.h"
11 #include "ntv2debug.h"
12 #include "ntv2utils.h"
13 #include <sstream>
14 #include "ajabase/common/common.h"
15 #include "ajabase/system/info.h" // for AJASystemInfo
16 
17 using namespace std;
18 
19 
20 // Default Constructor
22  : mDevCap(driverInterface())
23 {
24  _boardOpened = false;
25 }
26 
27 CNTV2Card::CNTV2Card (const UWord inDeviceIndex, const string & inHostName)
28  : mDevCap(driverInterface())
29 {
30  string hostName(inHostName);
31  aja::strip(hostName);
32  _boardOpened = false;
33  bool openOK = hostName.empty() ? CNTV2DriverInterface::Open(inDeviceIndex) : CNTV2DriverInterface::Open(hostName);
34  if (openOK)
35  {
36  if (IsBufferSizeSetBySW())
37  {
38  NTV2Framesize fbSize;
40  SetFrameBufferSize (fbSize);
41  }
42  else
43  {
45  NTV2FrameBufferFormat format;
46 
47  GetFrameGeometry (fg);
49 
52  }
53  }
54 }
55 
56 // Destructor
58 {
59  if (IsOpen ())
60  Close ();
61 
62 } // destructor
63 
64 
66 {
67  ULWord status (0);
68  return ReadRegister (kRegStatus, status) ? (status & 0xF) : -1;
69 }
70 
71 
73 {
74  ostringstream oss;
76  return oss.str();
77 }
78 
79 
81 {
84 }
85 
87 {
88  ostringstream oss;
89  if (IsRemote())
90  {
91  const NTV2Dictionary params (ConnectParams());
92  string fName (params.valueForKey(kQParamVDevName)),
93  devNdx (params.valueForKey(kQParamVDevIndex)),
94  model (GetModelName());
95  if (model == "Software" || model == "AJA Device" || model == "(Not Found)" || model == "Unknown" || model == "???")
96  model = fName.empty() ? params.valueForKey(kNTV2PluginRegInfoKey_ShortName) : fName;
97  if (devNdx.empty())
98  {ostringstream tmp; tmp << GetIndexNumber(); devNdx = tmp.str();}
99  oss << model << " - " << devNdx;
100  }
101  else
102  oss << GetModelName() << " - " << GetIndexNumber();
103  return oss.str();
104 }
105 
106 
108 {
109  ULWord numBytes (0);
110  string dateStr, timeStr;
111  ostringstream oss;
112 
113  if (inFPGA == eFPGAVideoProc && GetInstalledBitfileInfo (numBytes, dateStr, timeStr))
114  oss << dateStr << " at " << timeStr;
115  else
116  oss << "Unavailable";
117 
118  return oss.str ();
119 }
120 
121 
123 {
124  ULWord status (0);
125  return ReadRegister (48, status) ? ((status >> 8) & 0xFF) : -1;
126 }
127 
128 
130 {
131  const UWord version (static_cast<UWord>(GetPCIFPGAVersion()));
132  ostringstream oss;
133  oss << hex << version;
134  return oss.str ();
135 }
136 
137 string CNTV2Card::GetDescription (void) const
138 {
139  if (!IsOpen())
140  return string();
141  if (IsRemote())
143 
144  CNTV2Card * pCard = (CNTV2Card*)(this); // Ugly: *sigh* If only most CNTV2Card member functions were 'const'
145  ostringstream oss;
146  string hostName("localhost"), snStr;
148  sysInfo.GetValue(AJA_SystemInfoTag_System_Name, hostName);
149  oss << pCard->GetModelName();
150  if (!pCard->GetSerialNumberString(snStr))
151  snStr.clear();
152  if (!snStr.empty())
153  oss << " '" << snStr << "'";
154  if (!hostName.empty())
155  oss << " on '" << hostName << "'";
156  oss << " at index " << DEC(GetIndexNumber());
157  return oss.str();
158 }
159 
161 {
162  static const string sDriverBuildTypes [] = {"", "b", "a", "d"};
163  UWord versions[4] = {0, 0, 0, 0};
164  ULWord versBits(0);
165  if (!GetDriverVersionComponents (versions[0], versions[1], versions[2], versions[3]))
166  return string(); // fail
167  if (!ReadRegister (kVRegDriverVersion, versBits))
168  return string(); // fail
169 
170  const string & dabr (sDriverBuildTypes[versBits >> 30]); // Bits 31:30 == build type
171  ostringstream oss;
172  oss << DEC(versions[0]) << "." << DEC(versions[1]) << "." << DEC(versions[2]);
173  if (dabr.empty())
174  oss << "." << DEC(versions[3]);
175  else
176  oss << dabr << DEC(versions[3]);
177  return oss.str();
178 
179 } // GetDriverVersionString
180 
181 
182 bool CNTV2Card::GetDriverVersionComponents (UWord & outMajor, UWord & outMinor, UWord & outPoint, UWord & outBuild)
183 {
184  outMajor = outMinor = outPoint = outBuild = 0;
185  ULWord driverVersionULWord (0);
186  if (!ReadRegister (kVRegDriverVersion, driverVersionULWord))
187  return false;
188  if (!driverVersionULWord) // If zero --- pre-15.0 driver?
189  return false;
190 
191  // The normal 15.0+ way of decoding the 32-bit driver version value:
192  outMajor = UWord(NTV2DriverVersionDecode_Major(driverVersionULWord));
193  outMinor = UWord(NTV2DriverVersionDecode_Minor(driverVersionULWord));
194  outPoint = UWord(NTV2DriverVersionDecode_Point(driverVersionULWord));
195  outBuild = UWord(NTV2DriverVersionDecode_Build(driverVersionULWord));
196  return true;
197 }
198 
199 
201 {
202  ULWord serialNum (0);
203  return ReadRegister (kRegReserved54, serialNum) ? serialNum : 0; // Read EEPROM shadow of Serial Number
204 }
205 
206 
208 {
209  ULWord serialNum (0);
210  return ReadRegister (kRegReserved55, serialNum) ? serialNum : 0; // Read EEPROM shadow of Serial Number
211 }
212 
214 {
215  const uint64_t lo(GetSerialNumberLow()), hi(GetSerialNumberHigh());
216  const uint64_t result((hi << 32) | lo);
217  return result;
218 }
219 
220 
221 string CNTV2Card::SerialNum64ToString (const uint64_t inSerialNumber) // Class method
222 {
223  return ::SerialNum64ToString(inSerialNumber);
224 } // SerialNum64ToString
225 
226 
227 bool CNTV2Card::GetSerialNumberString (string & outSerialNumberString)
228 {
229  ULWord spiFlashVers(0);
230  if (!GetNumericParam(kDeviceGetSPIFlashVersion, spiFlashVers))
231  return false;
232  const NTV2DeviceID deviceID(GetDeviceID());
233  bool hasLPPC = NTV2DeviceHasLPProductCode(deviceID);
234  if (hasLPPC || spiFlashVers >= 6)
235  {
236  // Newer devices use 4 regs: kRegReserved54 thru kRegReserved57
237  ULWord serialArray[] = {0,0,0,0};
238  ReadRegister(hasLPPC ? kRegReserved54 : kRegReserved56, serialArray[0]);
239  ReadRegister(hasLPPC ? kRegReserved55 : kRegReserved57, serialArray[1]);
240  ReadRegister(hasLPPC ? kRegReserved56 : kRegReserved54, serialArray[2]);
241  ReadRegister(hasLPPC ? kRegReserved57 : kRegReserved55, serialArray[3]);
242  outSerialNumberString.clear();
243  for (int serialIndex = 0; serialIndex < 4; serialIndex++)
244  if (serialArray[serialIndex] != 0xffffffff)
245  for (int i = 0; i < 4; i++)
246  {
247  const char tempChar(((serialArray[serialIndex] >> (i*8)) & 0xff));
248  if (tempChar > 0 && tempChar != '.')
249  outSerialNumberString.push_back(tempChar);
250  }
251  }
252  else
253  { // Older devices use 2 regs: kRegReserved54 & kRegReserved55
254  outSerialNumberString = ::SerialNum64ToString(GetSerialNumber());
255  if (outSerialNumberString.empty())
256  {outSerialNumberString = "INVALID?"; return false;}
257 
258  // Prepend 5/6/7 for Io4K+/IoIP/IoX3, respectively...
259  if (deviceID == DEVICE_ID_IO4KPLUS)
260  outSerialNumberString = "5" + outSerialNumberString; // Io4K+/DNXIV: prepend "5"
261  else if (deviceID == DEVICE_ID_IOIP_2022 ||
262  deviceID == DEVICE_ID_IOIP_2110 ||
263  deviceID == DEVICE_ID_IOIP_2110_RGB12)
264  outSerialNumberString = "6" + outSerialNumberString; // IoIP: prepend "6"
265  else if (deviceID == DEVICE_ID_IOX3)
266  outSerialNumberString = "7" + outSerialNumberString; // IoX3: prepend "7"
267  }
268  return true;
269 } // GetSerialNumberString
270 
271 
272 bool CNTV2Card::IS_CHANNEL_INVALID (const NTV2Channel inChannel) const
273 {
274  if (!NTV2_IS_VALID_CHANNEL (inChannel))
275  return true;
276  return false;
277 }
278 
279 
280 bool CNTV2Card::IS_OUTPUT_SPIGOT_INVALID (const UWord inOutputSpigot)
281 {
282  if (inOutputSpigot >= UWord(GetNumSupported(kDeviceGetNumVideoOutputs)))
283  {
285  if (itms.find(ULWord(NTV2_WgtSDIMonOut1)) != itms.end() && inOutputSpigot == 4)
286  return false; // Io4K Monitor Output exception
287  return true; // Invalid
288  }
289  return false;
290 }
291 
292 
293 bool CNTV2Card::IS_INPUT_SPIGOT_INVALID (const UWord inInputSpigot)
294 {
295  if (inInputSpigot >= UWord(GetNumSupported(kDeviceGetNumVideoInputs)))
296  return true;
297  return false;
298 }
299 
300 bool CNTV2Card::IS_HDMI_INPUT_SPIGOT_INVALID (const UWord inInputHDMIPort)
301 {
302  if (inInputHDMIPort >= UWord(GetNumSupported(kDeviceGetNumHDMIVideoInputs)))
303  return true;
304  return false;
305 }
306 
308 {
310  {
311  ULWord totalFrames = GetNumSupported(kDeviceGetActiveMemorySize) / 0x800000;
314  totalFrames -= 6; // Lop off 48MB for HDMI MultiViewer
315  return totalFrames;
316  }
317  return ::NTV2DeviceGetNumberFrameBuffers(_boardID); // Handle non-stacked-audio devices
318 }
319 
320 bool CNTV2Card::GetInstalledBitfileInfo (ULWord & outNumBytes, std::string & outDateStr, std::string & outTimeStr)
321 {
322  outDateStr.clear ();
323  outTimeStr.clear ();
324  outNumBytes = 0;
325 
326  if (!_boardOpened)
327  return false; // Bail if I'm not open
328 
329  BITFILE_INFO_STRUCT bitFileInfo;
330  ::memset (&bitFileInfo, 0, sizeof (bitFileInfo));
331  bitFileInfo.whichFPGA = eFPGAVideoProc;
332 
333  // Call the OS specific method...
335  return false;
336 
337  // Fill in our OS independent data structure...
338  outDateStr = reinterpret_cast <char *> (&bitFileInfo.dateStr [0]);
339  outTimeStr = reinterpret_cast <char *> (&bitFileInfo.timeStr [0]);
340  outNumBytes = bitFileInfo.numBytes;
341  return true;
342 }
343 
345 {
346  ostringstream oss;
347  // format like: "date time name"
348  oss << inBitFileInfo.dateStr << " " << inBitFileInfo.timeStr << " ";
350  oss << "DNxIV";
351  else
352  oss << ::NTV2BitfileTypeToString(NTV2BitfileType(inBitFileInfo.bitFileType), true);
353  return oss.str();
354 }
355 
356 bool CNTV2Card::IsFailSafeBitfileLoaded (bool & outIsSafeBoot)
357 {
358  outIsSafeBoot = false;
360  return false;
361  return CNTV2DriverInterface::ReadRegister(kRegCPLDVersion, outIsSafeBoot, BIT(4), 4);
362 }
363 
364 
365 bool CNTV2Card::CanWarmBootFPGA (bool & outCanWarmBoot)
366 {
367  outCanWarmBoot = false; // Definitely can't
369  return false;
370 
371  ULWord version(0);
372  if (!ReadRegister(kRegCPLDVersion, version, BIT(0)|BIT(1)))
373  return false; // Fail
374  if (version != 3)
375  outCanWarmBoot = true; // Definitely can
376  return true;
377 }
378 
379 
381 {
383  ULWord audioCtlReg (0); // The Audio Control Register tells us what's connected
384 
385  if (IsOpen () && ReadRegister (kRegAud1Control, audioCtlReg))
386  {
387  const bool bPhonyKBox (false); // For debugging
388 
389  switch (_boardID)
390  {
391  case DEVICE_ID_KONA3G:
393  case DEVICE_ID_IO4K:
394  case DEVICE_ID_KONA4:
395  case DEVICE_ID_KONA4UFC:
396  case DEVICE_ID_KONA5:
398  case DEVICE_ID_KONA5_8K:
401  case DEVICE_ID_KONA5_OE1:
403  // Do we have a K3G-Box?
404  if ((audioCtlReg & kK2RegMaskKBoxDetect) || bPhonyKBox)
405  result = NTV2_K3GBox;
406  else
407  result = NTV2_BreakoutCableBNC;
408  break;
410  // Do we have a KL-Box?
411  if ((audioCtlReg & kK2RegMaskKBoxDetect) || bPhonyKBox)
412  result = NTV2_KLBox;
413  else
414  result = NTV2_BreakoutCableXLR; // no BNC breakout cable available
415  break;
416  case DEVICE_ID_KONALHI:
417  // Do we have a KLHi-Box?
418  if ((audioCtlReg & kK2RegMaskKBoxDetect) || bPhonyKBox)
419  result = NTV2_KLHiBox;
420  else
421  result = NTV2_BreakoutCableXLR; // no BNC breakout cable available
422  break;
423  case DEVICE_ID_KONAX:
424  // Do we have a BOB?
426  result = NTV2_BreakoutBoard;
427  break;
428  default:
429  break;
430  }
431  }
432  return result;
433 }
434 
436 {
438  return false;
439  uint32_t portIP(0);
440  int ipOctet(0);
441  ostringstream tempString;
442  ReadRegister(kRegLPRJ45IP, portIP);
443  if (portIP == 0)
444  return false;
445 
446  outURLString.clear();
447  tempString << "http://";
448  ipOctet = (portIP & 0xFF000000) >> 24;
449  tempString << ipOctet << ".";
450  ipOctet = (portIP & 0x00FF0000) >> 16;
451  tempString << ipOctet << ".";
452  ipOctet = (portIP & 0x0000FF00) >> 8;
453  tempString << ipOctet << ".";
454  ipOctet = (portIP & 0x000000FF);
455  tempString << ipOctet;
456 
457  outURLString = tempString.str();
458  return true;
459 }
460 
462 {
464  return false;
465  uint32_t portIP(0);
466  int ipOctet(0);
467  ostringstream tempString;
468  ReadRegister(kRegLPTunnelIP, portIP);
469  if (portIP == 0)
470  return false;
471 
472  outURLString.clear();
473  tempString << "http://";
474  ipOctet = (portIP & 0xFF000000) >> 24;
475  tempString << ipOctet << ".";
476  ipOctet = (portIP & 0x00FF0000) >> 16;
477  tempString << ipOctet << ".";
478  ipOctet = (portIP & 0x0000FF00) >> 8;
479  tempString << ipOctet << ".";
480  ipOctet = (portIP & 0x000000FF);
481  tempString << ipOctet;
482 
483  outURLString = tempString.str();
484  return true;
485 }
486 
487 int CNTV2Card::GetSFPConfigurationURLStrings(std::vector<std::string> & OutSFPURLStrings)
488 {
490  return 0;
491 
493 
494  for (int i = 0; i < numSFPs; i++)
495  {
496  uint32_t portIP(0);
497  int ipOctet(0);
498  ostringstream tempString;
499  ReadRegister(kRegLPSFP1IP+i, portIP);
500  if (portIP == 0)
501  return false;
502 
503  tempString << "http://";
504  ipOctet = (portIP & 0xFF000000) >> 24;
505  tempString << ipOctet << ".";
506  ipOctet = (portIP & 0x00FF0000) >> 16;
507  tempString << ipOctet << ".";
508  ipOctet = (portIP & 0x0000FF00) >> 8;
509  tempString << ipOctet << ".";
510  ipOctet = (portIP & 0x000000FF);
511  tempString << ipOctet;
512 
513  OutSFPURLStrings.push_back(tempString.str());
514  }
515  return int(OutSFPURLStrings.size());
516 }
517 
518 #if !defined(NTV2_DEPRECATE_16_3)
521  NTV2FrameGeometry inFrameGeometry,
522  NTV2Standard inStandard)
523  {
524  return ::NTV2DeviceCanDoFormat (GetDeviceID(), inFrameRate, inFrameGeometry, inStandard);
525  }
526 
528  {
529  return ::NTV2DeviceGetFrameBufferSize (GetDeviceID()); // Revisit for 2MB granularity
530  }
531 
533  {
534  return ::NTV2DeviceGetAudioFrameBuffer (GetDeviceID()); // Revisit for 2MB granularity
535  }
536 
538  {
539  return ::NTV2DeviceGetAudioFrameBuffer2 (GetDeviceID()); // Revisit for 2MB granularity
540  }
541 
543  {
544  return ::NTV2DeviceGetFrameBufferSize (GetDeviceID(), inFrameGeometry, inFBFormat); // Revisit for 2MB granularity
545  }
546 
548  {
549  return ::NTV2DeviceGetNumberFrameBuffers (GetDeviceID(), inFrameGeometry, inFBFormat); // Revisit for 2MB granularity
550  }
551 
553  {
554  return ::NTV2DeviceGetAudioFrameBuffer (GetDeviceID(), inFrameGeometry, inFBFormat); // Revisit for 2MB granularity
555  }
556 
558  {
559  return ::NTV2DeviceGetAudioFrameBuffer2 (GetDeviceID(), inFrameGeometry, inFBFormat); // Revisit for 2MB granularity
560  }
561 
564  return itms.find(ULWord(inVideoFormat)) != itms.end();
565  }
566 
569  return itms.find(ULWord(inFBFormat)) != itms.end();
570  }
571 
573  {
575  return wgtIDs.find(inWidgetID) != wgtIDs.end();
576  }
577 
580  return itms.find(ULWord(inConversionMode)) != itms.end();
581  }
582 
585  return itms.find(ULWord(inDSKMode)) != itms.end();
586  }
587 
590  return itms.find(ULWord(inInputSource)) != itms.end();
591  }
592 #endif // !defined(NTV2_DEPRECATE_16_3)
593 
594 
596 
597 
598 bool DeviceCapabilities::CanDoWidget (const NTV2WidgetType inWgtType, const UWord index0)
599 {
601 }
602 
603 
605 
606 
607 bool SDRAMAuditor::AssessDevice (CNTV2Card & inDevice, const bool inMarkStoppedAudioBuffersFree)
608 {
609  mFrameTags.clear();
610  mDeviceID = DEVICE_ID_INVALID;
611  mNumFrames = 0;
612  mIntrinsicSize = 0;
613  if (!inDevice.IsOpen())
614  return false;
615 
616  mDeviceID = inDevice.GetDeviceID();
617  const ULWord totalBytes(::NTV2DeviceGetActiveMemorySize(mDeviceID));
618  mNumFrames = UWord(totalBytes / m8MB);
619  if (totalBytes % m8MB)
620  {mNumFrames++; cerr << DEC(totalBytes % m8MB) << " leftover/spare bytes -- last frame is partial frame" << endl;}
621  for (UWord frm(0); frm < mNumFrames; frm++)
622  mFrameTags.insert(FrameTag(frm, NTV2StringSet()));
623 
624  return TagAudioBuffers(inDevice, inMarkStoppedAudioBuffersFree) && TagVideoFrames(inDevice);
625 }
626 
627 ostream & SDRAMAuditor::RawDump (ostream & oss) const
628 {
629  for (FrameTagsConstIter it(mFrameTags.begin()); it != mFrameTags.end(); ++it)
630  {
631  const NTV2StringSet & tags(it->second);
632  oss << DEC0N(it->first,3) << ": " << aja::join(tags, ", ") << endl;
633  }
634  return oss;
635 }
636 
638 {
639  ULWordSet result; // Coalesce all regions into this one sorted set
640  for (size_t ndx(0); ndx < inRgn1.size(); ndx++)
641  if (result.find(inRgn1.at(ndx)) == result.end())
642  result.insert(inRgn1.at(ndx));
643  for (size_t ndx(0); ndx < inRgn2.size(); ndx++)
644  if (result.find(inRgn2.at(ndx)) == result.end())
645  result.insert(inRgn2.at(ndx));
646  for (size_t ndx(0); ndx < inRgn3.size(); ndx++)
647  if (result.find(inRgn3.at(ndx)) == result.end())
648  result.insert(inRgn3.at(ndx));
649  return result;
650 }
651 
652 ostream & SDRAMAuditor::DumpBlocks (ostream & oss) const
653 {
654  ULWordSequence badBlks, freeBlks, goodBlks;
655  GetRegions (freeBlks, goodBlks, badBlks);
656  ULWordSet rgns (CoalesceRegions(freeBlks, goodBlks, badBlks)); // Coalesce all regions into this one sorted set
657 
658  for (ULWordSetConstIter it(rgns.begin()); it != rgns.end(); ++it)
659  {
660  const ULWord rgnInfo(*it);
661  const UWord startBlk(rgnInfo >> 16), numBlks(UWord(rgnInfo & 0x0000FFFF));
662  NTV2StringSet tags;
663  GetTagsForFrameIndex (startBlk, tags);
664  if (numBlks > 1)
665  oss << "Frms " << DEC0N(startBlk,3) << "-" << DEC0N(startBlk+numBlks-1,3) << " : ";
666  else
667  oss << "Frm " << DEC0N(startBlk,3) << " : ";
668  if (tags.empty())
669  oss << "{free}";
670  else
671  oss << aja::join(tags, ", ");
672  oss << endl;
673  }
674  return oss;
675 }
676 
677 bool SDRAMAuditor::GetRegions (ULWordSequence & outFree, ULWordSequence & outUsed, ULWordSequence & outBad) const
678 {
679  outFree.clear(); outUsed.clear(); outBad.clear();
680  FrameTagsConstIter it(mFrameTags.begin());
681  if (it == mFrameTags.end())
682  return true;
683  UWord frmStart(it->first), lastFrm(frmStart);
684  NTV2StringSet runTags(it->second);
685  while (++it != mFrameTags.end())
686  {
687  const NTV2StringSet & tags(it->second);
688  if (tags != runTags)
689  { // End of current run, start of new run
690  if (runTags.empty())
691  {
692  if (frmStart != lastFrm)
693  outFree.push_back((ULWord(frmStart) << 16) | ULWord(lastFrm-frmStart+1));
694  else
695  outFree.push_back((ULWord(frmStart) << 16) | ULWord(1));
696  }
697  else if (runTags.size() > 1)
698  {
699  if (frmStart != lastFrm)
700  outBad.push_back((ULWord(frmStart) << 16) | ULWord(lastFrm-frmStart+1));
701  else
702  outBad.push_back((ULWord(frmStart) << 16) | ULWord(1));
703  }
704  else
705  {
706  if (frmStart != lastFrm)
707  outUsed.push_back((ULWord(frmStart) << 16) | ULWord(lastFrm-frmStart+1));
708  else
709  outUsed.push_back((ULWord(frmStart) << 16) | ULWord(1));
710  }
711  frmStart = lastFrm = it->first;
712  runTags = tags;
713  }
714  else
715  lastFrm = it->first; // Continue current run
716  }
717  if (runTags.empty())
718  {
719  if (frmStart != lastFrm)
720  outFree.push_back((ULWord(frmStart) << 16) | ULWord(lastFrm-frmStart+1));
721  else
722  outFree.push_back((ULWord(frmStart) << 16) | ULWord(1));
723  }
724  else if (runTags.size() > 1)
725  {
726  if (frmStart != lastFrm)
727  outBad.push_back((ULWord(frmStart) << 16) | ULWord(lastFrm-frmStart+1));
728  else
729  outBad.push_back((ULWord(frmStart) << 16) | ULWord(1));
730  }
731  else
732  {
733  if (frmStart != lastFrm)
734  outUsed.push_back((ULWord(frmStart) << 16) | ULWord(lastFrm-frmStart+1));
735  else
736  outUsed.push_back((ULWord(frmStart) << 16) | ULWord(1));
737  }
738  return true;
739 }
740 
741 bool SDRAMAuditor::GetTagsForFrameIndex (const UWord inIndex, NTV2StringSet & outTags) const
742 {
743  outTags.clear();
744  FrameTagsConstIter it(mFrameTags.find(inIndex));
745  if (it == mFrameTags.end())
746  return false;
747  outTags = it->second;
748  return true;
749 }
750 
751 size_t SDRAMAuditor::GetTagCount (const UWord inIndex) const
752 {
753  FrameTagsConstIter it(mFrameTags.find(inIndex));
754  if (it == mFrameTags.end())
755  return 0;
756  return it->second.size();
757 }
758 
759 bool SDRAMAuditor::TranslateRegions (ULWordSequence & outDestRgns, const ULWordSequence & inSrcRgns, const bool inIsQuad, const bool inIsQuadQuad) const
760 {
761  outDestRgns.clear();
762  if (inIsQuad && inIsQuadQuad)
763  return false; // Can't be both
764  if (inSrcRgns.empty())
765  return true; // Empty list, not an error
766  const UWord _8MB_frames_per_dest_frame(UWord(GetIntrinsicFrameByteCount() / m8MB) * (inIsQuad?4:1) * (inIsQuadQuad?16:1)); // Should result in 1/4/16 or 2/8/32
767  if (!_8MB_frames_per_dest_frame)
768  return false; // Ordinarily won't happen, but possible with "ntv2:" (fake/software) "devices" having small SDRAM complement
769  if (_8MB_frames_per_dest_frame == 1)
770  {outDestRgns = inSrcRgns; return true;} // Same
771 
772  // For each region...
773  for (size_t ndx(0); ndx < inSrcRgns.size(); ndx++)
774  { const ULWord val(inSrcRgns.at(ndx));
775  ULWord startBlkOffset(val >> 16), lengthBlks(val & 0x0000FFFF); // <== These are in 8MB block units
776  startBlkOffset = startBlkOffset / _8MB_frames_per_dest_frame + (startBlkOffset % _8MB_frames_per_dest_frame ? 1 : 0);
777  lengthBlks = lengthBlks / _8MB_frames_per_dest_frame;
778  outDestRgns.push_back((startBlkOffset << 16) | lengthBlks);
779  }
780  return true;
781 }
782 
783 bool SDRAMAuditor::TagAudioBuffers (CNTV2Card & inDevice, const bool inMarkStoppedAudioBuffersFree)
784 {
785  ULWord addr(0);
786  bool isReading(false), isWriting(false);
787  const UWord numAudSystems(UWord(inDevice.GetNumSupported(kDeviceGetNumBufferedAudioSystems)));
788  for (NTV2AudioSystem audSys(NTV2_AUDIOSYSTEM_1); audSys < NTV2AudioSystem(numAudSystems); audSys = NTV2AudioSystem(audSys+1))
789  if (inDevice.GetAudioMemoryOffset (0, addr, audSys))
790  { ostringstream tag;
791  tag << "Aud" << DEC(audSys+1);
792  if (inDevice.IsAudioOutputRunning(audSys, isReading) && isReading)
793  tag << " Read";
794  if (inDevice.IsAudioInputRunning(audSys, isWriting) && isWriting)
795  tag << " Write";
796  TagMemoryBlock(addr, m8MB, inMarkStoppedAudioBuffersFree && !isReading && !isWriting ? string() : tag.str());
797  }
798  return true;
799 }
800 
802 {
803  const UWord numChannels (UWord(inDevice.GetNumSupported(kDeviceGetNumVideoChannels)) + (inDevice.HasMultiRasterWidget() ? 1 : 0));
804  NTV2ChannelSet skipChannels;
805  for (NTV2Channel chan(NTV2_CHANNEL1); chan < NTV2Channel(numChannels); chan = NTV2Channel(chan+1))
806  {
807  AUTOCIRCULATE_STATUS acStatus;
808  bool isEnabled(false), isMultiFormat(false), isQuad(false), isQuadQuad(false), isSquares(false), isTSI(false);
809  ostringstream tag;
810  uint64_t addr(0), len(0);
811  if (skipChannels.find(chan) != skipChannels.end())
812  continue; // Skip this channel/framestore
813  if (inDevice.AutoCirculateGetStatus (chan, acStatus) && !acStatus.IsStopped())
814  {
815  uint64_t tmp(0);
816  inDevice.GetDeviceFrameInfo(acStatus.GetStartFrame(), chan, mIntrinsicSize, isMultiFormat, isQuad, isQuadQuad, isSquares, isTSI, addr, tmp);
817  inDevice.GetDeviceFrameInfo(acStatus.GetEndFrame(), chan, tmp, len);
818  tag << "AC" << DEC(chan+1) << (acStatus.IsInput() ? " Write" : " Read");
819  TagMemoryBlock(addr, tmp + len - addr, tag.str());
820  } // if GetStatus succeeded
821  else if (inDevice.IsChannelEnabled(chan, isEnabled) && isEnabled)
822  {
824  inDevice.GetMode(chan, mode);
825  ULWord frameNum(0);
826  if (NTV2_IS_INPUT_MODE(mode))
827  inDevice.GetInputFrame(chan, frameNum);
828  else
829  inDevice.GetOutputFrame(chan, frameNum);
830  inDevice.GetDeviceFrameInfo (UWord(frameNum), chan, mIntrinsicSize, isMultiFormat, isQuad, isQuadQuad, isSquares, isTSI, addr, len);
831  if (inDevice.IsMultiRasterWidgetChannel(chan))
832  tag << "MR" << DEC(chan+1); // MultiRaster Viewer
833  else
834  tag << "Ch" << DEC(chan+1);
835  tag << (NTV2_IS_INPUT_MODE(mode) ? " Write" : " Read");
836  TagMemoryBlock(addr, len, tag.str());
837  }
838  if (isSquares && chan == NTV2_CHANNEL1)
839  {skipChannels.insert(NTV2_CHANNEL2); skipChannels.insert(NTV2_CHANNEL3); skipChannels.insert(NTV2_CHANNEL4);}
840  else if (isSquares && chan == NTV2_CHANNEL5)
841  {skipChannels.insert(NTV2_CHANNEL6); skipChannels.insert(NTV2_CHANNEL7); skipChannels.insert(NTV2_CHANNEL8);}
842  else if (isQuad && !isQuadQuad && isTSI)
843  {
844  if (chan == NTV2_CHANNEL1)
845  skipChannels.insert(NTV2_CHANNEL2);
846  else if (chan == NTV2_CHANNEL3)
847  skipChannels.insert(NTV2_CHANNEL4);
848  else if (chan == NTV2_CHANNEL5)
849  skipChannels.insert(NTV2_CHANNEL6);
850  else if (chan == NTV2_CHANNEL7)
851  skipChannels.insert(NTV2_CHANNEL8);
852  }
853  } // for each device channel
854  if (!mIntrinsicSize)
855  {
857  inDevice.GetFrameBufferSize(NTV2_CHANNEL1, frmsz);
858  mIntrinsicSize = ::NTV2FramesizeToByteCount(frmsz);
859  }
860  return true;
861 }
862 
863 bool SDRAMAuditor::TagMemoryBlock (const ULWord inStartAddr, const ULWord inByteLength, const string & inTag)
864 {
865  if (inStartAddr % m8MB)
866  return false;
867  if (inByteLength % m8MB)
868  return false;
869  if (inTag.empty())
870  return false;
871  const UWord startFrm(UWord(inStartAddr / m8MB)), frmCnt(UWord(inByteLength / m8MB));
872  for (UWord frm(0); frm < frmCnt; frm++)
873  {
874  UWord frameNum(startFrm + frm);
875  NTV2StringSet & tags(mFrameTags[frameNum]);
876  if (tags.find(inTag) == tags.end())
877  {
878  tags.insert(inTag);
879  if (frameNum >= mNumFrames)
880  tags.insert("Invalid");
881  }
882  }
883  return true;
884 }
CNTV2Card::DeviceGetAudioFrameBuffer
virtual ULWord DeviceGetAudioFrameBuffer(void)
Definition: ntv2card.cpp:532
kRegLPRJ45IP
@ kRegLPRJ45IP
Definition: ntv2publicinterface.h:1107
kQParamVDevIndex
#define kQParamVDevIndex
Device index number for .vdev virtual device.
Definition: ntv2nubaccess.h:45
kDeviceGetNumVideoInputs
@ kDeviceGetNumVideoInputs
The number of SDI video inputs on the device.
Definition: ntv2devicefeatures.h:212
CNTV2Card::IsAudioOutputRunning
virtual bool IsAudioOutputRunning(const NTV2AudioSystem inAudioSystem, bool &outIsRunning)
Answers whether or not the playout side of the given NTV2AudioSystem is currently running.
Definition: ntv2audio.cpp:1123
kNTV2PluginRegInfoKey_ShortName
#define kNTV2PluginRegInfoKey_ShortName
Plugin short name.
Definition: ntv2nubaccess.h:68
SDRAMAuditor::TagMemoryBlock
bool TagMemoryBlock(const ULWord inStartAddr, const ULWord inByteLength, const std::string &inTag)
kDeviceCanDoStackedAudio
@ kDeviceCanDoStackedAudio
True if device uses a "stacked" arrangement of its audio buffers.
Definition: ntv2devicefeatures.h:86
CNTV2Card::SetFrameBufferSize
virtual bool SetFrameBufferSize(const NTV2Framesize inSize)
Sets the device's intrinsic frame buffer size.
Definition: ntv2register.cpp:2033
BITFILE_INFO_STRUCT::whichFPGA
NTV2XilinxFPGA whichFPGA
Definition: ntv2publicinterface.h:4995
info.h
Declares the AJASystemInfo class.
CNTV2Card::GetSerialNumberHigh
virtual ULWord GetSerialNumberHigh(void)
Definition: ntv2card.cpp:207
NTV2_CHANNEL8
@ NTV2_CHANNEL8
Specifies channel or FrameStore 8 (or the 8th item).
Definition: ntv2enums.h:1362
NTV2_CHANNEL2
@ NTV2_CHANNEL2
Specifies channel or FrameStore 2 (or the 2nd item).
Definition: ntv2enums.h:1356
AJA_SystemInfoMemoryUnit_Megabytes
@ AJA_SystemInfoMemoryUnit_Megabytes
Definition: info.h:23
NTV2_WgtSDIMonOut1
@ NTV2_WgtSDIMonOut1
Definition: ntv2enums.h:2967
kDeviceGetSPIFlashVersion
@ kDeviceGetSPIFlashVersion
The SPI-flash version on the device. (New in SDK 17.1)
Definition: ntv2devicefeatures.h:223
kNTV2EnumsID_VideoFormat
@ kNTV2EnumsID_VideoFormat
Identifies the NTV2VideoFormat enumerated type.
Definition: ntv2devicefeatures.h:246
NTV2_VideoProcBitFile
@ NTV2_VideoProcBitFile
Definition: ntv2enums.h:3339
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:405
SDRAMAuditor::TagAudioBuffers
bool TagAudioBuffers(CNTV2Card &inDevice, const bool inMarkStoppedAudioBuffersFree)
Definition: ntv2card.cpp:783
NTV2StringSet
std::set< std::string > NTV2StringSet
Definition: ntv2utils.h:1158
NTV2DeviceGetNumberFrameBuffers
ULWord NTV2DeviceGetNumberFrameBuffers(NTV2DeviceID id, NTV2FrameGeometry fg, NTV2FrameBufferFormat fbf)
Definition: ntv2devicefeatures.cpp:498
aja::strip
std::string & strip(std::string &str, const std::string &ws)
Definition: common.cpp:461
NTV2Channel
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
Definition: ntv2enums.h:1353
kRegLPSFP1IP
@ kRegLPSFP1IP
Definition: ntv2publicinterface.h:1109
CNTV2DriverInterface::_boardOpened
bool _boardOpened
True if I'm open and connected to the device.
Definition: ntv2driverinterface.h:690
NTV2Buffer
Describes a user-space buffer on the host computer. I have an address and a length,...
Definition: ntv2publicinterface.h:6216
CNTV2Card::IS_CHANNEL_INVALID
virtual bool IS_CHANNEL_INVALID(const NTV2Channel inChannel) const
Definition: ntv2card.cpp:272
aja::join
std::string join(const std::vector< std::string > &parts, const std::string &delim)
Definition: common.cpp:468
NTV2WidgetType
NTV2WidgetType
Definition: ntv2enums.h:3035
DEVICE_ID_KONA5
@ DEVICE_ID_KONA5
See KONA 5.
Definition: ntv2enums.h:48
NTV2_KLBox
@ NTV2_KLBox
Definition: ntv2enums.h:3097
NTV2DeviceGetFrameBufferSize
ULWord NTV2DeviceGetFrameBufferSize(NTV2DeviceID id, NTV2FrameGeometry fg, NTV2FrameBufferFormat fbf)
Definition: ntv2devicefeatures.cpp:325
CNTV2Card::GetDeviceVersion
virtual Word GetDeviceVersion(void)
Answers with this device's version number.
Definition: ntv2card.cpp:65
DEVICE_ID_IOX3
@ DEVICE_ID_IOX3
See Io X3.
Definition: ntv2enums.h:41
NTV2DeviceGetActiveMemorySize
ULWord NTV2DeviceGetActiveMemorySize(const NTV2DeviceID inDeviceID)
Definition: ntv2devicefeatures.hpp:9002
DEVICE_ID_IOIP_2022
@ DEVICE_ID_IOIP_2022
See Io IP.
Definition: ntv2enums.h:38
SDRAMAuditor::GetTagsForFrameIndex
bool GetTagsForFrameIndex(const UWord inIndex, NTV2StringSet &outTags) const
Answers with the list of tags for the given frame number.
Definition: ntv2card.cpp:741
NTV2_AUDIOSYSTEM_1
@ NTV2_AUDIOSYSTEM_1
This identifies the first Audio System.
Definition: ntv2enums.h:3882
NTV2_BreakoutCableBNC
@ NTV2_BreakoutCableBNC
Identifies the AES/EBU audio breakout cable that has BNC connectors.
Definition: ntv2enums.h:3095
CNTV2Card::GetFrameBufferSize
virtual bool GetFrameBufferSize(const NTV2Channel inChannel, NTV2Framesize &outValue)
Answers with the frame size currently being used on the device.
Definition: ntv2register.cpp:2097
BITFILE_INFO_STRUCT::timeStr
char timeStr[(16)]
Definition: ntv2publicinterface.h:4989
DEVICE_ID_KONA5_8KMK
@ DEVICE_ID_KONA5_8KMK
See KONA 5.
Definition: ntv2enums.h:49
CNTV2DriverInterface::_ulNumFrameBuffers
ULWord _ulNumFrameBuffers
Definition: ntv2driverinterface.h:711
NTV2DeviceID
NTV2DeviceID
Identifies a specific AJA NTV2 device model number. The NTV2DeviceID is actually the PROM part number...
Definition: ntv2enums.h:20
BITFILE_INFO_STRUCT::bitFileType
ULWord bitFileType
Definition: ntv2publicinterface.h:4992
DEC0N
#define DEC0N(__x__, __n__)
Definition: ntv2publicinterface.h:5771
CNTV2Card::GetInputFrame
virtual bool GetInputFrame(const NTV2Channel inChannel, ULWord &outValue)
Answers with the current input frame index number for the given FrameStore. This identifies which par...
Definition: ntv2register.cpp:2281
kDeviceGetNumVideoOutputs
@ kDeviceGetNumVideoOutputs
The number of SDI video outputs on the device.
Definition: ntv2devicefeatures.h:213
CNTV2Card::DeviceCanDoConversionMode
virtual bool DeviceCanDoConversionMode(const NTV2ConversionMode inCM)
Definition: ntv2card.cpp:578
NTV2FrameBufferFormat
NTV2FrameBufferFormat
Identifies a particular video frame buffer format. See Device Frame Buffer Formats for details.
Definition: ntv2enums.h:215
CNTV2Card::GetInstalledBitfileInfo
virtual bool GetInstalledBitfileInfo(ULWord &outNumBytes, std::string &outDateStr, std::string &outTimeStr)
Returns the bitfile size and time/date stamp from the header of the bitfile that's currently installe...
Definition: ntv2card.cpp:320
kDeviceCanDo12gRouting
@ kDeviceCanDo12gRouting
True if device supports 12G routing crosspoints.
Definition: ntv2devicefeatures.h:117
CNTV2Card::DeviceCanDoFrameBufferFormat
virtual bool DeviceCanDoFrameBufferFormat(const NTV2PixelFormat inPF)
Definition: ntv2card.cpp:567
CNTV2DriverInterface::_ulFrameBufferSize
ULWord _ulFrameBufferSize
Definition: ntv2driverinterface.h:712
CNTV2Card::SerialNum64ToString
static std::string SerialNum64ToString(const uint64_t inSerialNumber)
Returns a string containing the decoded, human-readable device serial number.
Definition: ntv2card.cpp:221
NTV2_CHANNEL1
@ NTV2_CHANNEL1
Specifies channel or FrameStore 1 (or the first item).
Definition: ntv2enums.h:1355
ntv2debug.h
CNTV2Card::DeviceCanDoFormat
virtual bool DeviceCanDoFormat(const NTV2FrameRate inFR, const NTV2FrameGeometry inFG, const NTV2Standard inStd)
Definition: ntv2card.cpp:520
NTV2_BreakoutNone
@ NTV2_BreakoutNone
No identifiable breakout hardware appears to be attached.
Definition: ntv2enums.h:3093
CNTV2Card::DeviceCanDoWidget
virtual bool DeviceCanDoWidget(const NTV2WidgetID inWgtID)
Definition: ntv2card.cpp:572
CNTV2Card::GetFrameBufferFormat
virtual bool GetFrameBufferFormat(NTV2Channel inChannel, NTV2FrameBufferFormat &outValue)
Returns the current frame buffer format for the given FrameStore on the AJA device.
Definition: ntv2register.cpp:1919
kDeviceCanDoWarmBootFPGA
@ kDeviceCanDoWarmBootFPGA
True if device can warm-boot to load updated firmware.
Definition: ntv2devicefeatures.h:131
NTV2_K3GBox
@ NTV2_K3GBox
Definition: ntv2enums.h:3101
CNTV2DriverInterface::_boardID
NTV2DeviceID _boardID
My cached device ID.
Definition: ntv2driverinterface.h:689
kRegReserved57
@ kRegReserved57
Definition: ntv2publicinterface.h:178
NTV2FrameRate
NTV2FrameRate
Identifies a particular video frame rate.
Definition: ntv2enums.h:408
NTV2FramesizeToByteCount
ULWord NTV2FramesizeToByteCount(const NTV2Framesize inFrameSize)
Converts the given NTV2Framesize value into an exact byte count.
Definition: ntv2utils.cpp:5284
NTV2_CHANNEL6
@ NTV2_CHANNEL6
Specifies channel or FrameStore 6 (or the 6th item).
Definition: ntv2enums.h:1360
kDeviceGetNumBufferedAudioSystems
@ kDeviceGetNumBufferedAudioSystems
The total number of audio systems on the device that can read/write audio buffer memory....
Definition: ntv2devicefeatures.h:221
CNTV2Card::GetDeviceVersionString
virtual std::string GetDeviceVersionString(void)
Answers with this device's version number as a human-readable string.
Definition: ntv2card.cpp:72
NTV2_CHANNEL4
@ NTV2_CHANNEL4
Specifies channel or FrameStore 4 (or the 4th item).
Definition: ntv2enums.h:1358
kQParamVDevName
#define kQParamVDevName
Device name, if not specified in .vdev file, then base name of .vdev file.
Definition: ntv2nubaccess.h:43
ULWordSetConstIter
ULWordSet::const_iterator ULWordSetConstIter
Definition: ntv2publicinterface.h:55
CNTV2DriverInterface::IsSupported
virtual bool IsSupported(const NTV2BoolParamID inParamID)
Definition: ntv2driverinterface.h:417
NTV2DriverVersionDecode_Point
#define NTV2DriverVersionDecode_Point(__vers__)
Definition: ntv2publicinterface.h:5556
NTV2_CHANNEL5
@ NTV2_CHANNEL5
Specifies channel or FrameStore 5 (or the 5th item).
Definition: ntv2enums.h:1359
CNTV2Card::GetModelName
virtual std::string GetModelName(void)
Answers with this device's model name.
Definition: ntv2card.cpp:80
AUTOCIRCULATE_STATUS::IsInput
bool IsInput(void) const
Definition: ntv2publicinterface.h:7625
CNTV2DriverInterface::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: ntv2driverinterface.cpp:438
isEnabled
static bool isEnabled(CNTV2Card &device, const NTV2Channel inChannel)
Definition: ntv2supportlogger.cpp:143
CNTV2Card::IS_INPUT_SPIGOT_INVALID
virtual bool IS_INPUT_SPIGOT_INVALID(const UWord inInputSpigot)
Definition: ntv2card.cpp:293
CNTV2Card::GetBitfileInfoString
virtual std::string GetBitfileInfoString(const BITFILE_INFO_STRUCT &inBitFileInfo)
Generates and returns an info string with date, time and name for the given inBifFileInfo.
Definition: ntv2card.cpp:344
NTV2_KLHiBox
@ NTV2_KLHiBox
Definition: ntv2enums.h:3099
CNTV2Card::IsAudioInputRunning
virtual bool IsAudioInputRunning(const NTV2AudioSystem inAudioSystem, bool &outIsRunning)
Answers whether or not the capture side of the given NTV2AudioSystem is currently running.
Definition: ntv2audio.cpp:1214
CNTV2Card::GetDisplayName
virtual std::string GetDisplayName(void)
Answers with this device's display name.
Definition: ntv2card.cpp:86
kRegReserved54
@ kRegReserved54
Definition: ntv2publicinterface.h:175
SDRAMAuditor::DumpBlocks
std::ostream & DumpBlocks(std::ostream &oss) const
Dumps all 8MB blocks/frames and their tags, if any, into the given stream.
Definition: ntv2card.cpp:652
BITFILE_INFO_STRUCT::dateStr
char dateStr[(16)]
Definition: ntv2publicinterface.h:4988
NTV2XilinxFPGA
NTV2XilinxFPGA
Definition: ntv2enums.h:3831
kDeviceGetNumAudioSystems
@ kDeviceGetNumAudioSystems
The number of independent Audio Systems on the device.
Definition: ntv2devicefeatures.h:193
kRegReserved56
@ kRegReserved56
Definition: ntv2publicinterface.h:177
CNTV2Card::GetOutputFrame
virtual bool GetOutputFrame(const NTV2Channel inChannel, ULWord &outValue)
Answers with the current output frame number for the given FrameStore (expressed as an NTV2Channel).
Definition: ntv2register.cpp:2263
CNTV2Card::IS_OUTPUT_SPIGOT_INVALID
virtual bool IS_OUTPUT_SPIGOT_INVALID(const UWord inOutputSpigot)
Definition: ntv2card.cpp:280
NTV2Standard
NTV2Standard
Identifies a particular video standard.
Definition: ntv2enums.h:161
ULWordSet
std::set< ULWord > ULWordSet
A collection of unique ULWord (uint32_t) values.
Definition: ntv2publicinterface.h:54
CNTV2Card::GetPCIFPGAVersionString
virtual std::string GetPCIFPGAVersionString(void)
Definition: ntv2card.cpp:129
DEVICE_ID_KONA5_8K
@ DEVICE_ID_KONA5_8K
See KONA 5.
Definition: ntv2enums.h:50
DEVICE_ID_KONA3G
@ DEVICE_ID_KONA3G
See KONA 3G (UFC Mode).
Definition: ntv2enums.h:44
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:153
ULWord
uint32_t ULWord
Definition: ajatypes.h:276
NTV2DriverVersionDecode_Major
#define NTV2DriverVersionDecode_Major(__vers__)
Definition: ntv2publicinterface.h:5554
CNTV2Card::NULL_POINTER
static NTV2Buffer NULL_POINTER
Used for default empty NTV2Buffer parameters – do not modify.
Definition: ntv2card.h:6554
kDeviceGetNumVideoChannels
@ kDeviceGetNumVideoChannels
The number of video channels supported on the device.
Definition: ntv2devicefeatures.h:183
CNTV2Card::GetDescription
virtual std::string GetDescription(void) const
Definition: ntv2card.cpp:137
AUTOCIRCULATE_STATUS
This is returned from the CNTV2Card::AutoCirculateGetStatus function.
Definition: ntv2publicinterface.h:7405
AJA_SystemInfoTag_System_Name
@ AJA_SystemInfoTag_System_Name
Definition: info.h:33
CNTV2Card::DeviceCanDoInputSource
virtual bool DeviceCanDoInputSource(const NTV2InputSource inSrc)
Definition: ntv2card.cpp:588
NTV2_CHANNEL7
@ NTV2_CHANNEL7
Specifies channel or FrameStore 7 (or the 7th item).
Definition: ntv2enums.h:1361
CNTV2Card::DeviceGetFrameBufferSize
virtual ULWord DeviceGetFrameBufferSize(void)
Definition: ntv2card.cpp:527
DEVICE_ID_KONAX
@ DEVICE_ID_KONAX
See KONA X™.
Definition: ntv2enums.h:78
CNTV2Card::IS_HDMI_INPUT_SPIGOT_INVALID
virtual bool IS_HDMI_INPUT_SPIGOT_INVALID(const UWord inInputHDMIPort)
Definition: ntv2card.cpp:300
kNTV2EnumsID_ConversionMode
@ kNTV2EnumsID_ConversionMode
Identifies the NTV2ConversionMode enumerated type.
Definition: ntv2devicefeatures.h:255
DEVICE_ID_KONA4UFC
@ DEVICE_ID_KONA4UFC
See KONA 4 (UFC Mode).
Definition: ntv2enums.h:47
CNTV2Card::DeviceGetNumberFrameBuffers
virtual ULWord DeviceGetNumberFrameBuffers(void)
Definition: ntv2card.cpp:307
NTV2Mode
NTV2Mode
Used to identify the mode of a widget_framestore, or the direction of an AutoCirculate stream: either...
Definition: ntv2enums.h:1235
SDRAMAuditor::RawDump
std::ostream & RawDump(std::ostream &oss) const
Dumps a human-readable list of regions into the given stream.
Definition: ntv2card.cpp:627
NTV2DeviceIDToString
std::string NTV2DeviceIDToString(const NTV2DeviceID inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:4608
ntv2card.h
Declares the CNTV2Card class.
NTV2_BITFILE_IO4KPLUS_MAIN
@ NTV2_BITFILE_IO4KPLUS_MAIN
Definition: ntv2enums.h:3384
CNTV2Card::GetDeviceFrameInfo
virtual bool GetDeviceFrameInfo(const UWord inFrameNumber, const NTV2Channel inChannel, uint64_t &outAddress, uint64_t &outLength)
Answers with the address and size of the given frame.
Definition: ntv2dma.cpp:375
CNTV2Card::IsFailSafeBitfileLoaded
virtual bool IsFailSafeBitfileLoaded(bool &outIsFailSafe)
Answers whether or not the "fail-safe" (aka "safe-boot") bitfile is currently loaded and running in t...
Definition: ntv2card.cpp:356
CNTV2Card::HasMultiRasterWidget
virtual bool HasMultiRasterWidget(void)
Definition: ntv2card.h:6802
SDRAMAuditor::GetTagCount
size_t GetTagCount(const UWord inIndex) const
Definition: ntv2card.cpp:751
CNTV2Card::GetSerialNumberString
virtual bool GetSerialNumberString(std::string &outSerialNumberString)
Answers with a string that contains my human-readable serial number.
Definition: ntv2card.cpp:227
NTV2DeviceGetAudioFrameBuffer2
ULWord NTV2DeviceGetAudioFrameBuffer2(NTV2DeviceID boardID, NTV2FrameGeometry frameGeometry, NTV2FrameBufferFormat frameFormat)
Definition: ntv2devicefeatures.cpp:663
NTV2_CHANNEL3
@ NTV2_CHANNEL3
Specifies channel or FrameStore 3 (or the 3rd item).
Definition: ntv2enums.h:1357
UWord
uint16_t UWord
Definition: ajatypes.h:274
CNTV2Card::AutoCirculateGetStatus
virtual bool AutoCirculateGetStatus(const NTV2Channel inChannel, AUTOCIRCULATE_STATUS &outStatus)
Returns the current AutoCirculate status for the given channel.
Definition: ntv2autocirculate.cpp:668
CNTV2Card::GetSerialNumber
virtual uint64_t GetSerialNumber(void)
Answers with my serial number.
Definition: ntv2card.cpp:213
kNTV2EnumsID_InputSource
@ kNTV2EnumsID_InputSource
Identifies the NTV2InputSource enumerated type.
Definition: ntv2devicefeatures.h:248
ntv2utils.h
Declares numerous NTV2 utility functions.
NTV2Framesize
NTV2Framesize
Kona2/Xena2 specific enums.
Definition: ntv2enums.h:2112
Word
int16_t Word
Definition: ajatypes.h:273
NTV2BreakoutType
NTV2BreakoutType
Identifies the Breakout Boxes and Cables that may be attached to an AJA NTV2 device.
Definition: ntv2enums.h:3091
CNTV2DriverInterface::GetNumericParam
virtual bool GetNumericParam(const ULWord inParamID, ULWord &outValue)
Definition: ntv2driverinterface.cpp:1789
CNTV2Card
I interrogate and control an AJA video/audio capture/playout device.
Definition: ntv2card.h:28
DEVICE_ID_KONA5_8K_MV_TX
@ DEVICE_ID_KONA5_8K_MV_TX
See KONA 5.
Definition: ntv2enums.h:51
CNTV2Card::CanWarmBootFPGA
virtual bool CanWarmBootFPGA(bool &outCanWarmBoot)
Answers whether or not the FPGA can be reloaded without powering off.
Definition: ntv2card.cpp:365
AUTOCIRCULATE_STATUS::IsStopped
bool IsStopped(void) const
Definition: ntv2publicinterface.h:7555
DEVICE_ID_KONALHEPLUS
@ DEVICE_ID_KONALHEPLUS
See KONA LHe Plus.
Definition: ntv2enums.h:75
NTV2WidgetID
NTV2WidgetID
Definition: ntv2enums.h:2905
DEVICE_ID_KONA5_OE1
@ DEVICE_ID_KONA5_OE1
See KONA 5.
Definition: ntv2enums.h:54
NTV2BitfileType
NTV2BitfileType
Definition: ntv2enums.h:3356
DEVICE_ID_INVALID
@ DEVICE_ID_INVALID
Definition: ntv2enums.h:96
NTV2ChannelSet
std::set< NTV2Channel > NTV2ChannelSet
A set of distinct NTV2Channel values.
Definition: ntv2publicinterface.h:3938
AUTOCIRCULATE_STATUS::GetEndFrame
uint16_t GetEndFrame(void) const
Definition: ntv2publicinterface.h:7530
kNTV2EnumsID_WidgetID
@ kNTV2EnumsID_WidgetID
Identifies the NTV2AudioWidgetID enumerated type.
Definition: ntv2devicefeatures.h:254
CNTV2SignalRouter::WidgetIDFromTypeAndChannel
static NTV2WidgetID WidgetIDFromTypeAndChannel(const NTV2WidgetType inWidgetType, const NTV2Channel inChannel)
Definition: ntv2signalrouter.cpp:551
CNTV2DriverInterface::GetNumSupported
virtual ULWord GetNumSupported(const NTV2NumericParamID inParamID)
Definition: ntv2driverinterface.h:428
CNTV2Card::GetMode
virtual bool GetMode(const NTV2Channel inChannel, NTV2Mode &outValue)
Answers with the current NTV2Mode of the given FrameStore on the AJA device.
Definition: ntv2register.cpp:1643
NTV2_BreakoutCableXLR
@ NTV2_BreakoutCableXLR
Identifies the AES/EBU audio breakout cable that has XLR connectors.
Definition: ntv2enums.h:3094
NTV2DSKMode
NTV2DSKMode
Definition: ntv2enums.h:3484
AJA_NULL
#define AJA_NULL
Definition: ajatypes.h:220
NTV2_IS_VALID_CHANNEL
#define NTV2_IS_VALID_CHANNEL(__x__)
Definition: ntv2enums.h:1367
CNTV2Card::GetDriverVersionString
virtual std::string GetDriverVersionString(void)
Answers with this device's driver's version as a human-readable string.
Definition: ntv2card.cpp:160
CNTV2Card::GetBreakoutHardware
virtual NTV2BreakoutType GetBreakoutHardware(void)
Definition: ntv2card.cpp:380
BITFILE_INFO_STRUCT::numBytes
ULWord numBytes
Definition: ntv2publicinterface.h:4987
SDRAMAuditor::AssessDevice
bool AssessDevice(CNTV2Card &inDevice, const bool inIgnoreStoppedAudioBuffers=(0))
Assesses the given device.
Definition: ntv2card.cpp:607
kDeviceGetNumHDMIVideoInputs
@ kDeviceGetNumHDMIVideoInputs
The number of HDMI video inputs on the device.
Definition: ntv2devicefeatures.h:203
NTV2InputSource
NTV2InputSource
Identifies a specific video input source.
Definition: ntv2enums.h:1258
DEVICE_ID_IOIP_2110
@ DEVICE_ID_IOIP_2110
See Io IP.
Definition: ntv2enums.h:39
kRegStatus
@ kRegStatus
Definition: ntv2publicinterface.h:142
DEVICE_ID_KONA5_3DLUT
@ DEVICE_ID_KONA5_3DLUT
See KONA 5.
Definition: ntv2enums.h:53
CNTV2Card::DeviceCanDoVideoFormat
virtual bool DeviceCanDoVideoFormat(const NTV2VideoFormat inVF)
Definition: ntv2card.cpp:562
CNTV2Card::GetFrameGeometry
virtual bool GetFrameGeometry(NTV2FrameGeometry &outValue, NTV2Channel inChannel=NTV2_CHANNEL1)
Definition: ntv2register.cpp:970
kRegCPLDVersion
@ kRegCPLDVersion
Definition: ntv2publicinterface.h:184
CNTV2Card::GetLPExternalConfigurationURLString
virtual bool GetLPExternalConfigurationURLString(std::string &outURLString)
Definition: ntv2card.cpp:435
CNTV2Card::GetSFPConfigurationURLStrings
virtual int GetSFPConfigurationURLStrings(std::vector< std::string > &sfpURLStrings)
Definition: ntv2card.cpp:487
SDRAMAuditor::GetRegions
bool GetRegions(ULWordSequence &outFree, ULWordSequence &outUsed, ULWordSequence &outBad) const
Answers with the lists of free, in-use and conflicting 8MB memory blocks. Each ULWord represents a re...
Definition: ntv2card.cpp:677
SDRAMAuditor::TranslateRegions
bool TranslateRegions(ULWordSequence &outRgns, const ULWordSequence &inRgns, const bool inIsQuad, const bool inIsQuadQuad) const
Translates an 8MB-chunked list of regions into another list of regions with frame indexes and sizes e...
Definition: ntv2card.cpp:759
kRegAud1Control
@ kRegAud1Control
Definition: ntv2publicinterface.h:145
kNTV2EnumsID_DSKMode
@ kNTV2EnumsID_DSKMode
Identifies the NTV2DSKMode enumerated type.
Definition: ntv2devicefeatures.h:256
DEC
#define DEC(__x__)
Definition: ntv2publicinterface.h:5769
kRegLPTunnelIP
@ kRegLPTunnelIP
Definition: ntv2publicinterface.h:1108
common.h
Private include file for all ajabase sources.
CNTV2Card::~CNTV2Card
virtual ~CNTV2Card()
My destructor.
Definition: ntv2card.cpp:57
NTV2DriverVersionDecode_Minor
#define NTV2DriverVersionDecode_Minor(__vers__)
Definition: ntv2publicinterface.h:5555
kK2RegMaskKBoxDetect
@ kK2RegMaskKBoxDetect
Definition: ntv2publicinterface.h:1387
DEVICE_ID_IO4KPLUS
@ DEVICE_ID_IO4KPLUS
See Io 4K Plus.
Definition: ntv2enums.h:35
NTV2_FRAMESIZE_8MB
@ NTV2_FRAMESIZE_8MB
Definition: ntv2enums.h:2116
CNTV2Card::DeviceCanDoDSKMode
virtual bool DeviceCanDoDSKMode(const NTV2DSKMode inDSKM)
Definition: ntv2card.cpp:583
std
Definition: json.hpp:5362
NTV2DeviceCanDoFormat
bool NTV2DeviceCanDoFormat(const NTV2DeviceID inDevID, const NTV2FrameRate inFR, const NTV2FrameGeometry inFG, const NTV2Standard inStd)
Definition: ntv2utils.cpp:4158
ULWordSequence
std::vector< uint32_t > ULWordSequence
An ordered sequence of ULWord (uint32_t) values.
Definition: ntv2publicinterface.h:46
kDeviceHasBreakoutBoard
@ kDeviceHasBreakoutBoard
True if device has attached breakout board. (New in SDK 17.0)
Definition: ntv2devicefeatures.h:145
DEVICE_ID_KONA4
@ DEVICE_ID_KONA4
See KONA 4 (Quad Mode).
Definition: ntv2enums.h:46
AUTOCIRCULATE_STATUS::GetStartFrame
uint16_t GetStartFrame(void) const
Definition: ntv2publicinterface.h:7525
NTV2VideoFormat
enum _NTV2VideoFormat NTV2VideoFormat
Identifies a particular video format.
kDeviceHasMicrophoneInput
@ kDeviceHasMicrophoneInput
True if device has a microphone input connector.
Definition: ntv2devicefeatures.h:143
SDRAMAuditor::TagVideoFrames
bool TagVideoFrames(CNTV2Card &inDevice)
Definition: ntv2card.cpp:801
CNTV2DriverInterface::GetDescription
virtual std::string GetDescription(void) const
Definition: ntv2driverinterface.cpp:1194
NTV2FrameGeometry
NTV2FrameGeometry
Identifies a particular video frame geometry.
Definition: ntv2enums.h:344
CNTV2Card::IsChannelEnabled
virtual bool IsChannelEnabled(const NTV2Channel inChannel, bool &outEnabled)
Answers whether or not the given FrameStore is enabled.
Definition: ntv2register.cpp:2185
NTV2ConversionMode
NTV2ConversionMode
Definition: ntv2enums.h:3699
DeviceCapabilities::CanDoWidget
bool CanDoWidget(const NTV2WidgetID inWgtID)
Definition: ntv2devicecapabilities.h:264
CNTV2DriverInterface::GetFrameBufferSize
virtual ULWord GetFrameBufferSize(void) const
Definition: ntv2driverinterface.h:379
CNTV2Card::CNTV2Card
CNTV2Card()
My default constructor.
Definition: ntv2card.cpp:21
SDRAMAuditor::CoalesceRegions
static ULWordSet CoalesceRegions(const ULWordSequence &inRgn1, const ULWordSequence &inRgn2, const ULWordSequence &inRgn3)
Definition: ntv2card.cpp:637
kRegReserved55
@ kRegReserved55
Definition: ntv2publicinterface.h:176
CNTV2DriverInterface::GetDeviceID
virtual NTV2DeviceID GetDeviceID(void)
Definition: ntv2driverinterface.cpp:420
CNTV2Card::GetDriverVersionComponents
virtual bool GetDriverVersionComponents(UWord &outMajor, UWord &outMinor, UWord &outPoint, UWord &outBuild)
Answers with the individual version components of this device's driver.
Definition: ntv2card.cpp:182
CNTV2Card::IsMultiRasterWidgetChannel
virtual bool IsMultiRasterWidgetChannel(const NTV2Channel inChannel)
Definition: ntv2register.cpp:4776
CNTV2DriverInterface::ConnectParams
virtual NTV2Dictionary ConnectParams(void) const
Definition: ntv2driverinterface.cpp:1219
NTV2_BreakoutBoard
@ NTV2_BreakoutBoard
Definition: ntv2enums.h:3102
CNTV2Card::IsBufferSizeSetBySW
virtual bool IsBufferSizeSetBySW(void)
Definition: ntv2register.cpp:1696
CNTV2Card::GetFPGAVersionString
virtual std::string GetFPGAVersionString(const NTV2XilinxFPGA inFPGA=eFPGAVideoProc)
Definition: ntv2card.cpp:107
kDeviceGetActiveMemorySize
@ kDeviceGetActiveMemorySize
The size, in bytes, of the device's active RAM available for video and audio.
Definition: ntv2devicefeatures.h:174
NTV2_MODE_INVALID
@ NTV2_MODE_INVALID
The invalid mode.
Definition: ntv2enums.h:1241
NTV2DeviceGetNum25GSFPs
UWord NTV2DeviceGetNum25GSFPs(const NTV2DeviceID inDeviceID)
Definition: ntv2devicefeatures.hpp:10025
DEVICE_ID_KONA3GQUAD
@ DEVICE_ID_KONA3GQUAD
See KONA 3G (Quad Mode).
Definition: ntv2enums.h:45
kDeviceCanReportFailSafeLoaded
@ kDeviceCanReportFailSafeLoaded
True if device can report if its "fail-safe" firmware is loaded/running.
Definition: ntv2devicefeatures.h:132
NTV2DriverVersionDecode_Build
#define NTV2DriverVersionDecode_Build(__vers__)
Definition: ntv2publicinterface.h:5557
NTV2BitfileTypeToString
std::string NTV2BitfileTypeToString(const NTV2BitfileType inValue, const bool inCompactDisplay=false)
Definition: ntv2utils.cpp:7910
NTV2_IS_INPUT_MODE
#define NTV2_IS_INPUT_MODE(__mode__)
Definition: ntv2enums.h:1245
CNTV2Card::GetSerialNumberLow
virtual ULWord GetSerialNumberLow(void)
Definition: ntv2card.cpp:200
kVRegDriverVersion
@ kVRegDriverVersion
Packed driver version – use NTV2DriverVersionEncode, NTV2DriverVersionDecode* macros to encode/decode...
Definition: ntv2virtualregisters.h:29
BIT
#define BIT(_x_)
Definition: ajatypes.h:585
NTV2AudioSystem
NTV2AudioSystem
Used to identify an Audio System on an NTV2 device. See Audio System Operation for more information.
Definition: ntv2enums.h:3880
DEVICE_ID_IOIP_2110_RGB12
@ DEVICE_ID_IOIP_2110_RGB12
See Io IP.
Definition: ntv2enums.h:40
DEVICE_ID_KONA5_2X4K
@ DEVICE_ID_KONA5_2X4K
See KONA 5.
Definition: ntv2enums.h:52
CNTV2DriverInterface
I'm the base class that undergirds the platform-specific derived classes (from which CNTV2Card is ult...
Definition: ntv2driverinterface.h:60
NTV2Dictionary::valueForKey
std::string valueForKey(const std::string &inKey) const
Definition: ntv2nubaccess.cpp:112
NTV2Dictionary
A simple (not thread-safe) set of key/value pairs. (New in SDK 16.3)
Definition: ntv2nubaccess.h:104
CNTV2Card::GetAudioMemoryOffset
virtual bool GetAudioMemoryOffset(const ULWord inOffsetBytes, ULWord &outAbsByteOffset, const NTV2AudioSystem inAudioSystem, const bool inCaptureBuffer=(0))
Answers with the byte offset in device SDRAM into the specified Audio System's audio buffer.
Definition: ntv2audio.cpp:1783
CNTV2DriverInterface::Open
virtual bool Open(const UWord inDeviceIndex)
Opens a local/physical AJA device so it can be monitored/controlled.
Definition: ntv2driverinterface.cpp:131
DEVICE_ID_IO4K
@ DEVICE_ID_IO4K
See Io 4K (Quad Mode).
Definition: ntv2enums.h:34
AJA_SystemInfoSection_System
@ AJA_SystemInfoSection_System
Definition: info.h:64
eFPGAVideoProc
@ eFPGAVideoProc
Definition: ntv2enums.h:3833
CNTV2DriverInterface::DriverGetBitFileInformation
virtual bool DriverGetBitFileInformation(BITFILE_INFO_STRUCT &outBitFileInfo, const NTV2BitFileType inBitFileType=NTV2_VideoProcBitFile)
Answers with the currently-installed bitfile information.
Definition: ntv2driverinterface.cpp:632
DEVICE_ID_KONALHI
@ DEVICE_ID_KONALHI
See KONA LHi.
Definition: ntv2enums.h:76
BITFILE_INFO_STRUCT
Definition: ntv2publicinterface.h:4982
CNTV2Card::DeviceGetAudioFrameBuffer2
virtual ULWord DeviceGetAudioFrameBuffer2(void)
Definition: ntv2card.cpp:537
SerialNum64ToString
std::string SerialNum64ToString(const uint64_t &inSerNum)
Definition: ntv2utils.cpp:8223
CNTV2Card::GetPCIFPGAVersion
virtual Word GetPCIFPGAVersion(void)
Definition: ntv2card.cpp:122
CNTV2DriverInterface::Close
virtual bool Close(void)
Closes me, releasing host resources that may have been allocated in a previous Open call.
Definition: ntv2driverinterface.cpp:236
CNTV2Card::GetLPTunnelConfigurationURLString
virtual bool GetLPTunnelConfigurationURLString(std::string &outURLString)
Definition: ntv2card.cpp:461
CNTV2DriverInterface::GetSupportedItems
virtual ULWordSet GetSupportedItems(const NTV2EnumsID inEnumsID)
Definition: ntv2driverinterface.cpp:1467
kNTV2EnumsID_PixelFormat
@ kNTV2EnumsID_PixelFormat
Identifies the NTV2PixelFormat enumerated type.
Definition: ntv2devicefeatures.h:242
NTV2DeviceHasLPProductCode
bool NTV2DeviceHasLPProductCode(const NTV2DeviceID inDeviceID)
Definition: ntv2devicefeatures.hpp:7409
AJASystemInfo
Definition: info.h:80
NTV2DeviceGetAudioFrameBuffer
ULWord NTV2DeviceGetAudioFrameBuffer(NTV2DeviceID boardID, NTV2FrameGeometry frameGeometry, NTV2FrameBufferFormat frameFormat)
Definition: ntv2devicefeatures.cpp:657