AJA NTV2 SDK  18.0.0.2122
NTV2 SDK 18.0.0.2122
ntv2supportlogger.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
7 #include "ntv2supportlogger.h"
8 #include "ntv2devicescanner.h"
9 #include "ntv2devicefeatures.h"
10 #include "ntv2konaflashprogram.h"
11 #include "ntv2registerexpert.h"
12 #include "ntv2registersmb.h"
13 #include "ntv2rp188.h"
14 #include "ajabase/common/common.h"
15 #include "ajabase/persistence/persistence.h"
16 #include "ajabase/system/info.h"
17 #include <algorithm>
18 #include <sstream>
19 #include <vector>
20 #include <iterator>
21 
22 #if defined(MSWindows)
23  #define PATH_DELIMITER "\\"
24 #else
25  #define PATH_DELIMITER "/"
26 #endif
27 
28 using namespace std;
29 
30 
31 typedef map <NTV2Channel, AUTOCIRCULATE_STATUS> ChannelToACStatus;
32 typedef ChannelToACStatus::const_iterator ChannelToACStatusConstIter;
33 typedef pair <NTV2Channel, AUTOCIRCULATE_STATUS> ChannelToACStatusPair;
34 typedef map <uint16_t, NTV2TimeCodeList> FrameToTCList;
35 typedef FrameToTCList::const_iterator FrameToTCListConstIter;
36 typedef pair <uint16_t, NTV2TimeCodeList> FrameToTCListPair;
37 typedef map <NTV2Channel, FrameToTCList> ChannelToPerFrameTCList;
38 typedef ChannelToPerFrameTCList::const_iterator ChannelToPerFrameTCListConstIter;
39 typedef pair <NTV2Channel, FrameToTCList> ChannelToPerFrameTCListPair;
40 
41 
42 static string makeHeader(ostringstream & oss, const string & inName)
43 {
44  oss << setfill('=') << setw(96) << " " << inName << ":" << setfill(' ') << endl << endl;
45  return oss.str();
46 }
47 
48 static string timecodeToString (const NTV2_RP188 & inRP188)
49 {
50  ostringstream oss;
51  if (inRP188.IsValid())
52  {
53  const CRP188 foo(inRP188);
54  oss << foo;
55  }
56  else
57  oss << "---";
58  return oss.str();
59 }
60 
61 static string appSignatureToString (const ULWord inAppSignature)
62 {
63  ostringstream oss;
64  const string sigStr(NTV2_4CC_AS_STRING(inAppSignature));
65  if (isprint(sigStr.at(0)) && isprint(sigStr.at(1)) && isprint(sigStr.at(2)) && isprint(sigStr.at(3)))
66  oss << "'" << sigStr << "'";
67  else if (inAppSignature)
68  oss << "0x" << hex << setw (8) << setfill ('0') << inAppSignature << dec << " (" << inAppSignature << ")";
69  else
70  oss << "'----' (0)";
71  return oss.str();
72 }
73 
74 static string pidToString (const uint32_t inPID)
75 {
76  ostringstream oss;
77  #if defined (MSWindows)
78  oss << inPID;
79  //TCHAR filename [MAX_PATH];
80  //HANDLE processHandle (OpenProcess (PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, inPID));
81  //if (processHandle)
82  //{
83  // if (GetModuleFileNameEx (processHandle, NULL, filename, MAX_PATH))
84  // oss << " (" << filename << ")";
85  // CloseHandle (processHandle);
86  //}
87  #elif defined (AJALinux)
88  oss << inPID;
89  #elif defined (AJAMac)
90  oss << inPID;
91  // char pathbuf [PROC_PIDPATHINFO_MAXSIZE];
92  // const int rc (::proc_pidpath (pid_t (inPID), pathbuf, sizeof (pathbuf)));
93  // if (rc == 0 && ::strlen (pathbuf))
94  // oss << " (" << string (pathbuf) << ")";
95  #else
96  oss << inPID;
97  #endif
98  return oss.str();
99 }
100 
101 // NTV2_AUDIO_BUFFER_SIZE_8MB 8MB buffer: 16-ch: 130,560 samples 8-ch: 261,120 samples 6-ch: 348,160 samples
102 // NTV2_AUDIO_BUFFER_SIZE_4MB 4MB buffer: 0x00400000(4,194,304 bytes) - 0x00004000(16,384 bytes) = 0x003FC000(4,177,920 bytes) 16-ch: 65,280 samples 8-ch: 130,560 samples 6-ch: 174,080 samples
103 // NTV2_AUDIO_BUFFER_SIZE_2MB 2MB buffer: 16-ch: 32,640 samples 8-ch: 65,280 samples 6-ch: 87,040 samples
104 // NTV2_AUDIO_BUFFER_SIZE_1MB 1MB buffer: 16-ch: 16,320 samples 8-ch: 32,640 samples 6-ch: 43,520 samples
105 // Returns the maximum number of samples for a given NTV2AudioBufferSize and maximum audio channel count...
106 static uint32_t maxSampleCountForNTV2AudioBufferSize (const NTV2AudioBufferSize inBufferSize, const uint16_t inChannelCount)
107 { // NTV2_AUDIO_BUFFER_SIZE_1MB NTV2_AUDIO_BUFFER_SIZE_4MB NTV2_AUDIO_BUFFER_SIZE_2MB NTV2_AUDIO_BUFFER_SIZE_8MB NTV2_AUDIO_BUFFER_INVALID
108  static uint32_t gMaxSampleCount16 [] = { 16320, 65280, 32640, 130560, 0 };
109  static uint32_t gMaxSampleCount8 [] = { 32640, 130560, 65280, 261120, 0 };
110  static uint32_t gMaxSampleCount6 [] = { 87040, 174080, 87040, 348160, 0 };
111  if (NTV2_IS_VALID_AUDIO_BUFFER_SIZE (inBufferSize))
112  switch (inChannelCount)
113  {
114  case 16: return gMaxSampleCount16 [inBufferSize];
115  case 8: return gMaxSampleCount8 [inBufferSize];
116  case 6: return gMaxSampleCount6 [inBufferSize];
117  default: break;
118  }
119  return 0;
120 }
121 
122 static NTV2VideoFormat getVideoFormat (CNTV2Card & device, const NTV2Channel inChannel)
123 {
125  device.GetVideoFormat(result, inChannel);
126  return result;
127 }
128 
129 static NTV2PixelFormat getPixelFormat (CNTV2Card & device, const NTV2Channel inChannel)
130 {
132  device.GetFrameBufferFormat(inChannel, result);
133  return result;
134 }
135 
136 static NTV2Mode getMode (CNTV2Card & device, const NTV2Channel inChannel)
137 {
138  NTV2Mode result(NTV2_MODE_INVALID);
139  device.GetMode(inChannel, result);
140  return result;
141 }
142 
143 static bool isEnabled (CNTV2Card & device, const NTV2Channel inChannel)
144 {
145  bool result(false);
146  device.IsChannelEnabled(inChannel, result);
147  return result;
148 }
149 
150 static ULWord getActiveFrame (CNTV2Card & device, const NTV2Channel inChannel)
151 {
152  ULWord frameNum(0);
153  if (NTV2_IS_INPUT_MODE(::getMode(device, inChannel)))
154  device.GetInputFrame(inChannel, frameNum);
155  else
156  device.GetOutputFrame(inChannel, frameNum);
157  return frameNum;
158 }
159 
160 static string getActiveFrameStr (CNTV2Card & device, const NTV2Channel inChannel)
161 {
162  if (!isEnabled(device, inChannel))
163  return "---";
164  ostringstream oss;
165  oss << DEC(::getActiveFrame(device, inChannel));
166  return oss.str();
167 }
168 
170 {
171  ULWord result(0);
172  if (NTV2_IS_OUTPUT_MODE (mode))
173  device.ReadAudioLastOut (result, audioSystem); // read head
174  else
175  device.ReadAudioLastIn (result, audioSystem); // write head
176  return result;
177 }
178 
179 static ULWord getNumAudioChannels (CNTV2Card & device, NTV2AudioSystem audioSystem)
180 {
181  ULWord numChannels = 1;
182  device.GetNumberAudioChannels(numChannels, audioSystem);
183  return numChannels;
184 }
185 
186 static ULWord bytesToSamples (CNTV2Card & device, NTV2AudioSystem audioSystem, const ULWord inBytes)
187 {
188  return inBytes / sizeof (uint32_t) / getNumAudioChannels(device, audioSystem);
189 }
190 
192 {
193  ULWord bytes = readCurrentAudioPosition(device, audioSystem, mode);
194  return bytesToSamples(device, audioSystem, bytes);
195 }
196 
197 static ULWord getMaxNumSamples (CNTV2Card & device, NTV2AudioSystem audioSystem)
198 {
199  NTV2AudioBufferSize bufferSize;
200  device.GetAudioBufferSize(bufferSize, audioSystem);
201 
202  return maxSampleCountForNTV2AudioBufferSize (bufferSize, uint16_t(getNumAudioChannels(device, audioSystem)));
203 }
204 
206 {
207  for (UWord chan (0); chan < ::NTV2DeviceGetNumVideoChannels (device.GetDeviceID()); chan++)
208  if (device.AutoCirculateGetStatus (NTV2Channel(chan), outStatus))
209  if (!outStatus.IsStopped())
210  if (outStatus.GetAudioSystem() == audioSystem)
211  {
213  device.GetMode(NTV2Channel(chan), mode);
214  if ((outStatus.IsInput() && NTV2_IS_INPUT_MODE (mode))
215  || (outStatus.IsOutput() && NTV2_IS_OUTPUT_MODE (mode)))
216  return NTV2Channel(chan);
217  }
218  return NTV2_CHANNEL_INVALID;
219 }
220 
221 static bool detectInputChannelPairs (CNTV2Card & device, const NTV2AudioSource inAudioSource,
222  const NTV2EmbeddedAudioInput inEmbeddedSource,
223  NTV2AudioChannelPairs & outChannelPairsPresent)
224 {
225  outChannelPairsPresent.clear();
226  switch (inAudioSource)
227  {
228  default: return false;
229 
230  case NTV2_AUDIO_EMBEDDED: return NTV2_IS_VALID_EMBEDDED_AUDIO_INPUT (inEmbeddedSource)
231  // Input detection is based on the audio de-embedder (as opposed to the SDI spigot)...
232  ? device.GetDetectedAudioChannelPairs (NTV2AudioSystem(inEmbeddedSource), outChannelPairsPresent)
233  : false;
234 
235  case NTV2_AUDIO_AES: return device.GetDetectedAESChannelPairs (outChannelPairsPresent);
236 
239  {outChannelPairsPresent.insert(NTV2_AudioChannel1_2); return true;} // Assume chls 1&2 if an analog signal present
240  break;
241 
243  {
245  if (!device.GetHDMIInputAudioChannels (hdmiChls))
246  return false;
249  chPair = NTV2AudioChannelPair(chPair + 1))
250  outChannelPairsPresent.insert (chPair);
251  return true;
252  }
253  break;
254  }
255  return false;
256 }
257 
258 static bool getBitfileDate (CNTV2Card & device, string & outDateString, NTV2XilinxFPGA whichFPGA)
259 {
260  BITFILE_INFO_STRUCT bitFileInfo;
261  memset(&bitFileInfo, 0, sizeof(BITFILE_INFO_STRUCT));
262  bitFileInfo.whichFPGA = whichFPGA;
263  bool bBitFileInfoAvailable = false; // BitFileInfo is implemented only on 5.2 and later drivers.
264  bBitFileInfoAvailable = device.DriverGetBitFileInformation(bitFileInfo);
265  if( bBitFileInfoAvailable )
266  {
267  outDateString = bitFileInfo.designNameStr;
268  if (outDateString.find(".ncd") != string::npos)
269  {
270  outDateString = outDateString.substr(0, outDateString.find(".ncd"));
271  outDateString += ".bit ";
272  outDateString += bitFileInfo.dateStr;
273  outDateString += " ";
274  outDateString += bitFileInfo.timeStr;
275  }
276  else if (outDateString.find(";") != string::npos)
277  {
278  outDateString = outDateString.substr(0, outDateString.find(";"));
279  outDateString += ".bit ";
280  outDateString += bitFileInfo.dateStr;
281  outDateString += " ";
282  outDateString += bitFileInfo.timeStr;
283  }
284  else if (outDateString.find(".bit") != string::npos && outDateString != ".bit")
285  {
286  outDateString = bitFileInfo.designNameStr;
287  outDateString += " ";
288  outDateString += bitFileInfo.dateStr;
289  outDateString += " ";
290  outDateString += bitFileInfo.timeStr;
291  }
292  else
293  {
294  outDateString = "bad bitfile date string";
295  return false;
296  }
297  }
298  else
299  return false;
300  return true;
301 }
302 
303 AJAExport ostream & operator << (ostream & outStream, const CNTV2SupportLogger & inData)
304 {
305  outStream << inData.ToString();
306  return outStream;
307 }
308 
310  : mDevice (card),
311  mDispose (false),
312  mSections (sections)
313 {
314 }
315 
317  : mDevice (*(new CNTV2Card(cardIndex))),
318  mDispose (true),
319  mSections (sections)
320 {
321 }
322 
324 {
325  if (mDispose)
326  delete &mDevice;
327 }
328 
330 {
331  // Bump this whenever the formatting of the support log changes drastically
332  return 2;
333 }
334 
335 void CNTV2SupportLogger::PrependToSection (uint32_t section, const string & sectionData)
336 {
337  if (mPrependMap.find(section) != mPrependMap.end())
338  {
339  mPrependMap.at(section).insert(0, "\n");
340  mPrependMap.at(section).insert(0, sectionData);
341  }
342  else
343  {
344  mPrependMap[section] = sectionData;
345  mPrependMap.at(section).append("\n");
346  }
347 }
348 
349 void CNTV2SupportLogger::AppendToSection (uint32_t section, const string & sectionData)
350 {
351  if (mAppendMap.find(section) != mAppendMap.end())
352  {
353  mAppendMap.at(section).append("\n");
354  mAppendMap.at(section).append(sectionData);
355  }
356  else
357  {
358  mAppendMap[section] = "\n";
359  mAppendMap.at(section).append(sectionData);
360  }
361 }
362 
363 void CNTV2SupportLogger::AddHeader (const string & sectionName, const string & sectionData)
364 {
365  ostringstream oss;
366  makeHeader(oss, sectionName);
367  oss << sectionData << "\n";
368  mHeaderStr.append(oss.str());
369 }
370 
371 void CNTV2SupportLogger::AddFooter (const string & sectionName, const string & sectionData)
372 {
373  ostringstream oss;
374  makeHeader(oss, sectionName);
375  oss << sectionData << "\n";
376  mFooterStr.append(oss.str());
377 }
378 
379 // Use this macro to handle generating text for each section
380 // - the header
381 // - the prepend if any
382 // - the method that fills the section
383 // - the append if any
384 #define LoggerSectionToFunctionMacro(_SectionEnum_, _SectionString_, _SectionMethod_) \
385  if (mSections & _SectionEnum_) \
386  { \
387  makeHeader(oss, _SectionString_); \
388  if (mPrependMap.find(_SectionEnum_) != mPrependMap.end()) \
389  oss << mPrependMap.at(_SectionEnum_); \
390  \
391  _SectionMethod_(oss); \
392  \
393  if (mAppendMap.find(_SectionEnum_) != mAppendMap.end()) \
394  oss << mAppendMap.at(_SectionEnum_); \
395  }
396 
397 string CNTV2SupportLogger::ToString (void) const
398 {
399  ostringstream oss;
400  vector<char> dateBufferLocal(128, 0);
401  vector<char> dateBufferUTC(128, 0);
402 
403  // get the wall time and format it
404  time_t now = time(AJA_NULL);
405  struct tm *localTimeinfo;
406  localTimeinfo = localtime(reinterpret_cast<const time_t*>(&now));
407  strcpy(&dateBufferLocal[0], "");
408  if (localTimeinfo)
409  ::strftime(&dateBufferLocal[0], dateBufferLocal.size(), "%B %d, %Y %I:%M:%S %p %Z (local)", localTimeinfo);
410 
411  struct tm *utcTimeinfo;
412  utcTimeinfo = gmtime(reinterpret_cast<const time_t*>(&now));
413  strcpy(&dateBufferUTC[0], "");
414  if (utcTimeinfo)
415  ::strftime(&dateBufferUTC[0], dateBufferUTC.size(), "%Y-%m-%dT%H:%M:%SZ UTC", utcTimeinfo);
416 
417  oss << "Begin NTV2 Support Log" << "\n" <<
418  "Version: " << CNTV2SupportLogger::Version() << "\n"
419  "Generated: " << &dateBufferLocal[0] <<
420  " " << &dateBufferUTC[0] << "\n\n" << flush;
421 
422  if (!mHeaderStr.empty())
423  oss << mHeaderStr;
424 
425  // Go ahead and show info even if the device is not open
427 
428  if (mDevice.IsOpen())
429  {
430  LoggerSectionToFunctionMacro(NTV2_SupportLoggerSectionAutoCirculate, "AutoCirculate", FetchAutoCirculateLog)
434  }
435 
436  if (!mFooterStr.empty())
437  oss << mFooterStr;
438  oss << endl << "End NTV2 Support Log";
439  return oss.str();
440 }
441 
442 void CNTV2SupportLogger::ToString (string & outString) const
443 {
444  outString = ToString();
445 }
446 
447 static inline string HEX0NStr (const uint32_t inNum, const uint16_t inWidth) {ostringstream oss; oss << HEX0N(inNum,inWidth); return oss.str();}
448 static inline string xHEX0NStr(const uint32_t inNum, const uint16_t inWidth) {ostringstream oss; oss << xHEX0N(inNum,inWidth); return oss.str();}
449 template <typename T> string DECStr (const T inT) {ostringstream oss; oss << DEC(inT); return oss.str();}
450 
451 void CNTV2SupportLogger::FetchInfoLog (ostringstream & oss) const
452 {
453  string str;
454  AJALabelValuePairs infoTable;
455  AJASystemInfo::append(infoTable, "SDK/DRIVER INFO", "");
456  AJASystemInfo::append(infoTable, "NTV2 SDK Version", ::NTV2GetVersionString(true));
457  AJASystemInfo::append(infoTable, "supportlog Built", string(__DATE__ " at " __TIME__));
458  if (mDevice.IsOpen())
459  {
460  AJASystemInfo::append(infoTable, "Driver Version", mDevice.GetDriverVersionString());
461  #if defined(AJAMac)
462  ULWord drvrType(0), dextType(0x44455854); // 'DEXT'
463  mDevice.ReadRegister(kVRegDriverType, drvrType);
464  if (!drvrType)
465  str = "Kernel Extension ('KEXT')";
466  else if (drvrType == dextType)
467  str = "DriverKit ('DEXT')";
468  else
469  { ostringstream oss;
470  oss << "(Unknown/Invalid " << xHEX0N(drvrType,8) << ")";
471  str = oss.str();
472  }
473  AJASystemInfo::append(infoTable, "Driver Type", str);
474  #endif // defined(AJAMac)
475  }
476  AJASystemInfo::append(infoTable, "Watcher Nub Protocol Version", "Built-in RPC support");
477 
478  if (mDevice.IsOpen())
479  {
480  AJASystemInfo::append(infoTable, "DEVICE INFO", "");
481  AJASystemInfo::append(infoTable, "Device", mDevice.GetDisplayName());
482  str = xHEX0NStr(mDevice.GetDeviceID(),8) + " (" + string(::NTV2DeviceIDString(mDevice.GetDeviceID())) + ")";
483  AJASystemInfo::append(infoTable, "Device ID", str);
484  AJASystemInfo::append(infoTable, "Serial Number", (mDevice.GetSerialNumberString(str) ? str : "Not programmed"));
485  AJASystemInfo::append(infoTable, "Video Bitfile", (getBitfileDate(mDevice, str, eFPGAVideoProc) ? str : "Not available"));
486  AJASystemInfo::append(infoTable, "PCI FPGA Version", mDevice.GetPCIFPGAVersionString());
487  ULWord numBytes(0);
488  string dateStr, timeStr, connType;
489  if (mDevice.GetInstalledBitfileInfo(numBytes, dateStr, timeStr))
490  {
491  AJASystemInfo::append(infoTable, "Installed Bitfile ByteCount", DECStr(numBytes));
492  AJASystemInfo::append(infoTable, "Installed Bitfile Build Date", dateStr + " " + timeStr);
493  }
494 
495  if (::NTV2DeviceHasLPProductCode(mDevice.GetDeviceID()))
496  {
497  AJASystemInfo::append(infoTable, "URL INFO", "");
498  std::string urlString;
499  bool hasIP = mDevice.GetLPTunnelConfigurationURLString(urlString);
500  AJASystemInfo::append(infoTable, "Tunnel URL", hasIP ? urlString : "No URL");
501  hasIP = mDevice.GetLPExternalConfigurationURLString(urlString);
502  AJASystemInfo::append(infoTable, "External URL", hasIP ? urlString : "No URL");
503  std::vector<std::string> sfpURLStings;
504  int numSFPs = mDevice.GetSFPConfigurationURLStrings(sfpURLStings);
505  for (int i = 0; i < numSFPs; i++)
506  {
507  AJASystemInfo::append(infoTable, "SFP URL", sfpURLStings[i]);
508  }
509  }
510 
511  if (mDevice.features().CanDoIP())
512  {
513  PACKAGE_INFO_STRUCT pkgInfo;
514  if (mDevice.GetPackageInformation(pkgInfo))
515  {
516  AJASystemInfo::append(infoTable, "Package", pkgInfo.packageNumber);
517  AJASystemInfo::append(infoTable, "Build", pkgInfo.buildNumber);
518  AJASystemInfo::append(infoTable, "Build Date", pkgInfo.date);
519  AJASystemInfo::append(infoTable, "Build Time", pkgInfo.time);
520  }
521 
522  CNTV2KonaFlashProgram ntv2Card(mDevice.GetIndexNumber());
523  MacAddr mac1, mac2;
524  if (ntv2Card.ReadMACAddresses(mac1, mac2))
525  {
526  AJASystemInfo::append(infoTable, "MAC1", mac1.AsString());
527  AJASystemInfo::append(infoTable, "MAC2", mac2.AsString());
528  }
529 
530  ULWord cfg(0);
531  mDevice.ReadRegister((kRegSarekFwCfg + SAREK_REGS), cfg);
532  if (cfg & SAREK_2022_2)
533  {
534  ULWord dnaLo(0), dnaHi(0);
535  if (ntv2Card.ReadRegister(kRegSarekDNALow + SAREK_REGS, dnaLo))
536  if (ntv2Card.ReadRegister(kRegSarekDNAHi + SAREK_REGS, dnaHi))
537  AJASystemInfo::append(infoTable, "Device DNA", string(HEX0NStr(dnaHi,8)+HEX0NStr(dnaLo,8)));
538  }
539 
540  string licenseInfo;
541  ntv2Card.ReadLicenseInfo(licenseInfo);
542  AJASystemInfo::append(infoTable, "License", licenseInfo);
543 
544  if (cfg & SAREK_2022_2)
545  {
546  ULWord licenseStatus(0);
547  ntv2Card.ReadRegister(kRegSarekLicenseStatus + SAREK_REGS, licenseStatus);
548  AJASystemInfo::append(infoTable, "License Present", licenseStatus & SAREK_LICENSE_PRESENT ? "Yes" : "No");
549  AJASystemInfo::append(infoTable, "License Status", licenseStatus & SAREK_LICENSE_VALID ? "License is valid" : "License NOT valid");
550  AJASystemInfo::append(infoTable, "License Enable Mask", xHEX0NStr(licenseStatus & 0xff,2));
551  }
552  } // if IsIPDevice
553  if (mDevice.IsRemote())
554  {
555  if (!mDevice.GetHostName().empty())
556  AJASystemInfo::append(infoTable, "Host Name", mDevice.GetHostName());
557  if (!mDevice.GetDescription().empty())
558  AJASystemInfo::append(infoTable, "Device Description", mDevice.GetDescription());
559  } // if remote/fake device
560  #if defined(AJAMac)
561  connType = mDevice.GetConnectionType();
562  if (!connType.empty())
563  AJASystemInfo::append(infoTable, "Driver Connection", connType);
564  #endif // AJAMac
565  } // if IsOpen
566 
567  AJASystemInfo hostInfo;
568 
569  // append the system info from AJASystemInfo
570  AJASystemInfo::append(infoTable, "HOST INFO");
571  hostInfo.GetLabelValuePairs(infoTable, false);
572 
573  // append the health status of the persistence database files
574  std::vector<std::pair<std::string, bool> > persistenceChecks;
575  persistenceChecks.push_back(std::pair<std::string, bool>("User Persistence Health", false));
576  persistenceChecks.push_back(std::pair<std::string, bool>("System Persistence Health", true));
577  std::vector<std::pair<std::string, bool> >::const_iterator it(persistenceChecks.begin());
578  int errCode = 0;
579  std::string errMessage;
580  for (; it != persistenceChecks.end(); ++it)
581  {
582  std::string label(it->first);
583  bool shared(it->second);
584  AJAPersistence p("com.aja.devicesettings", "Unknown", "00000000", shared);
585  if (p.StorageHealthCheck(errCode, errMessage))
586  {
587  AJASystemInfo::append(infoTable, label, "exists and is good");
588  }
589  else
590  {
591  if (shared && errCode == -1)
592  AJASystemInfo::append(infoTable, label, "doesn't exist (this one is optional)");
593  else
594  AJASystemInfo::append(infoTable, label, std::string("err(") + aja::to_string(errCode) + ") '" + errMessage + "'");
595  }
596  }
597 
598  oss << AJASystemInfo::ToString(infoTable) << endl;
599 } // FetchInfoLog
600 
601 
602 void CNTV2SupportLogger::FetchRegisterLog (ostringstream & oss) const
603 {
604  NTV2RegisterReads regs;
605  const NTV2DeviceID deviceID (mDevice.GetDeviceID());
608  static const string sDashes (96, '-');
609 
610  // Dang, GetRegistersForDevice doesn't/can't read kRegCanDoRegister, so add the CanConnectROM regs here...
613  deviceRegs.insert(regNum);
614 
615  oss << endl << deviceRegs.size() << " Device Registers " << sDashes << endl << endl;
616  regs = ::FromRegNumSet (deviceRegs);
617  if (!mDevice.ReadRegisters (regs))
618  oss << "## NOTE: Driver failed to return one or more registers (those will be zero)" << endl;
619  for (NTV2RegisterReadsConstIter it (regs.begin()); it != regs.end(); ++it)
620  {
621  const NTV2RegInfo & regInfo (*it);
622  const uint32_t regNum (regInfo.registerNumber);
623  //const uint32_t offset (regInfo.registerNumber * 4);
624  const uint32_t value (regInfo.registerValue);
625  oss << endl
626  << "Register Name: " << CNTV2RegisterExpert::GetDisplayName(regNum) << endl
627  << "Register Number: " << regNum << endl
628  << "Register Value: " << value << " : " << xHEX0N(value,8) << endl
629  // << "Register Classes: " << CNTV2RegisterExpert::GetRegisterClasses(regNum) << endl
630  << CNTV2RegisterExpert::GetDisplayValue (regNum, value, deviceID) << endl;
631  }
632 
633  regs = ::FromRegNumSet (virtualRegs);
634  oss << endl << virtualRegs.size() << " Virtual Registers " << sDashes << endl << endl;
635  if (!mDevice.ReadRegisters (regs))
636  oss << "## NOTE: Driver failed to return one or more virtual registers (those will be zero)" << endl;
637  for (NTV2RegisterReadsConstIter it (regs.begin()); it != regs.end(); ++it)
638  {
639  const NTV2RegInfo & regInfo (*it);
640  const uint32_t regNum (regInfo.registerNumber);
641  //const uint32_t offset (regInfo.registerNumber * 4);
642  const uint32_t value (regInfo.registerValue);
643  oss << endl
644  << "VReg Name: " << CNTV2RegisterExpert::GetDisplayName(regNum) << endl
645  << "VReg Number: " << setw(10) << regNum << endl
646  << "VReg Value: " << value << " : " << xHEX0N(value,8) << endl
647  << CNTV2RegisterExpert::GetDisplayValue (regNum, value, deviceID) << endl;
648  }
649 } // FetchRegisterLog
650 
651 
652 void CNTV2SupportLogger::FetchAutoCirculateLog (ostringstream & oss) const
653 {
654  ULWord appSignature (0);
655  int32_t appPID (0);
656  ChannelToACStatus perChannelStatus; // Per-channel AUTOCIRCULATE_STATUS
657  ChannelToPerFrameTCList perChannelTCs; // Per-channel collection of per-frame TCs
658  NTV2TaskMode taskMode (NTV2_DISABLE_TASKS);
659  const NTV2DeviceID deviceID (mDevice.GetDeviceID());
660  const ULWord numChannels (::NTV2DeviceGetNumVideoChannels(deviceID));
661  static const string dashes (25, '-');
662 
663  // This code block takes a snapshot of the current AutoCirculate state of the device...
664  mDevice.GetTaskMode(taskMode);
666 
667  // Grab A/C status for each channel...
668  for (NTV2Channel chan(NTV2_CHANNEL1); chan < NTV2Channel(numChannels); chan = NTV2Channel(chan+1))
669  {
670  FrameToTCList perFrameTCs;
671  AUTOCIRCULATE_STATUS acStatus;
672  mDevice.AutoCirculateGetStatus (chan, acStatus);
674  mDevice.WaitForInputVerticalInterrupt(chan);
675  else
676  mDevice.WaitForOutputVerticalInterrupt(chan);
677  mDevice.AutoCirculateGetStatus (chan, acStatus);
678  perChannelStatus.insert(ChannelToACStatusPair(chan, acStatus));
679  if (!acStatus.IsStopped())
680  {
681  for (uint16_t frameNum (acStatus.GetStartFrame()); frameNum <= acStatus.GetEndFrame(); frameNum++)
682  {
683  FRAME_STAMP frameStamp;
684  NTV2TimeCodeList timecodes;
685  mDevice.AutoCirculateGetFrameStamp (chan, frameNum, frameStamp);
686  frameStamp.GetInputTimeCodes(timecodes);
687  perFrameTCs.insert(FrameToTCListPair(frameNum, timecodes));
688  } // for each A/C frame
689  perChannelTCs.insert(ChannelToPerFrameTCListPair(chan, perFrameTCs));
690  } // if not stopped
691  } // for each channel
692 
693  bool multiFormatMode(false);
694  if (::NTV2DeviceCanDoMultiFormat(deviceID) && mDevice.GetMultiFormatMode(multiFormatMode))
695  {
696  if (!multiFormatMode)
697  oss << "UniFormat: " << ::NTV2VideoFormatToString(::getVideoFormat(mDevice, NTV2_CHANNEL1)) << endl;
698  else
699  oss << "MultiFormat Mode" << endl;
700  }
701  else
702  oss << "Board Format: " << ::NTV2VideoFormatToString(::getVideoFormat(mDevice, NTV2_CHANNEL1)) << endl;
703 
704  oss << "Task mode: " << ::NTV2TaskModeToString(taskMode) << ", PID=" << pidToString(uint32_t(appPID)) << ", signature=" << appSignatureToString(appSignature) << endl
705  << endl
706  << "Chan/FrameStore State Start End Act FrmProc FrmDrop BufLvl Audio RP188 LTC FBFch FBOch Color VidPr Anc HDMIx Field VidFmt PixFmt" << endl
707  << "-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------" << endl;
708  for (ChannelToACStatusConstIter iter (perChannelStatus.begin()); iter != perChannelStatus.end(); ++iter)
709  {
710  const NTV2Channel chan(iter->first);
711  const AUTOCIRCULATE_STATUS & status(iter->second);
712  // The following should mirror what ntv2watcher/pages/page_autocirculate::fetchSupportLogInfo does...
713  oss << ::NTV2ChannelToString(chan, true) << ": "
714  << (::isEnabled(mDevice,chan) ? NTV2_IS_INPUT_MODE(::getMode(mDevice,chan)) ? "Input " : "Output" : "Off ")
715  << setw(12) << status[0] // State
716  << setw( 7) << status[1] // Start
717  << setw( 6) << status[2] // End
718  << setw( 6) << (status.IsStopped() ? ::getActiveFrameStr(mDevice,chan) : status[4]) // Act
719  << setw(10) << status[9] // FrmProc
720  << setw(10) << status[10] // FrmDrop
721  << setw( 7) << status[11] // BufLvl
722  << setw( 9) << status[12] // Audio
723  << setw( 8) << status[13] // RP188
724  << setw( 8) << status[14] // LTC
725  << setw( 8) << status[15] // FBFchg
726  << setw( 8) << status[16] // FBOchg
727  << setw( 8) << status[17] // ColCor
728  << setw( 8) << status[18] // VidProc
729  << setw( 8) << status[19] // Anc
730  << setw( 8) << status[20] // HDMIAux
731  << setw( 8) << status[21]; // Fld
732  if (!status.IsStopped() || isEnabled(mDevice,chan))
733  oss << setw(12) << ::NTV2VideoFormatToString(::getVideoFormat(mDevice, chan))
734  << setw(13) << ::NTV2FrameBufferFormatToString(::getPixelFormat(mDevice, chan), true)
735  << endl;
736  else
737  oss << setw(12) << "---"
738  << setw(13) << "---"
739  << endl;
740  if (!status.IsStopped() && status.WithAudio())
741  { // Not stopped and AutoCirculating audio -- check if audio buffer capacity will be exceeded...
742  ULWord audChlsPerSample(0);
745  mDevice.GetNumberAudioChannels (audChlsPerSample, status.GetAudioSystem());
746  if (mDevice.GetFrameRate (fr, status.GetChannel()) && NTV2_IS_SUPPORTED_NTV2FrameRate(fr))
747  if (mDevice.GetAudioRate (ar, status.GetAudioSystem()) && NTV2_IS_VALID_AUDIO_RATE(ar))
748  {
749  const double framesPerSecond (double(::GetScaleFromFrameRate(fr)) / 100.00);
750  const double samplesPerSecond (double(::GetAudioSamplesPerSecond(ar)));
751  const double bytesPerChannel (4.0);
752  const double channelsPerSample (double(audChlsPerSample+0));
753  const double bytesPerFrame (samplesPerSecond * bytesPerChannel * channelsPerSample / framesPerSecond);
754  const ULWord maxVideoFrames (4UL * 1024UL * 1024UL / ULWord(bytesPerFrame));
755  if (status.GetFrameCount() > maxVideoFrames)
756  oss << "## WARNING: " << DEC(status.GetFrameCount()) << " frames (" << DEC(status.GetStartFrame())
757  << " thru " << DEC(status.GetEndFrame()) << ") exceeds " << DEC(maxVideoFrames)
758  << "-frame max audio buffer capacity" << endl;
759  }
760  }
761  } // for each channel
762 
763  SDRAMAuditor ramMapper;
764  oss << endl << "Device SDRAM Map (8MB frms):" << endl;
765  ramMapper.AssessDevice(mDevice, /* ignore unused audio buffers */ true);
766  ramMapper.DumpBlocks(oss);
767  oss << endl;
768 
769  // Dump the A/C timecodes...
770  for (ChannelToACStatusConstIter iter (perChannelStatus.begin()); iter != perChannelStatus.end(); ++iter)
771  {
772  const NTV2Channel chan(iter->first);
773  const AUTOCIRCULATE_STATUS & status(iter->second);
774  if (status.IsStopped())
775  continue; // Not initialized/started/paused/running -- skip this channel
776 
777  ChannelToPerFrameTCListConstIter it(perChannelTCs.find(chan));
778  if (it == perChannelTCs.end())
779  continue; // Channel not in perChannelTCs
780 
781  const FrameToTCList perFrameTCs(it->second);
782  oss << endl << dashes << " " << (NTV2_IS_INPUT_CROSSPOINT(status.acCrosspoint) ? "Input " : "Output ") << DEC(chan+1) << " Per-Frame Valid Timecodes:" << endl;
783  for (FrameToTCListConstIter i(perFrameTCs.begin()); i != perFrameTCs.end(); ++i)
784  {
785  const uint16_t frameNum(i->first);
786  const NTV2TimeCodeList & timecodes(i->second);
787  oss << "Frame " << frameNum << ":" << endl;
788  for (uint16_t tcNdx(0); tcNdx < timecodes.size(); tcNdx++)
789  {
790  const NTV2_RP188 tcVal(timecodes[tcNdx]);
791  if (!tcVal.IsValid())
792  continue; // skip invalid timecodes
793  const string tcStr (timecodeToString(tcVal));
794  oss << "\t" << setw(10) << ::NTV2TCIndexToString(NTV2TimecodeIndex(tcNdx), true) << setw(0) << ":\t"
795  << setw(12) << tcStr << setw(0) << "\t" << tcVal << endl;
796  } // for each timecode
797  } // for each frame
798  } // for each channel
799 } // FetchAutoCirculateLog
800 
801 
802 void CNTV2SupportLogger::FetchAudioLog (ostringstream & oss) const
803 {
804  const NTV2DeviceID devID (mDevice.GetDeviceID());
805  const UWord maxNumChannels (::NTV2DeviceGetMaxAudioChannels(devID));
806  const UWord numAudSys (::NTV2DeviceGetNumAudioSystems(devID));
807  oss << " Device:\t" << mDevice.GetDisplayName() << endl;
808 
809  // loop over all the audio systems
810  for (NTV2AudioSystem audSys(NTV2_AUDIOSYSTEM_1); audSys < NTV2AudioSystem(numAudSys); audSys = NTV2AudioSystem(audSys+1))
811  {
812  AUTOCIRCULATE_STATUS acStatus;
813  NTV2Channel acChan (findActiveACChannel(mDevice, audSys, acStatus));
814  if (acChan != NTV2_CHANNEL_INVALID)
815  {
816  NTV2AudioSource audioSource (NTV2_AUDIO_EMBEDDED);
818  mDevice.GetAudioSystemInputSource(audSys, audioSource, embeddedSource);
820  mDevice.GetMode(acChan, mode);
821  NTV2AudioRate audioRate (NTV2_AUDIO_48K);
822  mDevice.GetAudioRate(audioRate, audSys);
823  NTV2AudioBufferSize audioBufferSize;
824  mDevice.GetAudioBufferSize(audioBufferSize, audSys);
826  mDevice.GetAudioLoopBack(loopbackMode, audSys);
827 
828  NTV2AudioChannelPairs channelPairsPresent;
829  if (NTV2_IS_INPUT_MODE(mode))
830  {
831  detectInputChannelPairs(mDevice, audioSource, embeddedSource, channelPairsPresent);
832  }
833  else if (NTV2_IS_OUTPUT_MODE(mode))
834  {
835  bool isEmbedderEnabled = false;
836  mDevice.GetSDIOutputAudioEnabled(NTV2Channel(audSys), isEmbedderEnabled);
837  UWord inChannelCount = isEmbedderEnabled ? maxNumChannels : 0;
838 
839  // Generates a NTV2AudioChannelPairs set for the given number of audio channels...
840  for (UWord audioChannel (0); audioChannel < inChannelCount; audioChannel++)
841  {
842  if (audioChannel & 1)
843  continue;
844  channelPairsPresent.insert(NTV2AudioChannelPair(audioChannel/2));
845  }
846  }
847 
848  if (::NTV2DeviceCanDoPCMDetection(devID))
849  mDevice.GetInputAudioChannelPairsWithPCM(acChan, channelPairsPresent);
850 
851  NTV2AudioChannelPairs nonPCMChannelPairs;
852  mDevice.GetInputAudioChannelPairsWithoutPCM(acChan, nonPCMChannelPairs);
853  bool isNonPCM (true);
854  //end temp
855 
856  const ULWord currentPosSampleNdx (getCurrentPositionSamples(mDevice, audSys, mode));
857  const ULWord maxSamples (getMaxNumSamples(mDevice, audSys));
858  oss << endl
859  << " Audio system:\t" << ::NTV2AudioSystemToString (audSys, true) << endl
860  << " Sample Rate:\t" << ::NTV2AudioRateToString (audioRate, true) << endl
861  << " Buffer Size:\t" << ::NTV2AudioBufferSizeToString (audioBufferSize, true) << endl
862  << " Audio Channels:\t" << getNumAudioChannels(mDevice, audSys);
863  if (getNumAudioChannels(mDevice, audSys) == maxNumChannels)
864  oss << " (max)" << endl;
865  else
866  oss << " (" << maxNumChannels << " (max))" << endl;
867  oss << " Total Samples:\t[" << DEC0N(maxSamples,6) << "]" << endl
868  << " Direction:\t" << ::NTV2ModeToString (mode, true) << endl
869  << " AutoCirculate:\t" << ::NTV2ChannelToString (acChan, true) << endl
870  << " Loopback Mode:\t" << ::NTV2AudioLoopBackToString (loopbackMode, true) << endl;
871  if (NTV2_IS_INPUT_MODE(mode))
872  {
873  oss << "Write Head Position:\t[" << DEC0N(currentPosSampleNdx,6) << "]" << endl
874  << " Audio source:\t" << ::NTV2AudioSourceToString(audioSource, true);
875  if (NTV2_AUDIO_SOURCE_IS_EMBEDDED(audioSource))
876  oss << " (" << ::NTV2EmbeddedAudioInputToString(embeddedSource, true) << ")";
877  oss << endl
878  << " Channels Present:\t" << channelPairsPresent << endl
879  << " Non-PCM Channels:\t" << nonPCMChannelPairs << endl;
880  }
881  else if (NTV2_IS_OUTPUT_MODE(mode))
882  {
883  oss << " Read Head Position:\t[" << DEC0N(currentPosSampleNdx,6) << "]" << endl;
884  if (::NTV2DeviceCanDoPCMControl(mDevice.GetDeviceID()))
885  oss << " Non-PCM Channels:\t" << nonPCMChannelPairs << endl;
886  else
887  oss << " Non-PCM Channels:\t" << (isNonPCM ? "All Channel Pairs" : "Normal") << endl;
888  }
889  }
890  }
891 } // FetchAudioLog
892 
893 void CNTV2SupportLogger::FetchRoutingLog (ostringstream & oss) const
894 {
895  // Dump routing info...
896  CNTV2SignalRouter router;
897  mDevice.GetRouting (router);
898  oss << "(NTV2InputCrosspointID <== NTV2OutputCrosspointID)" << endl;
899  router.Print (oss, false);
900  oss << endl;
913 }
914 
916 {
918  string registerStr;
919 };
921 {
1020 };
1021 
1022 bool CNTV2SupportLogger::LoadFromLog (const string & inLogFilePath, const bool bForceLoad)
1023 {
1024  ifstream fileInput;
1025  fileInput.open(inLogFilePath.c_str());
1026  string lineContents;
1027  int i = 0, numLines = 0;
1028  int size = sizeof(registerToLoadStrings)/sizeof(registerToLoadString);
1029  string searchString;
1030  bool isCompatible = false;
1031 
1032  while(getline(fileInput, lineContents))
1033  numLines++;
1034  if(size > numLines)
1035  return false;
1036  fileInput.clear();
1037  fileInput.seekg(0, ios::beg);
1038  while(getline(fileInput, lineContents) && i < size && !bForceLoad)
1039  {
1040  searchString = "Device: ";
1041  searchString.append(NTV2DeviceIDToString(mDevice.GetDeviceID()));
1042  if (lineContents.find(searchString, 0) != string::npos)
1043  {
1044  cout << NTV2DeviceIDToString(mDevice.GetDeviceID()) << " is compatible with the log." << endl;
1045  isCompatible = true;
1046  break;
1047  }
1048  else
1049  {
1050  continue;
1051  }
1052  }
1053 
1054  if(!isCompatible)
1055  return false;
1056 
1057  while(i < size)
1058  {
1059  getline(fileInput, lineContents);
1060  if(fileInput.eof())
1061  {
1062  //Did not find the register reset stream to begin
1063  fileInput.clear();
1064  fileInput.seekg(0, ios::beg);
1065  i++;
1066  continue;
1067  }
1068  searchString = "Register Name: ";
1069  searchString.append(registerToLoadStrings[i].registerStr);
1070  if (lineContents.find(searchString, 0) != string::npos)
1071  {
1072  getline(fileInput, lineContents);
1073  getline(fileInput, lineContents);
1074  searchString = "Register Value: ";
1075  size_t start = lineContents.find(searchString);
1076  if(start != string::npos)
1077  {
1078  size_t end = lineContents.find(" : ");
1079  stringstream registerValueString(lineContents.substr(start + searchString.length(), end));
1080  uint32_t registerValue = 0;
1081  registerValueString >> registerValue;
1082  cout << "Writing register: " << registerToLoadStrings[i].registerStr << " " << registerValue << endl;
1083  mDevice.WriteRegister(registerToLoadStrings[i].registerNum, registerValue);
1084  }
1085  else
1086  {
1087  cout << "The format of the log file is not compatible with this option." << endl;
1088  return false;
1089  }
1090  }
1091  else
1092  {
1093  continue;
1094  }
1095  i++;
1096  }
1097 
1098  return true;
1099 }
1100 
1101 string CNTV2SupportLogger::InventLogFilePathAndName (CNTV2Card & inDevice, const string inPrefix, const string inExtension) // STATIC
1102 {
1103  string homePath;
1104  AJASystemInfo info;
1105  time_t rawtime;
1106  ostringstream oss;
1107  const string deviceName (CNTV2DeviceScanner::GetDeviceRefName(inDevice));
1108 
1109  info.GetValue(AJA_SystemInfoTag_Path_UserHome, homePath);
1110  if (!homePath.empty())
1111  oss << homePath << PATH_DELIMITER;
1112  oss << inPrefix << "_" << deviceName << "_" << ::time(&rawtime) << "." << inExtension;
1113  return oss.str();
1114 }
1115 
1116 bool CNTV2SupportLogger::DumpDeviceSDRAM (CNTV2Card & inDevice, const string & inFilePath, ostream & msgStrm) // STATIC
1117 {
1118  if (!inDevice.IsOpen())
1119  return false;
1120  if (inFilePath.empty())
1121  return false;
1123  const ULWord maxBytes(::NTV2DeviceGetActiveMemorySize(inDevice.GetDeviceID()));
1124  inDevice.GetFrameBufferSize(NTV2_CHANNEL1, frmsz);
1125  const ULWord byteCount(::NTV2FramesizeToByteCount(frmsz)), megs(byteCount/1024/1024), numFrames(maxBytes / byteCount);
1126  NTV2Buffer buffer(byteCount);
1127  NTV2ULWordVector goodFrames, badDMAs, badWrites;
1128  ofstream ofs(inFilePath.c_str(), ofstream::out | ofstream::binary);
1129  if (!ofs)
1130  {msgStrm << "## ERROR: Unable to open '" << inFilePath << "' for writing" << endl; return false;}
1131 
1132  for (ULWord frameNdx(0); frameNdx < numFrames; frameNdx++)
1133  {
1134  if (!inDevice.DMAReadFrame(frameNdx, buffer, byteCount, NTV2_CHANNEL1))
1135  {badDMAs.push_back(frameNdx); continue;}
1136  if (!ofs.write(buffer, streamsize(buffer.GetByteCount())).good())
1137  {badWrites.push_back(frameNdx); continue;}
1138  goodFrames.push_back(frameNdx);
1139  } // for each frame
1140  if (!badDMAs.empty())
1141  {
1142  msgStrm << "## ERROR: DMARead failed for " << DEC(badDMAs.size()) << " " << DEC(megs) << "MB frame(s): ";
1143  ::NTV2PrintULWordVector(badDMAs, msgStrm); msgStrm << endl;
1144  }
1145  if (!badWrites.empty())
1146  {
1147  msgStrm << "## ERROR: Write failures for " << DEC(badWrites.size()) << " " << DEC(megs) << "MB frame(s): ";
1148  ::NTV2PrintULWordVector(badWrites, msgStrm); msgStrm << endl;
1149  }
1150  msgStrm << "## NOTE: " << DEC(goodFrames.size()) << " x " << DEC(megs) << "MB frames from device '"
1151  << CNTV2DeviceScanner::GetDeviceRefName(inDevice) << "' written to '" << inFilePath << "'" << endl;
1152  return true;
1153 }
NTV2RegisterNumber registerNum
std::string NTV2AudioBufferSizeToString(const NTV2AudioBufferSize inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:5769
Defines the KonaIP/IoIP registers.
Everything needed to call CNTV2Card::ReadRegister or CNTV2Card::WriteRegister functions.
#define NTV2_IS_INPUT_MODE(__mode__)
Definition: ntv2enums.h:1249
std::string NTV2AudioSystemToString(const NTV2AudioSystem inValue, const bool inCompactDisplay=false)
Definition: ntv2utils.cpp:5745
virtual bool IsSupported(const NTV2BoolParamID inParamID)
NTV2AudioSystem
Used to identify an Audio System on an NTV2 device. See Audio System Operation for more information...
Definition: ntv2enums.h:3895
virtual bool GetLPTunnelConfigurationURLString(std::string &outURLString)
Definition: ntv2card.cpp:464
map< NTV2Channel, FrameToTCList > ChannelToPerFrameTCList
virtual bool GetMultiFormatMode(bool &outIsEnabled)
Answers if the device is operating in multiple-format per channel (independent channel) mode or not...
virtual bool GetAudioLoopBack(NTV2AudioLoopBack &outMode, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Answers if NTV2AudioLoopBack mode is currently on or off for the given NTV2AudioSystem.
Definition: ntv2audio.cpp:321
std::string NTV2ModeToString(const NTV2Mode inValue, const bool inCompactDisplay=false)
Definition: ntv2utils.cpp:6493
virtual bool GetVideoFormat(NTV2VideoFormat &outValue, NTV2Channel inChannel=NTV2_CHANNEL1)
virtual bool GetDetectedAESChannelPairs(NTV2AudioChannelPairs &outDetectedChannelPairs)
Answers which AES/EBU audio channel pairs are present on the device.
Definition: ntv2audio.cpp:1422
#define Enum2Str(e)
Definition: ntv2utils.h:25
virtual ~CNTV2SupportLogger()
My default destructor.
NTV2AudioBufferSize
Represents the size of the audio buffer used by a device audio system for storing captured samples or...
Definition: ntv2enums.h:1914
static ULWord getNumAudioChannels(CNTV2Card &device, NTV2AudioSystem audioSystem)
#define DEC0N(__x__, __n__)
bool NTV2DeviceCanDoPCMControl(const NTV2DeviceID inDeviceID)
static string HEX0NStr(const uint32_t inNum, const uint16_t inWidth)
I interrogate and control an AJA video/audio capture/playout device.
Definition: ntv2card.h:28
NTV2FrameBufferFormat
Identifies a particular video frame buffer pixel format. See Device Frame Buffer Formats for details...
Definition: ntv2enums.h:219
NTV2TaskMode
Describes the task mode state. See also: Sharing AJA Devices With Other Applications.
Obtain audio samples from the device AES inputs, if available.
Definition: ntv2enums.h:2008
bool AssessDevice(CNTV2Card &inDevice, const bool inIgnoreStoppedAudioBuffers=(0))
Assesses the given device.
Definition: ntv2card.cpp:610
Obtain audio samples from the device HDMI input, if available.
Definition: ntv2enums.h:2010
ULWord NTV2DeviceGetActiveMemorySize(const NTV2DeviceID inDeviceID)
virtual UWord GetIndexNumber(void) const
enum _NTV2VideoFormat NTV2VideoFormat
Identifies a particular video format.
Audits an NTV2 device&#39;s SDRAM utilization, and can report contiguous regions of SDRAM, whether unused/free, those being read/written by AutoCirculate, those being read/written by non-AutoCirculating FrameStores, those that are in conflict (AutoCirculate, FrameStore and/or Audio collisions), plus invalid/out-of-bounds regions being accessed.
Definition: ntv2card.h:6908
Declares the CNTV2SupportLogger class.
bool NTV2DeviceHasLPProductCode(const NTV2DeviceID inDeviceID)
#define NTV2_IS_VALID_AUDIO_RATE(_x_)
Definition: ntv2enums.h:1937
static string appSignatureToString(const ULWord inAppSignature)
static std::string InventLogFilePathAndName(CNTV2Card &inDevice, std::string inPrefix="aja_supportlog", std::string inExtension="log")
virtual bool GetAudioSystemInputSource(const NTV2AudioSystem inAudioSystem, NTV2AudioSource &outAudioSource, NTV2EmbeddedAudioInput &outEmbeddedSource)
Answers with the device&#39;s current NTV2AudioSource (and also possibly its NTV2EmbeddedAudioInput) for ...
Definition: ntv2audio.cpp:515
bool NTV2DeviceCanDoMultiFormat(const NTV2DeviceID inDeviceID)
virtual bool GetAudioRate(NTV2AudioRate &outRate, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Returns the current NTV2AudioRate for the given Audio System.
Definition: ntv2audio.cpp:226
static NTV2RegNumSet GetRegistersForClass(const std::string &inClassName)
bool IsValid(void) const
Answers true if I&#39;m valid, or false if I&#39;m not valid.
ULWord GetByteCount(void) const
virtual bool GetOutputFrame(const NTV2Channel inChannel, ULWord &outValue)
Answers with the current output frame number for the given FrameStore (expressed as an NTV2Channel)...
std::ostream & NTV2PrintULWordVector(const NTV2ULWordVector &inObj, std::ostream &inOutStream=std::cout)
Streams a human-readable dump of the given NTV2ULWordVector into the specified output stream...
#define NTV2_IS_VALID_AUDIO_BUFFER_SIZE(_x_)
Definition: ntv2enums.h:1925
static bool isEnabled(CNTV2Card &device, const NTV2Channel inChannel)
std::vector< AJALabelValuePair > AJALabelValuePairs
An ordered sequence of label/value pairs.
Definition: info.h:71
#define SAREK_REGS
virtual bool GetInputAudioChannelPairsWithoutPCM(const NTV2Channel inSDIInputConnector, NTV2AudioChannelPairs &outChannelPairs)
For the given SDI input (specified as a channel number), returns the set of audio channel pairs that ...
Definition: ntv2audio.cpp:1587
static ULWord getCurrentPositionSamples(CNTV2Card &device, NTV2AudioSystem audioSystem, NTV2Mode mode)
Obtain audio samples from the audio that&#39;s embedded in the video HANC.
Definition: ntv2enums.h:2007
static ULWord readCurrentAudioPosition(CNTV2Card &device, NTV2AudioSystem audioSystem, NTV2Mode mode)
#define NTV2_AUDIO_SOURCE_IS_EMBEDDED(_x_)
Definition: ntv2enums.h:2016
FrameToTCList::const_iterator FrameToTCListConstIter
#define kRegSarekDNALow
static string makeHeader(ostringstream &oss, const string &inName)
virtual std::string GetConnectionType(void) const
virtual bool GetFrameBufferSize(const NTV2Channel inChannel, NTV2Framesize &outValue)
Answers with the frame size currently being used on the device.
Generates a standard support log (register log) for any NTV2 device attached to the host...
Definition: json.hpp:5362
NTV2HDMIAudioChannels
Indicates or specifies the HDMI audio channel count.
Definition: ntv2enums.h:3667
NTV2SupportLoggerSections
map< NTV2Channel, AUTOCIRCULATE_STATUS > ChannelToACStatus
#define false
uint32_t ULWord
Definition: ajatypes.h:223
virtual bool AutoCirculateGetStatus(const NTV2Channel inChannel, AUTOCIRCULATE_STATUS &outStatus)
Returns the current AutoCirculate status for the given channel.
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They&#39;re also commonly use...
Definition: ntv2enums.h:1357
pair< NTV2Channel, FrameToTCList > ChannelToPerFrameTCListPair
This class is a collection of widget input-to-output connections that can be applied all-at-once to a...
virtual class DeviceCapabilities & features(void)
Definition: ntv2card.h:148
ChannelToPerFrameTCList::const_iterator ChannelToPerFrameTCListConstIter
std::set< NTV2AudioChannelPair > NTV2AudioChannelPairs
A set of distinct NTV2AudioChannelPair values.
static bool DumpDeviceSDRAM(CNTV2Card &inDevice, const std::string &inFilePath, std::ostream &msgStream)
#define kRegSarekDNAHi
CNTV2SupportLogger(CNTV2Card &card, NTV2SupportLoggerSections sections=NTV2_SupportLoggerSectionsAll)
Construct from CNTV2Card instance.
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&#39;s currently installe...
Definition: ntv2card.cpp:322
#define PATH_DELIMITER
bool GetInputTimeCodes(NTV2TimeCodeList &outValues) const
Returns all RP188 timecodes associated with the frame in NTV2TCIndex order.
virtual bool LoadFromLog(const std::string &inLogFilePath, const bool bForceLoad)
Obtain audio samples from the device analog input(s), if available.
Definition: ntv2enums.h:2009
NTV2RegWritesConstIter NTV2RegisterReadsConstIter
This struct replaces the old RP188_STRUCT.
virtual NTV2VideoFormat GetHDMIInputVideoFormat(NTV2Channel inHDMIInput=NTV2_CHANNEL1)
int32_t appPID(0)
pair< NTV2Channel, AUTOCIRCULATE_STATUS > ChannelToACStatusPair
virtual bool IsRemote(void) const
NTV2XilinxFPGA
Definition: ntv2enums.h:3846
virtual bool GetTaskMode(NTV2TaskMode &outMode)
Retrieves the device&#39;s current task mode.
virtual void PrependToSection(uint32_t section, const std::string &sectionData)
Prepends arbitrary string data to my support log, ahead of a given section.
NTV2FrameRate
Identifies a particular video frame rate.
Definition: ntv2enums.h:412
virtual std::string GetPCIFPGAVersionString(void)
Definition: ntv2card.cpp:131
#define true
0: Disabled (never recommended): device configured exclusively by client application(s).
Playout (output) mode, which reads from device SDRAM.
Definition: ntv2enums.h:1241
virtual std::string GetDescription(void) const
Definition: ntv2card.cpp:139
NTV2DeviceID
Identifies a specific AJA NTV2 device model number. The NTV2DeviceID is actually the PROM part number...
Definition: ntv2enums.h:20
static NTV2VideoFormat getVideoFormat(CNTV2Card &device, const NTV2Channel inChannel)
virtual bool IsOpen(void) const
The invalid mode.
Definition: ntv2enums.h:1245
static string pidToString(const uint32_t inPID)
std::string to_string(bool val)
Definition: common.cpp:180
static ULWord bytesToSamples(CNTV2Card &device, NTV2AudioSystem audioSystem, const ULWord inBytes)
std::string NTV2TaskModeToString(const NTV2TaskMode inValue, const bool inCompactDisplay=false)
Definition: ntv2utils.cpp:6353
virtual bool ReadRegisters(NTV2RegisterReads &inOutValues)
Reads the register(s) specified by the given NTV2RegInfo sequence.
#define AJA_NULL
Definition: ajatypes.h:167
virtual bool GetSerialNumberString(std::string &outSerialNumberString)
Answers with a string that contains my human-readable serial number.
Definition: ntv2card.cpp:229
virtual std::string GetDisplayName(void)
Answers with this device&#39;s display name.
Definition: ntv2card.cpp:88
Declares the CRP188 class. See SMPTE RP188 standard for details.
NTV2AudioLoopBack
This enum value determines/states if an audio output embedder will embed silence (zeroes) or de-embed...
Definition: ntv2enums.h:2028
std::vector< ULWord > NTV2ULWordVector
An ordered sequence of ULWords.
std::string NTV2GetVersionString(const bool inDetailed=false)
Definition: ntv2utils.cpp:7868
This selects audio channels 1 and 2 (Group 1 channels 1 and 2)
Definition: ntv2enums.h:3133
virtual NTV2VideoFormat GetAnalogInputVideoFormat(void)
Returns the video format of the signal that is present on the device&#39;s analog video input...
ULWord NTV2FramesizeToByteCount(const NTV2Framesize inFrameSize)
Converts the given NTV2Framesize value into an exact byte count.
Definition: ntv2utils.cpp:5287
#define SAREK_LICENSE_PRESENT
bool IsStopped(void) const
NTV2RegisterNumberSet NTV2RegNumSet
A set of distinct NTV2RegisterNumbers.
NTV2AudioChannelPair
Identifies a pair of audio channels.
Definition: ntv2enums.h:3131
virtual std::string ToString(void) const
virtual std::string GetDriverVersionString(void)
Answers with this device&#39;s driver&#39;s version as a human-readable string.
Definition: ntv2card.cpp:162
virtual bool ReadAudioLastIn(ULWord &outValue, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
For the given Audio System, answers with the byte offset to the last byte of the latest chunk of 4-by...
Definition: ntv2audio.cpp:465
static uint32_t maxSampleCountForNTV2AudioBufferSize(const NTV2AudioBufferSize inBufferSize, const uint16_t inChannelCount)
NTV2RegWrites NTV2RegisterReads
virtual bool GetInputFrame(const NTV2Channel inChannel, ULWord &outValue)
Answers with the current input frame index number for the given FrameStore. This identifies which par...
the parser finished reading a JSON value
#define NTV2_IS_INPUT_CROSSPOINT(__x__)
Definition: ntv2enums.h:1724
#define kRegClass_Virtual
std::string NTV2VideoFormatToString(const NTV2VideoFormat inValue, const bool inUseFrameRate=false)
Definition: ntv2utils.cpp:6746
Embeds silence (zeroes) into the data stream.
Definition: ntv2enums.h:2030
virtual bool GetLPExternalConfigurationURLString(std::string &outURLString)
Definition: ntv2card.cpp:438
virtual bool GetAudioBufferSize(NTV2AudioBufferSize &outSize, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Retrieves the size of the input or output audio buffer being used for a given Audio System on the AJA...
Definition: ntv2audio.cpp:268
bool NTV2DeviceCanDoPCMDetection(const NTV2DeviceID inDeviceID)
virtual bool GetPackageInformation(PACKAGE_INFO_STRUCT &outPkgInfo)
Answers with the IP device&#39;s package information.
virtual NTV2DeviceID GetDeviceID(void)
std::string NTV2TCIndexToString(const NTV2TCIndex inValue, const bool inCompactDisplay=false)
Definition: ntv2utils.cpp:6394
virtual bool GetDetectedAudioChannelPairs(const NTV2AudioSystem inAudioSystem, NTV2AudioChannelPairs &outDetectedChannelPairs)
Answers which audio channel pairs are present in the given Audio System&#39;s input stream.
Definition: ntv2audio.cpp:1404
Declares the CNTV2DeviceScanner class.
#define LoggerSectionToFunctionMacro(_SectionEnum_, _SectionString_, _SectionMethod_)
#define kRegSarekFwCfg
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...
NTV2Framesize
Kona2/Xena2 specific enums.
Definition: ntv2enums.h:2116
virtual bool GetRouting(CNTV2SignalRouter &outRouting)
Answers with the current signal routing between any and all widgets on the AJA device.
UWord NTV2DeviceGetNumAudioSystems(const NTV2DeviceID inDeviceID)
Describes a user-space buffer on the host computer. I have an address and a length, plus some optional attributes (allocated by SDK?, page-aligned? etc.).
virtual bool DriverGetBitFileInformation(BITFILE_INFO_STRUCT &outBitFileInfo, const NTV2BitFileType inBitFileType=NTV2_VideoProcBitFile)
defined(NTV2_DEPRECATE_17_2)
NTV2Mode
Used to identify the mode of a widget_framestore, or the direction of an AutoCirculate stream: either...
Definition: ntv2enums.h:1239
uint16_t GetEndFrame(void) const
virtual int GetSFPConfigurationURLStrings(std::vector< std::string > &sfpURLStrings)
Definition: ntv2card.cpp:490
std::string NTV2DeviceIDToString(const NTV2DeviceID inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:4608
#define SAREK_2022_2
static NTV2Channel findActiveACChannel(CNTV2Card &device, NTV2AudioSystem audioSystem, AUTOCIRCULATE_STATUS &outStatus)
True if device has a crosspoint connection ROM (New in SDK 17.0)
virtual bool AutoCirculateGetFrameStamp(const NTV2Channel inChannel, const ULWord inFrameNumber, FRAME_STAMP &outFrameInfo)
Returns precise timing information for the given frame and channel that&#39;s currently AutoCirculating...
virtual bool ReadAudioLastOut(ULWord &outValue, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
For the given Audio System, answers with the byte offset of the tail end of the last chunk of audio s...
Definition: ntv2audio.cpp:472
virtual bool GetNumberAudioChannels(ULWord &outNumChannels, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Returns the current number of audio channels being captured or played by a given Audio System on the ...
Definition: ntv2audio.cpp:180
virtual bool GetHDMIInputAudioChannels(NTV2HDMIAudioChannels &outValue, const NTV2Channel inHDMIInput=NTV2_CHANNEL1)
Answers with the current number of audio channels being received on the given HDMI input...
Definition: ntv2hdmi.cpp:280
#define NTV2_IS_VALID_EMBEDDED_AUDIO_INPUT(_x_)
Definition: ntv2enums.h:1981
static AJALabelValuePairs & append(AJALabelValuePairs &inOutTable, const std::string &inLabel, const std::string &inValue=std::string())
A convenience function that appends the given label and value strings to the provided AJALabelValuePa...
Definition: info.h:170
static std::string GetDisplayValue(const uint32_t inRegNum, const uint32_t inRegValue, const NTV2DeviceID inDeviceID=DEVICE_ID_NOTFOUND)
virtual bool GetFrameBufferFormat(NTV2Channel inChannel, NTV2FrameBufferFormat &outValue)
Returns the current frame buffer format for the given FrameStore on the AJA device.
#define DEC(__x__)
NTV2RegisterNumber
#define AJAExport
Definition: export.h:33
virtual NTV2VideoFormat GetAnalogCompositeInputVideoFormat(void)
Returns the video format of the signal that is present on the device&#39;s composite video input...
This identifies the first Audio System.
Definition: ntv2enums.h:3897
virtual bool WaitForOutputVerticalInterrupt(const NTV2Channel inChannel=NTV2_CHANNEL1, UWord inRepeatCount=1)
Efficiently sleeps the calling thread/process until the next one or more field (interlaced video) or ...
const registerToLoadString registerToLoadStrings[]
virtual std::ostream & Print(std::ostream &inOutStream, const bool inForRetailDisplay=false) const
Prints me in a human-readable format to the given output stream.
double GetAudioSamplesPerSecond(const NTV2AudioRate inAudioRate)
Returns the audio sample rate as a number of audio samples per second.
Definition: ntv2utils.cpp:3303
Declares the AJASystemInfo class.
This is returned from the CNTV2Card::AutoCirculateGetStatus function.
std::vector< NTV2_RP188 > NTV2TimeCodeList
An ordered sequence of zero or more NTV2_RP188 structures. An NTV2TCIndex enum value can be used as a...
std::string NTV2AudioRateToString(const NTV2AudioRate inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:5756
ostream & operator<<(ostream &outStream, const CNTV2SupportLogger &inData)
static ULWord getMaxNumSamples(CNTV2Card &device, NTV2AudioSystem audioSystem)
#define kRegSarekLicenseStatus
uint16_t UWord
Definition: ajatypes.h:221
virtual bool WriteRegister(const ULWord inRegNum, const ULWord inValue, const ULWord inMask=0xFFFFFFFF, const ULWord inShift=0)
Updates or replaces all or part of the 32-bit contents of a specific register (real or virtual) on th...
static bool detectInputChannelPairs(CNTV2Card &device, const NTV2AudioSource inAudioSource, const NTV2EmbeddedAudioInput inEmbeddedSource, NTV2AudioChannelPairs &outChannelPairsPresent)
Specifies channel or FrameStore 1 (or the first item).
Definition: ntv2enums.h:1359
ULWord appSignature(0)
#define xHEX0N(__x__, __n__)
static NTV2RegNumSet GetRegistersForDevice(const NTV2DeviceID inDeviceID, const int inOtherRegsToInclude=0)
std::string NTV2AudioSourceToString(const NTV2AudioSource inValue, const bool inCompactDisplay=false)
Definition: ntv2utils.cpp:6731
string DECStr(const T inT)
static std::string GetDisplayName(const uint32_t inRegNum)
static std::string GetDeviceRefName(CNTV2Card &inDevice)
#define NTV2_IS_SUPPORTED_NTV2FrameRate(__r__)
Definition: ntv2enums.h:445
virtual bool GetSDIOutputAudioEnabled(const NTV2Channel inSDIOutput, bool &outIsEnabled)
Answers with the current state of the audio output embedder for the given SDI output connector (speci...
Definition: ntv2audio.cpp:1623
virtual bool GetFrameRate(NTV2FrameRate &outValue, NTV2Channel inChannel=NTV2_CHANNEL1)
Returns the AJA device&#39;s currently configured frame rate via its "value" parameter.
std::string NTV2FrameBufferFormatToString(const NTV2FrameBufferFormat inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:6936
virtual bool IsChannelEnabled(const NTV2Channel inChannel, bool &outEnabled)
Answers whether or not the given FrameStore is enabled.
Declares the CNTV2KonaFlashProgram class.
static int Version(void)
NTV2AudioSource
This enum value determines/states where an audio system will obtain its audio samples.
Definition: ntv2enums.h:2005
virtual bool GetInputAudioChannelPairsWithPCM(const NTV2Channel inSDIInputConnector, NTV2AudioChannelPairs &outChannelPairs)
For the given SDI input (specified as a channel number), returns the set of audio channel pairs that ...
Definition: ntv2audio.cpp:1559
virtual void AddFooter(const std::string &sectionName, const std::string &sectionData)
Adds footer text to my log.
virtual AJAStatus GetLabelValuePairs(AJALabelValuePairs &outTable, bool clearTable=false) const
Generates a "table" of label/value pairs that contains the complete host system info table...
Definition: info.cpp:175
#define NTV2_IS_OUTPUT_MODE(__mode__)
Definition: ntv2enums.h:1250
Private include file for all ajabase sources.
This class/object reports information about the current and/or requested AutoCirculate frame...
virtual bool DMAReadFrame(const ULWord inFrameNumber, ULWord *pOutFrameBuffer, const ULWord inByteCount)
Transfers a single frame from the AJA device to the host.
Definition: ntv2dma.cpp:41
NTV2AudioRate
Definition: ntv2enums.h:1928
#define NTV2_IS_VALID_VIDEO_FORMAT(__f__)
Definition: ntv2enums.h:725
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 NTV2DeviceGetNumVideoChannels(const NTV2DeviceID inDeviceID)
std::string NTV2AudioLoopBackToString(const NTV2AudioLoopBack inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:5781
const char * NTV2DeviceIDString(const NTV2DeviceID id)
Definition: ntv2debug.cpp:15
std::ostream & DumpBlocks(std::ostream &oss) const
Dumps all 8MB blocks/frames and their tags, if any, into the given stream.
Definition: ntv2card.cpp:655
8 audio channels
Definition: ntv2enums.h:3670
virtual void AppendToSection(uint32_t section, const std::string &sectionData)
Appends arbitrary string data to my support log, after a given section.
#define HEX0N(__x__, __n__)
Definition: debug.cpp:1175
static string xHEX0NStr(const uint32_t inNum, const uint16_t inWidth)
std::string NTV2ChannelToString(const NTV2Channel inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:5727
static bool getBitfileDate(CNTV2Card &device, string &outDateString, NTV2XilinxFPGA whichFPGA)
map< uint16_t, NTV2TimeCodeList > FrameToTCList
std::string NTV2EmbeddedAudioInputToString(const NTV2EmbeddedAudioInput inValue, const bool inCompactDisplay=false)
Definition: ntv2utils.cpp:6713
UWord NTV2DeviceGetMaxAudioChannels(const NTV2DeviceID inDeviceID)
NTV2AudioSystem GetAudioSystem(void) const
pair< uint16_t, NTV2TimeCodeList > FrameToTCListPair
NTV2RegisterReads FromRegNumSet(const NTV2RegNumSet &inRegNumSet)
Definition: ntv2utils.cpp:8093
This selects audio channels 9 and 10 (Group 3 channels 1 and 2)
Definition: ntv2enums.h:3137
static NTV2PixelFormat getPixelFormat(CNTV2Card &device, const NTV2Channel inChannel)
NTV2Crosspoint acCrosspoint
The crosspoint (channel number with direction)
virtual bool GetStreamingApplication(ULWord &outAppType, int32_t &outProcessID)
Answers with the four-CC type and process ID of the application that currently "owns" the AJA device ...
NTV2EmbeddedAudioInput
This enum value determines/states which SDI video input will be used to supply audio samples to an au...
Definition: ntv2enums.h:1967
virtual void ToString(std::string &outAllLabelsAndValues) const
Answers with a multi-line string that contains the complete host system info table.
static string getActiveFrameStr(CNTV2Card &device, const NTV2Channel inChannel)
static ULWord getActiveFrame(CNTV2Card &device, const NTV2Channel inChannel)
ChannelToACStatus::const_iterator ChannelToACStatusConstIter
#define SAREK_LICENSE_VALID
uint16_t GetStartFrame(void) const
virtual std::string GetHostName(void) const
Declares device capability functions.
This selects audio channels 3 and 4 (Group 1 channels 3 and 4)
Definition: ntv2enums.h:3134
virtual bool WaitForInputVerticalInterrupt(const NTV2Channel inChannel=NTV2_CHANNEL1, UWord inRepeatCount=1)
Efficiently sleeps the calling thread/process until the next one or more field (interlaced video) or ...
static NTV2Mode getMode(CNTV2Card &device, const NTV2Channel inChannel)
virtual bool GetMode(const NTV2Channel inChannel, NTV2Mode &outValue)
Answers with the current NTV2Mode of the given FrameStore on the AJA device.
enum NTV2TCIndex NTV2TimecodeIndex
Declares the CNTV2RegisterExpert class.
ULWord GetScaleFromFrameRate(const NTV2FrameRate inFrameRate)
Definition: ntv2utils.cpp:3454
virtual void AddHeader(const std::string &sectionName, const std::string &sectionData)
Adds header text to my log.
static string timecodeToString(const NTV2_RP188 &inRP188)