AJA NTV2 SDK  18.0.0.2122
NTV2 SDK 18.0.0.2122
ntv2driverinterface.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 #include "ajatypes.h"
9 #include "ntv2enums.h"
10 #include "ntv2debug.h"
11 #include "ntv2driverinterface.h"
12 #include "ntv2devicefeatures.h"
13 #include "ntv2nubaccess.h"
14 #include "ntv2bitfile.h"
15 #include "ntv2registersmb.h" // for SAREK_REGS
16 #include "ntv2spiinterface.h"
17 #include "ntv2utils.h"
18 #include "ntv2version.h"
19 #include "ntv2devicescanner.h" // for IsHexDigit, IsAlphaNumeric, etc.
20 #include "ajabase/system/debug.h"
21 #include "ajabase/system/atomic.h"
23 #include "ajabase/system/process.h"
24 #include "ajabase/common/common.h" // aja::join
25 #include <string.h>
26 #include <assert.h>
27 #include <iostream>
28 #include <sstream>
29 #include <algorithm>
30 #include <map>
31 
32 using namespace std;
33 
34 #define INSTP(_p_) HEX0N(uint64_t(_p_),16)
35 #define DIFAIL(__x__) AJA_sERROR (AJA_DebugUnit_DriverInterface, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
36 #define DIWARN(__x__) AJA_sWARNING(AJA_DebugUnit_DriverInterface, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
37 #define DINOTE(__x__) AJA_sNOTICE (AJA_DebugUnit_DriverInterface, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
38 #define DIINFO(__x__) AJA_sINFO (AJA_DebugUnit_DriverInterface, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
39 #define DIDBG(__x__) AJA_sDEBUG (AJA_DebugUnit_DriverInterface, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
40 
41 // Stats
42 static uint32_t gConstructCount(0); // Number of constructor calls made
43 static uint32_t gDestructCount(0); // Number of destructor calls made
44 static uint32_t gOpenCount(0); // Number of successful Open calls made
45 static uint32_t gCloseCount(0); // Number of Close calls made
46 //#define _DEBUGSTATS_ // Define this to log above construct/destruct & open/close tallies
47 #if defined(_DEBUGSTATS_)
48  #define DIDBGX(__x__) AJA_sDEBUG (AJA_DebugUnit_DriverInterface, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
49 #else
50  #define DIDBGX(__x__)
51 #endif
52 
54 
56 {
57  NTV2StringList result;
58  result.push_back("ntv2nub"); result.push_back("ntv2"); result.push_back("ntv2local");
59  return result;
60 }
61 
62 static bool gSharedMode(false);
63 void CNTV2DriverInterface::SetShareMode (const bool inSharedMode) {gSharedMode = inSharedMode;}
65 static bool gOverlappedMode(false);
66 void CNTV2DriverInterface::SetOverlappedMode (const bool inOverlapMode) {gOverlappedMode = inOverlapMode;}
68 
69 
71 
73  : _boardNumber (0)
74  ,_boardID (DEVICE_ID_NOTFOUND)
75  ,_boardOpened (false)
77  ,mRecordRegWrites (false)
78  ,mSkipRegWrites (false)
79 #endif
80  ,_programStatus (0)
81  ,_pRPCAPI (AJA_NULL)
82  ,mInterruptEventHandles ()
83  ,mEventCounts ()
85  ,mRegWrites ()
86  ,mRegWritesLock ()
87 #endif // NTV2_WRITEREG_PROFILING
88 #if !defined(NTV2_DEPRECATE_16_0)
89  ,_pFrameBaseAddress (AJA_NULL)
90  ,_pRegisterBaseAddress (AJA_NULL)
91  ,_pRegisterBaseAddressLength (0)
92  ,_pXena2FlashBaseAddress (AJA_NULL)
93  ,_pCh1FrameBaseAddress (AJA_NULL)
94  ,_pCh2FrameBaseAddress (AJA_NULL)
95 #endif // !defined(NTV2_DEPRECATE_16_0)
96 #if !defined(NTV2_DEPRECATE_17_2)
97  ,_ulNumFrameBuffers (0)
98  ,_ulFrameBufferSize (0)
99 #endif
100 #if !defined(NTV2_DEPRECATE_16_0)
101  ,_pciSlot (0) // DEPRECATE!
102 #endif // !defined(NTV2_DEPRECATE_16_0)
103 {
106  mInterruptEventHandles.push_back(AJA_NULL);
107 
109  while (mEventCounts.size() < eNumInterruptTypes)
110  mEventCounts.push_back(0);
112  DIDBGX(DEC(gConstructCount) << " constructed, " << DEC(gDestructCount) << " destroyed");
113 } // constructor
114 
115 
117 {
119  if (_pRPCAPI)
120  delete _pRPCAPI;
121  _pRPCAPI = AJA_NULL;
122  DIDBGX(DEC(gConstructCount) << " constructed, " << DEC(gDestructCount) << " destroyed");
123 } // destructor
124 
125 CNTV2DriverInterface & CNTV2DriverInterface::operator = (const CNTV2DriverInterface & inRHS)
126 { (void) inRHS; NTV2_ASSERT(false && "Not assignable"); return *this;} // operator =
127 
129 { (void) inObjToCopy; NTV2_ASSERT(false && "Not copyable");} // copy constructor
130 
131 
132 // Open local physical device (via ajantv2 driver)
133 bool CNTV2DriverInterface::Open (const UWord inDeviceIndex)
134 {
135  if (IsOpen() && inDeviceIndex == GetIndexNumber())
136  return true; // Same local device requested, already open
137  Close();
138  if (inDeviceIndex >= MaxNumDevices())
139  {DIFAIL("Requested device index '" << DEC(inDeviceIndex) << "' at/past limit of '" << DEC(MaxNumDevices()) << "'"); return false;}
140  if (!OpenLocalPhysical(inDeviceIndex))
141  {
142  // Check for virtual device...
143  static ULWord sRecursionCheck(0), RECURSION_LIMIT(32);
144  NTV2DeviceInfo info;
145  if (!CNTV2DeviceScanner::GetDeviceInfo (inDeviceIndex, info))
146  return false;
147  sRecursionCheck++; // increment
148  if (sRecursionCheck > RECURSION_LIMIT)
149  {DIFAIL("Failed: " << DEC(RECURSION_LIMIT) << " '.vdev' bounces -- limit exceeded"); return false;}
150  if (!Open(info.vdevUrl))
151  {sRecursionCheck--; return false;} // Open vdev urlSpec failed
152  setDeviceIndexNumber(UWord(info.deviceIndex)); // Patch _boardNumber
153  sRecursionCheck--; // decrement
154  return true;
155  } // if OpenLocalPhysical failed
156 
157 #if !defined(NTV2_ALLOW_OPEN_UNSUPPORTED)
158  // Check if device is officially supported...
159  const NTV2DeviceIDSet legalDeviceIDs(::NTV2GetSupportedDevices());
160  if (legalDeviceIDs.find(_boardID) == legalDeviceIDs.end())
161  {
162  DIFAIL("Device ID " << xHEX0N(_boardID,8) << " (at device index " << inDeviceIndex << ") is not in list of supported devices");
163  Close();
164  return false;
165  }
166 #endif // NTV2_ALLOW_OPEN_UNSUPPORTED
167 
168  // Read driver version...
169  uint16_t drvrVersComps[4] = {0, 0, 0, 0};
170  ULWord driverVersionRaw (0);
171  if (!IsRemote() && !ReadRegister (kVRegDriverVersion, driverVersionRaw))
172  {DIFAIL("ReadRegister(kVRegDriverVersion) failed"); Close(); return false;}
173  drvrVersComps[0] = uint16_t(NTV2DriverVersionDecode_Major(driverVersionRaw)); // major
174  drvrVersComps[1] = uint16_t(NTV2DriverVersionDecode_Minor(driverVersionRaw)); // minor
175  drvrVersComps[2] = uint16_t(NTV2DriverVersionDecode_Point(driverVersionRaw)); // point
176  drvrVersComps[3] = uint16_t(NTV2DriverVersionDecode_Build(driverVersionRaw)); // build
177 
178  // Check driver version (local devices only)
179  NTV2_ASSERT(!IsRemote());
181  DIWARN ("Driver version v" << DEC(drvrVersComps[0]) << "." << DEC(drvrVersComps[1]) << "." << DEC(drvrVersComps[2]) << "."
182  << DEC(drvrVersComps[3]) << " ignored for client SDK v0.0.0.0 (dev mode), driverVersionRaw=" << xHEX0N(driverVersionRaw,8));
183  else if (drvrVersComps[0] == uint16_t(AJA_NTV2_SDK_VERSION_MAJOR))
184  DIDBG ("Driver v" << DEC(drvrVersComps[0]) << "." << DEC(drvrVersComps[1])
185  << "." << DEC(drvrVersComps[2]) << "." << DEC(drvrVersComps[3]) << " == client SDK v"
186  << DEC(uint16_t(AJA_NTV2_SDK_VERSION_MAJOR)) << "." << DEC(uint16_t(AJA_NTV2_SDK_VERSION_MINOR))
187  << "." << DEC(uint16_t(AJA_NTV2_SDK_VERSION_POINT)) << "." << DEC(uint16_t(AJA_NTV2_SDK_BUILD_NUMBER)));
188  else
189  DIWARN ("Driver v" << DEC(drvrVersComps[0]) << "." << DEC(drvrVersComps[1])
190  << "." << DEC(drvrVersComps[2]) << "." << DEC(drvrVersComps[3]) << " != client SDK v"
191  << DEC(uint16_t(AJA_NTV2_SDK_VERSION_MAJOR)) << "." << DEC(uint16_t(AJA_NTV2_SDK_VERSION_MINOR)) << "."
192  << DEC(uint16_t(AJA_NTV2_SDK_VERSION_POINT)) << "." << DEC(uint16_t(AJA_NTV2_SDK_BUILD_NUMBER))
193  << ", driverVersionRaw=" << xHEX0N(driverVersionRaw,8));
194 
195  FinishOpen();
197  DIDBGX(DEC(gOpenCount) << " opened, " << DEC(gCloseCount) << " closed");
198  return true;
199 }
200 
201 // Open remote or virtual device
202 bool CNTV2DriverInterface::Open (const string & inURLSpec)
203 {
204  Close();
206  const NTV2DeviceSpecParser specParser (inURLSpec);
207  if (specParser.HasErrors())
208  {DIFAIL("Bad device specification '" << inURLSpec << "': " << specParser.Error()); return false;}
209 
210  // URLSpecs can specify locally-attached devices...
211  if (specParser.IsLocalDevice())
212  { // Local device...
213  CNTV2Card card;
214  if (specParser.HasResult(kConnectParamDevSerial))
215  { if (CNTV2DeviceScanner::GetDeviceWithSerial(specParser.DeviceSerial(), card))
216  Open(card.GetIndexNumber());
217  }
218  else if (specParser.HasResult(kConnectParamDevModel))
219  { if (CNTV2DeviceScanner::GetFirstDeviceWithName(specParser.DeviceModel(), card))
220  Open(card.GetIndexNumber());
221  }
222  else if (specParser.HasResult(kConnectParamDevID))
223  { if (CNTV2DeviceScanner::GetFirstDeviceWithID(specParser.DeviceID(), card))
224  Open(card.GetIndexNumber());
225  }
226  else if (specParser.HasResult(kConnectParamDevIndex))
227  Open(specParser.DeviceIndex());
228  if (!IsOpen())
229  {DIFAIL("Failed to open " << specParser.InfoString()); return false;}
230  return true;
231  }
232 
233  // Open the remote/virtual device...
234  if (!OpenRemote(specParser))
235  return false; // Failed to open
236 
237  FinishOpen();
239  DIDBGX(DEC(gOpenCount) << " opens, " << DEC(gCloseCount) << " closes");
240  return true;
241 }
242 
244 {
245  if (IsOpen())
246  {
247  // Unsubscribe all...
248  for (INTERRUPT_ENUMS eInt(eVerticalInterrupt); eInt < eNumInterruptTypes; eInt = INTERRUPT_ENUMS(eInt+1))
249  ConfigureSubscription (false, eInt, mInterruptEventHandles[eInt]);
250 
251  const bool closeOK(IsRemote() ? CloseRemote() : CloseLocalPhysical());
252  if (closeOK)
255  DIDBGX(DEC(gOpenCount) << " opens, " << DEC(gCloseCount) << " closes");
256  return closeOK;
257  }
258  return true;
259 
260 } // Close
261 
262 
264 {
265 #if defined(NTV2_NULL_DEVICE)
266  DIFAIL("SDK built with 'NTV2_NULL_DEVICE' defined -- cannot OpenLocalPhysical '" << DEC(inDeviceIndex) << "'");
267 #else // else defined(NTV2_NULL_DEVICE)
268  (void) inDeviceIndex;
269  NTV2_ASSERT(false && "Requires platform-specific implementation");
270 #endif // else NTV2_NULL_DEVICE defined
271  return false;
272 }
273 
275 {
276  NTV2_ASSERT(false && "Requires platform-specific implementation");
277  return false;
278 }
279 
280 #if defined(AJA_WINDOWS)
281  static bool winsock_inited = false;
282  static WSADATA wsaData;
283 
284  static void initWinsock(void)
285  {
286  int wret;
287  if (!winsock_inited)
288  wret = WSAStartup(MAKEWORD(2,2), &wsaData);
289  winsock_inited = true;
290  }
291 #endif // AJA_WINDOWS
292 
293 
295 {
296 #if defined(AJA_WINDOWS)
297  initWinsock();
298 #endif // defined(AJA_WINDOWS)
299  NTV2_ASSERT(!IsOpen()); // Must be closed!
301 
302 #if defined(NTV2_NUB_CLIENT_SUPPORT)
303  if (inParser.Failed())
304  {ostringstream errs; inParser.PrintErrors(errs); DIFAIL("Bad parser: " << errs.str()); return false;}
305  if (inParser.IsLocalDevice())
306  {DIFAIL("Parser infers local device: " << inParser.InfoString()); return false;}
307 
308  NTV2Dictionary connectParams(inParser.Results());
309  // This "connectParams" dictionary has keys/values that determine which plugin to load,
310  // and any other configuration parameters specified by the caller. This dictionary is
311  // modified during the call to "CreateClient" (below) by an NTV2PluginLoader that loads,
312  // interrogates and validates the plugin. Several new keys/values are added to it during
313  // this process that describe the plugin, its signature, and any query parameters it
314  // requires or accepts for further configuration.
315  DIDBG("Opening " << inParser.InfoString());
316  NTV2RPCAPI * pClient (NTV2RPCClientAPI::CreateClient(connectParams));
317  if (!pClient)
318  return false; // Failed to instantiate plugin client
319 
320  // At this point, the plugin's NTV2RPCAPI object exists, but may or may not be useable,
321  // depending on if it's "IsConnected". Before SDK 17.1, the plugin's NTV2Connect function
322  // was commonly called directly from its constructor. After SDK 17.1.0, OpenRemote is
323  // responsible for calling NTV2Connect, to allow tools like NTV2Watcher to probe the
324  // plugin in stages via its client interface.
325  if (!pClient->IsConnected())
326  if (!pClient->NTV2Connect())
327  { DIFAIL("Failed to connect/open '" << inParser.DeviceSpec() << "'");
328  delete pClient;
329  CloseRemote();
330  return false;
331  }
332 
333  // NTV2 physical devices always have a hardware identity -- the NTV2DeviceID read from register 50.
334  // This plugin device is considered "open" if ReadRegister is successful, and returns a non-zero
335  // value that's also not DEVICE_ID_NOTFOUND. (Virtual/software devices that have no NTV2 hardware
336  // corollary should return DEVICE_ID_SOFTWARE.)
337  _pRPCAPI = pClient;
339  if (!IsRemote() || !IsOpen())
340  DIFAIL("Failed to open '" << inParser.DeviceSpec() << "'");
341  return IsRemote() && IsOpen(); // Fail if not remote nor open
342 #else // NTV2_NUB_CLIENT_SUPPORT
343  DIFAIL("SDK built without 'NTV2_NUB_CLIENT_SUPPORT' -- cannot OpenRemote '" << inParser.DeviceSpec() << "'");
344  return false;
345 #endif // NTV2_NUB_CLIENT_SUPPORT
346 } // OpenRemote
347 
348 
350 {
351  if (_pRPCAPI)
352  {
353  DIDBG("Closing remote: " << *_pRPCAPI);
354  if (_pRPCAPI->NTV2Disconnect())
355  DIINFO("Remote closed: " << *_pRPCAPI);
356  else
357  DIFAIL("Remote close (NTV2Disconnect) failed: " << *_pRPCAPI);
358  delete _pRPCAPI;
359  _pRPCAPI = AJA_NULL;
360  _boardOpened = false;
361  return true;
362  }
363  // Wasn't open
364  _boardOpened = false;
365  return false;
366 }
367 
368 
370 {
371  outCount = 0;
372  if (!NTV2_IS_VALID_INTERRUPT_ENUM(inInterrupt))
373  return false;
374  outCount = mEventCounts.at(inInterrupt);
375  return true;
376 }
377 
379 {
380  if (!NTV2_IS_VALID_INTERRUPT_ENUM(inInterrupt))
381  return false;
382  mEventCounts.at(inInterrupt) = inCount;
383  return true;
384 }
385 
387 { (void) eInterrupt;
388  outCount = 0;
389  NTV2_ASSERT(false && "Needs subclass implementation");
390  return false;
391 }
392 
394 {
395  if (!NTV2_IS_VALID_INTERRUPT_ENUM(eInterruptType))
396  return HANDLE(0);
397  return HANDLE(uint64_t(mInterruptEventHandles.at(eInterruptType)));
398 }
399 
400 bool CNTV2DriverInterface::ConfigureInterrupt (const bool bEnable, const INTERRUPT_ENUMS eInterruptType)
401 { (void) bEnable; (void) eInterruptType;
402  NTV2_ASSERT(false && "Needs subclass implementation");
403  return false;
404 }
405 
406 bool CNTV2DriverInterface::ConfigureSubscription (const bool bSubscribe, const INTERRUPT_ENUMS eInterruptType, PULWord & outSubscriptionHdl)
407 {
408  if (!NTV2_IS_VALID_INTERRUPT_ENUM(eInterruptType))
409  return false;
410  outSubscriptionHdl = mInterruptEventHandles.at(eInterruptType);
411  if (bSubscribe)
412  { // If subscribing,
413  mEventCounts [eInterruptType] = 0; // clear this interrupt's event counter
414  DIDBG("Subscribing '" << ::NTV2InterruptEnumString(eInterruptType) << "' (" << UWord(eInterruptType)
415  << "), event counter reset");
416  }
417  else
418  {
419  DIDBGX("Unsubscribing '" << ::NTV2InterruptEnumString(eInterruptType) << "' (" << UWord(eInterruptType) << "), "
420  << mEventCounts[eInterruptType] << " event(s) received");
421  }
422  return true;
423 
424 } // ConfigureSubscription
425 
426 
428 {
429  ULWord value(0);
430  if (IsOpen() && ReadRegister(kRegBoardID, value))
431  {
432  const NTV2DeviceID currentValue(NTV2DeviceID(value+0));
433  if (currentValue != _boardID)
434  DIWARN(xHEX0N(this,16) << ": NTV2DeviceID " << xHEX0N(value,8) << " (" << ::NTV2DeviceIDToString(currentValue)
435  << ") read from register " << kRegBoardID << " doesn't match _boardID " << xHEX0N(_boardID,8) << " ("
436  << ::NTV2DeviceIDToString(_boardID) << ")");
437  return currentValue;
438  }
439  return DEVICE_ID_NOTFOUND;
440 }
441 
442 
443 // Common remote card read register. Subclasses have overloaded function
444 // that does platform-specific read of register on local card.
445 bool CNTV2DriverInterface::ReadRegister (const ULWord inRegNum, ULWord & outValue, const ULWord inMask, const ULWord inShift)
446 {
447 #if defined(NTV2_NUB_CLIENT_SUPPORT)
448  if (IsRemote())
449  return _pRPCAPI->NTV2ReadRegisterRemote (inRegNum, outValue, inMask, inShift);
450 #else
451  (void) inRegNum; (void) outValue; (void) inMask; (void) inShift;
452 #endif
453  return false;
454 }
455 
457 {
458  if (!IsOpen())
459  return false; // Device not open!
460  if (inOutValues.empty())
461  return true; // Nothing to do!
462 
463  NTV2GetRegisters getRegsParams (inOutValues);
464  if (NTV2Message(reinterpret_cast<NTV2_HEADER*>(&getRegsParams)))
465  {
466  if (!getRegsParams.GetRegisterValues(inOutValues))
467  return false;
468  }
469  else // Non-atomic user-space workaround until GETREGS implemented in driver...
470  for (NTV2RegisterReadsIter iter(inOutValues.begin()); iter != inOutValues.end(); ++iter)
471  if (iter->registerNumber != kRegXenaxFlashDOUT) // Prevent firmware erase/program/verify failures
472  if (!ReadRegister (iter->registerNumber, iter->registerValue))
473  return false;
474  return true;
475 }
476 
477 #if !defined(NTV2_DEPRECATE_16_0)
478  // Common remote card read multiple registers. Subclasses have overloaded function
479  bool CNTV2DriverInterface::ReadRegisterMulti (const ULWord inNumRegs, ULWord * pOutWhichRegFailed, NTV2RegInfo pOutRegInfos[])
480  {
481  if (!pOutWhichRegFailed)
482  return false; // NULL pointer
483  *pOutWhichRegFailed = 0xFFFFFFFF;
484  if (!inNumRegs)
485  return false; // numRegs is zero
486 
487  // New in SDK 16.0: Use ReadRegs NTV2Message
488  NTV2RegReads regReads, result;
489  regReads.reserve(inNumRegs); result.reserve(inNumRegs);
490  for (size_t ndx(0); ndx < size_t(inNumRegs); ndx++)
491  regReads.push_back(pOutRegInfos[ndx]);
492  result = regReads;
493  bool retVal (ReadRegisters(result));
494  NTV2_ASSERT(result.size() <= regReads.size());
495  if (result.size() < regReads.size())
496  *pOutWhichRegFailed = result.empty() ? regReads.front().registerNumber : result.back().registerNumber;
497  return retVal;
498  }
499 
501  {
502  AJATime::Sleep(milliseconds);
503  return 0; // Beware, this function always returns zero, even if sleep was interrupted
504  }
505 #endif // !defined(NTV2_DEPRECATE_16_0)
506 
507 
508 // Common remote card write register. Subclasses overloaded this to do platform-specific register write.
509 bool CNTV2DriverInterface::WriteRegister (const ULWord inRegNum, const ULWord inValue, const ULWord inMask, const ULWord inShift)
510 {
511 #if defined(NTV2_WRITEREG_PROFILING)
512  // Recording is done in platform-specific WriteRegister
513 #endif // NTV2_WRITEREG_PROFILING
514 #if defined(NTV2_NUB_CLIENT_SUPPORT)
515  // If we get here, must be a non-physical device connection...
516  return IsRemote() ? _pRPCAPI->NTV2WriteRegisterRemote(inRegNum, inValue, inMask, inShift) : false;
517 #else
518  (void) inRegNum; (void) inValue; (void) inMask; (void) inShift;
519  return false;
520 #endif
521 }
522 
523 
525  const bool inIsRead,
526  const ULWord inFrameNumber,
527  ULWord * pFrameBuffer,
528  const ULWord inCardOffsetBytes,
529  const ULWord inTotalByteCount,
530  const bool inSynchronous)
531 {
532 #if defined(NTV2_NUB_CLIENT_SUPPORT)
534  NTV2Buffer buffer(pFrameBuffer, inTotalByteCount);
535  return _pRPCAPI->NTV2DMATransferRemote(inDMAEngine, inIsRead, inFrameNumber, buffer, inCardOffsetBytes,
536  0/*numSegs*/, 0/*hostPitch*/, 0/*cardPitch*/, inSynchronous);
537 #else
538  (void) inDMAEngine; (void) inIsRead; (void) inFrameNumber; (void) pFrameBuffer; (void) inCardOffsetBytes;
539  (void) inTotalByteCount; (void) inSynchronous;
540  return false;
541 #endif
542 }
543 
545  const bool inIsRead,
546  const ULWord inFrameNumber,
547  ULWord * pFrameBuffer,
548  const ULWord inCardOffsetBytes,
549  const ULWord inTotalByteCount,
550  const ULWord inNumSegments,
551  const ULWord inHostPitchPerSeg,
552  const ULWord inCardPitchPerSeg,
553  const bool inSynchronous)
554 {
555 #if defined(NTV2_NUB_CLIENT_SUPPORT)
557  NTV2Buffer buffer(pFrameBuffer, inTotalByteCount);
558  return _pRPCAPI->NTV2DMATransferRemote(inDMAEngine, inIsRead, inFrameNumber, buffer, inCardOffsetBytes,
559  inNumSegments, inHostPitchPerSeg, inCardPitchPerSeg, inSynchronous);
560 #else
561  (void) inDMAEngine; (void) inIsRead; (void) inFrameNumber; (void) pFrameBuffer; (void) inCardOffsetBytes;
562  (void) inTotalByteCount; (void) inNumSegments; (void) inHostPitchPerSeg; (void) inCardPitchPerSeg; (void) inSynchronous;
563  return false;
564 #endif
565 }
566 
568  const NTV2Channel inDMAChannel,
569  const bool inIsTarget,
570  const ULWord inFrameNumber,
571  const ULWord inCardOffsetBytes,
572  const ULWord inByteCount,
573  const ULWord inNumSegments,
574  const ULWord inSegmentHostPitch,
575  const ULWord inSegmentCardPitch,
576  const PCHANNEL_P2P_STRUCT & inP2PData)
577 { (void) inDMAEngine; (void) inDMAChannel; (void) inIsTarget; (void) inFrameNumber; (void) inCardOffsetBytes;
578  (void) inByteCount; (void) inNumSegments; (void) inSegmentHostPitch; (void) inSegmentCardPitch; (void) inP2PData;
579 #if defined(NTV2_NUB_CLIENT_SUPPORT)
581  // No NTV2DMATransferP2PRemote implementation yet
582 #endif
583  return false;
584 }
585 
586 // Common remote card waitforinterrupt. Subclasses have overloaded function
587 // that does platform-specific waitforinterrupt on local cards.
589 {
590 #if defined(NTV2_NUB_CLIENT_SUPPORT)
591  return _pRPCAPI ? _pRPCAPI->NTV2WaitForInterruptRemote(eInterrupt, timeOutMs) : false;
592 #else
593  (void) eInterrupt;
594  (void) timeOutMs;
595  return false;
596 #endif
597 }
598 
599 // Common remote card autocirculate. Subclasses have overloaded function
600 // that does platform-specific autocirculate on local cards.
602 {
603 #if defined(NTV2_NUB_CLIENT_SUPPORT)
604  if (IsRemote())
605  switch (autoCircData.eCommand)
606  {
607  case eStartAutoCirc:
608  case eAbortAutoCirc:
609  case ePauseAutoCirc:
610  case eFlushAutoCirculate:
611  case eGetAutoCirc:
612  case eStopAutoCirc:
613  case eInitAutoCirc:
614  case eSetActiveFrame:
615  return _pRPCAPI->NTV2AutoCirculateRemote(autoCircData);
616  default: // Others not handled
617  return false;
618  }
619  return false;
620 #else
621  (void) autoCircData;
622  return false;
623 #endif
624 }
625 
627 {
628 #if defined(NTV2_NUB_CLIENT_SUPPORT)
629  return _pRPCAPI ? _pRPCAPI->NTV2MessageRemote(pInMessage) : false;
630 #else
631  (void) pInMessage;
632  return false;
633 #endif
634 }
635 
636 
637 // Common remote card DriverGetBitFileInformation. Subclasses have overloaded function
638 // that does platform-specific function on local cards.
640 { (void)bitFileType;
641  ::memset(&bitFileInfo, 0, sizeof(bitFileInfo));
642  if (IsRemote())
643  return false;
645  return false;
646 
647  ParseFlashHeader(bitFileInfo);
648  bitFileInfo.bitFileType = 0;
649  switch (_boardID)
650  {
651  case DEVICE_ID_CORVID1: bitFileInfo.bitFileType = NTV2_BITFILE_CORVID1_MAIN; break;
652  case DEVICE_ID_CORVID22: bitFileInfo.bitFileType = NTV2_BITFILE_CORVID22_MAIN; break;
653  case DEVICE_ID_CORVID24: bitFileInfo.bitFileType = NTV2_BITFILE_CORVID24_MAIN; break;
654  case DEVICE_ID_CORVID3G: bitFileInfo.bitFileType = NTV2_BITFILE_CORVID3G_MAIN; break;
655  case DEVICE_ID_CORVID44: bitFileInfo.bitFileType = NTV2_BITFILE_CORVID44; break;
661  case DEVICE_ID_CORVID88: bitFileInfo.bitFileType = NTV2_BITFILE_CORVID88; break;
664  case DEVICE_ID_CORVIDHEVC: bitFileInfo.bitFileType = NTV2_BITFILE_CORVIDHEVC; break;
665  case DEVICE_ID_IO4K: bitFileInfo.bitFileType = NTV2_BITFILE_IO4K_MAIN; break;
666  case DEVICE_ID_IO4KPLUS: bitFileInfo.bitFileType = NTV2_BITFILE_IO4KPLUS_MAIN; break;
667  case DEVICE_ID_IO4KUFC: bitFileInfo.bitFileType = NTV2_BITFILE_IO4KUFC_MAIN; break;
669  case DEVICE_ID_IOIP_2022: bitFileInfo.bitFileType = NTV2_BITFILE_IOIP_2022; break;
670  case DEVICE_ID_IOIP_2110: bitFileInfo.bitFileType = NTV2_BITFILE_IOIP_2110; break;
672  case DEVICE_ID_IOXT: bitFileInfo.bitFileType = NTV2_BITFILE_IOXT_MAIN; break;
673  case DEVICE_ID_KONA1: bitFileInfo.bitFileType = NTV2_BITFILE_KONA1; break;
674  case DEVICE_ID_KONA3G: bitFileInfo.bitFileType = NTV2_BITFILE_KONA3G_MAIN; break;
675  case DEVICE_ID_KONA3GQUAD: bitFileInfo.bitFileType = NTV2_BITFILE_KONA3G_QUAD; break;
676  case DEVICE_ID_KONA4: bitFileInfo.bitFileType = NTV2_BITFILE_KONA4_MAIN; break;
677  case DEVICE_ID_KONA4UFC: bitFileInfo.bitFileType = NTV2_BITFILE_KONA4UFC_MAIN; break;
678  case DEVICE_ID_KONA5: bitFileInfo.bitFileType = NTV2_BITFILE_KONA5_MAIN; break;
681  case DEVICE_ID_KONA5_8K: bitFileInfo.bitFileType = NTV2_BITFILE_KONA5_8K_MAIN; break;
695  case DEVICE_ID_SOJI_OE1: bitFileInfo.bitFileType = NTV2_BITFILE_SOJI_OE1_MAIN; break;
696  case DEVICE_ID_SOJI_OE2: bitFileInfo.bitFileType = NTV2_BITFILE_SOJI_OE2_MAIN; break;
697  case DEVICE_ID_SOJI_OE3: bitFileInfo.bitFileType = NTV2_BITFILE_SOJI_OE3_MAIN; break;
698  case DEVICE_ID_SOJI_OE4: bitFileInfo.bitFileType = NTV2_BITFILE_SOJI_OE4_MAIN; break;
699  case DEVICE_ID_SOJI_OE5: bitFileInfo.bitFileType = NTV2_BITFILE_SOJI_OE5_MAIN; break;
700  case DEVICE_ID_SOJI_OE6: bitFileInfo.bitFileType = NTV2_BITFILE_SOJI_OE6_MAIN; break;
701  case DEVICE_ID_SOJI_OE7: bitFileInfo.bitFileType = NTV2_BITFILE_SOJI_OE7_MAIN; break;
705  case DEVICE_ID_KONAHDMI: bitFileInfo.bitFileType = NTV2_BITFILE_KONAHDMI; break;
714  case DEVICE_ID_KONALHI: bitFileInfo.bitFileType = NTV2_BITFILE_LHI_MAIN; break;
716  case DEVICE_ID_TTAP: bitFileInfo.bitFileType = NTV2_BITFILE_TTAP_MAIN; break;
717  case DEVICE_ID_TTAP_PRO: bitFileInfo.bitFileType = NTV2_BITFILE_TTAP_PRO_MAIN; break;
718  case DEVICE_ID_IOX3: bitFileInfo.bitFileType = NTV2_BITFILE_IOX3_MAIN; break;
719  case DEVICE_ID_KONAX: bitFileInfo.bitFileType = NTV2_BITFILE_KONAX; break;
720  case DEVICE_ID_KONAXM: bitFileInfo.bitFileType = NTV2_BITFILE_KONAXM; break;
721  case DEVICE_ID_KONAX_4CH: bitFileInfo.bitFileType = NTV2_BITFILE_KONAX_4CH; break;
722  case DEVICE_ID_KONAIP_25G: bitFileInfo.bitFileType = NTV2_BITFILE_KONAIP_25G; break;
723 
724  case DEVICE_ID_IP25_T:
725  case DEVICE_ID_IP25_R:
726  case DEVICE_ID_SOFTWARE:
727  case DEVICE_ID_NOTFOUND: bitFileInfo.bitFileType = NTV2_BITFILE_TYPE_INVALID; break;
728  #if !defined (_DEBUG)
729  default: break;
730  #endif
731  }
732  bitFileInfo.checksum = 0;
733  bitFileInfo.structVersion = 0;
734  bitFileInfo.structSize = sizeof(BITFILE_INFO_STRUCT);
735  bitFileInfo.whichFPGA = eFPGAVideoProc;
736 
737  const string bitFileDesignNameString = string(bitFileInfo.designNameStr) + ".bit";
738  ::strncpy(bitFileInfo.designNameStr, bitFileDesignNameString.c_str(), sizeof(bitFileInfo.designNameStr)-1);
739  return true;
740 }
741 
743 {
744  if (!IsDeviceReady(false) || !IsSupported(kDeviceCanDoIP))
745  return false; // cannot read flash
746 
747  string packInfo;
748  ULWord deviceID = ULWord(_boardID);
749  ReadRegister (kRegBoardID, deviceID);
750 
752  {
753  CNTV2AxiSpiFlash spiFlash(GetIndexNumber(), false);
754 
755  uint32_t offset = spiFlash.Offset(SPI_FLASH_SECTION_MCSINFO);
756  vector<uint8_t> mcsInfoData;
757  if (spiFlash.Read(offset, mcsInfoData, 256))
758  {
759  packInfo.assign(mcsInfoData.begin(), mcsInfoData.end());
760 
761  // remove any trailing nulls
762  size_t found = packInfo.find('\0');
763  if (found != string::npos)
764  {
765  packInfo.resize(found);
766  }
767  }
768  else
769  return false;
770  }
771  else
772  {
773  ULWord baseAddress = (16 * 1024 * 1024) - (3 * 256 * 1024);
774  const ULWord dwordSizeCount = 256/4;
775 
778  bool busy = true;
779  ULWord timeoutCount = 1000;
780  do
781  {
782  ULWord regValue;
784  if (regValue & BIT(8))
785  {
786  busy = true;
787  timeoutCount--;
788  }
789  else
790  busy = false;
791  } while (busy == true && timeoutCount > 0);
792  if (timeoutCount == 0)
793  return false;
794 
795  ULWord* bitFilePtr = new ULWord[dwordSizeCount];
796  for ( ULWord count = 0; count < dwordSizeCount; count++, baseAddress += 4 )
797  {
798  WriteRegister(kRegXenaxFlashAddress, baseAddress);
800  busy = true;
801  timeoutCount = 1000;
802  do
803  {
804  ULWord regValue;
806  if ( regValue & BIT(8))
807  {
808  busy = true;
809  timeoutCount--;
810  }
811  else
812  busy = false;
813  } while(busy == true && timeoutCount > 0);
814  if (timeoutCount == 0)
815  {
816  delete [] bitFilePtr;
817  return false;
818  }
819  ReadRegister(kRegXenaxFlashDOUT, bitFilePtr[count]);
820  }
821 
822  packInfo = reinterpret_cast<char*>(bitFilePtr);
823  delete [] bitFilePtr;
824  }
825 
826  istringstream iss(packInfo);
827  vector<string> results;
828  string token;
829  while (getline(iss,token, ' '))
830  results.push_back(token);
831 
832  if (results.size() < 8)
833  return false;
834 
835  packageInfo.date = results[1];
836  token = results[2];
837  token.erase(remove(token.begin(), token.end(), '\n'), token.end());
838  packageInfo.time = token;
839  packageInfo.buildNumber = results[4];
840  packageInfo.packageNumber = results[7];
841  return true;
842 }
843 
844 // Common remote card DriverGetBuildInformation. Subclasses have overloaded function
845 // that does platform-specific function on local cards.
847 {
848  ::memset(&buildInfo, 0, sizeof(buildInfo));
849  return false;
850 }
851 
852 bool CNTV2DriverInterface::BitstreamWrite (const NTV2Buffer & inBuffer, const bool inFragment, const bool inSwap)
853 {
854  NTV2Bitstream bsMsg (inBuffer,
856  (inFragment? BITSTREAM_FRAGMENT : 0) |
857  (inSwap? BITSTREAM_SWAP : 0));
858  ULWord counts(0);
860  ULWord attempts(counts >> 16), successes(counts & 0x0000FFFF);
861  attempts++;
862  const bool result (NTV2Message (reinterpret_cast<NTV2_HEADER*>(&bsMsg)));
863  if (result)
864  successes++;
865  counts = (attempts << 16) | successes;
867  return result;
868 }
869 
870 bool CNTV2DriverInterface::BitstreamReset (const bool inConfiguration, const bool inInterface)
871 {
872  NTV2Buffer inBuffer;
873  NTV2Bitstream bsMsg (inBuffer,
874  (inConfiguration? BITSTREAM_RESET_CONFIG : 0) |
875  (inInterface? BITSTREAM_RESET_MODULE : 0));
876  return NTV2Message(bsMsg);
877 }
878 
880 {
881  outRegValues.reserve(BITSTREAM_MCAP_DATA);
882  outRegValues.clear();
883 
884  NTV2Buffer inBuffer;
885  NTV2Bitstream bsMsg (inBuffer, BITSTREAM_READ_REGISTERS);
886  if (!NTV2Message(bsMsg))
887  return false;
888 
889  for (UWord ndx(0); ndx < BITSTREAM_MCAP_DATA; ndx++)
890  outRegValues.push_back(bsMsg.mRegisters[ndx]);
891 
892  return true;
893 }
894 
895 bool CNTV2DriverInterface::BitstreamLoad (const bool inSuspend, const bool inResume)
896 {
897  NTV2Buffer inBuffer;
898  NTV2Bitstream bsMsg (inBuffer,
899  (inSuspend? BITSTREAM_SUSPEND : 0) |
900  (inResume? BITSTREAM_RESUME : 0));
901  return NTV2Message(bsMsg);
902 }
903 
905  ULWord flags,
906  NTV2StreamChannel& status)
907 {
908  status.mChannel = inChannel;
909  status.mFlags = flags;
910 
911  return NTV2Message(status);
912 }
913 
915  NTV2Buffer& inBuffer,
916  ULWord64 bufferCookie,
917  ULWord flags,
918  NTV2StreamBuffer& status)
919 {
920  status.mChannel = inChannel;
921  status.mBuffer.Set (inBuffer.GetHostPointer(), inBuffer.GetByteCount());
922  status.mBufferCookie = bufferCookie;
923  status.mFlags = flags;
924 
925  return NTV2Message(status);
926 }
927 
929  NTV2Buffer& inBuffer,
930  ULWord dataSize,
931  ULWord flags,
932  ULWord delay,
933  ULWord timeout,
934  NTV2MailBuffer& status)
935 {
936  status.mChannel = inChannel;
937  status.mBuffer.Set (inBuffer.GetHostPointer(), inBuffer.GetByteCount());
938  status.mDataSize = dataSize;
939  status.mDelay = delay;
940  status.mTimeout = timeout;
941  status.mFlags = flags;
942 
943  return NTV2Message(status);
944 }
945 
946 // FinishOpen
947 // NOTE _boardID must be set before calling this routine.
949 {
950  // HACK! FinishOpen needs frame geometry to determine frame buffer size and number.
952  ULWord val1(0), val2(0);
956  NTV2PixelFormat pf(NTV2PixelFormat((val1 & 0x0F) | ((val2 & 0x1) << 4)));
957 #if !defined(NTV2_DEPRECATE_17_2)
960 #endif
961 
962  ULWord returnVal1 = false;
963  ULWord returnVal2 = false;
968 
969 #if !defined(NTV2_DEPRECATE_16_0)
976 #endif // !defined(NTV2_DEPRECATE_16_0)
977 
978 } // FinishOpen
979 
980 
982 {
983  if (!IsDeviceReady(false))
984  return false; // cannot read flash
985 
987  {
988  uint32_t val;
989  ReadRegister((0x100000 + 0x08) / 4, val);
990  if (val != 0x01)
991  return false; // cannot read flash
992  }
993 
995  {
998  bool busy = true;
999  ULWord timeoutCount = 1000;
1000  do
1001  {
1002  ULWord regValue;
1004  if (regValue & BIT(8))
1005  {
1006  busy = true;
1007  timeoutCount--;
1008  }
1009  else
1010  busy = false;
1011  } while (busy && timeoutCount);
1012  if (!timeoutCount)
1013  return false;
1014  }
1015 
1016  // Allocate header buffer, read/fill from SPI-flash...
1017  static const ULWord dwordCount(256/4);
1018  NTV2Buffer bitFileHdrBuffer(dwordCount * sizeof(ULWord));
1019  if (!bitFileHdrBuffer)
1020  return false;
1021 
1022  ULWord* pULWord(bitFileHdrBuffer), baseAddress(0);
1023  for (ULWord count(0); count < dwordCount; count++, baseAddress += 4)
1024  if (!ReadFlashULWord(baseAddress, pULWord[count]))
1025  return false;
1026 
1027  CNTV2Bitfile fileInfo;
1028  std::string headerError;
1029 #if 0 // Fake out:
1030  if (_boardID == DEVICE_ID_TTAP_PRO) // Fake TTapPro -- load "flash" from on-disk bitfile:
1031  { fileInfo.Open("/Users/demo/dev-svn/firmware/T3_Tap/t_tap_pro.bit");
1032  headerError = fileInfo.GetLastError();
1033  } else
1034 #endif
1035  headerError = fileInfo.ParseHeaderFromBuffer(bitFileHdrBuffer);
1036  if (headerError.empty())
1037  {
1038  ::strncpy(bitFileInfo.dateStr, fileInfo.GetDate().c_str(), NTV2_BITFILE_DATETIME_STRINGLENGTH);
1039  ::strncpy(bitFileInfo.timeStr, fileInfo.GetTime().c_str(), NTV2_BITFILE_DATETIME_STRINGLENGTH);
1040  ::strncpy(bitFileInfo.designNameStr, fileInfo.GetDesignName().c_str(), NTV2_BITFILE_DESIGNNAME_STRINGLENGTH);
1041  ::strncpy(bitFileInfo.partNameStr, fileInfo.GetPartName().c_str(), NTV2_BITFILE_PARTNAME_STRINGLENGTH);
1042  bitFileInfo.numBytes = ULWord(fileInfo.GetProgramStreamLength());
1043  }
1044  return headerError.empty();
1045 } // ParseFlashHeader
1046 
1047 bool CNTV2DriverInterface::ReadFlashULWord (const ULWord inAddress, ULWord & outValue, const ULWord inRetryCount)
1048 {
1049  if (!WriteRegister(kRegXenaxFlashAddress, inAddress))
1050  return false;
1052  return false;
1053  bool busy(true);
1054  ULWord timeoutCount(inRetryCount);
1055  do
1056  {
1057  ULWord regValue(0);
1059  if (regValue & BIT(8))
1060  {
1061  busy = true;
1062  timeoutCount--;
1063  }
1064  else
1065  busy = false;
1066  } while (busy && timeoutCount);
1067  if (!timeoutCount)
1068  return false;
1069  return ReadRegister(kRegXenaxFlashDOUT, outValue);
1070 }
1071 
1073 {
1074  _boardNumber = num;
1075 }
1076 
1077 
1078 //--------------------------------------------------------------------------------------------------------------------
1079 // Application acquire and release stuff
1080 //--------------------------------------------------------------------------------------------------------------------
1081 const uint32_t kAgentAppFcc (NTV2_FOURCC('A','j','a','A'));
1082 
1083 
1084 bool CNTV2DriverInterface::AcquireStreamForApplicationWithReference (const ULWord inAppCode, const int32_t inProcessID)
1085 {
1086  ULWord svcInitialized(0);
1087  if (ReadRegister(kVRegServicesInitialized, svcInitialized))
1088  if (!svcInitialized) // if services have never initialized the device
1089  if (inAppCode != kAgentAppFcc) // if not AJA Agent
1091  << " uninitialized by AJAAgent, requesting app " << xHEX0N(inAppCode,8) << ", pid=" << DEC(inProcessID));
1092 
1093  ULWord currentCode(0), currentPID(0);
1094  if (!ReadRegister(kVRegApplicationCode, currentCode) || !ReadRegister(kVRegApplicationPID, currentPID))
1095  return false;
1096 
1097  // Check if owner is deceased
1098  if (!AJAProcess::IsValid(currentPID))
1099  {
1100  // Process doesn't exist, so make the board our own
1101  ReleaseStreamForApplication (currentCode, int32_t(currentPID));
1102  }
1103 
1104  if (!ReadRegister(kVRegApplicationCode, currentCode) || !ReadRegister(kVRegApplicationPID, currentPID))
1105  return false;
1106 
1107  for (int count(0); count < 20; count++)
1108  {
1109  if (!currentPID)
1110  {
1111  // Nothing has the board
1112  if (!WriteRegister(kVRegApplicationCode, inAppCode))
1113  return false;
1114  // Just in case this is not zero
1117  return WriteRegister(kVRegApplicationPID, ULWord(inProcessID));
1118  }
1119  else if (currentCode == inAppCode && currentPID == ULWord(inProcessID))
1120  return WriteRegister(kVRegAcquireLinuxReferenceCount, 1); // Process already acquired, so bump the count
1121  // Someone else has the board, so wait and try again
1122  AJATime::Sleep(50);
1123  }
1124  return false;
1125 }
1126 
1127 bool CNTV2DriverInterface::ReleaseStreamForApplicationWithReference (const ULWord inAppCode, const int32_t inProcessID)
1128 {
1129  ULWord currentCode(0), currentPID(0), currentCount(0);
1130  if (!ReadRegister(kVRegApplicationCode, currentCode)
1131  || !ReadRegister(kVRegApplicationPID, currentPID)
1132  || !ReadRegister(kVRegAcquireLinuxReferenceCount, currentCount))
1133  return false;
1134 
1135  if (currentCode == inAppCode && currentPID == ULWord(inProcessID))
1136  {
1137  if (currentCount > 1)
1139  if (currentCount == 1)
1140  return ReleaseStreamForApplication(inAppCode, inProcessID);
1141  return true;
1142  }
1143  return false;
1144 }
1145 
1146 bool CNTV2DriverInterface::AcquireStreamForApplication (const ULWord inAppCode, const int32_t inProcessID)
1147 {
1148  ULWord svcInitialized(0);
1149  if (ReadRegister(kVRegServicesInitialized, svcInitialized))
1150  if (!svcInitialized) // if services have never initialized the device
1151  if (inAppCode != kAgentAppFcc) // if not AJA Agent
1153  << " uninitialized by AJAAgent, requesting app " << xHEX0N(inAppCode,8) << ", pid=" << DEC(inProcessID));
1154 
1155  // Loop for a while trying to acquire the board
1156  for (int count(0); count < 20; count++)
1157  {
1158  if (WriteRegister(kVRegApplicationCode, inAppCode))
1159  return WriteRegister(kVRegApplicationPID, ULWord(inProcessID));
1160  AJATime::Sleep(50);
1161  }
1162 
1163  // Get data about current owner
1164  ULWord currentCode(0), currentPID(0);
1165  if (!ReadRegister(kVRegApplicationCode, currentCode) || !ReadRegister(kVRegApplicationPID, currentPID))
1166  return false;
1167 
1168  // Check if owner is deceased
1169  if (!AJAProcess::IsValid(currentPID))
1170  { // Process doesn't exist, so make the board our own
1171  ReleaseStreamForApplication (currentCode, int32_t(currentPID));
1172  for (int count(0); count < 20; count++)
1173  {
1174  if (WriteRegister(kVRegApplicationCode, inAppCode))
1175  return WriteRegister(kVRegApplicationPID, ULWord(inProcessID));
1176  AJATime::Sleep(50);
1177  }
1178  }
1179  // Current owner is alive, so don't interfere
1180  return false;
1181 }
1182 
1183 bool CNTV2DriverInterface::ReleaseStreamForApplication (const ULWord inAppCode, const int32_t inProcessID)
1184 { (void)inAppCode; // Don't care which appCode
1185  if (WriteRegister(kVRegReleaseApplication, ULWord(inProcessID)))
1186  {
1188  return true; // We don't care if the above call failed
1189  }
1190  return false;
1191 }
1192 
1193 bool CNTV2DriverInterface::SetStreamingApplication (const ULWord inAppCode, const int32_t inProcessID)
1194 {
1195  if (!WriteRegister(kVRegForceApplicationCode, inAppCode))
1196  return false;
1197  return WriteRegister(kVRegForceApplicationPID, ULWord(inProcessID));
1198 }
1199 
1200 bool CNTV2DriverInterface::GetStreamingApplication (ULWord & outAppType, int32_t & outProcessID)
1201 {
1202  if (!ReadRegister(kVRegApplicationCode, outAppType))
1203  return false;
1205 }
1206 
1208 {
1209  if (!IsRemote())
1210  return ""; // This implementation is intended for remote/plugin devices
1211  string desc(_pRPCAPI->Description());
1212  if (desc.empty())
1213  { // Plugin/remote device didn't provide description
1214  const NTV2Dictionary parms(ConnectParams());
1215  NTV2StringList strs;
1217  strs.push_back("\"" + parms.valueForKey(kNTV2PluginRegInfoKey_LongName) + "\"");
1218  else if (parms.hasKey(kNTV2PluginRegInfoKey_ShortName))
1219  strs.push_back(parms.valueForKey(kNTV2PluginRegInfoKey_ShortName));
1221  strs.push_back(parms.valueForKey(kNTV2PluginRegInfoKey_Description));
1222  else if (parms.hasKey(kNTV2PluginRegInfoKey_Copyright))
1223  strs.push_back(parms.valueForKey(kNTV2PluginRegInfoKey_Copyright));
1224  else if (parms.hasKey(kNTV2PluginRegInfoKey_Vendor))
1225  strs.push_back(parms.valueForKey(kNTV2PluginRegInfoKey_Vendor));
1226  if (!strs.empty())
1227  desc = aja::join(strs, ", ");
1228  }
1229  return desc;
1230 }
1231 
1233 {
1234  return IsRemote() ? _pRPCAPI->ConnectParams() : NTV2Dictionary();
1235 }
1236 
1237 // This function is used by the retail ControlPanel.
1238 // Read the current RP188 registers (which typically give you the timecode corresponding to the LAST frame).
1239 // NOTE: This is a hack to avoid making a "real" driver call! Since the RP188 data requires three ReadRegister()
1240 // calls, there is a chance that it can straddle a VBI, which could give bad results. To avoid this, we
1241 // read the 3 registers until we get two consecutive passes that give us the same data. (Someday it'd
1242 // be nice if the driver automatically read these as part of its VBI IRQ handler...
1244 { (void) inChannel;
1245  if (!pRP188Data)
1246  return false;
1247 
1248  RP188_STRUCT rp188;
1249  NTV2DeviceID boardID = DEVICE_ID_NOTFOUND;
1251  ULWord dbbReg(0), msReg(0), lsReg(0);
1252 
1255  bool bLTCPort = (source == kRP188SourceLTCPort);
1256 
1257  // values come from LTC port registers
1258  if (bLTCPort)
1259  {
1260  ULWord ltcPresent;
1262 
1263  // there is no equivalent DBB for LTC port - we synthesize it here
1264  rp188.DBB = (ltcPresent) ? 0xFE000000 | NEW_SELECT_RP188_RCVD : 0xFE000000;
1265 
1266  // LTC port registers
1267  dbbReg = 0; // don't care - does not exist
1268  msReg = kRegLTCAnalogBits0_31;
1269  lsReg = kRegLTCAnalogBits32_63;
1270  }
1271  else
1272  {
1273  // values come from RP188 registers
1274  NTV2Channel channel = NTV2_CHANNEL1;
1276 
1277  if (::NTV2DeviceGetNumVideoInputs(boardID) > 1)
1278  {
1280  channel = (inputSelect == NTV2_Input2Select) ? NTV2_CHANNEL2 : NTV2_CHANNEL1;
1281  }
1282  else
1283  channel = NTV2_CHANNEL1;
1284 
1285  // rp188 registers
1286  dbbReg = (channel == NTV2_CHANNEL1 ? kRegRP188InOut1DBB : kRegRP188InOut2DBB);
1287  //Check to see if TC is received
1288  uint32_t tcReceived = 0;
1289  ReadRegister(dbbReg, tcReceived, BIT(16), 16);
1290  if(tcReceived == 0)
1291  return false;//No TC recevied
1292 
1294  switch (rp188.DBB)//What do we have?
1295  {
1296  default:
1297  case 0x01:
1298  case 0x02:
1299  {
1300  //We have VITC - what do we want?
1301  if (pRP188Data->DBB == 0x01 || pRP188Data->DBB == 0x02)
1302  { // We want VITC
1305  }
1306  else
1307  { // We want Embedded LTC, so we should check one other place
1308  uint32_t ltcPresent = 0;
1309  ReadRegister(dbbReg, ltcPresent, BIT(18), 18);
1310  if (ltcPresent != 1)
1311  return false;
1312  //Read LTC registers
1315  }
1316  break;
1317  }
1318  case 0x00:
1319  //We have LTC - do we want it?
1320  if (pRP188Data->DBB != 0x00)
1321  return false;
1324  break;
1325  }
1326  //Re-Read the whole register just in case something is expecting other status values
1327  ReadRegister (dbbReg, rp188.DBB);
1328  }
1329  ReadRegister (msReg, rp188.Low );
1330  ReadRegister (lsReg, rp188.High);
1331 
1332  // register stability filter
1333  do
1334  {
1335  *pRP188Data = rp188; // struct copy to result
1336 
1337  // read again into local struct
1338  if (!bLTCPort)
1339  ReadRegister (dbbReg, rp188.DBB);
1340  ReadRegister (msReg, rp188.Low );
1341  ReadRegister (lsReg, rp188.High);
1342 
1343  // if the new read equals the previous read, consider it done
1344  if (rp188.DBB == pRP188Data->DBB &&
1345  rp188.Low == pRP188Data->Low &&
1346  rp188.High == pRP188Data->High)
1347  break;
1348  } while (true);
1349 
1350  return true;
1351 }
1352 
1354 {
1355  if (NTV2_IS_VALID_INTERRUPT_ENUM(eInterruptType))
1356  mEventCounts[eInterruptType] += 1;
1357 
1358 } // BumpEventCount
1359 
1360 
1361 bool CNTV2DriverInterface::IsDeviceReady (const bool checkValid)
1362 {
1363  if (IsRemote())
1364  {
1365  ULWord reg(0), val(0);
1367  return true; // failed to read VReg -- assume ready
1368  if (!reg)
1369  return true; // reg number is zero -- assume ready
1370  // A non-zero register number was returned (hope it's valid)
1371  if (!ReadRegister(reg, val))
1372  return true; // failed to read -- bad reg num? -- assume device ready
1373  // ReadRegister successful!
1374  return val; // zero means "not ready"; non-zero means "ready"
1375  }
1377  return true; // Non-IP devices always ready
1378 
1380  {
1381  if (!IsMBSystemReady())
1382  return false;
1383 
1384  if (checkValid && !IsMBSystemValid())
1385  return false;
1386  }
1387  else if (!IsLPSystemReady())
1388  return false;
1389  return true; // Ready!
1390 }
1391 
1393 {
1395  {
1396  uint32_t val;
1398  return val == SAREK_IF_VERSION;
1399  }
1400  return true;
1401 }
1402 
1404 {
1406  return false; // No microblaze
1407 
1408  uint32_t val;
1410  if (val != 0x01)
1411  return false; // MB not ready
1412 
1413  // Not enough to read MB State, we need to make sure MB is running
1415  return (val < 2) ? false : true;
1416 }
1417 
1419 {
1421  return false; // No local proc
1422 
1423  uint32_t val;
1425  if (val == 0x00)
1426  return false; // MB not ready
1427  return true;
1428 }
1429 
1430 #if defined(NTV2_WRITEREG_PROFILING) // Register Write Profiling
1432  {
1433  AJAAutoLock autoLock(&mRegWritesLock);
1434  outRegWrites = mRegWrites;
1435  return true;
1436  }
1437 
1438  bool CNTV2DriverInterface::StartRecordRegisterWrites (const bool inSkipActualWrites)
1439  {
1440  AJAAutoLock autoLock(&mRegWritesLock);
1441  if (mRecordRegWrites)
1442  return false; // Already recording
1443  mRegWrites.clear();
1444  mRecordRegWrites = true;
1445  mSkipRegWrites = inSkipActualWrites;
1446  return true;
1447  }
1448 
1450  { // Identical to Start, but don't clear mRegWrites nor change mSkipRegWrites
1451  AJAAutoLock autoLock(&mRegWritesLock);
1452  if (mRecordRegWrites)
1453  return false; // Already recording
1454  mRecordRegWrites = true;
1455  return true;
1456  }
1457 
1459  { // NB: This will return false if paused
1460  AJAAutoLock autoLock(&mRegWritesLock);
1461  return mRecordRegWrites;
1462  }
1463 
1465  {
1466  AJAAutoLock autoLock(&mRegWritesLock);
1467  mRecordRegWrites = mSkipRegWrites = false;
1468  return true;
1469  }
1470 
1472  { // Identical to Stop, but don't change mSkipRegWrites
1473  AJAAutoLock autoLock(&mRegWritesLock);
1474  if (!mRecordRegWrites)
1475  return false; // Already stopped/paused
1476  mRecordRegWrites = false;
1477  return true;
1478  }
1479 
1481  {
1482  AJAAutoLock autoLock(&mRegWritesLock);
1483  return ULWord(mRegWrites.size());
1484  }
1485 #endif // NTV2_WRITEREG_PROFILING
1486 
1487 
1489 {
1490  ULWordSet result;
1491  if (!IsOpen())
1492  return result;
1493 
1494  // Remote/virtual device gets first dibs on answering...
1495  if (IsRemote() && _pRPCAPI->NTV2GetSupportedRemote (inEnumsID, result))
1496  return result;
1497 
1498  const NTV2DeviceID devID(GetDeviceID());
1499  switch (inEnumsID)
1500  {
1501  case kNTV2EnumsID_DeviceID:
1502  { const NTV2DeviceIDSet devIDs(::NTV2GetSupportedDevices());
1503  for (NTV2DeviceIDSetConstIter it(devIDs.begin()); it != devIDs.end(); ++it)
1504  result.insert(ULWord(*it));
1505  break;
1506  }
1507  case kNTV2EnumsID_Standard:
1508  { NTV2StandardSet standards;
1509  ::NTV2DeviceGetSupportedStandards (devID, standards);
1510  for (NTV2StandardSetConstIter it(standards.begin()); it != standards.end(); ++it)
1511  result.insert(ULWord(*it));
1512  break;
1513  }
1517  for (NTV2FrameBufferFormatSetConstIter it(pfs.begin()); it != pfs.end(); ++it)
1518  result.insert(ULWord(*it));
1519  break;
1520  }
1522  { NTV2GeometrySet fgs;
1524  for (NTV2GeometrySetConstIter it(fgs.begin()); it != fgs.end(); ++it)
1525  result.insert(ULWord(*it));
1526  break;
1527  }
1529  { NTV2FrameRateSet frs;
1531  for (NTV2FrameRateSetConstIter it(frs.begin()); it != frs.end(); ++it)
1532  result.insert(ULWord(*it));
1533  break;
1534  }
1536  { // Needs implementation
1537  break;
1538  }
1540  { NTV2VideoFormatSet vfs;
1542  for (NTV2VideoFormatSetConstIter it(vfs.begin()); it != vfs.end(); ++it)
1543  result.insert(ULWord(*it));
1544  break;
1545  }
1546  case kNTV2EnumsID_Mode:
1547  { if (IsSupported(kDeviceCanDoPlayback)) result.insert(ULWord(NTV2_MODE_OUTPUT));
1548  if (IsSupported(kDeviceCanDoCapture)) result.insert(ULWord(NTV2_MODE_INPUT));
1549  break;
1550  }
1552  { NTV2InputSourceSet srcs;
1554  for (NTV2InputSourceSetConstIter it(srcs.begin()); it != srcs.end(); ++it)
1555  result.insert(ULWord(*it));
1556  break;
1557  }
1559  { NTV2OutputDestinations dsts;
1561  for (NTV2OutputDestinationsConstIter it(dsts.begin()); it != dsts.end(); ++it)
1562  result.insert(ULWord(*it));
1563  break;
1564  }
1565  case kNTV2EnumsID_Channel:
1566  { for (ULWord ch(0); ch < GetNumSupported(kDeviceGetNumFrameStores); ch++)
1567  result.insert(ch);
1568  break;
1569  }
1572  break;
1573  NTV2InputSourceSet inpSrcs;
1574  ::NTV2DeviceGetSupportedInputSources (devID, inpSrcs);
1575  for (NTV2InputSourceSetConstIter it(inpSrcs.begin()); it != inpSrcs.end(); ++it)
1576  { const NTV2ReferenceSource refSrc (::NTV2InputSourceToReferenceSource(*it));
1578  if (result.find(ULWord(refSrc)) == result.end())
1579  result.insert(ULWord(refSrc));
1580  }
1581  result.insert(ULWord(NTV2_REFERENCE_FREERUN)); // Always include Free-Run
1583  result.insert(ULWord(NTV2_REFERENCE_EXTERNAL)); // Has external reference
1584  break;
1585  }
1587  { result.insert(ULWord(NTV2_AUDIO_48K)); // All boards support 48KHz PCM
1588  if (IsSupported(kDeviceCanDoAudio96K)) result.insert(ULWord(NTV2_AUDIO_96K));
1590  break;
1591  }
1594  break;
1595  NTV2InputSourceSet inpSrcs;
1596  ::NTV2DeviceGetSupportedInputSources (devID, inpSrcs);
1597  for (NTV2InputSourceSetConstIter it(inpSrcs.begin()); it != inpSrcs.end(); ++it)
1598  { const NTV2AudioSource audSrc (::NTV2InputSourceToAudioSource(*it));
1599  if (NTV2_IS_VALID_AUDIO_SOURCE(audSrc))
1600  if (result.find(ULWord(audSrc)) == result.end())
1601  result.insert(ULWord(audSrc));
1602  }
1603  break;
1604  }
1605  case kNTV2EnumsID_WidgetID:
1606  { NTV2WidgetIDSet wgts;
1607  CNTV2SignalRouter::GetWidgetIDs (devID, wgts);
1608  for (NTV2WidgetIDSetConstIter it(wgts.begin()); it != wgts.end(); ++it)
1609  result.insert(ULWord(*it));
1610  break;
1611  }
1614  if (::NTV2DeviceCanDoConversionMode (devID, cm))
1615  result.insert(ULWord(cm));
1616  break;
1617  }
1620  if (::NTV2DeviceCanDoInputTCIndex (devID, ndx))
1621  result.insert(ULWord(ndx));
1622  break;
1623  }
1626  if (::NTV2DeviceCanDoOutputTCIndex (devID, ndx))
1627  result.insert(ULWord(ndx));
1628  break;
1629  }
1630  default: break;
1631  }
1632  return result;
1633 }
1634 
1635 bool CNTV2DriverInterface::GetBoolParam (const ULWord inParamID, ULWord & outValue)
1636 {
1637  // Remote/virtual device gets first dibs on answering...
1638  if (IsRemote() && _pRPCAPI->NTV2GetBoolParamRemote (inParamID, outValue))
1639  return true;
1640 
1641  // Is there a register/bit that will answer this query?
1642  const NTV2BoolParamID paramID (NTV2BoolParamID(inParamID+0));
1643  { NTV2RegInfo regInfo; bool invertSense(false);
1644  if (GetRegInfoForBoolParam (paramID, regInfo, invertSense))
1645  {
1646  if (!ReadRegister (regInfo.registerNumber, regInfo.registerValue, regInfo.registerMask, regInfo.registerShift))
1647  return false;
1648  if (invertSense)
1649  outValue = regInfo.registerValue ? 0 : 1;
1650  else
1651  outValue = regInfo.registerValue ? 1 : 0;
1652  return true;
1653  }
1654  }
1655 
1656  // Call classic device features function...
1657  const NTV2DeviceID devID (GetDeviceID());
1658  switch (inParamID)
1659  {
1660  case kDeviceCanChangeEmbeddedAudioClock: outValue = ::NTV2DeviceCanChangeEmbeddedAudioClock(devID); break; // Deprecate?
1662  case kDeviceCanDisableUFC: outValue = ::NTV2DeviceCanDisableUFC(devID); break;
1663  case kDeviceCanDo2KVideo: outValue = ::NTV2DeviceCanDo2KVideo(devID); break;
1666  case kDeviceCanDo425Mux: outValue = ::NTV2DeviceCanDo425Mux(devID); break;
1667  case kDeviceCanDo4KVideo: outValue = ::NTV2DeviceCanDo4KVideo(devID); break;
1670  case kDeviceCanDoAnalogAudio: outValue = ::NTV2DeviceCanDoAnalogAudio(devID); break;
1671  case kDeviceCanDoAnalogVideoIn: outValue = ::NTV2DeviceCanDoAnalogVideoIn(devID); break;
1672  case kDeviceCanDoAnalogVideoOut: outValue = ::NTV2DeviceCanDoAnalogVideoOut(devID); break;
1673  case kDeviceCanDoAudio2Channels: outValue = GetNumSupported(kDeviceGetMaxAudioChannels) >= 2; break; // Deprecate?
1674  case kDeviceCanDoAudio6Channels: outValue = GetNumSupported(kDeviceGetMaxAudioChannels) >= 6; break; // Deprecate?
1675  case kDeviceCanDoAudio8Channels: outValue = GetNumSupported(kDeviceGetMaxAudioChannels) >= 8; break; // Deprecate?
1676  case kDeviceCanDoAudio96K: outValue = ::NTV2DeviceCanDoAudio96K(devID); break; // Deprecate?
1677  case kDeviceCanDoAudioDelay: outValue = ::NTV2DeviceCanDoAudioDelay(devID); break; // Deprecate?
1686  case kDeviceCanDoBreakoutBoard: outValue = ::NTV2DeviceCanDoBreakoutBoard(devID); break;
1687  case kDeviceCanDoBreakoutBox: outValue = ::NTV2DeviceCanDoBreakoutBox(devID); break;
1691  case kDeviceCanDoColorCorrection: outValue = GetNumSupported(kDeviceGetNumLUTs) > 0; break; // Deprecate?
1692  case kDeviceCanDoCustomAnc: outValue = ::NTV2DeviceCanDoCustomAnc(devID); break; // Deprecate?
1693 
1694  // FOR NOW: kDeviceCanDoCustomHancInsertion
1695  // REMOVE THIS CASE ONCE ALL KONA5 & CORVID44/12G & KONAX FIRMWARE SETS kRegCanDoStatus BIT(2):
1696  case kDeviceCanDoCustomHancInsertion: outValue = devID == DEVICE_ID_IO4KPLUS
1697  || devID == DEVICE_ID_KONA5 || devID == DEVICE_ID_KONA5_2X4K
1698  || devID == DEVICE_ID_KONA5_8K || devID == DEVICE_ID_KONA5_3DLUT
1699  || devID == DEVICE_ID_KONA5_8K_MV_TX || devID == DEVICE_ID_CORVID44_8KMK
1700  || devID == DEVICE_ID_CORVID44_8K || devID == DEVICE_ID_CORVID44_2X4K
1701  || devID == DEVICE_ID_CORVID44_PLNR || devID == DEVICE_ID_KONAX
1702  || devID == DEVICE_ID_KONAX_4CH;
1703  break;
1704 
1705  case kDeviceCanDoDSKOpacity: outValue = ::NTV2DeviceCanDoDSKOpacity(devID); break; // Deprecate?
1706  case kDeviceCanDoDualLink: outValue = ::NTV2DeviceCanDoDualLink(devID); break; // Deprecate?
1707  case kDeviceCanDoDVCProHD: outValue = ::NTV2DeviceCanDoDVCProHD(devID); break; // Deprecate?
1708  case kDeviceCanDoEnhancedCSC: outValue = ::NTV2DeviceCanDoEnhancedCSC(devID); break; // Deprecate?
1709  case kDeviceCanDoFrameStore1Display: outValue = ::NTV2DeviceCanDoFrameStore1Display(devID); break; // Deprecate?
1710  case kDeviceCanDoGPIO: outValue = ::NTV2DeviceCanDoGPIO(devID); break;
1711  case kDeviceCanDoHDMIOutStereo: outValue = ::NTV2DeviceCanDoHDMIOutStereo(devID); break; // Deprecate?
1712  case kDeviceCanDoHDV: outValue = ::NTV2DeviceCanDoHDV(devID); break; // Deprecate?
1713  case kDeviceCanDoHDVideo: outValue = ::NTV2DeviceCanDoHDVideo(devID); break; // Deprecate?
1714  case kDeviceCanDoIsoConvert: outValue = ::NTV2DeviceCanDoIsoConvert(devID); break;
1715  case kDeviceCanDoLTC: outValue = ::NTV2DeviceCanDoLTC(devID); break;
1716  case kDeviceCanDoLTCInOnRefPort: outValue = ::NTV2DeviceCanDoLTCInOnRefPort(devID); break;
1717  case kDeviceCanDoMSI: outValue = ::NTV2DeviceCanDoMSI(devID); break;
1718  case kDeviceCanDoMultiFormat: outValue = ::NTV2DeviceCanDoMultiFormat(devID); break;
1719  case kDeviceCanDoPCMControl: outValue = ::NTV2DeviceCanDoPCMControl(devID); break;
1720  case kDeviceCanDoPCMDetection: outValue = ::NTV2DeviceCanDoPCMDetection(devID); break;
1721  case kDeviceCanDoPIO: outValue = ::NTV2DeviceCanDoPIO(devID); break; // Deprecate?
1725  case kDeviceCanDoProgrammableCSC: outValue = GetNumSupported(kDeviceGetNumCSCs) > 0; break;
1727  case kDeviceCanDoProRes: outValue = ::NTV2DeviceCanDoProRes(devID); break;
1728  case kDeviceCanDoQREZ: outValue = ::NTV2DeviceCanDoQREZ(devID); break;
1729  case kDeviceCanDoQuarterExpand: outValue = ::NTV2DeviceCanDoQuarterExpand(devID); break;
1730  case kDeviceCanDoRateConvert: outValue = ::NTV2DeviceCanDoRateConvert(devID); break; // Deprecate?
1731  case kDeviceCanDoRGBPlusAlphaOut: outValue = ::NTV2DeviceCanDoRGBPlusAlphaOut(devID); break; // Deprecate?
1732  case kDeviceCanDoRP188: outValue = ::NTV2DeviceCanDoRP188(devID); break; // Deprecate?
1733  case kDeviceCanDoSDVideo: outValue = ::NTV2DeviceCanDoSDVideo(devID); break; // Deprecate?
1734  case kDeviceCanDoSDIErrorChecks: outValue = ::NTV2DeviceCanDoSDIErrorChecks(devID); break;
1735  case kDeviceCanDoStackedAudio: outValue = ::NTV2DeviceCanDoStackedAudio(devID); break; // Deprecate?
1736  case kDeviceCanDoStereoIn: outValue = ::NTV2DeviceCanDoStereoIn(devID); break; // Deprecate?
1737  case kDeviceCanDoStereoOut: outValue = ::NTV2DeviceCanDoStereoOut(devID); break; // Deprecate?
1738  case kDeviceCanDoThunderbolt: outValue = ::NTV2DeviceCanDoThunderbolt(devID); break;
1739  case kDeviceCanDoVideoProcessing: outValue = ::NTV2DeviceCanDoVideoProcessing(devID); break;
1740  case kDeviceCanMeasureTemperature: outValue = ::NTV2DeviceCanMeasureTemperature(devID); break;
1741  case kDeviceCanReportFrameSize: outValue = ::NTV2DeviceCanReportFrameSize(devID); break;
1742  case kDeviceHasBiDirectionalSDI: outValue = ::NTV2DeviceHasBiDirectionalSDI(devID); break;
1743  case kDeviceHasBracketLED: outValue = ::NTV2DeviceHasBracketLED(devID); break;
1744  case kDeviceHasColorSpaceConverterOnChannel2: outValue = ::NTV2DeviceCanDoWidget(devID, NTV2_WgtCSC2); break; // Deprecate?
1745  case kDeviceHasIDSwitch: outValue = ::NTV2DeviceCanDoIDSwitch(devID); break;
1746  case kDeviceHasNTV4FrameStores: outValue = ::NTV2DeviceHasNTV4FrameStores(devID); break;
1747  case kDeviceHasNWL: outValue = ::NTV2DeviceHasNWL(devID); break;
1748  case kDeviceHasPCIeGen2: outValue = ::NTV2DeviceHasPCIeGen2(devID); break;
1749  case kDeviceHasRetailSupport: outValue = ::NTV2DeviceHasRetailSupport(devID); break;
1750  case kDeviceHasSDIRelays: outValue = ::NTV2DeviceHasSDIRelays(devID); break;
1751  case kDeviceHasSPIFlash: outValue = ::NTV2DeviceHasSPIFlash(devID); break; // Deprecate?
1752  case kDeviceHasSPIFlashSerial: outValue = ::NTV2DeviceHasSPIFlashSerial(devID); break; // Deprecate?
1753  case kDeviceHasSPIv2: outValue = GetNumSupported(kDeviceGetSPIFlashVersion) == 2; break;
1754  case kDeviceHasSPIv3: outValue = GetNumSupported(kDeviceGetSPIFlashVersion) == 3; break;
1755  case kDeviceHasSPIv4: outValue = GetNumSupported(kDeviceGetSPIFlashVersion) == 4; break;
1756  case kDeviceIs64Bit: outValue = ::NTV2DeviceIs64Bit(devID); break; // Deprecate?
1757  case kDeviceIsDirectAddressable: outValue = ::NTV2DeviceIsDirectAddressable(devID); break; // Deprecate?
1758  case kDeviceIsExternalToHost: outValue = ::NTV2DeviceIsExternalToHost(devID); break;
1759  case kDeviceIsLocalPhysical: outValue = !IsRemote(); break;
1760  case kDeviceIsSupported: outValue = ::NTV2DeviceIsSupported(devID); break;
1761  case kDeviceNeedsRoutingSetup: outValue = ::NTV2DeviceNeedsRoutingSetup(devID); break; // Deprecate?
1763  case kDeviceCanThermostat: outValue = ::NTV2DeviceCanThermostat(devID); break;
1764  case kDeviceHasHEVCM31: outValue = ::NTV2DeviceHasHEVCM31(devID); break;
1765  case kDeviceHasHEVCM30: outValue = ::NTV2DeviceHasHEVCM30(devID); break;
1766  case kDeviceCanDoVITC2: outValue = ::NTV2DeviceCanDoVITC2(devID); break;
1767  case kDeviceCanDoHDMIHDROut: outValue = ::NTV2DeviceCanDoHDMIHDROut(devID); break;
1768  case kDeviceCanDoJ2K: outValue = ::NTV2DeviceCanDoJ2K(devID); break;
1769 
1770  case kDeviceCanDo12gRouting: outValue = ::NTV2DeviceCanDo12gRouting(devID); break;
1771  case kDeviceCanDo12GSDI: outValue = ::NTV2DeviceCanDo12GSDI(devID); break;
1772  case kDeviceCanDo2110: outValue = ::NTV2DeviceCanDo2110(devID); break;
1773  case kDeviceCanDo8KVideo: outValue = ::NTV2DeviceCanDo8KVideo(devID); break;
1774  case kDeviceCanDoAudio192K: outValue = ::NTV2DeviceCanDoAudio192K(devID); break;
1775  case kDeviceCanDoHDMIAuxCapture: outValue = ::NTV2DeviceCanDoCustomAux(devID); break;
1776  case kDeviceCanDoHDMIAuxPlayback: outValue = false && ::NTV2DeviceCanDoCustomAux(devID); break; // SDK 17.1 HDMI AUX is Capture-Only
1777  case kDeviceCanDoFramePulseSelect: outValue = ::NTV2DeviceCanDoFramePulseSelect(devID); break;
1778  case kDeviceCanDoHDMIMultiView: outValue = ::NTV2DeviceCanDoHDMIMultiView(devID); break;
1779  case kDeviceCanDoHFRRGB: outValue = ::NTV2DeviceCanDoHFRRGB(devID); break;
1780  case kDeviceCanDoIP: outValue = ::NTV2DeviceCanDoIP(devID); break;
1781  case kDeviceCanDo25GIP: outValue = ::NTV2DeviceCanDo25GIP(devID); break;
1782  case kDeviceCanDoMultiLinkAudio: outValue = ::NTV2DeviceCanDoMultiLinkAudio(devID); break;
1783  case kDeviceCanDoWarmBootFPGA: outValue = ::NTV2DeviceCanDoWarmBootFPGA(devID); break;
1788  case kDeviceHasGenlockv2: outValue = GetNumSupported(kDeviceGetGenlockVersion) == 2; break; // Deprecate
1789  case kDeviceHasGenlockv3: outValue = GetNumSupported(kDeviceGetGenlockVersion) == 3; break; // Deprecate
1790  case kDeviceHasHeadphoneJack: outValue = ::NTV2DeviceHasHeadphoneJack(devID); break;
1791  case kDeviceHasLEDAudioMeters: outValue = ::NTV2DeviceHasLEDAudioMeters(devID); break;
1792  case kDeviceHasRotaryEncoder: outValue = ::NTV2DeviceHasRotaryEncoder(devID); break;
1793  case kDeviceHasSPIv5: outValue = ::NTV2DeviceGetSPIFlashVersion(devID) == 5; break;
1794  case kDeviceHasXilinxDMA: outValue = ::NTV2DeviceHasXilinxDMA(devID); break;
1795  case kDeviceCanDoStreamingDMA: outValue = GetDeviceID() == DEVICE_ID_KONAXM; break;
1796  case kDeviceHasPWMFanControl: outValue = ::NTV2DeviceHasPWMFanControl(devID); break;
1798  || GetNumSupported(kDeviceGetNumHDMIVideoOutputs)) // At least 1 HDMI in/out
1799  && (GetDeviceID() != DEVICE_ID_KONAHDMI) // Not a KonaHDMI
1800  && (!IsSupported(kDeviceCanDoAudioMixer)); // No audio mixer
1801  break;
1804  case kDeviceCanDoVersalSysMon: outValue = ::NTV2DeviceCanDoVersalSysMon(devID); break;
1807  default: return false; // Bad param
1808  }
1809  return true; // Successfully used old ::NTV2DeviceCanDo function
1810 
1811 } // GetBoolParam
1812 
1813 
1814 bool CNTV2DriverInterface::GetNumericParam (const ULWord inParamID, ULWord & outVal)
1815 {
1816  outVal = 0;
1817 
1818  // Remote/virtual device gets first dibs on answering...
1819  if (IsRemote() && _pRPCAPI->NTV2GetNumericParamRemote (inParamID, outVal))
1820  return true;
1821 
1822  // Is there a register that will answer this query?
1823  const NTV2NumericParamID paramID (NTV2NumericParamID(inParamID+0));
1824  { NTV2RegInfo regInfo;
1825  if (GetRegInfoForNumericParam (paramID, regInfo))
1826  return ReadRegister (regInfo.registerNumber, outVal, regInfo.registerMask, regInfo.registerShift);
1827  }
1828 
1829  // Call classic device features function...
1830  const NTV2DeviceID devID (GetDeviceID());
1831  switch (paramID)
1832  {
1833  case kDeviceGetActiveMemorySize: outVal = ::NTV2DeviceGetActiveMemorySize (devID); break;
1834  case kDeviceGetDACVersion: outVal = ::NTV2DeviceGetDACVersion (devID); break;
1836  case kDeviceGetGenlockVersion: outVal = ULWord(::NTV2DeviceGetGenlockVersion (devID)); break;
1837  case kDeviceGetHDMIVersion: outVal = ::NTV2DeviceGetHDMIVersion (devID); break;
1838  case kDeviceGetLUTVersion: outVal = ::NTV2DeviceGetLUTVersion (devID); break;
1839  case kDeviceGetMaxAudioChannels: outVal = ::NTV2DeviceGetMaxAudioChannels (devID); break;
1840  case kDeviceGetMaxRegisterNumber: outVal = ::NTV2DeviceGetMaxRegisterNumber (devID); break;
1841  case kDeviceGetMaxTransferCount: outVal = ::NTV2DeviceGetMaxTransferCount (devID); break;
1851  case kDeviceGetNumAudioSystems: outVal = ::NTV2DeviceGetNumAudioSystems (devID); break;
1853  + (IsSupported(kDeviceCanDoAudioMixer) ? 1 : 0); break;
1855  case kDeviceGetNumCSCs: outVal = ::NTV2DeviceGetNumCSCs (devID); break;
1856  case kDeviceGetNumDMAEngines: outVal = ::NTV2DeviceGetNumDMAEngines (devID); break;
1857  case kDeviceGetNumDownConverters: outVal = ::NTV2DeviceGetNumDownConverters (devID); break;
1860  case kDeviceGetNumFrameStores: outVal = ::NTV2DeviceGetNumFrameStores (devID); break;
1861  case kDeviceGetNumFrameSyncs: outVal = ::NTV2DeviceGetNumFrameSyncs (devID); break;
1867  case kDeviceGetNumLTCInputs: outVal = ::NTV2DeviceGetNumLTCInputs (devID); break;
1868  case kDeviceGetNumLTCOutputs: outVal = ::NTV2DeviceGetNumLTCOutputs (devID); break;
1869  case kDeviceGetNumLUTs: outVal = ::NTV2DeviceGetNumLUTs (devID); break;
1870  case kDeviceGetNumMixers: outVal = ::NTV2DeviceGetNumMixers (devID); break;
1873  case kDeviceGetNumSerialPorts: outVal = ::NTV2DeviceGetNumSerialPorts (devID); break;
1874  case kDeviceGetNumTSIMuxers: { static const NTV2WidgetID s425MuxerIDs[] = {NTV2_Wgt425Mux1, NTV2_Wgt425Mux2,
1877  for (size_t ndx(0); ndx < sizeof(s425MuxerIDs)/sizeof(NTV2WidgetID); ndx++)
1878  if (wgtIDs.find(s425MuxerIDs[ndx]) != wgtIDs.end())
1879  outVal++;
1880  break;
1881  }
1882  case kDeviceGetNumUpConverters: outVal = ::NTV2DeviceGetNumUpConverters (devID); break;
1883  case kDeviceGetNumVideoChannels: outVal = ::NTV2DeviceGetNumVideoChannels (devID); break;
1884  case kDeviceGetNumVideoInputs: outVal = ::NTV2DeviceGetNumVideoInputs (devID); break;
1885  case kDeviceGetNumVideoOutputs: outVal = ::NTV2DeviceGetNumVideoOutputs (devID); break;
1886  case kDeviceGetPingLED: outVal = ::NTV2DeviceGetPingLED (devID); break;
1887  case kDeviceGetSPIFlashVersion: outVal = ::NTV2DeviceGetSPIFlashVersion (devID); break;
1889  + (IsSupported(kDeviceCanDoAudioMixer) ? 2 : 0); break;
1890  case kDeviceGetUFCVersion: outVal = ::NTV2DeviceGetUFCVersion (devID); break;
1891  default: return false; // Bad param
1892  }
1893  return true; // Successfully used old ::NTV2DeviceGetNum function
1894 
1895 } // GetNumericParam
1896 
1897 
1898 bool CNTV2DriverInterface::GetRegInfoForBoolParam (const NTV2BoolParamID inParamID, NTV2RegInfo & outRegInfo, bool & outFlipSense)
1899 {
1900  outRegInfo.MakeInvalid();
1901  outFlipSense = false;
1902  switch (inParamID)
1903  {
1909 
1910 // BIT(2) IN kRegCanDoStatus NOT YET IN ALL KONA5, CORVID44/12G, KONAX FIRMWARE:
1911 // case kDeviceCanDoCustomHancInsertion: outRegInfo.Set(kRegCanDoStatus, 0, kRegMaskCanDoHancInsertion, kRegShiftCanDoHancInsertion); break;
1912 
1913  // kDeviceHasBreakoutBoard's sense is opposite of "BOBAbsent", so set outFlipSense 'true':
1914  case kDeviceHasBreakoutBoard: outRegInfo.Set(kRegBOBStatus, 0, kRegMaskBOBAbsent, kRegShiftBOBAbsent); outFlipSense = true; break;
1915 
1916  default: break;
1917  }
1918  return outRegInfo.IsValid();
1919 }
1920 
1921 
1923 {
1924  outRegInfo.MakeInvalid();
1925  switch (inParamID)
1926  {
1928  default: break;
1929  }
1930  return outRegInfo.IsValid();
1931 }
1932 
1933 
1935 { (void)msgSet; (void) enable;
1936  return false;
1937 }
bool NTV2DeviceCanDoConversionMode(const NTV2DeviceID inDeviceID, const NTV2ConversionMode inConversionMode)
NTV2Channel mChannel
Stream channel.
UWord NTV2DeviceGetNumUpConverters(const NTV2DeviceID inDeviceID)
std::set< NTV2VideoFormat > NTV2VideoFormatSet
A set of distinct NTV2VideoFormat values.
#define NTV2_IS_VALID_NTV2ReferenceSource(__x__)
Definition: ntv2enums.h:1483
See Io XT.
Definition: ntv2enums.h:44
virtual bool GetNumericParam(const ULWord inParamID, ULWord &outValue)
Defines the KonaIP/IoIP registers.
virtual bool ControlDriverDebugMessages(NTV2_DriverDebugMessageSet msgSet, bool enable)
Everything needed to call CNTV2Card::ReadRegister or CNTV2Card::WriteRegister functions.
const char * NTV2InterruptEnumString(const unsigned inInterruptEnum)
Definition: ntv2debug.cpp:1175
#define BITSTREAM_READ_REGISTERS
Used in NTV2Bitstream to get status registers.
bool NTV2DeviceCanDoLTC(const NTV2DeviceID inDeviceID)
NTV2StandardSet::const_iterator NTV2StandardSetConstIter
A handy const iterator for iterating over an NTV2StandardSet.
ULWord mFlags
Action flags.
The number of cross-converters on the device.
std::set< NTV2FrameBufferFormat > NTV2FrameBufferFormatSet
A set of distinct NTV2FrameBufferFormat values.
enum _NTV2NumericParamID NTV2NumericParamID
Used with CNTV2DriverInterface::GetNumericParam to determine device capabilities. ...
virtual std::string ParseHeaderFromBuffer(const uint8_t *inBitfileBuffer, const size_t inBufferSize)
Parse a bitfile header that&#39;s stored in a buffer.
virtual bool GetRegInfoForBoolParam(const NTV2BoolParamID inParamID, NTV2RegInfo &outRegInfo, bool &outFlipSense)
Answers with the NTV2RegInfo of the register associated with the given boolean (i.e., "Can Do") device feature.
virtual bool AcquireStreamForApplicationWithReference(const ULWord inAppType, const int32_t inProcessID)
A reference-counted version of CNTV2DriverInterface::AcquireStreamForApplication useful for process g...
bool NTV2DeviceCanDoGPIO(const NTV2DeviceID inDeviceID)
virtual bool ResumeRecordRegisterWrites(void)
Resumes recording WriteRegister calls (after a prior call to PauseRecordRegisterWrites).
#define kNTV2PluginRegInfoKey_LongName
Plugin long name.
Definition: ntv2nubaccess.h:76
#define DIDBGX(__x__)
bool NTV2DeviceGetSupportedStandards(const NTV2DeviceID inDeviceID, NTV2StandardSet &outStandards)
Returns a set of distinct NTV2Standard values supported on the given device.
The number of input converter widgets on the device.
virtual bool IsSupported(const NTV2BoolParamID inParamID)
Identifies the NTV2ScanGeometry enumerated type.
The number of TSI muxers on the device. (New in SDK 17.0)
bool NTV2DeviceCanDoMultiLinkAudio(const NTV2DeviceID inDeviceID)
#define AJA_NTV2_SDK_BUILD_NUMBER
The SDK build number, an unsigned decimal integer.
Definition: ntv2version.h:16
True if device can handle 2Kx1556 (film) video.
static bool GetFirstDeviceWithID(const NTV2DeviceID inDeviceID, CNTV2Card &outDevice)
Rescans the host, and returns an open CNTV2Card instance for the first AJA device found on the host t...
NTV2OutputDestinations::const_iterator NTV2OutputDestinationsConstIter
A handy const iterator for iterating over an NTV2OutputDestinations.
True if device supports 3D video output over dual-stream SDI.
bool NTV2DeviceCanDoJ2K(const NTV2DeviceID inDeviceID)
#define kConnectParamDevSerial
Device with this serial number.
Definition: ntv2nubaccess.h:28
The version number of the device&#39;s genlock hardware/firmware. (New in SDK 17.6)
The number of SDI-embedded input audio channels supported by the device.
True if device DMA hardware supports MSI (Message Signaled Interrupts).
UWord NTV2DeviceGetNumLTCInputs(const NTV2DeviceID inDeviceID)
True if device has version 3 genlock hardware and/or firmware. (Deprecate – use kDeviceGetGenlockVer...
True if device has SPI flash hardware.
ULWord mRegisters[16]
Register data.
True if audio system(s) support 2 or more audio channels.
UWord NTV2DeviceGetNum4kQuarterSizeConverters(const NTV2DeviceID inDeviceID)
The number of analog video outputs on the device.
bool NTV2DeviceCanDoRP188(const NTV2DeviceID inDeviceID)
static bool DeviceSupported(NTV2DeviceID deviceId)
#define DIDBG(__x__)
UWord NTV2DeviceGetNumCrossConverters(const NTV2DeviceID inDeviceID)
std::set< NTV2FrameRate > NTV2FrameRateSet
A set of distinct NTV2FrameRate values. New in SDK 17.0.
True if device can do ISO conversion.
True if device has enhanced CSCs.
virtual bool ReadFlashULWord(const ULWord inAddress, ULWord &outValue, const ULWord inRetryCount=1000)
Specifies the device&#39;s internal clock.
Definition: ntv2enums.h:1459
UWord NTV2DeviceGetNumAnalogAudioOutputChannels(const NTV2DeviceID inDeviceID)
virtual bool NTV2GetNumericParamRemote(const ULWord inParamID, ULWord &outValue)
Declares the CNTV2DriverInterface base class.
ULWord registerMask
My register mask value to use in a ReadRegister or WriteRegister call.
The number of external reference video inputs on the device.
NTV2DeviceIDSet NTV2GetSupportedDevices(const NTV2DeviceKinds inKinds=NTV2_DEVICEKIND_ALL)
Returns an NTV2DeviceIDSet of devices supported by the SDK.
Definition: ntv2utils.cpp:7730
bool NTV2DeviceCanDo25GIP(const NTV2DeviceID inDeviceID)
UWord NTV2DeviceGetNum2022ChannelsSFP1(const NTV2DeviceID inDeviceID)
True if the device supports SMPTE 425 mux control.
bool NTV2DeviceCanThermostat(const NTV2DeviceID inDeviceID)
virtual bool CloseRemote(void)
Releases host resources associated with the remote/special device connection.
static void SetShareMode(const bool inSharedMode)
Specifies if subsequent Open calls should open the device in shared mode or not.
virtual bool IsLPSystemReady(void)
See KONA IP.
Definition: ntv2enums.h:71
static uint32_t gConstructCount(0)
bool NTV2DeviceCanDoPCMControl(const NTV2DeviceID inDeviceID)
bool NTV2DeviceCanDoDSKOpacity(const NTV2DeviceID inDeviceID)
See Io IP.
Definition: ntv2enums.h:41
The number of video channels supported on the device.
ULWord mFlags
Action flags.
See KONA 5.
Definition: ntv2enums.h:55
I interrogate and control an AJA video/audio capture/playout device.
Definition: ntv2card.h:28
UWord _boardNumber
My device index number.
The number of mixer/keyer widgets on the device.
NTV2FrameBufferFormat
Identifies a particular video frame buffer pixel format. See Device Frame Buffer Formats for details...
Definition: ntv2enums.h:219
True if device can squeeze/stretch between 1920x1080/1280x1080 and 1280x720/960x720.
#define BIT(_x_)
Definition: ajatypes.h:578
True if device can do 3G level B to 3G level A conversion.
True if device supports an AJA breakout box.
Identifies the NTV2DeviceID enumerated type.
The number of analog LTC outputs on the device.
The number of AES/EBU audio output channels on the device.
uint32_t * PULWord
Definition: ajatypes.h:224
See KONA 5.
Definition: ntv2enums.h:63
#define BITSTREAM_SUSPEND
Used in peta to suspend board before bitstream load.
Declares the AJADebug class.
See KONA LHe Plus.
Definition: ntv2enums.h:77
std::string valueForKey(const std::string &inKey) const
const std::string & DeviceSpec(void) const
NTV2InputVideoSelect
Definition: ntv2enums.h:2296
True if HDMI in/out supports square-division (quad) raster conversion. (New in SDK 17...
UWord NTV2DeviceGetNumFrameSyncs(const NTV2DeviceID inDeviceID)
See KONA 5.
Definition: ntv2enums.h:56
std::set< NTV2InputSource > NTV2InputSourceSet
A set of distinct NTV2InputSource values.
See Corvid 88.
Definition: ntv2enums.h:32
#define NEW_SELECT_RP188_RCVD
ULWord NTV2DeviceGetActiveMemorySize(const NTV2DeviceID inDeviceID)
enum _NTV2EnumsID NTV2EnumsID
Identifies NTV2 enumerated types, used in CNTV2DriverInterface::GetSupportedItems.
True if device can warm-boot to load updated firmware.
virtual UWord GetIndexNumber(void) const
virtual bool IsDeviceReady(const bool inCheckValid=(0))
bool NTV2DeviceCanDoHDMIOutStereo(const NTV2DeviceID inDeviceID)
bool NTV2DeviceHasNTV4FrameStores(const NTV2DeviceID inDeviceID)
bool NTV2DeviceCanDoAnalogAudio(const NTV2DeviceID inDeviceID)
#define kNTV2PluginRegInfoKey_Copyright
Plugin copyright notice.
Definition: ntv2nubaccess.h:78
True if device can display/output video from FrameStore 1.
The number of independent Audio Systems on the device.
void setDeviceIndexNumber(const UWord num)
Identifies the NTV2AudioRate enumerated type.
#define kNTV2PluginRegInfoKey_Vendor
Plugin vendor (manufacturer) name.
Definition: ntv2nubaccess.h:72
virtual bool DriverGetBuildInformation(BUILD_INFO_STRUCT &outBuildInfo)
Answers with the driver&#39;s build information.
True if device has version 2 genlock hardware and/or firmware. (Deprecate – use kDeviceGetGenlockVer...
ULWord NTV2DeviceGetLUTVersion(const NTV2DeviceID inDeviceID)
#define NTV2_IS_VALID_INTERRUPT_ENUM(__e__)
bool Failed(void) const
See Corvid 24.
Definition: ntv2enums.h:24
UWord NTV2DeviceGetNumEmbeddedAudioOutputChannels(const NTV2DeviceID inDeviceID)
bool NTV2DeviceCanDo425Mux(const NTV2DeviceID inDeviceID)
Identifies the NTV2OutputDest enumerated type.
enum _NTV2BoolParamID NTV2BoolParamID
Used with CNTV2DriverInterface::GetBoolParam to determine device capabilities.
bool NTV2DeviceCanDoMultiFormat(const NTV2DeviceID inDeviceID)
bool NTV2DeviceCanDo12GSDI(const NTV2DeviceID inDeviceID)
True if device can report if its "fail-safe" firmware is loaded/running.
bool NTV2DeviceHasSPIFlash(const NTV2DeviceID inDeviceID)
True if device connects to the host with a cable.
#define DIFAIL(__x__)
bool NTV2DeviceCanDoEnhancedCSC(const NTV2DeviceID inDeviceID)
bool NTV2DeviceCanDoStereoOut(const NTV2DeviceID inDeviceID)
ULWord GetByteCount(void) const
UWord NTV2DeviceGetNumDownConverters(const NTV2DeviceID inDeviceID)
#define kNTV2PluginRegInfoKey_ShortName
Plugin short name.
Definition: ntv2nubaccess.h:75
True if device can detect which audio channel pairs are not carrying PCM (Pulse Code Modulation) audi...
UWord NTV2DeviceGetNumSerialPorts(const NTV2DeviceID inDeviceID)
virtual bool Close(void)
Closes me, releasing host resources that may have been allocated in a previous Open call...
virtual bool ConfigureInterrupt(const bool bEnable, const INTERRUPT_ENUMS eInterruptType)
virtual void FinishOpen(void)
Initializes my member variables after a successful Open.
virtual bool GetBoolParam(const ULWord inParamID, ULWord &outValue)
#define SAREK_REGS
int32_t LWord
Definition: ajatypes.h:222
One-stop shop for parsing device specifications. (New in SDK 16.3) I do very little in the way of val...
bool NTV2DeviceCanDoProRes(const NTV2DeviceID inDeviceID)
Declares the AJATime class.
True if device has an HEVC M31 encoder.
virtual bool IsRecordingRegisterWrites(void) const
virtual bool Open(const UWord inDeviceIndex)
Opens a local/physical AJA device so it can be monitored/controlled.
True if device has LED audio meters.
virtual bool NTV2GetSupportedRemote(const ULWord inEnumsID, ULWordSet &outSupported)
#define NTV2_FOURCC(_a_, _b_, _c_, _d_)
UWord NTV2DeviceGetNumCSCs(const NTV2DeviceID inDeviceID)
if(!(riid==IID_IUnknown) &&!(riid==IID_IClassFactory))
Definition: dllentry.cpp:196
The version number of the LUT(s) on the device.
Identifies the NTV2VideoFormat enumerated type.
See KONA 4 (Quad Mode).
Definition: ntv2enums.h:48
Declares the CNTV2SpiFlash and CNTV2AxiSpiFlash classes.
True if device has SFP connectors.
#define BITSTREAM_RESUME
Used in peta to resume board after bitstream load.
The "default" timecode (mostly used by the AJA "Retail" service and Control Panel) ...
Definition: ntv2enums.h:3953
static bool GetShareMode(void)
Identifies the NTV2Channel enumerated type.
True if device widget routing can be queried or changed.
True if device can do video processing.
void MakeInvalid(void)
Invalidates me, setting my register number, value, mask and shift values to 0xFFFFFFFF.
Identifies the NTV2InputSource enumerated type.
ULWord mDelay
Trial delay (us)
virtual bool ReleaseStreamForApplication(const ULWord inAppType, const int32_t inProcessID)
Releases exclusive use of the AJA device for the given process, permitting other processes to acquire...
True if the device can do RGB over 3G Level A.
Definition: json.hpp:5362
NTV2_DriverDebugMessageSet
Definition: ntv2enums.h:3829
See KONA 5.
Definition: ntv2enums.h:58
std::set< NTV2OutputDestination > NTV2OutputDestinations
A set of distinct NTV2OutputDestination values.
static void SetOverlappedMode(const bool inOverlapMode)
Specifies if the next Open call should try to open the device in overlapped mode or not...
virtual uint32_t Offset(SpiFlashSection sectionID=SPI_FLASH_SECTION_TOTAL)
The maximum number of 32-bit words that the DMA engine can move at a time on the device.
True if device can handle QRez.
#define false
UWord NTV2DeviceGetNumAnalogVideoInputs(const NTV2DeviceID inDeviceID)
const uint32_t kAgentAppFcc(((((uint32_t)( 'A'))<< 24)|(((uint32_t)( 'j'))<< 16)|(((uint32_t)( 'a'))<< 8)|(((uint32_t)( 'A'))<< 0)))
UWord NTV2DeviceGetGenlockVersion(const NTV2DeviceID inDeviceID)
bool NTV2DeviceCanDoIsoConvert(const NTV2DeviceID inDeviceID)
See KONA 1.
Definition: ntv2enums.h:45
#define kRegSarekMBUptime
#define AJA_NTV2_SDK_VERSION_POINT
The SDK "point" release version, an unsigned decimal integer.
Definition: ntv2version.h:15
uint32_t ULWord
Definition: ajatypes.h:223
The number of DMA engines on the device.
virtual bool DmaTransfer(const NTV2DMAEngine inDMAEngine, const bool inIsRead, const ULWord inFrameNumber, ULWord *pFrameBuffer, const ULWord inCardOffsetBytes, const ULWord inTotalByteCount, const bool inSynchronous=(!(0)))
Transfers data between the AJA device and the host. This function will block and not return to the ca...
virtual bool StartRecordRegisterWrites(const bool inSkipActualWrites=(0))
Starts recording all WriteRegister calls.
See KONA 5.
Definition: ntv2enums.h:65
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They&#39;re also commonly use...
Definition: ntv2enums.h:1357
#define BITSTREAM_FRAGMENT
Used in NTV2Bitstream to indicate bitstream is a fragment.
virtual bool SetInterruptEventCount(const INTERRUPT_ENUMS inEventCode, const ULWord inCount)
Resets my interrupt event tally for the given interrupt type. (This is my count of the number of succ...
virtual NTV2Dictionary ConnectParams(void) const
short HANDLE
Definition: ajatypes.h:285
True if Audio System(s) support an adjustable delay.
True if device supports an AJA breakout board. (New in SDK 17.0)
Declares NTV2 "nub" client functions.
bool NTV2DeviceCanDoMSI(const NTV2DeviceID inDeviceID)
See Io 4K Plus.
Definition: ntv2enums.h:37
static bool gSharedMode((0))
bool hasKey(const std::string &inKey) const
#define kConnectParamDevModel
First device of this model (e.g. &#39;kona4&#39;)
Definition: ntv2nubaccess.h:29
#define NTV2DriverVersionDecode_Major(__vers__)
NTV2FrameRateSet::const_iterator NTV2FrameRateSetConstIter
A handy const iterator for iterating over an NTV2FrameRateSet.
virtual bool BitstreamLoad(const bool inSuspend, const bool inResume)
std::set< NTV2Standard > NTV2StandardSet
A set of distinct NTV2Standard values.
See Corvid 44.
Definition: ntv2enums.h:26
True if device supports grouped audio system control.
#define NTV2DriverVersionDecode_Point(__vers__)
bool NTV2DeviceNeedsRoutingSetup(const NTV2DeviceID inDeviceID)
#define NTV2_ASSERT(_expr_)
Definition: ajatypes.h:476
The number of SDI video outputs on the device.
virtual bool NTV2DMATransferRemote(const NTV2DMAEngine inDMAEngine, const bool inIsRead, const ULWord inFrameNumber, NTV2Buffer &inOutBuffer, const ULWord inCardOffsetBytes, const ULWord inNumSegments, const ULWord inSegmentHostPitch, const ULWord inSegmentCardPitch, const bool inSynchronous)
#define kConnectParamDevID
First device having this ID (e.g. &#39;0x10518400&#39;)
Definition: ntv2nubaccess.h:30
Output (playout, display) mode, which reads from device SDRAM.
Definition: ntv2enums.h:1242
See KONA 3G (Quad Mode).
Definition: ntv2enums.h:47
True if device supports streaming DMA. (New in SDK 17.1)
bool NTV2DeviceSoftwareCanChangeFrameBufferSize(const NTV2DeviceID inDeviceID)
bool NTV2DeviceIs64Bit(const NTV2DeviceID inDeviceID)
bool IsLocalDevice(void) const
bool NTV2DeviceCanDoFrameStore1Display(const NTV2DeviceID inDeviceID)
NTV2GeometrySet::const_iterator NTV2GeometrySetConstIter
A handy const iterator for iterating over an NTV2GeometrySet.
NTV2FrameBufferFormat NTV2PixelFormat
An alias for NTV2FrameBufferFormat.
Definition: ntv2enums.h:260
virtual size_t GetProgramStreamLength(void) const
Definition: ntv2bitfile.h:210
virtual bool AcquireStreamForApplication(const ULWord inAppType, const int32_t inProcessID)
Reserves exclusive use of the AJA device for a given process, preventing other processes on the host ...
True if device has any audio output capability (SDI, HDMI or analog) (New in SDK 17.1)
The total number of audio systems on the device, including host audio and mixer audio systems...
bool NTV2DeviceHasSPIFlashSerial(const NTV2DeviceID inDeviceID)
virtual bool NTV2GetBoolParamRemote(const ULWord inParamID, ULWord &outValue)
virtual bool IsRemote(void) const
See KONA 5.
Definition: ntv2enums.h:66
bool NTV2DeviceCanReportFailSafeLoaded(const NTV2DeviceID inDeviceID)
bool NTV2DeviceHasBiDirectionalAnalogAudio(const NTV2DeviceID inDeviceID)
True if device is 64-bit addressable.
True if device can read LTC (Linear TimeCode) from its reference input.
See T-TAP.
Definition: ntv2enums.h:93
NTV2TCIndex
These enum values are indexes into the capture/playout AutoCirculate timecode arrays.
Definition: ntv2enums.h:3951
True if device can mark specific audio channel pairs as not carrying PCM (Pulse Code Modulation) audi...
Specifies the External Reference connector.
Definition: ntv2enums.h:1456
True if device SDI connectors are bi-directional.
static bool GetFirstDeviceWithName(const std::string &inNameSubString, CNTV2Card &outDevice)
Rescans the host, and returns an open CNTV2Card instance for the first AJA device whose device identi...
bool GetRegisterValues(NTV2RegisterValueMap &outValues) const
Returns an NTV2RegisterValueMap built from my mOutGoodRegisters and mOutValues fields.
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 ...
Identifies the NTV2AudioSource enumerated type.
UWord NTV2DeviceGetNumHDMIVideoOutputs(const NTV2DeviceID inDeviceID)
I&#39;m the base class that undergirds the platform-specific derived classes (from which CNTV2Card is ult...
An object that can connect to, and operate remote or fake devices. I have three general API groups: ...
True if device has CSCs capable of splitting the key (alpha) and YCbCr (fill) from RGB frame buffers ...
The version number of the UFC on the device.
True if device has at least one programmable color space converter widget.
See KONA 5.
Definition: ntv2enums.h:62
True if device supports 3D video input over dual-stream SDI.
True if device supports Programmed I/O.
bool NTV2DeviceCanDoInputTCIndex(const NTV2DeviceID inDeviceID, const NTV2TCIndex inTCIndex)
True if device SPIFlash ROM is bank-selected. (New in SDK 17.1)
virtual std::string GetDesignName(void) const
Definition: ntv2bitfile.h:139
The highest register number for the device.
Identifies the NTV2RefSource enumerated type.
ULWord registerValue
My register value to use in a ReadRegister or WriteRegister call.
Use kDeviceGetSPIVersion instead.
UWord NTV2DeviceGetNumInputConverters(const NTV2DeviceID inDeviceID)
static NTV2StringList GetLegalSchemeNames(void)
NTV2DeviceID
Identifies a specific AJA NTV2 device model number. The NTV2DeviceID is actually the PROM part number...
Definition: ntv2enums.h:20
virtual bool SetStreamingApplication(const ULWord inAppType, const int32_t inProcessID)
Sets the four-CC type and process ID of the application that should "own" the AJA device (i...
See KONA 5.
Definition: ntv2enums.h:57
ULWord registerNumber
My register number to use in a ReadRegister or WriteRegister call.
The highest bit number of the LED bits in the Global Control Register on the device.
bool NTV2DeviceCanDoDualLink(const NTV2DeviceID inDeviceID)
NTV2DeviceID _boardID
My cached device ID.
bool NTV2DeviceCanDoWidget(const NTV2DeviceID inDeviceID, const NTV2WidgetID inWidgetID)
Enumerations for controlling NTV2 devices.
virtual bool PauseRecordRegisterWrites(void)
Pauses recording WriteRegister calls.
void Set(const ULWord inRegNum, const ULWord inValue, const ULWord inMask=0xFFFFFFFF, const ULWord inShift=0)
Sets me from the given parameters.
The number of FrameStores on the device.
int16_t Word
Definition: ajatypes.h:220
virtual bool NTV2Disconnect(void)
Disconnects me from the remote/fake host, closing the connection.
See Io 4K (Quad Mode).
Definition: ntv2enums.h:36
True if device can handle quarter-sized frames (pixel-halving and line-halving during input...
virtual bool IsOpen(void) const
virtual bool OpenLocalPhysical(const UWord inDeviceIndex)
Opens the local/physical device connection.
True if device has bypass relays on its SDI connectors.
See KONA LHi.
Definition: ntv2enums.h:78
Invalid or "not found".
Definition: ntv2enums.h:98
bool _boardOpened
True if I&#39;m open and connected to the device.
#define AJA_NTV2_SDK_VERSION_MAJOR
The SDK major version number, an unsigned decimal integer.
Definition: ntv2version.h:13
See Corvid HB-R.
Definition: ntv2enums.h:34
NTV2DeviceIDSet::const_iterator NTV2DeviceIDSetConstIter
A convenient const iterator for NTV2DeviceIDSet.
Definition: ntv2utils.h:1046
bool NTV2DeviceCanDoHDV(const NTV2DeviceID inDeviceID)
virtual const std::string & GetLastError(void) const
Definition: ntv2bitfile.h:149
NTV2ReferenceSource
These enum values identify a specific source for the device&#39;s (output) reference clock.
Definition: ntv2enums.h:1454
#define kRegSarekIfVersion
virtual bool ReadRegisters(NTV2RegisterReads &inOutValues)
Reads the register(s) specified by the given NTV2RegInfo sequence.
virtual void BumpEventCount(const INTERRUPT_ENUMS eInterruptType)
Atomically increments the event count tally for the given interrupt type.
static bool GetDeviceWithSerial(const std::string &inSerialNumber, CNTV2Card &outDevice)
Rescans the host, and returns an open CNTV2Card instance for the first AJA device whose serial number...
NTV2VideoFormatSet::const_iterator NTV2VideoFormatSetConstIter
A handy const iterator for iterating over an NTV2VideoFormatSet.
UWord NTV2DeviceGetNumFrameStores(const NTV2DeviceID inDeviceID)
bool NTV2DeviceCanDoAudio96K(const NTV2DeviceID inDeviceID)
virtual bool NTV2MessageRemote(NTV2_HEADER *pInMessage)
True if device can squeeze/stretch between 1920x1080 and 1440x1080.
virtual bool Open(const std::string &inBitfilePath)
Opens the bitfile at the given path, then parses its header.
True if device supports JPEG 2000 codec.
NTV2Channel mChannel
Stream channel.
NTV2DMAEngine
Definition: ntv2enums.h:1856
#define BITSTREAM_RESET_CONFIG
Used in NTV2Bitstream to reset config.
#define AJA_NULL
Definition: ajatypes.h:167
virtual const std::string & GetTime(void) const
Definition: ntv2bitfile.h:134
True if device has attached breakout board. (New in SDK 17.0)
True if device has LED(s) on the card bracket. (New in SDK 18.0)
bool NTV2DeviceCanDoHFRRGB(const NTV2DeviceID inDeviceID)
UWord NTV2DeviceGetDownConverterDelay(const NTV2DeviceID inDeviceID)
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...
True if device has any SDI, HDMI or analog video outputs.
The number of up-converters on the device.
See KONA 5.
Definition: ntv2enums.h:61
True if device has any audio input capability (SDI, HDMI or analog) (New in SDK 17.1)
See KONA 5.
Definition: ntv2enums.h:67
True if device has a headphone jack.
bool NTV2DeviceHasPWMFanControl(const NTV2DeviceID inDeviceID)
Declares the most fundamental data types used by NTV2. Since Windows NT was the first principal devel...
std::set< NTV2WidgetID > NTV2WidgetIDSet
A collection of distinct NTV2WidgetID values.
See Corvid 44 12G.
Definition: ntv2enums.h:31
virtual bool BitstreamReset(const bool inConfiguration, const bool inInterface)
std::vector< ULWord > NTV2ULWordVector
An ordered sequence of ULWords.
virtual bool CloseLocalPhysical(void)
Releases host resources associated with the local/physical device connection.
Defines for the NTV2 SDK version number, used by ajantv2/includes/ntv2enums.h. See the ajantv2/includ...
enum _INTERRUPT_ENUMS_ INTERRUPT_ENUMS
True if device has 25Gbps SFPs. (New in SDK 18.0)
static void Sleep(const int32_t inMilliseconds)
Suspends execution of the current thread for a given number of milliseconds.
Definition: systemtime.cpp:284
See KONA 5.
Definition: ntv2enums.h:54
bool NTV2DeviceIsSupported(const NTV2DeviceID inDeviceID)
True if device has at least one RS-422 serial port, and it (they) can be programmed (for baud rate...
bool IsValid(void) const
True if device has a pair of unbalanced RCA audio monitor output connectors.
Identifies the NTV2Standard enumerated type.
ULWord NTV2DeviceGetMaxTransferCount(const NTV2DeviceID inDeviceID)
True if device uses a "stacked" arrangement of its audio buffers.
else retVal
Definition: ntv2vcam.cpp:1100
std::set< ULWord > ULWordSet
A collection of unique ULWord (uint32_t) values.
#define DIWARN(__x__)
bool mRecordRegWrites
True if recording; otherwise false when not recording.
std::vector< std::string > NTV2StringList
Definition: ntv2utils.h:1155
#define BITSTREAM_MCAP_DATA
MCAP data register.
virtual bool GetRegInfoForNumericParam(const NTV2NumericParamID inParamID, NTV2RegInfo &outRegInfo)
Answers with the NTV2RegInfo of the register associated with the given numeric (i.e., "Get Num") device feature.
Software device that doesn&#39;t emulate one of the above devices.
Definition: ntv2enums.h:83
#define kNTV2PluginRegInfoKey_Description
Brief plugin description.
Definition: ntv2nubaccess.h:77
#define kRegSarekMBState
All new NTV2 structs start with this common header.
NTV2RegWrites NTV2RegisterReads
AJALock mRegWritesLock
Guard mutex for mRegWrites.
ULWord registerShift
My register shift value to use in a ReadRegister or WriteRegister call.
UWord NTV2DeviceGetNumMixers(const NTV2DeviceID inDeviceID)
bool NTV2DeviceGetSupportedFrameRates(const NTV2DeviceID inDeviceID, NTV2FrameRateSet &outRates)
Returns a set of distinct NTV2FrameRate values supported on the given device.
bool NTV2DeviceCanDo3GLevelConversion(const NTV2DeviceID inDeviceID)
True if device has 12G SDI connectors.
std::set< NTV2FrameGeometry > NTV2GeometrySet
A set of distinct NTV2FrameGeometry values.
_EventHandles mInterruptEventHandles
For subscribing to each possible event, one for each interrupt type.
bool NTV2DeviceHasLEDAudioMeters(const NTV2DeviceID inDeviceID)
True if device is supported by AJA "retail" software (AJA ControlPanel & ControlRoom).
The maximum number of audio channels that a single Audio System can support on the device...
See KONA 5.
Definition: ntv2enums.h:59
bool NTV2DeviceCanDoThunderbolt(const NTV2DeviceID inDeviceID)
bool NTV2DeviceHasBiDirectionalSDI(const NTV2DeviceID inDeviceID)
ULWord NTV2DeviceGetHDMIVersion(const NTV2DeviceID inDeviceID)
bool NTV2DeviceCanDoStereoIn(const NTV2DeviceID inDeviceID)
bool NTV2DeviceCanDoPCMDetection(const NTV2DeviceID inDeviceID)
static int32_t Increment(int32_t volatile *pTarget)
Definition: atomic.cpp:82
True if device can rasterize 4 HD signals into a single HDMI output.
virtual bool NTV2WaitForInterruptRemote(const INTERRUPT_ENUMS eInterrupt, const ULWord timeOutMs)
bool NTV2DeviceGetSupportedVideoFormats(const NTV2DeviceID inDeviceID, NTV2VideoFormatSet &outFormats)
Returns a set of distinct NTV2VideoFormat values supported on the given device.
ULWord NTV2DeviceGetUFCVersion(const NTV2DeviceID inDeviceID)
UWord NTV2DeviceGetNumAnalogVideoOutputs(const NTV2DeviceID inDeviceID)
virtual bool ParseFlashHeader(BITFILE_INFO_STRUCT &outBitfileInfo)
ULWord NTV2DeviceGetPingLED(const NTV2DeviceID inDeviceID)
See KONA HDMI.
Definition: ntv2enums.h:68
bool NTV2DeviceHasPCIeGen2(const NTV2DeviceID inDeviceID)
True if device supports 2nd-generation PCIe.
True if audio system(s) support 6 or more audio channels.
virtual bool GetRecordedRegisterWrites(NTV2RegisterWrites &outRegWrites) const
Answers with the recorded register writes.
static NTV2RPCClientAPI * CreateClient(NTV2ConnectParams &inParams)
Instantiates a new NTV2RPCClientAPI instance using the given NTV2ConnectParams.
virtual bool GetPackageInformation(PACKAGE_INFO_STRUCT &outPkgInfo)
Answers with the IP device&#39;s package information.
bool NTV2DeviceCanReportFrameSize(const NTV2DeviceID inDeviceID)
#define NTV2_WRITEREG_PROFILING
Definition: ajatypes.h:74
True if device is local-host-attached, and not remote, software or virtual (new in SDK 17...
virtual bool ReleaseStreamForApplicationWithReference(const ULWord inAppType, const int32_t inProcessID)
A reference-counted version of CNTV2DriverInterface::ReleaseStreamForApplication useful for process g...
Specifies channel or FrameStore 2 (or the 2nd item).
Definition: ntv2enums.h:1360
See Corvid 44 12G.
Definition: ntv2enums.h:27
virtual NTV2DeviceID GetDeviceID(void)
bool NTV2DeviceHasSDIRelays(const NTV2DeviceID inDeviceID)
Identifies the NTV2FrameGeometry enumerated type.
virtual bool ReadRegisterMulti(const ULWord numRegs, ULWord *pOutWhichRegFailed, NTV2RegInfo aRegs[])
uint64_t ULWord64
Definition: ajatypes.h:226
NTV2Buffer mBuffer
Virtual address of a mail buffer and its length.
NTV2Buffer mBuffer
Virtual address of a stream buffer and its length.
NTV2ConnectParams Results(void) const
See Io Express.
Definition: ntv2enums.h:39
True if device has GPIO interface. (New in SDK 18.0)
True if frame buffer sizes are not fixed.
bool NTV2DeviceCanDo2KVideo(const NTV2DeviceID inDeviceID)
The number of quarter-size 4K/UHD down-converters on the device.
This is used by the CNTV2Card::ReadRegisters function.
Identifies the NTV2TCIndex enumerated type for output.
ULWord NTV2DeviceGetNumDMAEngines(const NTV2DeviceID inDeviceID)
True if device is direct addressable.
True if device has any SDI, HDMI or analog video inputs.
UWord NTV2DeviceGetNumVideoInputs(const NTV2DeviceID inDeviceID)
True if device has serial SPI flash hardware.
See KONA LHi.
Definition: ntv2enums.h:79
ULWord NTV2DeviceGetNumberFrameBuffers(NTV2DeviceID id, NTV2FrameGeometry fg, NTV2FrameBufferFormat fbf)
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...
NTV2BitFileType
Definition: ntv2enums.h:3349
True if device can report its frame size.
bool NTV2DeviceCanDisableUFC(const NTV2DeviceID inDeviceID)
bool NTV2DeviceCanDo4KVideo(const NTV2DeviceID inDeviceID)
Declares the CNTV2DeviceScanner class.
True if device has any AES audio output channels (New in SDK 17.1)
virtual bool NTV2ReadRegisterRemote(const ULWord regNum, ULWord &outRegValue, const ULWord regMask, const ULWord regShift)
bool NTV2DeviceCanReportRunningFirmwareDate(const NTV2DeviceID inDeviceID)
virtual std::string GetDescription(void) const
virtual bool NTV2Message(NTV2_HEADER *pInMessage)
Sends a message to the NTV2 driver (the new, improved, preferred way).
bool NTV2DeviceCanDoRateConvert(const NTV2DeviceID inDeviceID)
static bool GetOverlappedMode(void)
ULWord deviceIndex
Device index number – this will be phased out someday.
The number of HDMI video outputs on the device.
Use kDeviceGetSPIVersion instead.
bool NTV2DeviceGetSupportedPixelFormats(const NTV2DeviceID inDeviceID, NTV2PixelFormats &outFormats)
Returns a set of distinct NTV2FrameBufferFormat values supported on the given device.
#define BITSTREAM_SWAP
Used in NTV2Bitstream to byte swap bitstream data.
The number of SDI-embedded output audio channels supported by the device.
UWord NTV2DeviceGetNumAudioSystems(const NTV2DeviceID inDeviceID)
static uint32_t gCloseCount(0)
Declares the AJAProcess class.
This is used for bitstream maintainance. (New in SDK 16.0)
See KONA 5.
Definition: ntv2enums.h:50
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.).
The number of frame sync widgets on the device.
virtual bool DriverGetBitFileInformation(BITFILE_INFO_STRUCT &outBitFileInfo, const NTV2BitFileType inBitFileType=NTV2_VideoProcBitFile)
defined(NTV2_DEPRECATE_17_2)
bool NTV2DeviceHasAudioMonitorRCAJacks(const NTV2DeviceID inDeviceID)
See KONA IP.
Definition: ntv2enums.h:72
Use kDeviceGetSPIVersion instead.
bool NTV2DeviceGetSupportedOutputDests(const NTV2DeviceID inDeviceID, NTV2OutputDestinations &outOutputDests, const NTV2IOKinds inKinds=NTV2_IOKINDS_ALL)
Returns a set of distinct NTV2OutputDest values supported on the given device.
True if device can handle SD (Standard Definition) video.
std::string NTV2DeviceIDToString(const NTV2DeviceID inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:4608
Declares the AJAAtomic class.
bool NTV2DeviceCanDoIDSwitch(const NTV2DeviceID inDeviceID)
virtual ~CNTV2DriverInterface()
My destructor.
NTV2InputSourceSet::const_iterator NTV2InputSourceSetConstIter
A handy const iterator for iterating over an NTV2InputSourceSet.
bool NTV2DeviceCanDoSDIErrorChecks(const NTV2DeviceID inDeviceID)
True if device mixer/keyer supports adjustable opacity.
#define BITSTREAM_WRITE
Used in NTV2Bitstream to write a bitstream.
ULWord mTimeout
Timeout (us)
True if device has a crosspoint connection ROM (New in SDK 17.0)
True if device supports 10-bit RGB input/output over 2-wire SDI.
bool NTV2DeviceCanDo12gRouting(const NTV2DeviceID inDeviceID)
UWord NTV2DeviceGetNumEmbeddedAudioInputChannels(const NTV2DeviceID inDeviceID)
NTV2WidgetIDSet::const_iterator NTV2WidgetIDSetConstIter
An iterator for iterating over a read-only NTV2WidgetIDSet.
#define kConnectParamDevIndex
Device having this index number.
Definition: ntv2nubaccess.h:27
True if device frame buffer size can be changed.
bool NTV2DeviceIsDirectAddressable(const NTV2DeviceID inDeviceID)
bool NTV2DeviceCanDoStackedAudio(const NTV2DeviceID inDeviceID)
static uint32_t gOpenCount(0)
virtual std::string Description(void) const
The number of analog audio output channels on the device.
See KONA 5.
Definition: ntv2enums.h:64
virtual bool Read(const uint32_t address, std::vector< uint8_t > &data, uint32_t maxBytes=1)
True if Audio System(s) support a 192kHz sample rate.
Use kDeviceGetSPIVersion instead.
True if device has one or more analog video outputs.
#define DEC(__x__)
static bool GetDeviceInfo(const ULWord inDeviceIndexNumber, NTV2DeviceInfo &outDeviceInfo, const bool inRescan=(0))
virtual bool StreamBufferOps(const NTV2Channel inChannel, NTV2Buffer &inBuffer, ULWord64 bufferCookie, ULWord flags, NTV2StreamBuffer &status)
See Corvid 22.
Definition: ntv2enums.h:23
NTV2FrameGeometry
Identifies a particular video frame geometry.
Definition: ntv2enums.h:348
UWord NTV2DeviceGetNumOutputConverters(const NTV2DeviceID inDeviceID)
std::ostream & PrintErrors(std::ostream &oss) const
The number of analog LTC inputs on the device.
bool NTV2DeviceCanDoWarmBootFPGA(const NTV2DeviceID inDeviceID)
See Corvid HEVC.
Definition: ntv2enums.h:35
bool NTV2DeviceCanDoRGBPlusAlphaOut(const NTV2DeviceID inDeviceID)
The number of analog video inputs on the device.
The total number of audio systems on the device that can read/write audio buffer memory. Includes host audio system, if present. (New in SDK 17.0)
UWord NTV2DeviceGetNumLUTs(const NTV2DeviceID inDeviceID)
True if device supports 1080p RGB at more than 50Hz frame rates.
Declares numerous NTV2 utility functions.
True if device supports 12G routing crosspoints.
virtual Word SleepMs(const LWord msec)
bool NTV2DeviceHasRetailSupport(const NTV2DeviceID inDeviceID)
The version number of the DAC on the device.
bool Set(const void *pInUserPointer, const size_t inByteCount)
Sets (or resets) me from a client-supplied address and size.
CNTV2DriverInterface()
My default constructor.
True if device can rasterize 4 HD signals into a single HDMI output.
UWord NTV2DeviceGetNum2022ChannelsSFP2(const NTV2DeviceID inDeviceID)
ULWord NTV2DeviceGetMaxRegisterNumber(const NTV2DeviceID inDeviceID)
bool NTV2DeviceCanDoHDVideo(const NTV2DeviceID inDeviceID)
virtual ULWord GetNumSupported(const NTV2NumericParamID inParamID)
virtual const std::string & GetDate(void) const
Definition: ntv2bitfile.h:129
virtual bool StreamChannelOps(const NTV2Channel inChannel, ULWord flags, NTV2StreamChannel &status)
static bool GetWidgetIDs(const NTV2DeviceID inDeviceID, NTV2WidgetIDSet &outWidgets)
Returns the widget IDs supported by the given device.
virtual bool GetInterruptCount(const INTERRUPT_ENUMS eInterrupt, ULWord &outCount)
Answers with the number of interrupts of the given type processed by the driver.
True if device supports SMPTE ST2110.
True if device can perform SDI error checking.
virtual bool OpenRemote(const NTV2DeviceSpecParser &inSpec)
Peforms the housekeeping details of opening the remote/virtual device using the given specParser...
The number of output converter widgets on the device.
AUTO_CIRC_COMMAND eCommand
True if device has any analog inputs or outputs.
True if the device can handle 4K/UHD video.
bool NTV2DeviceCanDoAudioDelay(const NTV2DeviceID inDeviceID)
static bool gOverlappedMode((0))
The number of RS-422 serial ports on the device.
#define NTV2_BITFILE_PARTNAME_STRINGLENGTH
True if device has SDI ANC inserter/extractor firmware.
UWord NTV2DeviceGetNumHDMIAudioInputChannels(const NTV2DeviceID inDeviceID)
Declares the CNTV2Bitfile class.
ULWord mFlags
Action flags.
See Io X3.
Definition: ntv2enums.h:43
bool NTV2DeviceCanDoVideoProcessing(const NTV2DeviceID inDeviceID)
NTV2WidgetID
Definition: ntv2enums.h:2909
bool NTV2DeviceCanDo8KVideo(const NTV2DeviceID inDeviceID)
bool NTV2DeviceCanChangeEmbeddedAudioClock(const NTV2DeviceID inDeviceID)
uint16_t UWord
Definition: ajatypes.h:221
#define NTV2DriverVersionDecode_Build(__vers__)
True if device supports HDMI HDR output.
True if device can measure its FPGA die temperature.
_EventCounts mEventCounts
My event tallies, one for each interrupt type. Note that these.
bool NTV2DeviceCanDoQuarterExpand(const NTV2DeviceID inDeviceID)
True if there&#39;s at least one UFC, and it can be disabled.
UWord NTV2DeviceGetNumLTCOutputs(const NTV2DeviceID inDeviceID)
Specifies channel or FrameStore 1 (or the first item).
Definition: ntv2enums.h:1359
True if device can report its running (and not necessarily installed) firmware date.
bool NTV2DeviceHasNWL(const NTV2DeviceID inDeviceID)
See Corvid 44 12G.
Definition: ntv2enums.h:29
True if device supports Versal Adaptive SoC System Monitor.
Calculate based on if NTV2_WgtCSC2 is present.
See Io IP.
Definition: ntv2enums.h:40
True if device is supported by this SDK.
bool NTV2DeviceHasHEVCM31(const NTV2DeviceID inDeviceID)
bool NTV2DeviceGetSupportedInputSources(const NTV2DeviceID inDeviceID, NTV2InputSourceSet &outInputSources, const NTV2IOKinds inKinds=NTV2_IOKINDS_ALL)
Returns a set of distinct NTV2InputSource values supported on the given device.
bool NTV2DeviceCanDoRGBLevelAConversion(const NTV2DeviceID inDeviceID)
#define xHEX0N(__x__, __n__)
bool NTV2DeviceIsExternalToHost(const NTV2DeviceID inDeviceID)
A simple (not thread-safe) set of key/value pairs. (New in SDK 16.3)
The number of microphone inputs on the device.
The number of HDMI audio input channels on the device.
True if device supports frame pulse source independent of reference source.
bool NTV2DeviceCanDoSDVideo(const NTV2DeviceID inDeviceID)
virtual bool WaitForInterrupt(const INTERRUPT_ENUMS eInterrupt, const ULWord timeOutMs=68)
See Io 4K (UFC Mode).
Definition: ntv2enums.h:38
virtual ULWordSet GetSupportedItems(const NTV2EnumsID inEnumsID)
The number of 2022 channels configured on SFP 2 on the device.
See Corvid, Corvid 3G.
Definition: ntv2enums.h:22
True if device has any LUTs.
bool NTV2DeviceHasRotaryEncoder(const NTV2DeviceID inDeviceID)
NTV2RegWritesIter NTV2RegisterReadsIter
True if device has HDMI AUX data extractor(s).
#define NTV2_IS_VALID_AUDIO_SOURCE(_x_)
Definition: ntv2enums.h:2020
bool NTV2DeviceCanDoAudio192K(const NTV2DeviceID inDeviceID)
True if device can read LTC (Linear TimeCode) from one of its inputs.
See KONA 5.
Definition: ntv2enums.h:51
#define NTV2DriverVersionDecode_Minor(__vers__)
The SPI-flash version on the device. (New in SDK 17.1)
True if device supports 3D/stereo HDMI video output.
See Corvid 44.
Definition: ntv2enums.h:33
NTV2AudioSource
This enum value determines/states where an audio system will obtain its audio samples.
Definition: ntv2enums.h:2005
The down-converter delay on the device.
True if device has a PWM-controlled cooling fan. (New in SDK 17.1)
bool NTV2DeviceHasHeadphoneJack(const NTV2DeviceID inDeviceID)
virtual const std::string & GetPartName(void) const
Definition: ntv2bitfile.h:144
bool NTV2DeviceCanDoHDMIHDROut(const NTV2DeviceID inDeviceID)
#define DIINFO(__x__)
#define BITSTREAM_RESET_MODULE
Used in NTV2Bitstream to reset module.
std::string vdevUrl
See Corvid 44 12G.
Definition: ntv2enums.h:28
Input (capture) mode, which writes into device SDRAM.
Definition: ntv2enums.h:1244
virtual bool StopRecordRegisterWrites(void)
Stops recording all WriteRegister calls.
bool NTV2DeviceGetSupportedGeometries(const NTV2DeviceID inDeviceID, NTV2GeometrySet &outGeometries)
Returns a set of distinct NTV2FrameGeometry values supported on the given device. ...
bool NTV2DeviceCanDoDVCProHD(const NTV2DeviceID inDeviceID)
virtual bool ConfigureSubscription(const bool bSubscribe, const INTERRUPT_ENUMS inInterruptType, PULWord &outSubcriptionHdl)
bool NTV2DeviceCanDoBreakoutBoard(const NTV2DeviceID inDeviceID)
virtual bool NTV2WriteRegisterRemote(const ULWord regNum, const ULWord regValue, const ULWord regMask, const ULWord regShift)
UWord NTV2DeviceGetNumVideoOutputs(const NTV2DeviceID inDeviceID)
True if device has NorthWest Logic DMA hardware.
ULWord NTV2DeviceGetFrameBufferSize(NTV2DeviceID id, NTV2FrameGeometry fg, NTV2FrameBufferFormat fbf)
RP188SourceFilterSelect
Private include file for all ajabase sources.
The version number of the HDMI chipset on the device.
virtual bool GetInterruptEventCount(const INTERRUPT_ENUMS inEventCode, ULWord &outCount)
Answers with the number of interrupt events that I successfully waited for.
bool NTV2DeviceCanDoCustomAnc(const NTV2DeviceID inDeviceID)
True if device audio systems can wait for VBI before starting. (New in SDK 17.0)
The number of LUT widgets on the device.
virtual bool IsMBSystemValid(void)
bool NTV2DeviceCanDoLTCInOnRefPort(const NTV2DeviceID inDeviceID)
The number of analog audio input channels on the device.
True if audio system(s) support 8 or more audio channels.
True if device has a microphone input connector.
virtual bool BitstreamWrite(const NTV2Buffer &inBuffer, const bool inFragment, const bool inSwap)
bool NTV2DeviceCanDoVITC2(const NTV2DeviceID inDeviceID)
UWord NTV2DeviceGetNumAESAudioOutputChannels(const NTV2DeviceID inDeviceID)
std::string join(const std::vector< std::string > &parts, const std::string &delim)
Definition: common.cpp:468
True if device can insert or extract RP-188/VITC2.
ULWord NTV2DeviceGetNumVideoChannels(const NTV2DeviceID inDeviceID)
UWord NTV2DeviceGetSPIFlashVersion(const NTV2DeviceID inDeviceID)
NTV2ConversionMode
Definition: ntv2enums.h:3714
std::set< NTV2DeviceID > NTV2DeviceIDSet
A set of NTV2DeviceIDs.
Definition: ntv2utils.h:1044
True if device has an HEVC M30 encoder/decoder.
void * GetHostPointer(void) const
See KONA X™.
Definition: ntv2enums.h:82
bool NTV2DeviceCanDoBreakoutBox(const NTV2DeviceID inDeviceID)
True if device has a firmware audio mixer.
Identifies the NTV2PixelFormat enumerated type.
NTV2AudioSource NTV2InputSourceToAudioSource(const NTV2InputSource inInputSource)
Definition: ntv2utils.cpp:4901
bool NTV2DeviceCanDoProgrammableRS422(const NTV2DeviceID inDeviceID)
virtual bool BitstreamStatus(NTV2ULWordVector &outRegValues)
Instances of me can parse a bitfile.
Definition: ntv2bitfile.h:86
Identifies the NTV2TCIndex enumerated type for input.
bool NTV2DeviceHasXilinxDMA(const NTV2DeviceID inDeviceID)
bool NTV2DeviceCanDoOutputTCIndex(const NTV2DeviceID inDeviceID, const NTV2TCIndex inTCIndex)
See Corvid 44.
Definition: ntv2enums.h:30
bool NTV2DeviceCanDoIP(const NTV2DeviceID inDeviceID)
Identifies the NTV2Mode enumerated type.
NTV2RegisterWrites mRegWrites
Stores WriteRegister data.
UWord NTV2DeviceGetNumHDMIAudioOutputChannels(const NTV2DeviceID inDeviceID)
bool NTV2DeviceCanDoAnalogVideoIn(const NTV2DeviceID inDeviceID)
Identifies the NTV2ConversionMode enumerated type.
virtual bool IsMBSystemReady(void)
See KONA 3G (UFC Mode).
Definition: ntv2enums.h:46
bool NTV2DeviceCanDo2110(const NTV2DeviceID inDeviceID)
True if device connects to the host using a Thunderbolt cable.
True if device has a bi-directional analog audio connector.
bool NTV2DeviceHasHEVCM30(const NTV2DeviceID inDeviceID)
std::vector< NTV2RegInfo > NTV2RegisterWrites
bool NTV2DeviceCanDoVersalSysMon(const NTV2DeviceID inDeviceID)
bool mSkipRegWrites
True if actual register writes are skipped while recording.
See KONA X™.
Definition: ntv2enums.h:80
virtual NTV2ConnectParams ConnectParams(void) const
NTV2RPCAPI * _pRPCAPI
Points to remote or software device interface; otherwise NULL for local physical device.
bool NTV2DeviceCanDoHDMIMultiView(const NTV2DeviceID inDeviceID)
The number of 2022 channels configured on SFP 1 on the device.
NTV2RegWrites NTV2RegReads
An ordered sequence of zero or more NTV2RegInfo structs intended for ReadRegister.
std::string InfoString(void) const
bool NTV2DeviceHasBracketLED(const NTV2DeviceID inDeviceID)
virtual bool ReadRP188Registers(const NTV2Channel inChannel, RP188_STRUCT *pRP188Data)
See KONA 4 (UFC Mode).
Definition: ntv2enums.h:49
True if device has a rotary encoder volume control.
bool NTV2DeviceCanChangeFrameBufferSize(const NTV2DeviceID inDeviceID)
NTV2Channel mChannel
Mail buffer channel.
UWord NTV2DeviceGetMaxAudioChannels(const NTV2DeviceID inDeviceID)
virtual bool NTV2AutoCirculateRemote(AUTOCIRCULATE_DATA &autoCircData)
UWord NTV2DeviceGetNumHDMIVideoInputs(const NTV2DeviceID inDeviceID)
bool NTV2DeviceCanDoAnalogVideoOut(const NTV2DeviceID inDeviceID)
bool NTV2DeviceCanMeasureTemperature(const NTV2DeviceID inDeviceID)
The number of colorspace converter widgets on the device.
Identifies the NTV2AudioWidgetID enumerated type.
UWord NTV2DeviceGetNumReferenceVideoInputs(const NTV2DeviceID inDeviceID)
#define NTV2_BITFILE_DESIGNNAME_STRINGLENGTH
True if device supports custom HANC packet insertion. (New in SDK 17.1)
UWord NTV2DeviceGetDACVersion(const NTV2DeviceID inDeviceID)
True if device can insert and/or extract RP-188/VITC.
True if device supports 8K video formats.
Identifies the NTV2FrameRate enumerated type.
UWord NTV2DeviceGetNumAnalogAudioInputChannels(const NTV2DeviceID inDeviceID)
True if device has NTV4 FrameStores. (New in SDK 17.0)
bool NTV2DeviceCanDoFramePulseSelect(const NTV2DeviceID inDeviceID)
bool NTV2DeviceCanDoQREZ(const NTV2DeviceID inDeviceID)
virtual bool AutoCirculate(AUTOCIRCULATE_DATA &pAutoCircData)
Sends an AutoCirculate command to the NTV2 driver.
virtual bool MailBufferOps(const NTV2Channel inChannel, NTV2Buffer &inBuffer, ULWord dataSize, ULWord flags, ULWord delay, ULWord timeout, NTV2MailBuffer &status)
The number of HDMI audio output channels on the device.
ULWord mDataSize
Size of data in the buffer.
The number of SDI video inputs on the device.
True if device fan can be thermostatically controlled.
#define SAREK_IF_VERSION
#define AJA_NTV2_SDK_VERSION_MINOR
The SDK minor version number, an unsigned decimal integer.
Definition: ntv2version.h:14
static UWord MaxNumDevices(void)
True if device can can accommodate Apple ProRes-compressed video in its frame buffers.
ULWord64 mBufferCookie
Buffer User cookie.
True if device can handle HD (High Definition) video.
Declares device capability functions.
True if device has HDMI AUX data inserter(s).
bool NTV2DeviceCanDoCustomAux(const NTV2DeviceID inDeviceID)
Packed driver version – use NTV2DriverVersionEncode, NTV2DriverVersionDecode* macros to encode/decod...
The size, in bytes, of the device&#39;s active RAM available for video and audio.
The number of AES/EBU audio input channels on the device.
bool NTV2DeviceCanDoPIO(const NTV2DeviceID inDeviceID)
See KONA 5.
Definition: ntv2enums.h:52
See T-TAP Pro.
Definition: ntv2enums.h:94
static bool IsValid(uint64_t pid)
Definition: process.cpp:41
True if device has Xilinx DMA hardware.
See KONA IP25.
Definition: ntv2enums.h:74
The number of down-converters on the device.
NTV2ReferenceSource NTV2InputSourceToReferenceSource(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2ReferenceSource value.
Definition: ntv2utils.cpp:5023
True if Audio System(s) support a 96kHz sample rate.
virtual ULWord GetNumRecordedRegisterWrites(void) const
True if device has any AES audio inputs or outputs.
See KONA XM™.
Definition: ntv2enums.h:81
True if device has one or more analog video inputs.
See Corvid, Corvid 3G.
Definition: ntv2enums.h:25
True if device can do frame rate conversion.
True if device has a mechanical identification switch. (New in SDK 17.1)
The number of HDMI video inputs on the device.
#define NTV2_BITFILE_DATETIME_STRINGLENGTH
See KONA 5.
Definition: ntv2enums.h:60
NTV2FrameBufferFormatSet::const_iterator NTV2FrameBufferFormatSetConstIter
A handy const iterator for iterating over an NTV2FrameBufferFormatSet.
virtual HANDLE GetInterruptEvent(const INTERRUPT_ENUMS eInterruptType)
True if device can simultaneously handle different video formats on more than one SDI input or output...
UWord NTV2DeviceGetNumAESAudioInputChannels(const NTV2DeviceID inDeviceID)
static uint32_t gDestructCount(0)