AJA NTV2 SDK  17.0.1.1246
NTV2 SDK 17.0.1.1246
ntv2macdriverinterface.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
9 #include "ntv2nubaccess.h"
10 #include "ntv2utils.h"
11 #include <time.h>
12 #include <syslog.h>
13 #include <iostream>
14 #include <sstream>
15 #include <string>
16 #include <map>
17 #include <iomanip>
18 #include "ntv2devicefeatures.h"
19 #include "ajabase/system/lock.h"
20 #include "ajabase/system/debug.h"
21 #include "ajabase/system/atomic.h"
23 
24 #if !defined (NTV2_NULL_DEVICE)
25  extern "C"
26  {
27  #include <mach/mach.h>
28  }
29 #endif // !defined (NTV2_NULL_DEVICE)
30 
31 using namespace std;
32 
33 
34 static const char * GetKernErrStr (const kern_return_t inError);
37 static const string sNTV2PCIKEXTClassName ("com_aja_iokit_ntv2"); // AJA NTV2 KEXT's IOService class name
38 static const string sNTV2PCIDEXTName ("NTV2PCIe"); // AJA NTV2 DEXT's IOService name
39 
40 
41 // MacDriverInterface-specific Logging Macros
42 
43 #define HEX2(__x__) xHEX0N(0xFF & uint8_t (__x__),2)
44 #define HEX4(__x__) xHEX0N(0xFFFF & uint16_t(__x__),4)
45 #define HEX8(__x__) xHEX0N(0xFFFFFFFF & uint32_t(__x__),8)
46 #define HEX16(__x__) xHEX0N(uint64_t(__x__),16)
47 #define KR(_kr_) "kernResult=" << HEX8(_kr_) << "(" << GetKernErrStr(_kr_) << ")"
48 #define INSTP(_p_) HEX0N(uint64_t(_p_),16)
49 
50 #define DIFAIL(__x__) AJA_sERROR (AJA_DebugUnit_DriverInterface, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
51 #define DIWARN(__x__) AJA_sWARNING(AJA_DebugUnit_DriverInterface, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
52 #define DINOTE(__x__) AJA_sNOTICE (AJA_DebugUnit_DriverInterface, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
53 #define DIINFO(__x__) AJA_sINFO (AJA_DebugUnit_DriverInterface, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
54 #define DIDBG(__x__) AJA_sDEBUG (AJA_DebugUnit_DriverInterface, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
55 
56 #define MDIFAIL(__x__) AJA_sERROR (AJA_DebugUnit_DriverInterface, AJAFUNC << ": " << __x__)
57 #define MDIWARN(__x__) AJA_sWARNING(AJA_DebugUnit_DriverInterface, AJAFUNC << ": " << __x__)
58 #define MDINOTE(__x__) AJA_sNOTICE (AJA_DebugUnit_DriverInterface, AJAFUNC << ": " << __x__)
59 #define MDIINFO(__x__) AJA_sINFO (AJA_DebugUnit_DriverInterface, AJAFUNC << ": " << __x__)
60 #define MDIDBG(__x__) AJA_sDEBUG (AJA_DebugUnit_DriverInterface, AJAFUNC << ": " << __x__)
61 
62 
63 #if !defined (NTV2_NULL_DEVICE)
64  // This section builds 'libajantv2.a' with the normal linkage to the IOKit...
65  #define OS_IOMasterPort(_x_,_y_) ::IOMasterPort ((_x_), (_y_))
66  #define OS_IOServiceOpen(_w_,_x_,_y_,_z_) ::IOServiceOpen((_w_), (_x_), (_y_), (_z_))
67  #define OS_IOServiceClose(_x_) ::IOServiceClose ((_x_))
68  #define OS_IOServiceMatching(_x_) ::IOServiceMatching ((_x_))
69  #define OS_IOServiceNameMatching(_x_) ::IOServiceNameMatching((_x_))
70  #define OS_IOServiceGetMatchingServices(_x_,_y_,_z_) ::IOServiceGetMatchingServices ((_x_), (_y_), (_z_))
71  #define OS_IOIteratorNext(_x_) ::IOIteratorNext ((_x_))
72  #define OS_IOObjectRelease(_x_) ::IOObjectRelease ((_x_))
73  #define OS_IORegistryEntryCreateCFProperty(_w_,_x_,_y_,_z_) ::IORegistryEntryCreateCFProperty ((_w_), (_x_), (_y_), (_z_))
74  #define OS_IOConnectCallMethod(_q_,_r_,_s_,_t_,_u_,_v_,_w_,_x_,_y_,_z_) ::IOConnectCallMethod ((_q_), (_r_), (_s_), (_t_), (_u_), (_v_), (_w_), (_x_), (_y_), (_z_))
75  #define OS_IOConnectCallScalarMethod(_u_,_v_,_w_,_x_,_y_,_z_) ::IOConnectCallScalarMethod ((_u_), (_v_), (_w_), (_x_), (_y_), (_z_))
76  #define OS_IOConnectCallStructMethod(_u_,_v_,_w_,_x_,_y_,_z_) ::IOConnectCallStructMethod ((_u_), (_v_), (_w_), (_x_), (_y_), (_z_))
77  #define OS_IOConnectMapMemory(_u_,_v_,_w_,_x_,_y_,_z_) ::IOConnectMapMemory ((_u_), (_v_), (_w_), (_x_), (_y_), (_z_))
78  #define OS_IOKitGetBusyState(_x_,_y_) ::IOKitGetBusyState ((_x_), (_y_))
79  #define OS_IOKitWaitQuiet(_x_,_y_) ::IOKitWaitQuiet ((_x_), (_y_))
80 #else // NTV2_NULL_DEVICE defined
81  // STUB FUNCTIONS TO REPLACE IOKIT CALLS
82  // Eliminates all linkage to IOKit.
83  static IOReturn OS_IOMasterPort (const mach_port_t inPort, mach_port_t * pOutPort)
84  { (void)inPort;
85  MDIWARN("NTV2_NULL_DEVICE -- will not connect to IOKit");
86  if (pOutPort)
87  *pOutPort = 1;
88  return KERN_SUCCESS;
89  }
90  static kern_return_t OS_IOServiceOpen (const io_service_t inSvc, const task_port_t inTask, const uint32_t inType, io_connect_t * pOutConn)
91  { (void)inSvc; (void)inTask; (void)inType;
92  if (pOutConn) *pOutConn = 0;
93  return KERN_SUCCESS;
94  }
95  static IOReturn OS_IOServiceClose (const io_connect_t inConnection)
96  { (void)inConnection;
97  return KERN_SUCCESS;
98  }
99  static CFMutableDictionaryRef OS_IOServiceMatching (const char * pInName)
100  { (void)pInName;
101  return AJA_NULL;
102  }
103  static IOReturn OS_IOServiceGetMatchingServices (const mach_port_t inPort, const CFDictionaryRef inMatch, io_iterator_t * pOutIter)
104  { (void)inPort; (void)inMatch;
105  if (pOutIter)
106  *pOutIter = 0;
107  return KERN_SUCCESS;
108  }
109  static io_object_t OS_IOIteratorNext (io_iterator_t inIter)
110  { (void)inIter;
111  return 0;
112  }
113  static IOReturn OS_IOObjectRelease (io_object_t inObj)
114  { (void)inObj;
115  return KERN_SUCCESS;
116  }
117  static CFTypeRef OS_IORegistryEntryCreateCFProperty (const io_registry_entry_t inEntry, const CFStringRef inKey, const CFAllocatorRef inAllocator, const IOOptionBits inOptions)
118  { (void)inEntry; (void)inKey; (void)inAllocator; (void)inOptions;
119  return AJA_NULL;
120  }
121  static IOReturn OS_IOConnectCallScalarMethod (const mach_port_t inConnect, const uint32_t inSelector, const uint64_t * pInput, const uint32_t inCount, uint64_t * pOutput, uint32_t * pOutCount)
122  { (void)inConnect; (void)inSelector; (void)pInput; (void)inCount;
123  if (pOutput) *pOutput = 0;
124  if (pOutCount) *pOutCount = 0;
125  return KERN_SUCCESS;
126  }
127  static kern_return_t OS_IOConnectCallMethod (const mach_port_t inConnect, const uint32_t inSelector, const uint64_t * pInput, uint32_t inputCnt, const void * pInStruct, const size_t inStructCnt, uint64_t * pOutput, uint32_t * pOutputCnt, void * pOutStruct, size_t * pOutStructCnt)
128  { (void)inConnect; (void)inSelector; (void)pInput; (void)inputCnt; (void)pInStruct; (void)inStructCnt; (void)pOutput; (void)pOutputCnt; (void)pOutStruct; (void)pOutStructCnt;
129  return KERN_SUCCESS;
130  }
131  static IOReturn OS_IOKitGetBusyState (const mach_port_t inPort, uint32_t * pOutState)
132  { (void)inPort;
133  if (pOutState)
134  *pOutState = 0;
135  return KERN_SUCCESS;
136  }
137  static IOReturn OS_IOKitWaitQuiet (const mach_port_t inPort, const mach_timespec_t * pInOutWait)
138  { (void)inPort; (void)pInOutWait;
139  return KERN_SUCCESS;
140  }
141  static IOReturn OS_IOConnectCallStructMethod (const io_connect_t inPort, const uint32_t inSelector, const void *inputStruct, size_t inputStructCnt, void *pOutStruct, size_t *pOutStructCnt)
142  { (void)inPort; (void)inSelector; (void)inputStruct; (void)inputStructCnt; (void)pOutStruct; (void)pOutStructCnt;
143  return KERN_SUCCESS;
144  }
145  static kern_return_t OS_IOConnectMapMemory (const io_connect_t inPort, const uint32_t inMemType, const task_port_t inTask, mach_vm_address_t * pAddr, mach_vm_size_t * pOutSize, const IOOptionBits inOpts)
146  { (void)inPort; (void)inMemType; (void)inTask; (void)pAddr; (void)pOutSize; (void)inOpts;
147  return KERN_SUCCESS;
148  }
149 #endif // NTV2_NULL_DEVICE defined
150 
151 
152 #if defined(USE_DEVICE_MAP)
153 static unsigned gnBoardMaps (0); // Instance counter -- should never exceed one
154 static const UWord kMaxNumDevices (32); // Limit to 32 devices
155 static uint64_t RECHECK_INTERVAL (1024LL); // Number of calls to DeviceMap::GetConnection before connection recheck performed
156 static unsigned int TWO_SECONDS (2); // Max wait times for IORegistry to settle for hot plug/unplug
157 #define NTV2_IGNORE_IOREG_BUSY (true) // If defined, ignore IORegistry busy state;
158  // otherwise wait for non-busy IORegistry before making new connections
159 
164 class DeviceMap
165 {
166  public:
167  DeviceMap ()
168  : //mIOConnections,
169  //mRecheckTally,
170  //mMutex,
171  mMasterPort (0),
172  mStopping (false),
173  mDriverVersion (0)
174  {
175  NTV2_ASSERT (gnBoardMaps == 0 && "Attempt to create more than one DeviceMap");
176  AJAAtomic::Increment(&gnBoardMaps);
177  ::memset (&mIOConnections, 0, sizeof (mIOConnections));
178  ::memset (&mRecheckTally, 0, sizeof (mRecheckTally));
179  mDrvrVersComps[0] = mDrvrVersComps[1] = mDrvrVersComps[2] = mDrvrVersComps[3] = 0;
180 
181  // Get the master mach port for talking to IOKit...
182  IOReturn error (OS_IOMasterPort (MACH_PORT_NULL, &mMasterPort));
183  if (error != kIOReturnSuccess)
184  {
185  MDIFAIL (KR(error) << "Unable to get master port");
186  return;
187  }
188  NTV2_ASSERT (mMasterPort && "No MasterPort!");
189  MDINOTE ("DeviceMap singleton created");
190  }
191 
192 
193  ~DeviceMap ()
194  {
195  mStopping = true;
196  AJAAutoLock autoLock (&mMutex);
197  Reset ();
198  MDINOTE ("DeviceMap singleton destroyed");
199  AJAAtomic::Decrement(&gnBoardMaps);
200  }
201 
202 
203  void Reset (const bool inResetMasterPort = false)
204  {
205  AJAAutoLock autoLock (&mMutex);
206  // Clear the device map...
207  for (UWord ndx (0); ndx < kMaxNumDevices; ++ndx)
208  {
209  io_connect_t connection (mIOConnections [ndx]);
210  if (connection)
211  {
212  OS_IOServiceClose (connection);
213  mIOConnections [ndx] = 0;
214  MDINOTE ("Device " << ndx << " connection " << HEX8(connection) << " closed");
215  }
216  } // for each connection in the map
217  if (inResetMasterPort)
218  {
219  IOReturn error (OS_IOMasterPort (MACH_PORT_NULL, &mMasterPort));
220  if (error != kIOReturnSuccess)
221  MDIFAIL (KR(error) << "Unable to reset master port");
222  else
223  MDINOTE ("reset mMasterPort=" << HEX8(mMasterPort));
224  }
225  }
226 
227 
228  io_connect_t GetConnection (const UWord inDeviceIndex, const bool inDoNotAllocate = false)
229  {
230  if (inDeviceIndex >= kMaxNumDevices)
231  {
232  MDIWARN ("Bad device index " << inDeviceIndex << ", GetConnection fail");
233  return 0;
234  }
235 
236  AJAAutoLock autoLock (&mMutex);
237  const io_connect_t connection (mIOConnections [inDeviceIndex]);
238  if (connection && RECHECK_INTERVAL)
239  {
240  uint64_t & recheckTally (mRecheckTally [inDeviceIndex]);
241  if (++recheckTally % RECHECK_INTERVAL == 0)
242  {
243 // MDIDBG ("Device " << inDeviceIndex << " connection " << HEX8(connection) << " expired, checking connection");
244  if (!ConnectionIsStillOkay (inDeviceIndex))
245  {
246  MDIFAIL ("Device " << inDeviceIndex << " connection " << HEX8(connection) << " invalid, resetting DeviceMap");
247  Reset ();
248  return 0;
249  }
250  }
251  return connection;
252  }
253 
254  if (inDoNotAllocate)
255  return connection;
256 
257  if (mStopping)
258  {
259  MDIWARN ("Request to Open device " << inDeviceIndex << " denied because DeviceMap closing");
260  return 0; // No new connections if my destructor was called
261  }
262 
263  // Wait for IORegistry to settle down (if busy)...
264  if (!WaitForBusToSettle ())
265  {
266  MDIWARN ("IORegistry unstable, resetting DeviceMap");
267  Reset ();
268  return 0;
269  }
270 
271  // Make a new connection...
272  UWord ndx (inDeviceIndex);
273  io_iterator_t ioIterator (0);
274  IOReturn error (kIOReturnSuccess);
275  io_object_t ioObject (0);
276  io_connect_t ioConnect (0);
277  const string & className (sNTV2PCIKEXTClassName);
278 
279  NTV2_ASSERT (mMasterPort && "No MasterPort!");
280 
281  // Create an iterator to search for our driver...
282  error = OS_IOServiceGetMatchingServices (mMasterPort, OS_IOServiceMatching(className.c_str()), &ioIterator);
283  if (error != kIOReturnSuccess)
284  {
285  MDIFAIL (KR(error) << " -- IOServiceGetMatchingServices failed, no match for '" << className << "', device index " << inDeviceIndex << " requested");
286  return 0;
287  }
288 
289  // Use ndx to find nth device -- and only open that one...
290  for ( ; (ioObject = OS_IOIteratorNext(ioIterator)); OS_IOObjectRelease(ioObject))
291  if (ndx == 0)
292  break; // Found it!
293  else
294  --ndx;
295 
296  if (ioIterator)
297  OS_IOObjectRelease (ioIterator);
298  if (ioObject == 0)
299  return 0; // No devices found at all
300  if (ndx)
301  return 0; // Requested device index exceeds number of devices found
302 
303  // Found the device we want -- open it...
304  error = OS_IOServiceOpen (ioObject, ::mach_task_self(), 0, &ioConnect);
305  OS_IOObjectRelease (ioObject);
306  if (error != kIOReturnSuccess)
307  {
308  MDIFAIL (KR(error) << " -- IOServiceOpen failed on device " << inDeviceIndex);
309  return 0;
310  }
311 
312  // All good -- cache the connection handle...
313  mIOConnections [inDeviceIndex] = ioConnect;
314  mRecheckTally [inDeviceIndex] = 0;
315  MDINOTE ("Device " << inDeviceIndex << " connection " << HEX8(ioConnect) << " opened");
316  return ioConnect;
317 
318  } // GetConnection
319 
320 
321  void Dump (const UWord inMaxNumDevices = 10) const
322  {
323  AJAAutoLock autoLock (&mMutex);
324  for (UWord ndx (0); ndx < inMaxNumDevices; ++ndx)
325  MDIDBG (" [" << ndx << "]: con=" << HEX8(mIOConnections [ndx]));
326  }
327 
328 
329  UWord GetConnectionCount (void) const
330  {
331  UWord tally (0);
332  AJAAutoLock autoLock (&mMutex);
333  for (UWord ndx (0); ndx < kMaxNumDevices; ++ndx)
334  if (mIOConnections [ndx])
335  tally++;
336  else
337  break;
338  return tally;
339  }
340 
341 
342  ULWord GetConnectionChecksum (void) const
343  {
344  ULWord checksum (0);
345  AJAAutoLock autoLock (&mMutex);
346  for (UWord ndx (0); ndx < kMaxNumDevices; ++ndx)
347  if (mIOConnections [ndx])
348  checksum += mIOConnections [ndx];
349  else
350  break;
351  return checksum;
352  }
353 
354 
355  uint32_t GetDriverVersion (void) const { return mDriverVersion; }
356 
357 
358  bool ConnectionIsStillOkay (const UWord inDeviceIndex)
359  {
360  if (inDeviceIndex >= kMaxNumDevices)
361  {
362  MDIWARN ("ConnectionIsStillOkay: bad 'inDeviceIndex' parameter " << inDeviceIndex);
363  return 0;
364  }
365 
366  const io_connect_t connection (mIOConnections [inDeviceIndex]);
367  if (connection)
368  {
369  uint64_t scalarO_64 [2] = {0, 0};
370  uint32_t outputCount = 2;
371  kern_return_t kernResult = OS_IOConnectCallScalarMethod (connection, kDriverGetStreamForApplication, AJA_NULL, 0, scalarO_64, &outputCount);
372  if (kernResult == KERN_SUCCESS)
373  return true;
374  }
375  return false;
376  }
377 
378  uint64_t SetConnectionCheckInterval (const uint64_t inNewInterval)
379  {
380  uint64_t oldValue (RECHECK_INTERVAL);
381  if (oldValue != inNewInterval)
382  {
383  RECHECK_INTERVAL = inNewInterval;
384  if (RECHECK_INTERVAL)
385  MDINOTE ("connection recheck interval changed to" << HEX16(RECHECK_INTERVAL) << ", was" << HEX16(oldValue));
386  else
387  MDINOTE ("connection rechecking disabled, was" << HEX16(oldValue));
388  }
389  return oldValue;
390  }
391 
392  private:
393  bool WaitForBusToSettle (void)
394  {
395  uint32_t busyState (0);
396  IOReturn kr (OS_IOKitGetBusyState (mMasterPort, &busyState));
397 
398  if (kr != kIOReturnSuccess)
399  MDIFAIL ("IOKitGetBusyState failed -- " << KR(kr));
400  else if (busyState)
401  {
402  #if defined (NTV2_IGNORE_IOREG_BUSY)
403  MDINOTE ("IOKitGetBusyState reported BUSY");
404  return true; // IORegistry busy, but so what?
405  #else
406  mach_timespec_t maxWaitTime = {TWO_SECONDS, 0};
407  MDINOTE ("IOKitGetBusyState reported BUSY -- waiting for IORegistry to stabilize...");
408 
409  kr = OS_IOKitWaitQuiet (mMasterPort, &maxWaitTime);
410  if (kr == kIOReturnSuccess)
411  return true;
412  MDIFAIL ("IOKitWaitQuiet timed out -- " << KR(kr));
413  #endif // defined (NTV2_IGNORE_IOREG_BUSY)
414  }
415  else
416  return true;
417  return false;
418  }
419 
420  private:
421  io_connect_t mIOConnections [kMaxNumDevices]; // My io_connect_t map
422  uint64_t mRecheckTally [kMaxNumDevices]; // Used to calc when it's time to test if connection still ok
423  mutable AJALock mMutex; // My guard mutex
424  mach_port_t mMasterPort; // Handy master port
425  bool mStopping; // Don't open new connections if I'm stopping
426  uint32_t mDriverVersion; // Handy (packed) driver version
427  uint16_t mDrvrVersComps[4]; // Handy (unpacked) driver version components
428 
429 }; // DeviceMap
430 
431 
432 static DeviceMap gDeviceMap; // The DeviceMap singleton
433 
434 
435 io_connect_t CNTV2MacDriverInterface::GetIOConnect (const bool inDoNotAllocate) const
436 {
437  return gDeviceMap.GetConnection (_boardNumber, inDoNotAllocate);
438 }
439 #endif // defined(USE_DEVICE_MAP)
440 
441 
442 #if defined(_DEBUG)
443 #endif
445 
446 //--------------------------------------------------------------------------------------------------------------------
447 // CNTV2MacDriverInterface
448 //
449 // Constructor
450 //--------------------------------------------------------------------------------------------------------------------
452 {
453  mIsDEXT = false;
454 #if !defined(USE_DEVICE_MAP)
455  mConnection = 0;
456 #endif
457 }
458 
459 
460 //--------------------------------------------------------------------------------------------------------------------
461 // ~CNTV2MacDriverInterface
462 //--------------------------------------------------------------------------------------------------------------------
464 {
465  if (IsOpen())
466  Close();
467 }
468 
469 #if !defined(NTV2_NULL_DEVICE)
470  //--------------------------------------------------------------------------------------------------------------------
471  // Open
472  //--------------------------------------------------------------------------------------------------------------------
474  {
475  #if defined(USE_DEVICE_MAP)
476  // Local host open -- get a Mach connection
477  _boardOpened = gDeviceMap.GetConnection (inDeviceIndex) != 0;
478 
479  // When device is unplugged, saved static io_connect_t value goes stale, yet remains non-zero.
480  // This resets it it to zero, reestablishes a connection on replug. Fixes many pnp/sleep issues.
481  if (IsOpen())
482  {
483  if (!gDeviceMap.ConnectionIsStillOkay(inDeviceIndex))
484  {
485  gDeviceMap.Reset();
486  _boardOpened = gDeviceMap.GetConnection(inDeviceIndex) != 0;
487  }
488  }
489  #else // !defined(USE_DEVICE_MAP)
490  // Make a new connection...
491  io_iterator_t ioIterator (0);
492  IOReturn error (kIOReturnSuccess);
493  io_object_t ioObject (0);
494  static const string kSvcNames[] = {sNTV2PCIDEXTName, sNTV2PCIKEXTClassName, ""}; // Try DEXT first, then KEXT
495 
496  for (size_t svcNdx(0); svcNdx < 2 && !mConnection; svcNdx++)
497  {
498  const string & svcName (kSvcNames[svcNdx]);
499  const char * pSvcName(svcName.c_str());
500  const bool tryKEXT (svcName.find("com_aja_iokit") != string::npos);
501 
502  // Create an iterator to search for our driver instances...
503  error = OS_IOServiceGetMatchingServices (kIOMasterPortDefault,
504  tryKEXT ? OS_IOServiceMatching(pSvcName) : OS_IOServiceNameMatching(pSvcName),
505  &ioIterator);
506  if (error != kIOReturnSuccess)
507  {DIWARN(KR(error) << ": No '" << svcName << "' driver"); continue;}
508 
509  // Find nth device -- and only use that one...
510  for (UWord ndx(inDeviceIndex); (ioObject = OS_IOIteratorNext(ioIterator)); OS_IOObjectRelease(ioObject))
511  if (ndx == 0)
512  break; // Found a match!
513  else
514  --ndx;
515 
516  if (ioIterator)
517  OS_IOObjectRelease(ioIterator);
518  if (!ioObject)
519  {
520  if (!inDeviceIndex) // Warn only if requesting first device, to show "no devices"
521  DIWARN("No '" << svcName << "' devices");
522  continue; // No service object
523  }
524 
525  // Found the device we want -- open it...
526  error = OS_IOServiceOpen (ioObject, ::mach_task_self(), 0, &mConnection);
527  OS_IOObjectRelease(ioObject);
528  if (error != kIOReturnSuccess)
529  {DIWARN(KR(error) << ": IOServiceOpen failed for '" << svcName << "' ndx=" << inDeviceIndex); continue;}
530 
531  mIsDEXT = !tryKEXT;
532  } // for each in kServiceNames
533 
534  _boardOpened = mConnection != 0;
535  if (IsOpen())
536  DIDBG((mIsDEXT ? "DEXT" : "KEXT") << " ndx=" << inDeviceIndex << " conn=" << HEX8(GetIOConnect()) << " opened");
537  #endif // !defined(USE_DEVICE_MAP)
538  if (!IsOpen())
539  {DIFAIL(INSTP(this) << ": No connection: ndx=" << inDeviceIndex); return false;}
540 
541  // If USE_DEVICE_MAP defined, _boardNumber must be set before first ReadReg call, or it won't work:
542  _boardNumber = inDeviceIndex;
544  {
545  DIFAIL("ReadRegister(kRegBoardID) failed: ndx=" << inDeviceIndex << " con=" << HEX8(GetIOConnect()) << " boardID=" << HEX8(_boardID));
546  Close();
547  return false;
548  }
549 
550  // Good to go...
551  DIDBG("Opened ndx=" << _boardNumber << " con=" << HEX8(GetIOConnect()) << " id=" << ::NTV2DeviceIDToString(_boardID));
552  return true;
553 
554  } // OpenLocalPhysical
555 
556 
558  {
559  NTV2_ASSERT(!IsRemote());
560  DIDBG("Closed " << (mIsDEXT ? "DEXT" : "KEXT") << " ndx=" << _boardNumber << " con=" << HEX8(GetIOConnect()) << " id=" << ::NTV2DeviceIDToString(_boardID));
561  _boardOpened = false;
562  _boardNumber = 0;
563  #if !defined(USE_DEVICE_MAP)
564  if (mConnection)
565  OS_IOServiceClose(mConnection);
566  mConnection = 0;
567  #endif // !defined(USE_DEVICE_MAP)
568  mIsDEXT = false;
569  return true;
570 
571  } // CloseLocalPhysical
572 #endif // !defined(NTV2_NULL_DEVICE)
573 
574 
575 #if !defined(NTV2_DEPRECATE_16_0)
576  //--------------------------------------------------------------------------------------------------------------------
577  // GetPCISlotNumber
578  //
579  // Returns my PCI slot number, if known; otherwise returns zero.
580  //--------------------------------------------------------------------------------------------------------------------
582  {
583  // TBD: Determine where in the IORegistry the io_connect_t is, then navigate up to the io_registry_entry
584  // for our driver that contains the "AJAPCISlot" property. Then proceed as before...
585  return 0; // FINISH THIS
586  } // GetPCISlotNumber
587 
588  //--------------------------------------------------------------------------------------------------------------------
589  // MapFrameBuffers
590  //
591  // Return a pointer and size of either the register map or frame buffer memory.
592  //--------------------------------------------------------------------------------------------------------------------
594  {
595  UByte *baseAddr;
596  if (!MapMemory (kFrameBufferMemory, reinterpret_cast<void**>(&baseAddr)))
597  {
598  _pFrameBaseAddress = AJA_NULL;
599  _pCh1FrameBaseAddress = _pCh2FrameBaseAddress = AJA_NULL; // DEPRECATE!
600  return false;
601  }
602  _pFrameBaseAddress = reinterpret_cast<ULWord*>(baseAddr);
603  return true;
604  }
605 
607  {
608  _pFrameBaseAddress = AJA_NULL;
609  _pCh1FrameBaseAddress = _pCh2FrameBaseAddress = AJA_NULL; // DEPRECATE!
610  return true;
611  }
612 
613  //--------------------------------------------------------------------------------------------------------------------
614  // MapRegisters
615  //--------------------------------------------------------------------------------------------------------------------
617  {
618  ULWord *baseAddr;
619  if (!MapMemory (kRegisterMemory, reinterpret_cast<void**>(&baseAddr)))
620  {
621  _pRegisterBaseAddress = AJA_NULL;
622  return false;
623  }
624  _pRegisterBaseAddress = reinterpret_cast<ULWord*>(baseAddr);
625  return true;
626  }
627 
629  {
630  _pRegisterBaseAddress = AJA_NULL;
631  return true;
632  }
633 
634  //--------------------------------------------------------------------------------------------------------------------
635  // Map / Unmap Xena2Flash
636  //--------------------------------------------------------------------------------------------------------------------
638  {
639  ULWord *baseAddr;
640  if (!MapMemory (kXena2FlashMemory, reinterpret_cast<void**>(&baseAddr)))
641  {
642  _pXena2FlashBaseAddress = AJA_NULL;
643  return false;
644  }
645  _pXena2FlashBaseAddress = reinterpret_cast<ULWord*>(baseAddr);
646  return true;
647  }
648 
650  {
651  _pXena2FlashBaseAddress = AJA_NULL;
652  return true;
653  }
654 
655  //--------------------------------------------------------------------------------------------------------------------
656  // MapMemory
657  //--------------------------------------------------------------------------------------------------------------------
658  bool CNTV2MacDriverInterface::MapMemory (const MemoryType memType, void **memPtr)
659  {
660 #ifndef __LP64__
661  return false;
662 #endif
663  if (GetIOConnect())
664  {
665  mach_vm_size_t size(0);
666  OS_IOConnectMapMemory ( GetIOConnect(), memType, mach_task_self(),
667  reinterpret_cast<mach_vm_address_t*>(memPtr),
668  &size, kIOMapDefaultCache | kIOMapAnywhere);
669  return size > 0;
670  }
671  return false;
672  }
673 
674  //--------------------------------------------------------------------------------------------------------------------
675  // SystemControl
676  //--------------------------------------------------------------------------------------------------------------------
678  {
679  kern_return_t kernResult = KERN_FAILURE;
680  uint64_t scalarI_64[2] = {uint64_t(dataPtr), controlCode};
681  uint32_t outputCount = 0;
682  if (controlCode != SCC_Test)
683  kernResult = KERN_INVALID_ARGUMENT;
684  else if (GetIOConnect())
685  kernResult = OS_IOConnectCallScalarMethod ( GetIOConnect(), // an io_connect_t returned from IOServiceOpen().
686  kDriverSystemControl, // selector of the function to be called via the user client.
687  scalarI_64, // array of scalar (64-bit) input values.
688  2, // the number of scalar input values.
689  AJA_NULL, // array of scalar (64-bit) output values.
690  &outputCount); // pointer to the number of scalar output values.
691  if (kernResult == KERN_SUCCESS)
692  return true;
693  DIFAIL (KR(kernResult) << ", con=" << HEX8(GetIOConnect()));
694  return false;
695  }
696 #endif // !defined(NTV2_DEPRECATE_16_0)
697 
698 #pragma mark - New Driver Calls
699 #if defined(AJA_MULTIRASTER_TEST)
700  // kRegMRQ1Control kRegMRQ2Control kRegMRQ3Control kRegMRQ4Control kRegMROutControl kRegMRSupport
701  static ULWord gMRRegs[] = { 0x01000004, 0x01000004, 0x01000004, 0x01000004, 0x01101D48, 0x00444400, 0x00000000, 0x00000001};
702 #endif
703 
704 //--------------------------------------------------------------------------------------------------------------------
705 // ReadRegister
706 //
707 // Return the value of specified register after masking and shifting the value.
708 //--------------------------------------------------------------------------------------------------------------------
709 bool CNTV2MacDriverInterface::ReadRegister (const ULWord inRegNum, ULWord & outValue, const ULWord inMask, const ULWord inShift)
710 {
711  if (inShift >= 32)
712  {
713  DIFAIL("Shift " << DEC(inShift) << " > 31, reg=" << DEC(inRegNum) << " msk=" << xHEX0N(inMask,8));
714  return false;
715  }
716 #if defined (NTV2_NUB_CLIENT_SUPPORT)
717  if (IsRemote())
718  return CNTV2DriverInterface::ReadRegister(inRegNum, outValue, inMask, inShift);
719 #endif // defined (NTV2_NUB_CLIENT_SUPPORT)
720 #if defined(AJA_MULTIRASTER_TEST)
721  if (inRegNum >= kRegMRQ1Control && inRegNum <= kRegMRSupport)
722  {outValue = (gMRRegs[inRegNum - kRegMRQ1Control] & inMask) >> inShift; return true;}
723 #endif
724  kern_return_t kernResult(KERN_FAILURE);
725  uint64_t scalarI_64[2] = {inRegNum, inMask};
726  uint64_t scalarO_64 = outValue;
727  uint32_t outputCount = 1;
728  if (GetIOConnect())
729  {
731  kernResult = OS_IOConnectCallScalarMethod ( GetIOConnect(), // an io_connect_t returned from IOServiceOpen().
732  kDriverReadRegister, // selector of the function to be called via the user client.
733  scalarI_64, // array of scalar (64-bit) input values.
734  2, // the number of scalar input values.
735  &scalarO_64, // array of scalar (64-bit) output values.
736  &outputCount); // pointer to the number of scalar output values.
738  }
739  outValue = uint32_t(scalarO_64);
740  if (kernResult == KERN_SUCCESS)
741  return true;
742  DIFAIL(KR(kernResult) << ": ndx=" << _boardNumber << ", con=" << HEX8(GetIOConnect())
743  << " -- reg=" << DEC(inRegNum) << ", mask=" << HEX8(inMask) << ", shift=" << HEX8(inShift));
744  return false;
745 }
746 
747 
748 //--------------------------------------------------------------------------------------------------------------------
749 // WriteRegister
750 //
751 // Set the specified register value taking into accout the bit mask.
752 // If the bit mask is not 0xFFFFFFFF (default) or 0, then this does a read-modify-write.
753 //--------------------------------------------------------------------------------------------------------------------
754 bool CNTV2MacDriverInterface::WriteRegister (const ULWord inRegNum, const ULWord inValue, const ULWord inMask, const ULWord inShift)
755 {
756  if (inShift >= 32)
757  {
758  DIFAIL("Shift " << DEC(inShift) << " > 31, reg=" << DEC(inRegNum) << " msk=" << xHEX0N(inMask,8));
759  return false;
760  }
761 #if defined(NTV2_WRITEREG_PROFILING) // Register Write Profiling
762  if (mRecordRegWrites)
763  {
764  AJAAutoLock autoLock(&mRegWritesLock);
765  mRegWrites.push_back(NTV2RegInfo(inRegNum, inValue, inMask, inShift));
766  if (mSkipRegWrites)
767  return true;
768  }
769 #endif // defined(NTV2_WRITEREG_PROFILING) // Register Write Profiling
770 #if defined(NTV2_NUB_CLIENT_SUPPORT)
771  if (IsRemote())
772  return CNTV2DriverInterface::WriteRegister(inRegNum, inValue, inMask, inShift);
773 #endif // defined (NTV2_NUB_CLIENT_SUPPORT)
774 #if defined(AJA_MULTIRASTER_TEST)
775  if (inRegNum >= kRegMRQ1Control && inRegNum <= kRegMRSupport)
776  {gMRRegs[inRegNum - kRegMRQ1Control] = ((inValue << inShift) & inMask) | ((~inMask) & gMRRegs[inRegNum - kRegMRQ1Control]); return true;}
777 #endif
778  kern_return_t kernResult(KERN_FAILURE);
779  uint64_t scalarI_64[3] = {inRegNum, inValue, inMask};
780  uint32_t outputCount = 0;
781  if (GetIOConnect())
782  {
784  kernResult = OS_IOConnectCallScalarMethod ( GetIOConnect(), // an io_connect_t returned from IOServiceOpen().
785  kDriverWriteRegister, // selector of the function to be called via the user client.
786  scalarI_64, // array of scalar (64-bit) input values.
787  3, // the number of scalar input values.
788  AJA_NULL, // array of scalar (64-bit) output values.
789  &outputCount); // pointer to the number of scalar output values.
791  }
792  if (kernResult == KERN_SUCCESS)
793  return true;
794  DIFAIL (KR(kernResult) << ": con=" << HEX8(GetIOConnect()) << " -- reg=" << inRegNum
795  << ", val=" << HEX8(inValue) << ", mask=" << HEX8(inMask) << ", shift=" << HEX8(inShift));
796  return false;
797 }
798 
799 
800 //--------------------------------------------------------------------------------------------------------------------
801 // AcquireStreamForApplication
802 //
803 // Aquire board by by waiting for current board to release its resources
804 //
805 // Note: When quicktime is using the board, desktop output on the board is disabled
806 // by the driver.
807 //--------------------------------------------------------------------------------------------------------------------
809 {
810  kern_return_t kernResult = KERN_FAILURE;
811  uint64_t scalarI_64[2] = {uint64_t(appType), uint64_t(pid)};
812  uint32_t outputCount = 0;
813  if (GetIOConnect())
814  {
815  kernResult = OS_IOConnectCallScalarMethod ( GetIOConnect(), // an io_connect_t returned from IOServiceOpen().
816  kDriverAcquireStreamForApplication, // selector of the function to be called via the user client.
817  scalarI_64, // array of scalar (64-bit) input values.
818  2, // the number of scalar input values.
819  AJA_NULL, // array of scalar (64-bit) output values.
820  &outputCount); // pointer to the number of scalar output values.
821  }
822  if (kernResult == KERN_SUCCESS)
823  return true;
824  DIFAIL(KR(kernResult) << ": con=" << HEX8(GetIOConnect()));
825  return false;
826 }
827 
828 
829 //--------------------------------------------------------------------------------------------------------------------
830 // ReleaseStreamForApplication
831 //--------------------------------------------------------------------------------------------------------------------
833 {
834  kern_return_t kernResult = KERN_FAILURE;
835  uint64_t scalarI_64[2] = {uint64_t(appType), uint64_t(pid)};
836  uint32_t outputCount = 0;
837  if (GetIOConnect())
838  {
839  kernResult = OS_IOConnectCallScalarMethod ( GetIOConnect(), // an io_connect_t returned from IOServiceOpen().
840  kDriverReleaseStreamForApplication, // selector of the function to be called via the user client.
841  scalarI_64, // array of scalar (64-bit) input values.
842  2, // the number of scalar input values.
843  AJA_NULL, // array of scalar (64-bit) output values.
844  &outputCount); // pointer to the number of scalar output values.
845  }
846  if (kernResult == KERN_SUCCESS)
847  return true;
848  DIFAIL (KR(kernResult) << ": con=" << HEX8(GetIOConnect()));
849  return false;
850 }
851 
852 
853 //--------------------------------------------------------------------------------------------------------------------
854 // AcquireStreamForApplicationWithReference
855 //
856 // Do a reference counted acquire
857 // Use this call ONLY with ReleaseStreamForApplicationWithReference
858 // Aquire board by by waiting for current board to release its resources
859 //
860 // Note: When quicktime is using the board, desktop output on the board is disabled
861 // by the driver.
862 //--------------------------------------------------------------------------------------------------------------------
864 {
865  kern_return_t kernResult = KERN_FAILURE;
866  uint64_t scalarI_64[2] = {uint64_t(appType), uint64_t(pid)};
867  uint32_t outputCount = 0;
868  if (GetIOConnect())
869  {
870  kernResult = OS_IOConnectCallScalarMethod ( GetIOConnect(), // an io_connect_t returned from IOServiceOpen().
871  kDriverAcquireStreamForApplicationWithReference, // selector of the function to be called via the user client.
872  scalarI_64, // array of scalar (64-bit) input values.
873  2, // the number of scalar input values.
874  AJA_NULL, // array of scalar (64-bit) output values.
875  &outputCount); // pointer to the number of scalar output values.
876  }
877  if (kernResult == KERN_SUCCESS)
878  return true;
879  DIFAIL (KR(kernResult) << ": con=" << HEX8(GetIOConnect()));
880  return false;
881 }
882 
883 
884 //--------------------------------------------------------------------------------------------------------------------
885 // ReleaseStreamForApplicationWithReference
886 //
887 // Do a reference counted release
888 // Use this call ONLY with AcquireStreamForApplicationWithReference
889 //--------------------------------------------------------------------------------------------------------------------
891 {
892  kern_return_t kernResult = KERN_FAILURE;
893  uint64_t scalarI_64[2] = {uint64_t(appType), uint64_t(pid)};
894  uint32_t outputCount = 0;
895  if (GetIOConnect())
896  {
897  kernResult = OS_IOConnectCallScalarMethod ( GetIOConnect(), // an io_connect_t returned from IOServiceOpen().
898  kDriverReleaseStreamForApplicationWithReference, // selector of the function to be called via the user client.
899  scalarI_64, // array of scalar (64-bit) input values.
900  2, // the number of scalar input values.
901  AJA_NULL, // array of scalar (64-bit) output values.
902  &outputCount); // pointer to the number of scalar output values.
903  }
904  if (kernResult == KERN_SUCCESS)
905  return true;
906  DIFAIL (KR(kernResult) << ": con=" << HEX8(GetIOConnect()));
907  return false;
908 }
909 
910 
911 //--------------------------------------------------------------------------------------------------------------------
912 // Get/Set Streaming Application
913 //
914 // Forced aquisition of board for exclusive use by app
915 // Use with care - better to use AcquireStreamForApplication
916 //
917 // Note: When quicktime is using the board, desktop output on the board is disabled
918 // by the driver.
919 //--------------------------------------------------------------------------------------------------------------------
921 {
922  kern_return_t kernResult = KERN_FAILURE;
923  uint64_t scalarI_64[2] = {uint64_t(appType), uint64_t(pid)};
924  uint32_t outputCount = 0;
925  if (GetIOConnect())
926  {
927  kernResult = OS_IOConnectCallScalarMethod ( GetIOConnect(), // an io_connect_t returned from IOServiceOpen().
928  kDriverSetStreamForApplication, // selector of the function to be called via the user client.
929  scalarI_64, // array of scalar (64-bit) input values.
930  2, // the number of scalar input values.
931  AJA_NULL, // array of scalar (64-bit) output values.
932  &outputCount); // pointer to the number of scalar output values.
933  }
934  if (kernResult == KERN_SUCCESS)
935  return true;
936  DIFAIL (KR(kernResult) << ": con=" << HEX8(GetIOConnect()));
937  return false;
938 }
939 
940 
941 //--------------------------------------------------------------------------------------------------------------------
942 // GetStreamingApplication
943 //--------------------------------------------------------------------------------------------------------------------
944 bool CNTV2MacDriverInterface::GetStreamingApplication (ULWord & outAppType, int32_t & outProcessID)
945 {
946  kern_return_t kernResult = KERN_FAILURE;
947  uint64_t scalarO_64[2] = {0, 0};
948  uint32_t outputCount(2);
949  if (GetIOConnect())
950  {
951  kernResult = OS_IOConnectCallScalarMethod ( GetIOConnect(), // an io_connect_t returned from IOServiceOpen().
952  kDriverGetStreamForApplication, // selector of the function to be called via the user client.
953  AJA_NULL, // array of scalar (64-bit) input values.
954  0, // the number of scalar input values.
955  scalarO_64, // array of scalar (64-bit) output values.
956  &outputCount); // pointer to the number of scalar output values.
957  }
958  outAppType = ULWord(scalarO_64[0]);
959  outProcessID = int32_t(scalarO_64[1]);
960  if (kernResult == KERN_SUCCESS)
961  return true;
962  DIFAIL (KR(kernResult) << ": con=" << HEX8(GetIOConnect()));
963  return false;
964 }
965 
966 
967 //--------------------------------------------------------------------------------------------------------------------
968 // KernelLog
969 //--------------------------------------------------------------------------------------------------------------------
970 bool CNTV2MacDriverInterface::KernelLog (void * dataPtr, UInt32 dataSize)
971 {
972  kern_return_t kernResult = KERN_FAILURE;
973  uint64_t scalarI_64[2] = {uint64_t(dataPtr), dataSize};
974  uint32_t outputCount = 0;
975  if (GetIOConnect())
976  kernResult = OS_IOConnectCallScalarMethod ( GetIOConnect(), // an io_connect_t returned from IOServiceOpen().
977  kDriverKernelLog, // selector of the function to be called via the user client.
978  scalarI_64, // array of scalar (64-bit) input values.
979  2, // the number of scalar input values.
980  AJA_NULL, // array of scalar (64-bit) output values.
981  &outputCount); // pointer to the number of scalar output values.
982  if (kernResult == KERN_SUCCESS)
983  return true;
984  DIFAIL (KR(kernResult) << ": con=" << HEX8(GetIOConnect()));
985  return false;
986 }
987 
988 
989 static const uint32_t sIntEnumToStatKeys[] = { AJA_DebugStat_WaitForInterruptOut1, // eOutput1 // 0
991  AJA_DebugStat_WaitForInterruptIn1, // eInput1 // 2
992  AJA_DebugStat_WaitForInterruptIn2, // eInput2 // 3
994  AJA_DebugStat_WaitForInterruptUartTx1, // eUart1Tx // 14
995  AJA_DebugStat_WaitForInterruptUartRx1, // eUart1Rx // 15
997  AJA_DebugStat_WaitForInterruptIn3, // eInput3 // 24
998  AJA_DebugStat_WaitForInterruptIn4, // eInput4 // 25
999  AJA_DebugStat_WaitForInterruptUartTx2, // eUartTx2 // 26
1000  AJA_DebugStat_WaitForInterruptUartRx2, // eUartRx2 // 27
1002  AJA_DebugStat_WaitForInterruptIn5, // eInput5 // 29
1003  AJA_DebugStat_WaitForInterruptIn6, // eInput6 // 30
1004  AJA_DebugStat_WaitForInterruptIn7, // eInput7 // 31
1005  AJA_DebugStat_WaitForInterruptIn8, // eInput8 // 32
1007 
1008 //--------------------------------------------------------------------------------------------------------------------
1009 // WaitForInterrupt
1010 //
1011 // Block the current thread until the specified interrupt occurs.
1012 // Supply a timeout in milliseconds - if 0 (default), then never time out.
1013 // Returns true if interrupt occurs, false if timeout.
1014 //--------------------------------------------------------------------------------------------------------------------
1016 {
1017  if (IsRemote())
1018  return CNTV2DriverInterface::WaitForInterrupt(type, timeout);
1019  if (type == eChangeEvent)
1020  return WaitForChangeEvent(timeout);
1021 
1022  kern_return_t kernResult = KERN_FAILURE;
1023  uint64_t scalarI_64[2] = {type, timeout};
1024  uint64_t scalarO_64 = 0;
1025  uint32_t outputCount = 1;
1026 
1027  if (!NTV2_IS_VALID_INTERRUPT_ENUM(type))
1028  kernResult = KERN_INVALID_VALUE;
1029  else if (GetIOConnect())
1030  {
1032  kernResult = OS_IOConnectCallScalarMethod ( GetIOConnect(), // an io_connect_t returned from IOServiceOpen().
1033  kDriverWaitForInterrupt,// selector of the function to be called via the user client.
1034  scalarI_64, // array of scalar (64-bit) input values.
1035  2, // the number of scalar input values.
1036  &scalarO_64, // array of scalar (64-bit) output values.
1037  &outputCount); // pointer to the number of scalar output values.
1039  }
1040  UInt32 interruptOccurred = uint32_t(scalarO_64);
1041  if (kernResult != KERN_SUCCESS)
1042  {DIFAIL (KR(kernResult) << ": con=" << HEX8(GetIOConnect())); return false;}
1043  if (interruptOccurred)
1044  BumpEventCount(type);
1045  return interruptOccurred;
1046 }
1047 
1048 //--------------------------------------------------------------------------------------------------------------------
1049 // GetInterruptCount
1050 //
1051 // Returns the number of interrupts that have occured for the specified interrupt type.
1052 //--------------------------------------------------------------------------------------------------------------------
1054 {
1055  kern_return_t kernResult = KERN_FAILURE;
1056  uint64_t scalarI_64[1] = {eInterrupt};
1057  uint64_t scalarO_64 = 0;
1058  uint32_t outputCount = 1;
1059  if (GetIOConnect())
1060  {
1062  kernResult = OS_IOConnectCallScalarMethod ( GetIOConnect(), // an io_connect_t returned from IOServiceOpen().
1063  kDriverGetInterruptCount, // selector of the function to be called via the user client.
1064  scalarI_64, // array of scalar (64-bit) input values.
1065  1, // the number of scalar input values.
1066  &scalarO_64, // array of scalar (64-bit) output values.
1067  &outputCount); // pointer to the number of scalar output values.
1069  }
1070  outCount = ULWord(scalarO_64);
1071  if (kernResult == KERN_SUCCESS)
1072  return true;
1073  DIFAIL(KR(kernResult) << ": con=" << HEX8(GetIOConnect()));
1074  return false;
1075 }
1076 
1077 //--------------------------------------------------------------------------------------------------------------------
1078 // WaitForChangeEvent
1079 //
1080 // Block the current thread until a register changes.
1081 // Supply a timeout in milliseconds - if 0 (default), then never time out.
1082 // Returns true if change occurs, false if timeout.
1083 //--------------------------------------------------------------------------------------------------------------------
1085 {
1086  kern_return_t kernResult = KERN_FAILURE;
1087  uint64_t scalarI_64[1] = {timeout};
1088  uint64_t scalarO_64 = 0;
1089  uint32_t outputCount = 1;
1090  if (GetIOConnect())
1091  kernResult = OS_IOConnectCallScalarMethod ( GetIOConnect(), // an io_connect_t returned from IOServiceOpen().
1092  kDriverWaitForChangeEvent, // selector of the function to be called via the user client.
1093  scalarI_64, // array of scalar (64-bit) input values.
1094  1, // the number of scalar input values.
1095  &scalarO_64, // array of scalar (64-bit) output values.
1096  &outputCount); // pointer to the number of scalar output values.
1097  if (kernResult != KERN_SUCCESS)
1098  DIFAIL(KR(kernResult) << ": con=" << HEX8(GetIOConnect()));
1099  return bool(scalarO_64);
1100 }
1101 
1102 
1103 //--------------------------------------------------------------------------------------------------------------------
1104 // DmaTransfer
1105 //
1106 // Start a memory transfer using the specified DMA engine.
1107 // Optional - call PrepareDMAMemory on the dataPtr before the first use of memory block
1108 // for DMA and CompleteDMAMemory when done. This will speed up the DMA by not requiring
1109 // memory to be prepared for each DMA. Otherwise, it takes about 2 to 5 ms (sometimes
1110 // much more) for the memory block to be prepared.
1111 // This function will sleep (block) until the DMA finishes.
1112 //--------------------------------------------------------------------------------------------------------------------
1114  const bool inIsRead,
1115  const ULWord inFrameNumber,
1116  ULWord * pFrameBuffer,
1117  const ULWord inOffsetBytes,
1118  const ULWord inByteCount,
1119  const bool inSynchronous)
1120 {
1121  if (IsRemote())
1122  return CNTV2DriverInterface::DmaTransfer(inDMAEngine, inIsRead, inFrameNumber, pFrameBuffer,
1123  inOffsetBytes, inByteCount, inSynchronous);
1124  if (!IsOpen())
1125  return false;
1126  kern_return_t kernResult = KERN_FAILURE;
1127  uint64_t scalarI_64[6] = {inDMAEngine, uint64_t(pFrameBuffer), inFrameNumber, inOffsetBytes, inByteCount, !inIsRead};
1128  uint32_t outputCount = 0;
1129  if (GetIOConnect())
1130  {
1132  kernResult = OS_IOConnectCallScalarMethod ( GetIOConnect(), // an io_connect_t returned from IOServiceOpen().
1133  kDriverDMATransfer, // selector of the function to be called via the user client.
1134  scalarI_64, // array of scalar (64-bit) input values.
1135  6, // the number of scalar input values.
1136  AJA_NULL, // array of scalar (64-bit) output values.
1137  &outputCount); // pointer to the number of scalar output values.
1139  }
1140  if (kernResult == KERN_SUCCESS)
1141  return true;
1142  DIFAIL(KR(kernResult) << ": con=" << HEX8(GetIOConnect()) << ", eng=" << inDMAEngine << ", frm=" << inFrameNumber
1143  << ", off=" << HEX8(inOffsetBytes) << ", len=" << HEX8(inByteCount) << ", " << (inIsRead ? "R" : "W"));
1144  return false;
1145 }
1146 
1147 
1148 //--------------------------------------------------------------------------------------------------------------------
1149 // DmaTransfer
1150 //
1151 // Start a memory transfer using the specified DMA engine.
1152 // Optional - call PrepareDMAMemory on the dataPtr before the first use of memory block
1153 // for DMA and CompleteDMAMemory when done. This will speed up the DMA by not requiring
1154 // memory to be prepared for each DMA. Otherwise, it takes about 2 to 5 ms (sometimes
1155 // much more) for the memory block to be prepared.
1156 // This function will sleep (block) until the DMA finishes.
1157 //--------------------------------------------------------------------------------------------------------------------
1159  const bool inIsRead,
1160  const ULWord inFrameNumber,
1161  ULWord * pFrameBuffer,
1162  const ULWord inCardOffsetBytes,
1163  const ULWord inByteCount,
1164  const ULWord inNumSegments,
1165  const ULWord inSegmentHostPitch,
1166  const ULWord inSegmentCardPitch,
1167  const bool inSynchronous)
1168 {
1169  if (IsRemote())
1170  return CNTV2DriverInterface::DmaTransfer (inDMAEngine, inIsRead, inFrameNumber, pFrameBuffer, inCardOffsetBytes, inByteCount,
1171  inNumSegments, inSegmentHostPitch, inSegmentCardPitch, inSynchronous);
1172  if (!IsOpen())
1173  return false;
1174  kern_return_t kernResult = KERN_FAILURE;
1175  size_t outputStructSize = 0;
1176 
1177  DMA_TRANSFER_STRUCT_64 dmaTransfer64;
1178  dmaTransfer64.dmaEngine = inDMAEngine;
1179  dmaTransfer64.dmaFlags = 0;
1180  dmaTransfer64.dmaHostBuffer = Pointer64(pFrameBuffer); // virtual address of host buffer
1181  dmaTransfer64.dmaSize = inByteCount; // total number of bytes to DMA
1182  dmaTransfer64.dmaCardFrameNumber = inFrameNumber; // card frame number
1183  dmaTransfer64.dmaCardFrameOffset = inCardOffsetBytes; // offset (in bytes) into card frame to begin DMA
1184  dmaTransfer64.dmaNumberOfSegments = inNumSegments; // number of segments of size videoBufferSize to DMA
1185  dmaTransfer64.dmaSegmentSize = (inByteCount / inNumSegments); // size of each segment (if videoNumSegments > 1)
1186  dmaTransfer64.dmaSegmentHostPitch = inSegmentHostPitch; // offset between the beginning of one host-memory segment and the next host-memory segment
1187  dmaTransfer64.dmaSegmentCardPitch = inSegmentCardPitch; // offset between the beginning of one Kona-memory segment and the next Kona-memory segment
1188  dmaTransfer64.dmaToCard = !inIsRead; // direction of DMA transfer
1189 
1190  if (GetIOConnect())
1191  {
1193  kernResult = OS_IOConnectCallStructMethod (GetIOConnect(), // an io_connect_t returned from IOServiceOpen().
1194  kDriverDMATransferEx, // selector of the function to be called via the user client.
1195  &dmaTransfer64, // pointer to the input structure
1196  sizeof(DMA_TRANSFER_STRUCT_64), // size of input structure
1197  AJA_NULL, // pointer to the output structure
1198  &outputStructSize); // size of output structure
1200  }
1201  if (kernResult == KERN_SUCCESS)
1202  return true;
1203  DIFAIL (KR(kernResult) << ": con=" << HEX8(GetIOConnect()));
1204  return false;
1205 }
1206 
1207 
1209  const NTV2Channel inDMAChannel,
1210  const bool inIsTarget,
1211  const ULWord inFrameNumber,
1212  const ULWord inCardOffsetBytes,
1213  const ULWord inByteCount,
1214  const ULWord inNumSegments,
1215  const ULWord inSegmentHostPitch,
1216  const ULWord inSegmentCardPitch,
1217  const PCHANNEL_P2P_STRUCT & inP2PData)
1218 {
1219  if (IsRemote())
1220  return CNTV2DriverInterface::DmaTransfer (inDMAEngine, inDMAChannel, inIsTarget, inFrameNumber, inCardOffsetBytes, inByteCount,
1221  inNumSegments, inSegmentHostPitch, inSegmentCardPitch, inP2PData);
1222  return false;
1223 }
1224 
1225 
1226 //--------------------------------------------------------------------------------------------------------------------
1227 // RestoreHardwareProcampRegisters
1228 //--------------------------------------------------------------------------------------------------------------------
1230 {
1231  kern_return_t kernResult = KERN_FAILURE;
1232  uint32_t outputCount = 0;
1233  if (GetIOConnect())
1234  kernResult = OS_IOConnectCallScalarMethod ( GetIOConnect(), // an io_connect_t returned from IOServiceOpen().
1235  kDriverRestoreProcAmpRegisters, // selector of the function to be called via the user client.
1236  AJA_NULL, // array of scalar (64-bit) input values.
1237  0, // the number of scalar input values.
1238  AJA_NULL, // array of scalar (64-bit) output values.
1239  &outputCount); // pointer to the number of scalar output values.
1240  if (kernResult == KERN_SUCCESS)
1241  return true;
1242  DIFAIL (KR(kernResult) << ": con=" << HEX8(GetIOConnect()));
1243  return false;
1244 }
1245 
1246 
1247 //--------------------------------------------------------------------------------------------------------------------
1248 // SystemStatus
1249 //--------------------------------------------------------------------------------------------------------------------
1251 {
1252  kern_return_t kernResult = KERN_FAILURE;
1253  uint64_t scalarI_64[2] = {uint64_t(dataPtr), statusCode};
1254  uint32_t outputCount = 0;
1255  if (GetIOConnect())
1256  kernResult = OS_IOConnectCallScalarMethod ( GetIOConnect(), // an io_connect_t returned from IOServiceOpen().
1257  kDriverSystemStatus, // selector of the function to be called via the user client.
1258  scalarI_64, // array of scalar (64-bit) input values.
1259  2, // the number of scalar input values.
1260  AJA_NULL, // array of scalar (64-bit) output values.
1261  &outputCount); // pointer to the number of scalar output values.
1262  if (statusCode != SSC_GetFirmwareProgress)
1263  return false;
1264  if (kernResult == KERN_SUCCESS)
1265  return true;
1266  MDIFAIL (KR(kernResult) << INSTP(this) << ", con=" << HEX8(GetIOConnect()));
1267  return false;
1268 }
1269 
1270 
1271 //--------------------------------------------------------------------------------------------------------------------
1272 // AutoCirculate
1273 //--------------------------------------------------------------------------------------------------------------------
1275 {
1276  bool success = true;
1277  if (IsRemote())
1278  return CNTV2DriverInterface::AutoCirculate(autoCircData);
1279 
1280  kern_return_t kernResult = KERN_FAILURE;
1281  io_connect_t conn(GetIOConnect());
1282  if (!conn)
1283  return false;
1284 
1285  switch (autoCircData.eCommand)
1286  {
1287  case eInitAutoCirc:
1288  case eStartAutoCirc:
1289  case eStopAutoCirc:
1290  case eAbortAutoCirc:
1291  case ePauseAutoCirc:
1292  case eFlushAutoCirculate:
1293  case ePrerollAutoCirculate:
1294  case eSetActiveFrame:
1295  case eStartAutoCircAtTime:
1296  {
1297  // Pass the autoCircData structure to the driver. The driver knows the implicit meanings of the
1298  // members of the structure based on the the command contained within it.
1299  size_t outputStructSize = 0;
1300  AUTOCIRCULATE_DATA_64 autoCircData64;
1301  CopyTo_AUTOCIRCULATE_DATA_64 (&autoCircData, &autoCircData64);
1302 
1304  kernResult = OS_IOConnectCallStructMethod ( conn, // an io_connect_t returned from IOServiceOpen().
1305  kDriverAutoCirculateControl, // selector of the function to be called via the user client.
1306  &autoCircData64, // pointer to the input structure
1307  sizeof(AUTOCIRCULATE_DATA_64), // size of input structure
1308  AJA_NULL, // pointer to the output structure
1309  &outputStructSize); // size of output structure
1311  break;
1312  } // eInit, eStart, eStop, eAbort, etc...
1313 
1314  case eGetAutoCirc:
1315  {
1316  uint64_t scalarI_64[1];
1317  uint32_t outputCount = 0;
1318  size_t outputStructSize = sizeof(AUTOCIRCULATE_STATUS_STRUCT);
1319  scalarI_64[0] = autoCircData.channelSpec;
1321  kernResult = OS_IOConnectCallMethod ( conn, // an io_connect_t returned from IOServiceOpen().
1322  kDriverAutoCirculateStatus, // selector of the function to be called via the user client.
1323  scalarI_64, // array of scalar (64-bit) input values.
1324  1, // the number of scalar input values.
1325  AJA_NULL, // pointer to the input structure
1326  0, // size of input structure
1327  AJA_NULL, // array of scalar (64-bit) output values.
1328  &outputCount, // the number of scalar output values.
1329  autoCircData.pvVal1, // pointer to the output structure
1330  &outputStructSize); // size of output structure
1332  break;
1333  } // eGetAutoCirc
1334 
1335  case eGetFrameStamp:
1336  case eGetFrameStampEx2:
1337  {
1338  // Make sure task structure does not get passed in with eGetFrameStamp call.
1339  if ( autoCircData.eCommand == eGetFrameStamp)
1340  autoCircData.pvVal2 = AJA_NULL;
1341 
1342  size_t outputStructSize = sizeof(AUTOCIRCULATE_DATA_64);
1343 
1344  // promote base data structure
1345  AUTOCIRCULATE_DATA_64 autoCircData64;
1346  CopyTo_AUTOCIRCULATE_DATA_64 (&autoCircData, &autoCircData64);
1347 
1349  kernResult = OS_IOConnectCallStructMethod ( conn, // an io_connect_t returned from IOServiceOpen().
1350  kDriverAutoCirculateFramestamp, // selector of the function to be called via the user client.
1351  &autoCircData64, // pointer to the input structure
1352  sizeof(AUTOCIRCULATE_DATA_64), // size of input structure
1353  &autoCircData64, // pointer to the output structure
1354  &outputStructSize); // size of output structure
1356  break;
1357  } // eGetFrameStamp, eGetFrameStampEx2
1358 
1362  {
1363  // Pass the autoCircData structure to the driver. The driver knows the implicit meanings of the
1364  // members of the structure based on the the command contained within it.
1365  // Make sure routing table and task structure does not get passed in with eTransferAutoCirculate call.
1366  if (autoCircData.eCommand == eTransferAutoCirculate)
1367  {
1368  autoCircData.pvVal3 = AJA_NULL;
1369  autoCircData.pvVal4 = AJA_NULL;
1370  }
1371 
1372  // Make sure task structure does not get passed in with eTransferAutoCirculateEx call.
1373  if (autoCircData.eCommand == eTransferAutoCirculateEx)
1374  autoCircData.pvVal4 = AJA_NULL;
1375 
1376  size_t outputStructSize = sizeof(AUTOCIRCULATE_TRANSFER_STATUS_STRUCT);
1377 
1378  // promote base data structure
1379  AUTOCIRCULATE_DATA_64 autoCircData64;
1380  CopyTo_AUTOCIRCULATE_DATA_64 (&autoCircData, &autoCircData64);
1381 
1382  // promote AUTOCIRCULATE_TRANSFER_STRUCT
1383  AUTOCIRCULATE_TRANSFER_STRUCT_64 autoCircTransfer64;
1384  CopyTo_AUTOCIRCULATE_TRANSFER_STRUCT_64 (reinterpret_cast<AUTOCIRCULATE_TRANSFER_STRUCT*>(autoCircData.pvVal1), &autoCircTransfer64);
1385  autoCircData64.pvVal1 = Pointer64(&autoCircTransfer64);
1386 
1387  AUTOCIRCULATE_TASK_STRUCT_64 autoCircTask64;
1388  if (autoCircData.pvVal4 != AJA_NULL)
1389  {
1390  CopyTo_AUTOCIRCULATE_TASK_STRUCT_64 (reinterpret_cast<AUTOCIRCULATE_TASK_STRUCT*>(autoCircData.pvVal4), &autoCircTask64);
1391  autoCircData64.pvVal4 = Pointer64(&autoCircTask64);
1392  }
1393 
1395  kernResult = OS_IOConnectCallStructMethod ( conn, // an io_connect_t returned from IOServiceOpen().
1396  kDriverAutoCirculateTransfer, // selector of the function to be called via the user client.
1397  &autoCircData64, // pointer to the input structure
1398  sizeof(AUTOCIRCULATE_DATA_64), // size of input structure
1399  autoCircData.pvVal2, // pointer to the output structure
1400  &outputStructSize); // size of output structure
1402  break;
1403  } // eTransferAutoCirculate, eTransferAutoCirculateEx, eTransferAutoCirculateEx2
1404 
1405  default:
1406  //DisplayNTV2Error("Unsupported AC command type in AutoCirculate()\n");
1407  kernResult = KERN_INVALID_ARGUMENT;
1408  break;
1409  } // switch
1410 
1411  success = (kernResult == KERN_SUCCESS);
1412  if (kernResult != KERN_SUCCESS && kernResult != kIOReturnOffline)
1413  MDIFAIL (KR(kernResult) << INSTP(this) << ", con=" << HEX8(conn) << ", eCmd=" << autoCircData.eCommand);
1414  return success;
1415 } // AutoCirculate
1416 
1417 
1419 {
1420  if (!pInOutMessage)
1421  return false;
1422  if (!pInOutMessage->IsValid())
1423  return false;
1424  if (!pInOutMessage->GetSizeInBytes())
1425  return false;
1426  if (IsRemote())
1427  return CNTV2DriverInterface::NTV2Message (pInOutMessage);
1428 
1429  // Force fOperation = 0 in SDK 16.3, to allow RPCs from 16.3 or later clients to work on servers running 16.2 or earlier drivers:
1430  ULWord* pU32 = reinterpret_cast<ULWord*>(pInOutMessage); pU32[6] = 0;
1431 
1432  kern_return_t kernResult (KERN_FAILURE);
1433  io_connect_t connection (GetIOConnect ());
1434  uint64_t scalarI_64 [2] = {uint64_t(pInOutMessage), pInOutMessage->GetSizeInBytes()};
1435  uint32_t numScalarOutputs(0);
1436  if (connection)
1437  {
1439  kernResult = OS_IOConnectCallScalarMethod ( connection, // an io_connect_t returned from IOServiceOpen
1440  kDriverNTV2Message, // selector of the function to be called via the user client
1441  scalarI_64, // array of scalar (64-bit) input values
1442  2, // the number of scalar input values
1443  AJA_NULL, // array of scalar (64-bit) output values
1444  &numScalarOutputs); // pointer (in: number of scalar output values capable of receiving; out: actual number of scalar output values)
1446  }
1447  if (kernResult != KERN_SUCCESS && kernResult != kIOReturnOffline)
1448  MDIFAIL (KR(kernResult) << INSTP(this) << ", con=" << HEX8(connection) << endl << *pInOutMessage);
1449  return kernResult == KERN_SUCCESS;
1450 
1451 } // NTV2Message
1452 
1453 
1454 
1455 #pragma mark Old Driver Calls
1456 
1458 {
1459  return WriteRegister(kVRegGlobalAudioPlaybackMode,mode);
1460 }
1461 
1463 {
1465 }
1466 
1467 
1468 //-------------------------------------------------------------------------------------------------------
1469 // CopyTo_AUTOCIRCULATE_DATA_64
1470 //-------------------------------------------------------------------------------------------------------
1471 void CNTV2MacDriverInterface::CopyTo_AUTOCIRCULATE_DATA_64 (AUTOCIRCULATE_DATA *p, AUTOCIRCULATE_DATA_64 *p64)
1472 {
1473  // note that p is native structure, either 64 or 32 bit
1474  p64->eCommand = p->eCommand;
1475  p64->channelSpec = p->channelSpec;
1476 
1477  p64->lVal1 = p->lVal1;
1478  p64->lVal2 = p->lVal2;
1479  p64->lVal3 = p->lVal3;
1480  p64->lVal4 = p->lVal4;
1481  p64->lVal5 = p->lVal5;
1482  p64->lVal6 = p->lVal6;
1483 
1484  p64->bVal1 = p->bVal1;
1485  p64->bVal2 = p->bVal2;
1486  p64->bVal3 = p->bVal3;
1487  p64->bVal4 = p->bVal4;
1488  p64->bVal5 = p->bVal5;
1489  p64->bVal6 = p->bVal6;
1490  p64->bVal7 = p->bVal7;
1491  p64->bVal8 = p->bVal8;
1492 
1493  p64->pvVal1 = Pointer64(p->pvVal1); // native to 64 bit
1494  p64->pvVal2 = Pointer64(p->pvVal2); // native to 64 bit
1495  p64->pvVal3 = Pointer64(p->pvVal3); // native to 64 bit
1496  p64->pvVal4 = Pointer64(p->pvVal4); // native to 64 bit
1497 }
1498 
1499 
1500 //-------------------------------------------------------------------------------------------------------
1501 // CopyTo_AUTOCIRCULATE_DATA
1502 //-------------------------------------------------------------------------------------------------------
1503 void CNTV2MacDriverInterface::CopyTo_AUTOCIRCULATE_DATA (AUTOCIRCULATE_DATA_64 *p64, AUTOCIRCULATE_DATA *p)
1504 {
1505  // note that p is native structure, either 64 or 32 bit
1506  p->eCommand = p64->eCommand;
1507  p->channelSpec = p64->channelSpec;
1508 
1509  p->lVal1 = p64->lVal1;
1510  p->lVal2 = p64->lVal2;
1511  p->lVal3 = p64->lVal3;
1512  p->lVal4 = p64->lVal4;
1513  p->lVal5 = p64->lVal5;
1514  p->lVal6 = p64->lVal6;
1515 
1516  p->bVal1 = p64->bVal1;
1517  p->bVal2 = p64->bVal2;
1518  p->bVal3 = p64->bVal3;
1519  p->bVal4 = p64->bVal4;
1520  p->bVal5 = p64->bVal5;
1521  p->bVal6 = p64->bVal6;
1522  p->bVal7 = p64->bVal7;
1523  p->bVal8 = p64->bVal8;
1524 
1525  p->pvVal1 = reinterpret_cast<void*>(p64->pvVal1); // 64 bit to native
1526  p->pvVal2 = reinterpret_cast<void*>(p64->pvVal2); // 64 bit to native
1527  p->pvVal3 = reinterpret_cast<void*>(p64->pvVal3); // 64 bit to native
1528  p->pvVal4 = reinterpret_cast<void*>(p64->pvVal4); // 64 bit to native
1529 }
1530 
1531 
1532 //-------------------------------------------------------------------------------------------------------
1533 // CopyTo_AUTOCIRCULATE_TRANSFER_STRUCT_64
1534 //-------------------------------------------------------------------------------------------------------
1535 void CNTV2MacDriverInterface::CopyTo_AUTOCIRCULATE_TRANSFER_STRUCT_64 (AUTOCIRCULATE_TRANSFER_STRUCT *p, AUTOCIRCULATE_TRANSFER_STRUCT_64 *p64)
1536 {
1537  // note that p is native structure, either 64 or 32 bit
1538  p64->channelSpec = p->channelSpec;
1539  p64->videoBuffer = Pointer64(p->videoBuffer); // native to 64 bit
1540  p64->videoBufferSize = p->videoBufferSize;
1541  p64->videoDmaOffset = p->videoDmaOffset;
1542  p64->audioBuffer = Pointer64(p->audioBuffer); // native to 64 bit
1543  p64->audioBufferSize = p->audioBufferSize;
1547 
1548  p64->rp188.DBB = p->rp188.DBB;
1549  p64->rp188.Low = p->rp188.Low;
1550  p64->rp188.High = p->rp188.High;
1551 
1552  p64->desiredFrame = p->desiredFrame;
1553  p64->hUser = p->hUser;
1554  p64->transferFlags = p->transferFlags;
1558 
1562 
1563  p64->vidProcInfo.mode = p->vidProcInfo.mode;
1570 
1575 
1579 
1581 
1582 #if 0
1583  printf("----------------------\n");
1584  printf("sizeof = %d\n", (int)sizeof(AUTOCIRCULATE_TRANSFER_STRUCT_64));
1585 
1586  uint8_t * ptr = (uint8_t *)p64;
1587  for (int i = 0; i < (int)sizeof(AUTOCIRCULATE_TRANSFER_STRUCT_64); i++)
1588  {
1589  if ((i % 4) == 0)
1590  printf("\n");
1591  printf("%x ", *ptr++);
1592  }
1593  printf("\n\n", *ptr++);
1594 
1595 #endif
1596 
1597  #if 0
1598  printf("----------------------\n");
1599  printf("sizeof = %d\n", (int)sizeof(AUTOCIRCULATE_TRANSFER_STRUCT_64));
1600 
1601  // note that p is native structure, either 64 or 32 bit
1602  printf("channelSpec %x\n", p64->channelSpec);
1603  printf("videoBuffer %lx\n",p64->videoBuffer);
1604  printf("videoBufferSize %x\n",p64->videoBufferSize);
1605  printf("videoDmaOffset %x\n",p64->videoDmaOffset);
1606  printf("audioBuffer %lx\n",p64->audioBuffer);
1607  printf("audioBufferSize %x\n",p64->audioBufferSize);
1608  printf("audioStartSample %x\n",p64->audioStartSample);
1609  printf("audioNumChannels %x\n",p64->audioNumChannels);
1610  printf("frameRepeatCount %x\n",p64->frameRepeatCount);
1611 
1612  printf("rp188.DBB %x\n",p64->rp188.DBB);
1613  printf("rp188.Low %x\n",p64->rp188.Low);
1614  printf("rp188.High %x\n",p64->rp188.High);
1615 
1616  printf("desiredFrame %x\n",p64->desiredFrame);
1617  printf("hUser %x\n",p64->hUser);
1618  printf("transferFlags %x\n",p64->transferFlags);
1619  printf("bDisableExtraAudioInfo %x\n",p64->bDisableExtraAudioInfo);
1620  printf("frameBufferFormat %x\n",p64->frameBufferFormat);
1621  printf("frameBufferOrientation %x\n",p64->frameBufferOrientation);
1622 
1623  printf("colorCorrectionInfo.mode %x\n",p64->colorCorrectionInfo.mode);
1624  printf("colorCorrectionInfo.saturationValue %x\n",p64->colorCorrectionInfo.saturationValue);
1625  printf("colorCorrectionInfo.ccLookupTables %x\n",p64->colorCorrectionInfo.ccLookupTables);
1626 
1627  printf("vidProcInfo.mode %x\n",p64->vidProcInfo.mode);
1628  printf("vidProcInfo.foregroundVideoCrosspoint %x\n",p64->vidProcInfo.foregroundVideoCrosspoint);
1629  printf("vidProcInfo.backgroundVideoCrosspoint %x\n",p64->vidProcInfo.backgroundVideoCrosspoint);
1630  printf("vidProcInfo.foregroundKeyCrosspoint %x\n",p64->vidProcInfo.foregroundKeyCrosspoint);
1631  printf("vidProcInfo.backgroundKeyCrosspoint %x\n",p64->vidProcInfo.backgroundKeyCrosspoint);
1632  printf("vidProcInfo.transitionCoefficient %x\n",p64->vidProcInfo.transitionCoefficient);
1633  printf("vidProcInfo.transitionSoftness %x\n",p64->vidProcInfo.transitionSoftness);
1634 
1635  printf("customAncInfo.Group1 %x\n",p64->customAncInfo.Group1);
1636  printf("customAncInfo.Group2 %x\n",p64->customAncInfo.Group2);
1637  printf("customAncInfo.Group3 %x\n",p64->customAncInfo.Group3);
1638  printf("customAncInfo.Group4 %x\n",p64->customAncInfo.Group4);
1639 
1640  printf("videoNumSegments %x\n",p64->videoNumSegments);
1641  printf("videoSegmentHostPitch %x\n",p64->videoSegmentHostPitch);
1642  printf("videoSegmentCardPitch %x\n",p64->videoSegmentCardPitch);
1643 
1644  printf("videoQuarterSizeExpand %x\n",p64->videoQuarterSizeExpand);
1645  #endif
1646 }
1647 
1648 
1649 //-------------------------------------------------------------------------------------------------------
1650 // CopyTo_AUTOCIRCULATE_TRANSFER_STRUCT
1651 //-------------------------------------------------------------------------------------------------------
1652 void CNTV2MacDriverInterface::CopyTo_AUTOCIRCULATE_TRANSFER_STRUCT (AUTOCIRCULATE_TRANSFER_STRUCT_64 *p64, AUTOCIRCULATE_TRANSFER_STRUCT *p)
1653 {
1654  // note that p is native structure, either 64 or 32 bit
1655  p->channelSpec = p64->channelSpec;
1656  p->videoBuffer = reinterpret_cast<ULWord*>(p64->videoBuffer); // 64 bit to native
1657  p->videoBufferSize = p64->videoBufferSize;
1658  p->videoDmaOffset = p64->videoDmaOffset;
1659  p->audioBuffer = reinterpret_cast<ULWord*>(p64->audioBuffer); // 64 bit to native
1660  p->audioBufferSize = p64->audioBufferSize;
1664 
1665  p->rp188.DBB = p64->rp188.DBB;
1666  p->rp188.Low = p64->rp188.Low;
1667  p->rp188.High = p64->rp188.High;
1668 
1669  p->desiredFrame = p64->desiredFrame;
1670  p->hUser = p64->hUser;
1671  p->transferFlags = p64->transferFlags;
1675 
1679 
1680  p->vidProcInfo.mode = p64->vidProcInfo.mode;
1687 
1692 
1696 
1698 }
1699 
1700 
1701 //-------------------------------------------------------------------------------------------------------
1702 // CopyTo_AUTOCIRCULATE_TASK_STRUCT_64
1703 //-------------------------------------------------------------------------------------------------------
1704 void CNTV2MacDriverInterface::CopyTo_AUTOCIRCULATE_TASK_STRUCT_64 (AUTOCIRCULATE_TASK_STRUCT *p, AUTOCIRCULATE_TASK_STRUCT_64 *p64)
1705 {
1706  p64->taskVersion = p->taskVersion;
1707  p64->taskSize = p->taskSize;
1708  p64->numTasks = p->numTasks;
1709  p64->maxTasks = p->maxTasks;
1710  p64->taskArray = Pointer64(p->taskArray);
1711  p64->reserved0 = p->reserved0;
1712  p64->reserved1 = p->reserved1;
1713  p64->reserved2 = p->reserved2;
1714  p64->reserved3 = p->reserved3;
1715 }
1716 
1717 
1718 static const char * GetKernErrStr (const kern_return_t inError)
1719 {
1720  switch (inError)
1721  {
1722  case kIOReturnError: return "general error";
1723  case kIOReturnNoMemory: return "can't allocate memory";
1724  case kIOReturnNoResources: return "resource shortage";
1725  case kIOReturnIPCError: return "error during IPC";
1726  case kIOReturnNoDevice: return "no such device";
1727  case kIOReturnNotPrivileged: return "privilege violation";
1728  case kIOReturnBadArgument: return "invalid argument";
1729  case kIOReturnLockedRead: return "device read locked";
1730  case kIOReturnLockedWrite: return "device write locked";
1731  case kIOReturnExclusiveAccess: return "exclusive access and device already open";
1732  case kIOReturnBadMessageID: return "sent/received messages had different msg_id";
1733  case kIOReturnUnsupported: return "unsupported function";
1734  case kIOReturnVMError: return "misc. VM failure";
1735  case kIOReturnInternalError: return "internal error";
1736  case kIOReturnIOError: return "General I/O error";
1737  case kIOReturnCannotLock: return "can't acquire lock";
1738  case kIOReturnNotOpen: return "device not open";
1739  case kIOReturnNotReadable: return "read not supported";
1740  case kIOReturnNotWritable: return "write not supported";
1741  case kIOReturnNotAligned: return "alignment error";
1742  case kIOReturnBadMedia: return "Media Error";
1743  case kIOReturnStillOpen: return "device(s) still open";
1744  case kIOReturnRLDError: return "rld failure";
1745  case kIOReturnDMAError: return "DMA failure";
1746  case kIOReturnBusy: return "Device Busy";
1747  case kIOReturnTimeout: return "I/O Timeout";
1748  case kIOReturnOffline: return "device offline";
1749  case kIOReturnNotReady: return "not ready";
1750  case kIOReturnNotAttached: return "device not attached";
1751  case kIOReturnNoChannels: return "no DMA channels left";
1752  case kIOReturnNoSpace: return "no space for data";
1753  case kIOReturnPortExists: return "port already exists";
1754  case kIOReturnCannotWire: return "can't wire down physical memory";
1755  case kIOReturnNoInterrupt: return "no interrupt attached";
1756  case kIOReturnNoFrames: return "no DMA frames enqueued";
1757  case kIOReturnMessageTooLarge: return "oversized msg received on interrupt port";
1758  case kIOReturnNotPermitted: return "not permitted";
1759  case kIOReturnNoPower: return "no power to device";
1760  case kIOReturnNoMedia: return "media not present";
1761  case kIOReturnUnformattedMedia: return "media not formatted";
1762  case kIOReturnUnsupportedMode: return "no such mode";
1763  case kIOReturnUnderrun: return "data underrun";
1764  case kIOReturnOverrun: return "data overrun";
1765  case kIOReturnDeviceError: return "the device is not working properly!";
1766  case kIOReturnNoCompletion: return "a completion routine is required";
1767  case kIOReturnAborted: return "operation aborted";
1768  case kIOReturnNoBandwidth: return "bus bandwidth would be exceeded";
1769  case kIOReturnNotResponding: return "device not responding";
1770  case kIOReturnIsoTooOld: return "isochronous I/O request for distant past!";
1771  case kIOReturnIsoTooNew: return "isochronous I/O request for distant future";
1772  case kIOReturnNotFound: return "data was not found";
1773  case MACH_SEND_INVALID_DEST: return "MACH_SEND_INVALID_DEST";
1774  case kNTV2DriverBadDMA: return "bad dma engine num";
1775  case kNTV2DriverDMABusy: return "dma engine busy, or none available";
1776  case kNTV2DriverParamErr: return "bad aja parameter (out of range)";
1777  case kNTV2DriverPgmXilinxErr: return "xilinx programming error";
1778  case kNTV2DriverNotReadyErr: return "xilinx not yet programmed";
1779  case kNTV2DriverPrepMemErr: return "error preparing memory (no room?)";
1780  case kNTV2DriverDMATooLarge: return "dma xfer too large, or out of range";
1781  case kNTV2DriverBadHeaderTag: return "bad NTV2 header";
1782  case kNTV2UnknownStructType: return "unknown NTV2 struct type";
1783  case kNTV2HeaderVersionErr: return "bad or unsupported NTV2 header version";
1784  case kNTV2DriverBadTrailerTag: return "bad NTV2 trailer";
1785  case kNTV2DriverMapperErr: return "failure while mapping NTV2 struct ptrs";
1786  case kNTV2DriverUnmapperErr: return "failure while unmapping NTV2 struct ptrs";
1787  default: return "";
1788  }
1789 } // GetKernErrStr
kNTV2DriverNotReadyErr
const IOReturn kNTV2DriverNotReadyErr
Definition: ntv2macpublicinterface.h:21
CNTV2MacDriverInterface::MapRegisters
virtual bool MapRegisters(void)
Definition: ntv2macdriverinterface.cpp:616
kDriverReleaseStreamForApplicationWithReference
@ kDriverReleaseStreamForApplicationWithReference
Definition: ntv2macpublicinterface.h:69
kNTV2DriverBadDMA
const IOReturn kNTV2DriverBadDMA
Definition: ntv2macpublicinterface.h:17
kNTV2DriverUnmapperErr
const IOReturn kNTV2DriverUnmapperErr
Definition: ntv2macpublicinterface.h:31
AJA_DebugStat_GetInterruptCount
@ AJA_DebugStat_GetInterruptCount
Definition: debugshare.h:240
AUTOCIRCULATE_TRANSFER_STRUCT_64::videoSegmentHostPitch
ULWord videoSegmentHostPitch
Definition: ntv2publicinterface.h:4536
AJA_DebugStat_DMATransferEx
@ AJA_DebugStat_DMATransferEx
Definition: debugshare.h:242
AUTOCIRCULATE_TRANSFER_STRUCT_64::videoNumSegments
ULWord videoNumSegments
Definition: ntv2publicinterface.h:4535
MDIDBG
#define MDIDBG(__x__)
Definition: ntv2macdriverinterface.cpp:60
AUTOCIRCULATE_DATA_64::pvVal4
Pointer64 pvVal4
Definition: ntv2publicinterface.h:4333
AUTOCIRCULATE_DATA_64::lVal1
LWord lVal1
Definition: ntv2publicinterface.h:4314
kDriverSystemControl
@ kDriverSystemControl
Definition: ntv2macpublicinterface.h:65
AUTOCIRCULATE_TRANSFER_STRUCT::transferFlags
ULWord transferFlags
Definition: ntv2publicinterface.h:4556
MDIWARN
#define MDIWARN(__x__)
Definition: ntv2macdriverinterface.cpp:57
AUTOCIRCULATE_TRANSFER_STRUCT::videoSegmentHostPitch
ULWord videoSegmentHostPitch
Definition: ntv2publicinterface.h:4573
kDriverDMATransfer
@ kDriverDMATransfer
Definition: ntv2macpublicinterface.h:53
AUTOCIRCULATE_TRANSFER_STRUCT::audioStartSample
ULWord audioStartSample
Definition: ntv2publicinterface.h:4550
RP188_STRUCT::High
ULWord High
Definition: ntv2publicinterface.h:4055
AJADebug::StatTimerStop
static AJAStatus StatTimerStop(const uint32_t inKey)
Definition: debug.cpp:1154
AUTOCIRCULATE_DATA::channelSpec
NTV2Crosspoint channelSpec
Definition: ntv2publicinterface.h:4341
HEX8
#define HEX8(__x__)
Definition: ntv2macdriverinterface.cpp:45
DIWARN
#define DIWARN(__x__)
Definition: ntv2macdriverinterface.cpp:51
kNTV2HeaderVersionErr
const IOReturn kNTV2HeaderVersionErr
Definition: ntv2macpublicinterface.h:28
kRegBoardID
@ kRegBoardID
Definition: ntv2publicinterface.h:124
INTERRUPT_ENUMS
enum _INTERRUPT_ENUMS_ INTERRUPT_ENUMS
AUTOCIRCULATE_DATA_64::eCommand
AUTO_CIRC_COMMAND eCommand
Definition: ntv2publicinterface.h:4311
kDriverWaitForInterrupt
@ kDriverWaitForInterrupt
Definition: ntv2macpublicinterface.h:49
CNTV2MacDriverInterface::GetAudioOutputMode
virtual bool GetAudioOutputMode(NTV2_GlobalAudioPlaybackMode *mode)
Definition: ntv2macdriverinterface.cpp:1462
AUTOCIRCULATE_DATA::bVal2
BOOL_ bVal2
Definition: ntv2publicinterface.h:4351
CNTV2MacDriverInterface::KernelLog
virtual bool KernelLog(void *dataPtr, UInt32 dataSize)
Definition: ntv2macdriverinterface.cpp:970
GetKernErrStr
static const char * GetKernErrStr(const kern_return_t inError)
Definition: ntv2macdriverinterface.cpp:1718
ntv2devicefeatures.h
Declares device capability functions.
CNTV2MacDriverInterface::~CNTV2MacDriverInterface
virtual ~CNTV2MacDriverInterface()
My destructor.
Definition: ntv2macdriverinterface.cpp:463
CNTV2MacDriverInterface::ReadRegister
virtual bool ReadRegister(const ULWord inRegNum, ULWord &outValue, const ULWord inMask=0xFFFFFFFF, const ULWord inShift=0)
Reads all or part of the 32-bit contents of a specific register (real or virtual) on the AJA device....
Definition: ntv2macdriverinterface.cpp:709
AUTOCIRCULATE_TRANSFER_STRUCT_64::frameRepeatCount
ULWord frameRepeatCount
Definition: ntv2publicinterface.h:4515
kDriverAutoCirculateTransfer
@ kDriverAutoCirculateTransfer
Definition: ntv2macpublicinterface.h:61
AUTOCIRCULATE_TRANSFER_STRUCT::videoBuffer
ULWord * videoBuffer
Definition: ntv2publicinterface.h:4545
NTV2Channel
NTV2Channel
These enum values are mostly used to identify a specific Frame Store. They're also commonly used to i...
Definition: ntv2enums.h:1305
AJA_DebugStat_ReadRegister
@ AJA_DebugStat_ReadRegister
Definition: debugshare.h:224
AUTOCIRCULATE_TRANSFER_STRUCT::videoQuarterSizeExpand
NTV2QuarterSizeExpandMode videoQuarterSizeExpand
Definition: ntv2publicinterface.h:4575
AJA_DebugStat_NTV2Message
@ AJA_DebugStat_NTV2Message
Definition: debugshare.h:246
AJADebug::StatTimerStart
static AJAStatus StatTimerStart(const uint32_t inKey)
Definition: debug.cpp:1134
NTV2_ASSERT
#define NTV2_ASSERT(_expr_)
Definition: ajatypes.h:601
DMA_TRANSFER_STRUCT_64::dmaFlags
ULWord dmaFlags
Definition: ntv2publicinterface.h:4794
kDriverKernelLog
@ kDriverKernelLog
Definition: ntv2macpublicinterface.h:70
AJA_DebugStat_AutoCirculate
@ AJA_DebugStat_AutoCirculate
Definition: debugshare.h:244
AJA_DebugStat_WaitForInterruptOthers
@ AJA_DebugStat_WaitForInterruptOthers
Definition: debugshare.h:239
systemtime.h
Declares the AJATime class.
AUTOCIRCULATE_DATA_64::lVal5
LWord lVal5
Definition: ntv2publicinterface.h:4318
kRegMRSupport
@ kRegMRSupport
Definition: ntv2publicinterface.h:1008
CNTV2DriverInterface::WaitForInterrupt
virtual bool WaitForInterrupt(const INTERRUPT_ENUMS eInterrupt, const ULWord timeOutMs=68)
Definition: ntv2driverinterface.cpp:536
kNTV2DriverParamErr
const IOReturn kNTV2DriverParamErr
Definition: ntv2macpublicinterface.h:19
AUTOCIRCULATE_TRANSFER_STRUCT::frameBufferOrientation
NTV2VideoFrameBufferOrientation frameBufferOrientation
Definition: ntv2publicinterface.h:4559
AJA_DebugStat_WaitForInterruptIn2
@ AJA_DebugStat_WaitForInterruptIn2
Definition: debugshare.h:227
AUTOCIRCULATE_TRANSFER_STRUCT_64::videoDmaOffset
ULWord videoDmaOffset
Definition: ntv2publicinterface.h:4510
AUTOCIRCULATE_TASK_STRUCT_64::reserved3
ULWord reserved3
Definition: ntv2publicinterface.h:4721
ntv2macdriverinterface.h
Implements the MacOS-specific flavor of CNTV2DriverInterface.
AUTOCIRCULATE_TASK_STRUCT::reserved3
ULWord reserved3
Definition: ntv2publicinterface.h:4734
eStartAutoCircAtTime
@ eStartAutoCircAtTime
Definition: ntv2publicinterface.h:4223
AUTOCIRCULATE_DATA_64::pvVal2
Pointer64 pvVal2
Definition: ntv2publicinterface.h:4331
AUTOCIRCULATE_DATA::bVal3
BOOL_ bVal3
Definition: ntv2publicinterface.h:4352
AUTOCIRCULATE_TASK_STRUCT::taskVersion
ULWord taskVersion
Definition: ntv2publicinterface.h:4726
NTV2ColorCorrectionInfo_64::ccLookupTables
Pointer64 ccLookupTables
only used in 3way color correction mode.
Definition: ntv2publicinterface.h:4116
CNTV2MacDriverInterface::AutoCirculate
virtual bool AutoCirculate(AUTOCIRCULATE_DATA &autoCircData)
Sends an AutoCirculate command to the NTV2 driver.
Definition: ntv2macdriverinterface.cpp:1274
CNTV2MacDriverInterface::ReleaseStreamForApplication
virtual bool ReleaseStreamForApplication(ULWord inApplicationType, int32_t inProcessID)
Releases exclusive use of the AJA device for the given process, permitting other processes to acquire...
Definition: ntv2macdriverinterface.cpp:832
AUTOCIRCULATE_TRANSFER_STRUCT::bDisableExtraAudioInfo
BOOL_ bDisableExtraAudioInfo
Definition: ntv2publicinterface.h:4557
AUTOCIRCULATE_TRANSFER_STRUCT::audioBufferSize
ULWord audioBufferSize
Definition: ntv2publicinterface.h:4549
AUTOCIRCULATE_TRANSFER_STRUCT_64::colorCorrectionInfo
NTV2ColorCorrectionInfo_64 colorCorrectionInfo
Definition: ntv2publicinterface.h:4523
AUTOCIRCULATE_TRANSFER_STRUCT::frameRepeatCount
ULWord frameRepeatCount
Definition: ntv2publicinterface.h:4552
AUTOCIRCULATE_TASK_STRUCT_64::taskArray
Pointer64 taskArray
Definition: ntv2publicinterface.h:4717
kNTV2DriverDMABusy
const IOReturn kNTV2DriverDMABusy
Definition: ntv2macpublicinterface.h:18
CNTV2MacDriverInterface::OpenLocalPhysical
virtual bool OpenLocalPhysical(const UWord inDeviceIndex)
Opens the local/physical device connection.
Definition: ntv2macdriverinterface.cpp:473
AUTOCIRCULATE_TASK_STRUCT::taskSize
ULWord taskSize
Definition: ntv2publicinterface.h:4727
kDriverSystemStatus
@ kDriverSystemStatus
Definition: ntv2macpublicinterface.h:66
CUSTOM_ANC_STRUCT::Group3
ULWord Group3
Definition: ntv2publicinterface.h:4200
OS_IOKitGetBusyState
#define OS_IOKitGetBusyState(_x_, _y_)
Definition: ntv2macdriverinterface.cpp:78
CNTV2MacDriverInterface::WaitForInterrupt
virtual bool WaitForInterrupt(const INTERRUPT_ENUMS type, const ULWord timeout=50)
Definition: ntv2macdriverinterface.cpp:1015
AUTOCIRCULATE_TRANSFER_STRUCT_64::videoBuffer
Pointer64 videoBuffer
Definition: ntv2publicinterface.h:4508
kVRegGlobalAudioPlaybackMode
@ kVRegGlobalAudioPlaybackMode
Definition: ntv2virtualregisters.h:34
CNTV2DriverInterface::WriteRegister
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...
Definition: ntv2driverinterface.cpp:457
AUTOCIRCULATE_TRANSFER_STRUCT::rp188
RP188_STRUCT rp188
Definition: ntv2publicinterface.h:4553
CNTV2MacDriverInterface::GetInterruptCount
virtual bool GetInterruptCount(const INTERRUPT_ENUMS eInterrupt, ULWord &outCount)
Answers with the number of interrupts of the given type processed by the driver.
Definition: ntv2macdriverinterface.cpp:1053
ePrerollAutoCirculate
@ ePrerollAutoCirculate
Definition: ntv2publicinterface.h:4220
NTV2_HEADER::IsValid
bool IsValid(void) const
Definition: ntv2publicinterface.h:6938
AUTOCIRCULATE_DATA::bVal6
BOOL_ bVal6
Definition: ntv2publicinterface.h:4355
OS_IOServiceClose
#define OS_IOServiceClose(_x_)
Definition: ntv2macdriverinterface.cpp:67
AJA_DebugStat_WaitForInterruptIn8
@ AJA_DebugStat_WaitForInterruptIn8
Definition: debugshare.h:233
kNTV2DriverBadHeaderTag
const IOReturn kNTV2DriverBadHeaderTag
Definition: ntv2macpublicinterface.h:26
NTV2_IS_VALID_INTERRUPT_ENUM
#define NTV2_IS_VALID_INTERRUPT_ENUM(__e__)
Definition: ntv2publicinterface.h:3763
AUTOCIRCULATE_TRANSFER_STRUCT::colorCorrectionInfo
NTV2ColorCorrectionInfo colorCorrectionInfo
Definition: ntv2publicinterface.h:4560
AUTOCIRCULATE_STATUS_STRUCT
struct AUTOCIRCULATE_STATUS_STRUCT AUTOCIRCULATE_STATUS_STRUCT
kDriverReadRegister
@ kDriverReadRegister
Definition: ntv2macpublicinterface.h:38
AUTOCIRCULATE_DATA::pvVal4
void * pvVal4
Definition: ntv2publicinterface.h:4362
OS_IORegistryEntryCreateCFProperty
#define OS_IORegistryEntryCreateCFProperty(_w_, _x_, _y_, _z_)
Definition: ntv2macdriverinterface.cpp:73
kDriverAutoCirculateStatus
@ kDriverAutoCirculateStatus
Definition: ntv2macpublicinterface.h:60
AUTOCIRCULATE_DATA::pvVal3
void * pvVal3
Definition: ntv2publicinterface.h:4361
CNTV2DriverInterface::ReadRegister
virtual bool ReadRegister(const ULWord inRegNum, ULWord &outValue, const ULWord inMask=0xFFFFFFFF, const ULWord inShift=0)
Reads all or part of the 32-bit contents of a specific register (real or virtual) on the AJA device....
Definition: ntv2driverinterface.cpp:393
kDriverReleaseStreamForApplication
@ kDriverReleaseStreamForApplication
Definition: ntv2macpublicinterface.h:43
AUTOCIRCULATE_DATA::lVal5
LWord lVal5
Definition: ntv2publicinterface.h:4347
AUTOCIRCULATE_TRANSFER_STRUCT::frameBufferFormat
NTV2FrameBufferFormat frameBufferFormat
Definition: ntv2publicinterface.h:4558
AUTOCIRCULATE_DATA::lVal3
LWord lVal3
Definition: ntv2publicinterface.h:4345
NTV2_GlobalAudioPlaybackMode
NTV2_GlobalAudioPlaybackMode
Definition: ntv2enums.h:2047
AUTOCIRCULATE_DATA_64::pvVal1
Pointer64 pvVal1
Definition: ntv2publicinterface.h:4330
eAbortAutoCirc
@ eAbortAutoCirc
Definition: ntv2publicinterface.h:4222
CNTV2MacDriverInterface::SystemStatus
virtual bool SystemStatus(void *dataPtr, SystemStatusCode systemStatusCode)
Definition: ntv2macdriverinterface.cpp:1250
eTransferAutoCirculate
@ eTransferAutoCirculate
Definition: ntv2publicinterface.h:4221
AUTOCIRCULATE_DATA_64::pvVal3
Pointer64 pvVal3
Definition: ntv2publicinterface.h:4332
kNTV2DriverMapperErr
const IOReturn kNTV2DriverMapperErr
Definition: ntv2macpublicinterface.h:30
NTV2DMAEngine
NTV2DMAEngine
Definition: ntv2enums.h:1801
AutoCircVidProcInfo::foregroundKeyCrosspoint
NTV2Crosspoint foregroundKeyCrosspoint
Definition: ntv2publicinterface.h:4180
MemoryType
MemoryType
Definition: ntv2macpublicinterface.h:79
eGetFrameStamp
@ eGetFrameStamp
Definition: ntv2publicinterface.h:4218
AUTOCIRCULATE_DATA::eCommand
AUTO_CIRC_COMMAND eCommand
Definition: ntv2publicinterface.h:4340
AUTOCIRCULATE_TRANSFER_STRUCT_64::rp188
RP188_STRUCT rp188
Definition: ntv2publicinterface.h:4516
AUTOCIRCULATE_TRANSFER_STRUCT_64::transferFlags
ULWord transferFlags
Definition: ntv2publicinterface.h:4519
AUTOCIRCULATE_DATA_64::bVal4
BOOL_ bVal4
Definition: ntv2publicinterface.h:4324
lock.h
Declares the AJALock class.
AUTOCIRCULATE_TRANSFER_STRUCT::hUser
ULWord hUser
Definition: ntv2publicinterface.h:4555
OS_IOConnectCallStructMethod
#define OS_IOConnectCallStructMethod(_u_, _v_, _w_, _x_, _y_, _z_)
Definition: ntv2macdriverinterface.cpp:76
AUTOCIRCULATE_DATA_64::lVal3
LWord lVal3
Definition: ntv2publicinterface.h:4316
AUTOCIRCULATE_TASK_STRUCT_64::reserved2
ULWord reserved2
Definition: ntv2publicinterface.h:4720
ULWord
uint32_t ULWord
Definition: ajatypes.h:246
AUTOCIRCULATE_TRANSFER_STRUCT_64::channelSpec
NTV2Crosspoint channelSpec
Definition: ntv2publicinterface.h:4507
OS_IOServiceNameMatching
#define OS_IOServiceNameMatching(_x_)
Definition: ntv2macdriverinterface.cpp:69
AUTOCIRCULATE_TASK_STRUCT::reserved1
ULWord reserved1
Definition: ntv2publicinterface.h:4732
CNTV2DriverInterface::DmaTransfer
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...
Definition: ntv2driverinterface.cpp:472
AutoCircVidProcInfo::mode
AutoCircVidProcMode mode
Definition: ntv2publicinterface.h:4177
AJA_DebugStat_WaitForInterruptUartTx1
@ AJA_DebugStat_WaitForInterruptUartTx1
Definition: debugshare.h:236
kRegMRQ1Control
@ kRegMRQ1Control
Definition: ntv2publicinterface.h:1003
AUTOCIRCULATE_DATA::lVal1
LWord lVal1
Definition: ntv2publicinterface.h:4343
Pointer64
uint64_t Pointer64
Definition: ajatypes.h:250
CNTV2MacDriverInterface::GetStreamingApplication
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 ...
Definition: ntv2macdriverinterface.cpp:944
AUTOCIRCULATE_TRANSFER_STRUCT
Definition: ntv2publicinterface.h:4542
AJA_DebugStat_AutoCirculateXfer
@ AJA_DebugStat_AutoCirculateXfer
Definition: debugshare.h:245
AUTOCIRCULATE_TRANSFER_STRUCT_64::hUser
ULWord hUser
Definition: ntv2publicinterface.h:4518
kRegisterMemory
@ kRegisterMemory
Definition: ntv2macpublicinterface.h:81
NTV2DeviceIDToString
std::string NTV2DeviceIDToString(const NTV2DeviceID inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:4673
CNTV2MacDriverInterface::MapXena2Flash
virtual bool MapXena2Flash(void)
Definition: ntv2macdriverinterface.cpp:637
KR
#define KR(_kr_)
Definition: ntv2macdriverinterface.cpp:47
eFlushAutoCirculate
@ eFlushAutoCirculate
Definition: ntv2publicinterface.h:4219
DMA_TRANSFER_STRUCT_64::dmaCardFrameNumber
ULWord dmaCardFrameNumber
Definition: ntv2publicinterface.h:4798
AJA_DebugStat_WaitForInterruptUartTx2
@ AJA_DebugStat_WaitForInterruptUartTx2
Definition: debugshare.h:238
eGetAutoCirc
@ eGetAutoCirc
Definition: ntv2publicinterface.h:4217
DMA_TRANSFER_STRUCT_64::dmaSegmentCardPitch
ULWord dmaSegmentCardPitch
Definition: ntv2publicinterface.h:4803
AUTOCIRCULATE_DATA::lVal2
LWord lVal2
Definition: ntv2publicinterface.h:4344
DMA_TRANSFER_STRUCT_64::dmaEngine
NTV2DMAEngine dmaEngine
Definition: ntv2publicinterface.h:4793
AUTOCIRCULATE_TASK_STRUCT::taskArray
AutoCircGenericTask * taskArray
Definition: ntv2publicinterface.h:4730
AUTOCIRCULATE_DATA_64
Definition: ntv2publicinterface.h:4309
OS_IOKitWaitQuiet
#define OS_IOKitWaitQuiet(_x_, _y_)
Definition: ntv2macdriverinterface.cpp:79
AUTOCIRCULATE_TRANSFER_STRUCT::audioBuffer
ULWord * audioBuffer
Definition: ntv2publicinterface.h:4548
NTV2_HEADER
All new NTV2 structs start with this common header.
Definition: ntv2publicinterface.h:6899
UWord
uint16_t UWord
Definition: ajatypes.h:244
CNTV2MacDriverInterface::RestoreHardwareProcampRegisters
virtual bool RestoreHardwareProcampRegisters(void)
Definition: ntv2macdriverinterface.cpp:1229
AUTOCIRCULATE_TRANSFER_STRUCT_64::customAncInfo
CUSTOM_ANC_STRUCT customAncInfo
This field is obsolete. Do not use.
Definition: ntv2publicinterface.h:4525
AUTOCIRCULATE_TRANSFER_STRUCT::videoNumSegments
ULWord videoNumSegments
Definition: ntv2publicinterface.h:4572
AUTOCIRCULATE_DATA::bVal5
BOOL_ bVal5
Definition: ntv2publicinterface.h:4354
DIDBG
#define DIDBG(__x__)
Definition: ntv2macdriverinterface.cpp:54
kNTV2DriverBadTrailerTag
const IOReturn kNTV2DriverBadTrailerTag
Definition: ntv2macpublicinterface.h:29
SystemStatusCode
SystemStatusCode
Definition: ntv2publicinterface.h:4823
ntv2utils.h
Declares numerous NTV2 utility functions.
AUTOCIRCULATE_TRANSFER_STRUCT_64::vidProcInfo
AutoCircVidProcInfo vidProcInfo
Definition: ntv2publicinterface.h:4524
AUTOCIRCULATE_TASK_STRUCT_64::numTasks
ULWord numTasks
Definition: ntv2publicinterface.h:4715
OS_IOMasterPort
#define OS_IOMasterPort(_x_, _y_)
Definition: ntv2macdriverinterface.cpp:65
AUTOCIRCULATE_TASK_STRUCT_64::taskVersion
ULWord taskVersion
Definition: ntv2publicinterface.h:4713
CNTV2MacDriverInterface::WaitForChangeEvent
virtual bool WaitForChangeEvent(UInt32 timeout=0)
Definition: ntv2macdriverinterface.cpp:1084
CUSTOM_ANC_STRUCT::Group4
ULWord Group4
Definition: ntv2publicinterface.h:4201
INSTP
#define INSTP(_p_)
Definition: ntv2macdriverinterface.cpp:48
eTransferAutoCirculateEx
@ eTransferAutoCirculateEx
Definition: ntv2publicinterface.h:4224
AUTOCIRCULATE_DATA::lVal4
LWord lVal4
Definition: ntv2publicinterface.h:4346
eStartAutoCirc
@ eStartAutoCirc
Definition: ntv2publicinterface.h:4214
AUTOCIRCULATE_DATA_64::channelSpec
NTV2Crosspoint channelSpec
Definition: ntv2publicinterface.h:4312
AUTOCIRCULATE_TRANSFER_STRUCT_64
Definition: ntv2publicinterface.h:4505
DMA_TRANSFER_STRUCT_64::dmaSegmentSize
ULWord dmaSegmentSize
Definition: ntv2publicinterface.h:4801
AUTOCIRCULATE_TRANSFER_STRUCT_64::audioBufferSize
ULWord audioBufferSize
Definition: ntv2publicinterface.h:4512
DMA_TRANSFER_STRUCT_64::dmaCardFrameOffset
ULWord dmaCardFrameOffset
Definition: ntv2publicinterface.h:4799
AUTOCIRCULATE_TRANSFER_STRUCT::vidProcInfo
AutoCircVidProcInfo vidProcInfo
Definition: ntv2publicinterface.h:4561
CNTV2MacDriverInterface::MapMemory
virtual bool MapMemory(const MemoryType memType, void **memPtr)
Definition: ntv2macdriverinterface.cpp:658
kDriverRestoreProcAmpRegisters
@ kDriverRestoreProcAmpRegisters
Definition: ntv2macpublicinterface.h:54
sNTV2PCIKEXTClassName
static const string sNTV2PCIKEXTClassName("com_aja_iokit_ntv2")
AUTOCIRCULATE_TASK_STRUCT::reserved0
ULWord reserved0
Definition: ntv2publicinterface.h:4731
AJALock
Definition: lock.h:30
NTV2RegInfo
struct NTV2RegInfo NTV2RegInfo
Everything needed to call CNTV2Card::ReadRegister or CNTV2Card::WriteRegister functions.
NTV2ColorCorrectionInfo_64::saturationValue
UWord_ saturationValue
Definition: ntv2publicinterface.h:4115
OS_IOObjectRelease
#define OS_IOObjectRelease(_x_)
Definition: ntv2macdriverinterface.cpp:72
AUTOCIRCULATE_TRANSFER_STRUCT_64::videoSegmentCardPitch
ULWord videoSegmentCardPitch
Definition: ntv2publicinterface.h:4537
AJA_DebugStat_WaitForInterruptUartRx2
@ AJA_DebugStat_WaitForInterruptUartRx2
Definition: debugshare.h:237
AJA_NULL
#define AJA_NULL
Definition: ajatypes.h:190
AUTOCIRCULATE_DATA::bVal1
BOOL_ bVal1
Definition: ntv2publicinterface.h:4350
kNTV2DriverPgmXilinxErr
const IOReturn kNTV2DriverPgmXilinxErr
Definition: ntv2macpublicinterface.h:20
AutoCircVidProcInfo::backgroundVideoCrosspoint
NTV2Crosspoint backgroundVideoCrosspoint
Definition: ntv2publicinterface.h:4179
AJAAutoLock
Definition: lock.h:91
AUTOCIRCULATE_TRANSFER_STRUCT::videoDmaOffset
ULWord videoDmaOffset
Definition: ntv2publicinterface.h:4547
DMA_TRANSFER_STRUCT_64::dmaHostBuffer
Pointer64 dmaHostBuffer
Definition: ntv2publicinterface.h:4796
CNTV2MacDriverInterface::SystemControl
virtual bool SystemControl(void *dataPtr, SystemControlCode systemControlCode)
Definition: ntv2macdriverinterface.cpp:677
NTV2ColorCorrectionInfo::ccLookupTables
ULWord * ccLookupTables
only used in 3way color correction mode.
Definition: ntv2publicinterface.h:4124
CNTV2MacDriverInterface::UnmapXena2Flash
virtual bool UnmapXena2Flash(void)
Definition: ntv2macdriverinterface.cpp:649
AJA_DebugStat_WaitForInterruptIn7
@ AJA_DebugStat_WaitForInterruptIn7
Definition: debugshare.h:232
AUTOCIRCULATE_DATA::lVal6
LWord lVal6
Definition: ntv2publicinterface.h:4348
AutoCircVidProcInfo::foregroundVideoCrosspoint
NTV2Crosspoint foregroundVideoCrosspoint
Definition: ntv2publicinterface.h:4178
AUTOCIRCULATE_DATA_64::lVal6
LWord lVal6
Definition: ntv2publicinterface.h:4319
MDINOTE
#define MDINOTE(__x__)
Definition: ntv2macdriverinterface.cpp:58
AutoCircVidProcInfo::transitionCoefficient
Fixed_ transitionCoefficient
Definition: ntv2publicinterface.h:4182
AJAAtomic::Increment
static int32_t Increment(int32_t volatile *pTarget)
Definition: atomic.cpp:82
AJA_DebugStat_WaitForInterruptIn6
@ AJA_DebugStat_WaitForInterruptIn6
Definition: debugshare.h:231
RP188_STRUCT::DBB
ULWord DBB
Definition: ntv2publicinterface.h:4053
kXena2FlashMemory
@ kXena2FlashMemory
Definition: ntv2macpublicinterface.h:83
AJA_DebugStat_WaitForInterruptUartRx1
@ AJA_DebugStat_WaitForInterruptUartRx1
Definition: debugshare.h:235
AUTOCIRCULATE_DATA_64::bVal5
BOOL_ bVal5
Definition: ntv2publicinterface.h:4325
AUTOCIRCULATE_TRANSFER_STRUCT_64::desiredFrame
LWord desiredFrame
Definition: ntv2publicinterface.h:4517
DEC
#define DEC(__x__)
Definition: ntv2publicinterface.h:5579
RP188_STRUCT::Low
ULWord Low
Definition: ntv2publicinterface.h:4054
AUTOCIRCULATE_TASK_STRUCT_64::maxTasks
ULWord maxTasks
Definition: ntv2publicinterface.h:4716
AUTOCIRCULATE_TRANSFER_STRUCT::customAncInfo
CUSTOM_ANC_STRUCT customAncInfo
This field is obsolete. Do not use.
Definition: ntv2publicinterface.h:4562
CNTV2MacDriverInterface::MapFrameBuffers
virtual bool MapFrameBuffers(void)
Definition: ntv2macdriverinterface.cpp:593
false
#define false
Definition: ntv2devicefeatures.h:25
CUSTOM_ANC_STRUCT::Group1
ULWord Group1
Definition: ntv2publicinterface.h:4198
OS_IOServiceOpen
#define OS_IOServiceOpen(_w_, _x_, _y_, _z_)
Definition: ntv2macdriverinterface.cpp:66
UByte
uint8_t UByte
Definition: ajatypes.h:241
AUTOCIRCULATE_TRANSFER_STRUCT_64::audioBuffer
Pointer64 audioBuffer
Definition: ntv2publicinterface.h:4511
CNTV2MacDriverInterface::SetStreamingApplication
virtual bool SetStreamingApplication(const ULWord appType, const int32_t pid)
Sets the four-CC type and process ID of the application that should "own" the AJA device (i....
Definition: ntv2macdriverinterface.cpp:920
SystemControlCode
SystemControlCode
Definition: ntv2publicinterface.h:4869
CNTV2MacDriverInterface::NTV2Message
virtual bool NTV2Message(NTV2_HEADER *pInMessage)
Sends a message to the NTV2 driver (the new, improved, preferred way).
Definition: ntv2macdriverinterface.cpp:1418
AUTOCIRCULATE_TRANSFER_STRUCT::videoSegmentCardPitch
ULWord videoSegmentCardPitch
Definition: ntv2publicinterface.h:4574
kDriverAutoCirculateControl
@ kDriverAutoCirculateControl
Definition: ntv2macpublicinterface.h:59
AJA_DebugStat_WaitForInterruptOut1
@ AJA_DebugStat_WaitForInterruptOut1
Definition: debugshare.h:234
AUTOCIRCULATE_TRANSFER_STRUCT_64::frameBufferOrientation
NTV2VideoFrameBufferOrientation frameBufferOrientation
Definition: ntv2publicinterface.h:4522
SCC_Test
@ SCC_Test
Definition: ntv2publicinterface.h:4871
AUTOCIRCULATE_TASK_STRUCT_64::reserved1
ULWord reserved1
Definition: ntv2publicinterface.h:4719
AUTOCIRCULATE_TRANSFER_STATUS_STRUCT
Definition: ntv2publicinterface.h:4491
DIFAIL
#define DIFAIL(__x__)
Definition: ntv2macdriverinterface.cpp:50
AUTOCIRCULATE_DATA_64::bVal8
BOOL_ bVal8
Definition: ntv2publicinterface.h:4328
ePauseAutoCirc
@ ePauseAutoCirc
Definition: ntv2publicinterface.h:4216
eInitAutoCirc
@ eInitAutoCirc
Definition: ntv2publicinterface.h:4213
CNTV2MacDriverInterface::AcquireStreamForApplicationWithReference
virtual bool AcquireStreamForApplicationWithReference(ULWord inApplicationType, int32_t inProcessID)
A reference-counted version of CNTV2DriverInterface::AcquireStreamForApplication useful for process g...
Definition: ntv2macdriverinterface.cpp:863
CNTV2MacDriverInterface::UnmapRegisters
virtual bool UnmapRegisters(void)
Definition: ntv2macdriverinterface.cpp:628
AUTOCIRCULATE_P2P_STRUCT
Definition: ntv2publicinterface.h:4626
DMA_TRANSFER_STRUCT_64
Definition: ntv2publicinterface.h:4792
DMA_TRANSFER_STRUCT_64::dmaNumberOfSegments
ULWord dmaNumberOfSegments
Definition: ntv2publicinterface.h:4800
NTV2ColorCorrectionInfo::mode
NTV2ColorCorrectionMode mode
Definition: ntv2publicinterface.h:4122
AUTOCIRCULATE_TRANSFER_STRUCT_64::videoBufferSize
ULWord videoBufferSize
Definition: ntv2publicinterface.h:4509
eStopAutoCirc
@ eStopAutoCirc
Definition: ntv2publicinterface.h:4215
AUTOCIRCULATE_DATA_64::bVal3
BOOL_ bVal3
Definition: ntv2publicinterface.h:4323
sNTV2PCIDEXTName
static const string sNTV2PCIDEXTName("NTV2PCIe")
atomic.h
Declares the AJAAtomic class.
eGetFrameStampEx2
@ eGetFrameStampEx2
Definition: ntv2publicinterface.h:4226
CNTV2MacDriverInterface::AcquireStreamForApplication
virtual bool AcquireStreamForApplication(ULWord inApplicationType, int32_t inProcessID)
Reserves exclusive use of the AJA device for a given process, preventing other processes on the host ...
Definition: ntv2macdriverinterface.cpp:808
AUTOCIRCULATE_DATA_64::bVal1
BOOL_ bVal1
Definition: ntv2publicinterface.h:4321
OS_IOConnectMapMemory
#define OS_IOConnectMapMemory(_u_, _v_, _w_, _x_, _y_, _z_)
Definition: ntv2macdriverinterface.cpp:77
NTV2DeviceIDSet
std::set< NTV2DeviceID > NTV2DeviceIDSet
A set of NTV2DeviceIDs.
Definition: ntv2utils.h:1031
CNTV2MacDriverInterface::CNTV2MacDriverInterface
CNTV2MacDriverInterface()
My default constructor.
Definition: ntv2macdriverinterface.cpp:451
CNTV2MacDriverInterface::DmaTransfer
virtual bool DmaTransfer(const NTV2DMAEngine inDMAEngine, const bool inIsRead, const ULWord inFrameNumber, ULWord *pFrameBuffer, const ULWord inCardOffsetBytes, const ULWord inByteCount, const bool inSynchronous=(!(0)))
Transfers data between the AJA device and the host. This function will block and not return to the ca...
Definition: ntv2macdriverinterface.cpp:1113
CNTV2MacDriverInterface::UnmapFrameBuffers
virtual bool UnmapFrameBuffers(void)
Definition: ntv2macdriverinterface.cpp:606
AJA_DebugStat_WriteRegister
@ AJA_DebugStat_WriteRegister
Definition: debugshare.h:225
AUTOCIRCULATE_TASK_STRUCT::reserved2
ULWord reserved2
Definition: ntv2publicinterface.h:4733
AUTOCIRCULATE_DATA::bVal4
BOOL_ bVal4
Definition: ntv2publicinterface.h:4353
CNTV2MacDriverInterface::SetAudioOutputMode
virtual bool SetAudioOutputMode(NTV2_GlobalAudioPlaybackMode mode)
Definition: ntv2macdriverinterface.cpp:1457
MDIFAIL
#define MDIFAIL(__x__)
Definition: ntv2macdriverinterface.cpp:56
AUTOCIRCULATE_TASK_STRUCT::numTasks
ULWord numTasks
Definition: ntv2publicinterface.h:4728
HEX16
#define HEX16(__x__)
Definition: ntv2macdriverinterface.cpp:46
AUTOCIRCULATE_DATA_64::bVal2
BOOL_ bVal2
Definition: ntv2publicinterface.h:4322
AUTOCIRCULATE_TRANSFER_STRUCT_64::audioStartSample
ULWord audioStartSample
Definition: ntv2publicinterface.h:4513
eSetActiveFrame
@ eSetActiveFrame
Definition: ntv2publicinterface.h:4228
AutoCircVidProcInfo::backgroundKeyCrosspoint
NTV2Crosspoint backgroundKeyCrosspoint
Definition: ntv2publicinterface.h:4181
AUTOCIRCULATE_TRANSFER_STRUCT_64::audioNumChannels
ULWord audioNumChannels
Definition: ntv2publicinterface.h:4514
AutoCircVidProcInfo::transitionSoftness
Fixed_ transitionSoftness
Definition: ntv2publicinterface.h:4183
AJA_DebugStat_DMATransfer
@ AJA_DebugStat_DMATransfer
Definition: debugshare.h:241
AUTOCIRCULATE_TASK_STRUCT_64::taskSize
ULWord taskSize
Definition: ntv2publicinterface.h:4714
AUTOCIRCULATE_DATA_64::lVal4
LWord lVal4
Definition: ntv2publicinterface.h:4317
AUTOCIRCULATE_TASK_STRUCT
Definition: ntv2publicinterface.h:4724
AUTOCIRCULATE_TRANSFER_STRUCT_64::bDisableExtraAudioInfo
BOOL_ bDisableExtraAudioInfo
Definition: ntv2publicinterface.h:4520
OS_IOServiceMatching
#define OS_IOServiceMatching(_x_)
Definition: ntv2macdriverinterface.cpp:68
AUTOCIRCULATE_DATA::bVal8
BOOL_ bVal8
Definition: ntv2publicinterface.h:4357
kDriverWaitForChangeEvent
@ kDriverWaitForChangeEvent
Definition: ntv2macpublicinterface.h:51
SSC_GetFirmwareProgress
@ SSC_GetFirmwareProgress
Definition: ntv2publicinterface.h:4825
DMA_TRANSFER_STRUCT_64::dmaSize
ULWord dmaSize
Definition: ntv2publicinterface.h:4797
CNTV2DriverInterface::AutoCirculate
virtual bool AutoCirculate(AUTOCIRCULATE_DATA &pAutoCircData)
Sends an AutoCirculate command to the NTV2 driver.
Definition: ntv2driverinterface.cpp:549
kDriverDMATransferEx
@ kDriverDMATransferEx
Definition: ntv2macpublicinterface.h:67
DMA_TRANSFER_STRUCT_64::dmaToCard
BOOL_ dmaToCard
Definition: ntv2publicinterface.h:4805
kDriverSetStreamForApplication
@ kDriverSetStreamForApplication
Definition: ntv2macpublicinterface.h:44
kDriverWriteRegister
@ kDriverWriteRegister
Definition: ntv2macpublicinterface.h:39
eTransferAutoCirculateEx2
@ eTransferAutoCirculateEx2
Definition: ntv2publicinterface.h:4225
kDriverGetInterruptCount
@ kDriverGetInterruptCount
Definition: ntv2macpublicinterface.h:50
DMA_TRANSFER_STRUCT_64::dmaSegmentHostPitch
ULWord dmaSegmentHostPitch
Definition: ntv2publicinterface.h:4802
AUTOCIRCULATE_TASK_STRUCT::maxTasks
ULWord maxTasks
Definition: ntv2publicinterface.h:4729
AUTOCIRCULATE_DATA::bVal7
BOOL_ bVal7
Definition: ntv2publicinterface.h:4356
CNTV2MacDriverInterface::ReleaseStreamForApplicationWithReference
virtual bool ReleaseStreamForApplicationWithReference(ULWord inApplicationType, int32_t inProcessID)
A reference-counted version of CNTV2DriverInterface::ReleaseStreamForApplication useful for process g...
Definition: ntv2macdriverinterface.cpp:890
xHEX0N
#define xHEX0N(__x__, __n__)
Definition: ntv2publicinterface.h:5578
AUTOCIRCULATE_TRANSFER_STRUCT::channelSpec
NTV2Crosspoint channelSpec
Definition: ntv2publicinterface.h:4544
AUTOCIRCULATE_DATA::pvVal1
void * pvVal1
Definition: ntv2publicinterface.h:4359
AUTOCIRCULATE_DATA_64::bVal6
BOOL_ bVal6
Definition: ntv2publicinterface.h:4326
NTV2ColorCorrectionInfo::saturationValue
UWord_ saturationValue
Definition: ntv2publicinterface.h:4123
kDriverGetStreamForApplication
@ kDriverGetStreamForApplication
Definition: ntv2macpublicinterface.h:45
AJA_DebugStat_WaitForInterruptIn1
@ AJA_DebugStat_WaitForInterruptIn1
Definition: debugshare.h:226
OS_IOIteratorNext
#define OS_IOIteratorNext(_x_)
Definition: ntv2macdriverinterface.cpp:71
OS_IOConnectCallScalarMethod
#define OS_IOConnectCallScalarMethod(_u_, _v_, _w_, _x_, _y_, _z_)
Definition: ntv2macdriverinterface.cpp:75
OS_IOConnectCallMethod
#define OS_IOConnectCallMethod(_q_, _r_, _s_, _t_, _u_, _v_, _w_, _x_, _y_, _z_)
Definition: ntv2macdriverinterface.cpp:74
AJA_DebugStat_WaitForInterruptIn3
@ AJA_DebugStat_WaitForInterruptIn3
Definition: debugshare.h:228
AUTOCIRCULATE_DATA::pvVal2
void * pvVal2
Definition: ntv2publicinterface.h:4360
CNTV2MacDriverInterface::WriteRegister
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...
Definition: ntv2macdriverinterface.cpp:754
CUSTOM_ANC_STRUCT::Group2
ULWord Group2
Definition: ntv2publicinterface.h:4199
AUTOCIRCULATE_TRANSFER_STRUCT::videoBufferSize
ULWord videoBufferSize
Definition: ntv2publicinterface.h:4546
CNTV2DriverInterface::NTV2Message
virtual bool NTV2Message(NTV2_HEADER *pInMessage)
Sends a message to the NTV2 driver (the new, improved, preferred way).
Definition: ntv2driverinterface.cpp:573
AUTOCIRCULATE_TRANSFER_STRUCT::audioNumChannels
ULWord audioNumChannels
Definition: ntv2publicinterface.h:4551
kDriverAutoCirculateFramestamp
@ kDriverAutoCirculateFramestamp
Definition: ntv2macpublicinterface.h:62
AJA_DebugStat_WaitForInterruptIn4
@ AJA_DebugStat_WaitForInterruptIn4
Definition: debugshare.h:229
AUTOCIRCULATE_DATA_64::lVal2
LWord lVal2
Definition: ntv2publicinterface.h:4315
OS_IOServiceGetMatchingServices
#define OS_IOServiceGetMatchingServices(_x_, _y_, _z_)
Definition: ntv2macdriverinterface.cpp:70
AUTOCIRCULATE_TRANSFER_STRUCT_64::videoQuarterSizeExpand
NTV2QuarterSizeExpandMode videoQuarterSizeExpand
Definition: ntv2publicinterface.h:4538
gLegalDeviceIDs
static NTV2DeviceIDSet gLegalDeviceIDs
Definition: ntv2macdriverinterface.cpp:36
AUTOCIRCULATE_TASK_STRUCT_64::reserved0
ULWord reserved0
Definition: ntv2publicinterface.h:4718
sIntEnumToStatKeys
static const uint32_t sIntEnumToStatKeys[]
Definition: ntv2macdriverinterface.cpp:989
kDriverNTV2Message
@ kDriverNTV2Message
Definition: ntv2macpublicinterface.h:72
AUTOCIRCULATE_TRANSFER_STRUCT_64::frameBufferFormat
NTV2FrameBufferFormat frameBufferFormat
Definition: ntv2publicinterface.h:4521
ntv2nubaccess.h
Declares NTV2 "nub" client functions.
kNTV2DriverPrepMemErr
const IOReturn kNTV2DriverPrepMemErr
Definition: ntv2macpublicinterface.h:22
NTV2ColorCorrectionInfo_64::mode
NTV2ColorCorrectionMode mode
Definition: ntv2publicinterface.h:4114
eChangeEvent
@ eChangeEvent
Definition: ntv2publicinterface.h:3724
gLegalDevIDsLock
static AJALock gLegalDevIDsLock
Definition: ntv2macdriverinterface.cpp:35
kNTV2DriverDMATooLarge
const IOReturn kNTV2DriverDMATooLarge
Definition: ntv2macpublicinterface.h:24
debug.h
Declares the AJADebug class.
CNTV2MacDriverInterface::GetPCISlotNumber
virtual ULWord GetPCISlotNumber(void) const
Definition: ntv2macdriverinterface.cpp:581
AUTOCIRCULATE_DATA
Definition: ntv2publicinterface.h:4338
AJAAtomic::Decrement
static int32_t Decrement(int32_t volatile *pTarget)
Definition: atomic.cpp:95
AJA_DebugStat_WaitForInterruptIn5
@ AJA_DebugStat_WaitForInterruptIn5
Definition: debugshare.h:230
AUTOCIRCULATE_TRANSFER_STRUCT::desiredFrame
LWord desiredFrame
Definition: ntv2publicinterface.h:4554
kDriverAcquireStreamForApplicationWithReference
@ kDriverAcquireStreamForApplicationWithReference
Definition: ntv2macpublicinterface.h:68
AUTOCIRCULATE_DATA_64::bVal7
BOOL_ bVal7
Definition: ntv2publicinterface.h:4327
kNTV2UnknownStructType
const IOReturn kNTV2UnknownStructType
Definition: ntv2macpublicinterface.h:27
AUTOCIRCULATE_TASK_STRUCT_64
Definition: ntv2publicinterface.h:4711
CNTV2MacDriverInterface::CloseLocalPhysical
virtual bool CloseLocalPhysical(void)
Releases host resources associated with the local/physical device connection.
Definition: ntv2macdriverinterface.cpp:557
kDriverAcquireStreamForApplication
@ kDriverAcquireStreamForApplication
Definition: ntv2macpublicinterface.h:42
kFrameBufferMemory
@ kFrameBufferMemory
Definition: ntv2macpublicinterface.h:82