AJA NTV2 SDK  17.1.1.1245
NTV2 SDK 17.1.1.1245
ntv2macdriverinterface.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 #ifndef NTV2MACDRIVERINTERFACE_H
9 #define NTV2MACDRIVERINTERFACE_H
10 
11 
12 #include "ntv2publicinterface.h"
13 #include "ntv2macpublicinterface.h"
14 #include "ntv2driverinterface.h"
15 
16 //#define OPEN_UNSUPPORTED_DEVICES // Define to open device, even if it's not support (see NTV2GetSupportedDevices)
17 
18 
23 {
27  public:
31 
36  AJA_VIRTUAL bool WriteRegister (const ULWord inRegNum, const ULWord inValue, const ULWord inMask = 0xFFFFFFFF, const ULWord inShift = 0);
38  AJA_VIRTUAL bool ReadRegister (const ULWord inRegNum, ULWord & outValue, const ULWord inMask = 0xFFFFFFFF, const ULWord inShift = 0);
39 
40  AJA_VIRTUAL bool AcquireStreamForApplication (ULWord inApplicationType, int32_t inProcessID);
41  AJA_VIRTUAL bool ReleaseStreamForApplication (ULWord inApplicationType, int32_t inProcessID);
42  AJA_VIRTUAL bool AcquireStreamForApplicationWithReference (ULWord inApplicationType, int32_t inProcessID);
43  AJA_VIRTUAL bool ReleaseStreamForApplicationWithReference (ULWord inApplicationType, int32_t inProcessID);
44  AJA_VIRTUAL bool SetStreamingApplication (const ULWord appType, const int32_t pid);
45  AJA_VIRTUAL bool GetStreamingApplication (ULWord & outAppType, int32_t & outProcessID);
46 
47  AJA_VIRTUAL bool WaitForInterrupt (const INTERRUPT_ENUMS type, const ULWord timeout = 50);
48  AJA_VIRTUAL bool GetInterruptCount (const INTERRUPT_ENUMS eInterrupt, ULWord & outCount);
49  AJA_VIRTUAL bool WaitForChangeEvent (UInt32 timeout = 0);
50  AJA_VIRTUAL bool DmaTransfer (const NTV2DMAEngine inDMAEngine,
51  const bool inIsRead,
52  const ULWord inFrameNumber,
53  ULWord * pFrameBuffer,
54  const ULWord inCardOffsetBytes,
55  const ULWord inByteCount,
56  const bool inSynchronous = true);
57 
58  AJA_VIRTUAL bool DmaTransfer (const NTV2DMAEngine inDMAEngine,
59  const bool inIsRead,
60  const ULWord inFrameNumber,
61  ULWord * pFrameBuffer,
62  const ULWord inCardOffsetBytes,
63  const ULWord inByteCount,
64  const ULWord inNumSegments,
65  const ULWord inSegmentHostPitch,
66  const ULWord inSegmentCardPitch,
67  const bool inSynchronous = true);
68 
69  AJA_VIRTUAL bool DmaTransfer (const NTV2DMAEngine inDMAEngine,
70  const NTV2Channel inDMAChannel,
71  const bool inIsTarget,
72  const ULWord inFrameNumber,
73  const ULWord inCardOffsetBytes,
74  const ULWord inByteCount,
75  const ULWord inNumSegments,
76  const ULWord inSegmentHostPitch,
77  const ULWord inSegmentCardPitch,
78  const PCHANNEL_P2P_STRUCT & inP2PData);
79 
80  AJA_VIRTUAL bool AutoCirculate (AUTOCIRCULATE_DATA & autoCircData);
81  AJA_VIRTUAL bool NTV2Message (NTV2_HEADER * pInMessage);
82  AJA_VIRTUAL bool ControlDriverDebugMessages (NTV2_DriverDebugMessageSet /*msgSet*/, bool /*enable*/) {return false;}
85 
86 #if !defined(NTV2_DEPRECATE_16_0)
87  AJA_VIRTUAL NTV2_DEPRECATED_f(bool GetStreamingApplication(ULWord * pAppType, int32_t * pPID)) {return pAppType && pPID ? GetStreamingApplication(*pAppType,*pPID) : false;}
88  AJA_VIRTUAL NTV2_DEPRECATED_f(bool SystemControl(void* dataPtr, SystemControlCode systemControlCode));
89  AJA_VIRTUAL NTV2_DEPRECATED_f(void Sleep(int)) {}
97  AJA_VIRTUAL NTV2_DEPRECATED_f(bool MapMemory(const MemoryType memType, void **memPtr));
98 #endif // !defined(NTV2_DEPRECATE_16_0)
99 
102 
103  AJA_VIRTUAL bool SystemStatus( void* dataPtr, SystemStatusCode systemStatusCode );
104  AJA_VIRTUAL bool KernelLog( void* dataPtr, UInt32 dataSize );
105  AJA_VIRTUAL bool ConfigureInterrupt( bool /*bEnable*/, INTERRUPT_ENUMS /*eInterruptType*/ ) {return true;}
106  AJA_VIRTUAL std::string GetConnectionType (void) const {return IsOpen() && !IsRemote() ? (mIsDEXT ? "DEXT" : "KEXT") : "";} // New in SDK 17.0
107 
108 #if !defined(NTV2_NULL_DEVICE)
109  protected:
110  AJA_VIRTUAL bool OpenLocalPhysical (const UWord inDeviceIndex);
111  AJA_VIRTUAL bool CloseLocalPhysical (void);
112 #endif // !defined(NTV2_NULL_DEVICE)
113 
114 private:
115  bool mIsDEXT; // Uses DEXT interface?
116  AJA_VIRTUAL inline io_connect_t GetIOConnect (void) const {return mConnection;} // For internal use only
117  io_connect_t mConnection; // My io_connect_t
118 
119  // 64 bit thunking - only for structures that contain pointers
120  AJA_VIRTUAL void CopyTo_AUTOCIRCULATE_DATA_64 (AUTOCIRCULATE_DATA *p, AUTOCIRCULATE_DATA_64 *p64);
121  AJA_VIRTUAL void CopyTo_AUTOCIRCULATE_DATA (AUTOCIRCULATE_DATA_64 *p64, AUTOCIRCULATE_DATA *p);
122  AJA_VIRTUAL void CopyTo_AUTOCIRCULATE_TRANSFER_STRUCT_64 (AUTOCIRCULATE_TRANSFER_STRUCT *p, AUTOCIRCULATE_TRANSFER_STRUCT_64 *p64);
123  AJA_VIRTUAL void CopyTo_AUTOCIRCULATE_TASK_STRUCT_64 (AUTOCIRCULATE_TASK_STRUCT *p, AUTOCIRCULATE_TASK_STRUCT_64 *p64);
124  AJA_VIRTUAL void CopyTo_AUTOCIRCULATE_TRANSFER_STRUCT (AUTOCIRCULATE_TRANSFER_STRUCT_64 *p64, AUTOCIRCULATE_TRANSFER_STRUCT *p);
125 
126 }; // CNTV2MacDriverInterface
127 
128 #endif // NTV2MACDRIVERINTERFACE_H
CNTV2MacDriverInterface::MapRegisters
virtual bool MapRegisters(void)
Definition: ntv2macdriverinterface.cpp:300
INTERRUPT_ENUMS
enum _INTERRUPT_ENUMS_ INTERRUPT_ENUMS
CNTV2MacDriverInterface::GetAudioOutputMode
virtual bool GetAudioOutputMode(NTV2_GlobalAudioPlaybackMode *mode)
Definition: ntv2macdriverinterface.cpp:1174
CNTV2MacDriverInterface::KernelLog
virtual bool KernelLog(void *dataPtr, UInt32 dataSize)
Definition: ntv2macdriverinterface.cpp:681
NTV2_DriverDebugMessageSet
NTV2_DriverDebugMessageSet
Definition: ntv2enums.h:3748
CNTV2MacDriverInterface::~CNTV2MacDriverInterface
virtual ~CNTV2MacDriverInterface()
My destructor.
Definition: ntv2macdriverinterface.cpp:166
CNTV2MacDriverInterface::ReadRegister
virtual bool ReadRegister(const ULWord inRegNum, ULWord &outValue, const ULWord inMask=0xFFFFFFFF, const ULWord inShift=0)
Reads all or part of the 32-bit contents of a specific register (real or virtual) on the AJA device....
Definition: ntv2macdriverinterface.cpp:389
NTV2Channel
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
Definition: ntv2enums.h:1305
CNTV2MacDriverInterface::AutoCirculate
virtual bool AutoCirculate(AUTOCIRCULATE_DATA &autoCircData)
Sends an AutoCirculate command to the NTV2 driver.
Definition: ntv2macdriverinterface.cpp:986
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:516
CNTV2MacDriverInterface::OpenLocalPhysical
virtual bool OpenLocalPhysical(const UWord inDeviceIndex)
Opens the local/physical device connection.
Definition: ntv2macdriverinterface.cpp:176
CNTV2MacDriverInterface::WaitForInterrupt
virtual bool WaitForInterrupt(const INTERRUPT_ENUMS type, const ULWord timeout=50)
Definition: ntv2macdriverinterface.cpp:726
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:764
NTV2_GlobalAudioPlaybackMode
NTV2_GlobalAudioPlaybackMode
Definition: ntv2enums.h:2051
CNTV2MacDriverInterface::SystemStatus
virtual bool SystemStatus(void *dataPtr, SystemStatusCode systemStatusCode)
Definition: ntv2macdriverinterface.cpp:962
NTV2DMAEngine
NTV2DMAEngine
Definition: ntv2enums.h:1801
MemoryType
MemoryType
Definition: ntv2macpublicinterface.h:80
ULWord
uint32_t ULWord
Definition: ajatypes.h:253
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:651
AUTOCIRCULATE_TRANSFER_STRUCT
Definition: ntv2publicinterface.h:4573
CNTV2MacDriverInterface::MapXena2Flash
virtual bool MapXena2Flash(void)
Definition: ntv2macdriverinterface.cpp:321
CNTV2MacDriverInterface::GetConnectionType
virtual std::string GetConnectionType(void) const
Definition: ntv2macdriverinterface.h:106
AUTOCIRCULATE_DATA_64
Definition: ntv2publicinterface.h:4340
NTV2_HEADER
All new NTV2 structs start with this common header.
Definition: ntv2publicinterface.h:6954
UWord
uint16_t UWord
Definition: ajatypes.h:251
CNTV2MacDriverInterface::RestoreHardwareProcampRegisters
virtual bool RestoreHardwareProcampRegisters(void)
Definition: ntv2macdriverinterface.cpp:941
SystemStatusCode
SystemStatusCode
Definition: ntv2publicinterface.h:4854
ntv2macpublicinterface.h
Declares MacOS-only enums used by the Mac driver and the SDK.
CNTV2MacDriverInterface::WaitForChangeEvent
virtual bool WaitForChangeEvent(UInt32 timeout=0)
Definition: ntv2macdriverinterface.cpp:795
CNTV2MacDriverInterface::ControlDriverDebugMessages
virtual bool ControlDriverDebugMessages(NTV2_DriverDebugMessageSet, bool)
Definition: ntv2macdriverinterface.h:82
AJA_VIRTUAL
#define AJA_VIRTUAL
Definition: ajatypes.h:160
AUTOCIRCULATE_TRANSFER_STRUCT_64
Definition: ntv2publicinterface.h:4536
CNTV2MacDriverInterface::ConfigureInterrupt
virtual bool ConfigureInterrupt(bool, INTERRUPT_ENUMS)
Definition: ntv2macdriverinterface.h:105
CNTV2MacDriverInterface::MapMemory
virtual bool MapMemory(const MemoryType memType, void **memPtr)
Definition: ntv2macdriverinterface.cpp:342
CNTV2MacDriverInterface::SystemControl
virtual bool SystemControl(void *dataPtr, SystemControlCode systemControlCode)
Definition: ntv2macdriverinterface.cpp:361
CNTV2MacDriverInterface::UnmapXena2Flash
virtual bool UnmapXena2Flash(void)
Definition: ntv2macdriverinterface.cpp:333
NTV2_SHOULD_BE_DEPRECATED
#define NTV2_SHOULD_BE_DEPRECATED(__f__)
Definition: ajatypes.h:521
NTV2_DEPRECATED_f
#define NTV2_DEPRECATED_f(__f__)
Definition: ajatypes.h:553
CNTV2MacDriverInterface::MapFrameBuffers
virtual bool MapFrameBuffers(void)
Definition: ntv2macdriverinterface.cpp:277
false
#define false
Definition: ntv2devicefeatures.h:25
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:623
SystemControlCode
SystemControlCode
Definition: ntv2publicinterface.h:4900
CNTV2MacDriverInterface::NTV2Message
virtual bool NTV2Message(NTV2_HEADER *pInMessage)
Sends a message to the NTV2 driver (the new, improved, preferred way).
Definition: ntv2macdriverinterface.cpp:1130
CNTV2MacDriverInterface::AcquireStreamForApplicationWithReference
virtual bool AcquireStreamForApplicationWithReference(ULWord inApplicationType, int32_t inProcessID)
A reference-counted version of CNTV2DriverInterface::AcquireStreamForApplication useful for process g...
Definition: ntv2macdriverinterface.cpp:551
CNTV2MacDriverInterface::UnmapRegisters
virtual bool UnmapRegisters(void)
Definition: ntv2macdriverinterface.cpp:312
AUTOCIRCULATE_P2P_STRUCT
Definition: ntv2publicinterface.h:4657
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:481
CNTV2MacDriverInterface
A Mac-specific implementation of CNTV2DriverInterface.
Definition: ntv2macdriverinterface.h:22
CNTV2MacDriverInterface::CNTV2MacDriverInterface
CNTV2MacDriverInterface()
My default constructor.
Definition: ntv2macdriverinterface.cpp:156
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:824
CNTV2MacDriverInterface::UnmapFrameBuffers
virtual bool UnmapFrameBuffers(void)
Definition: ntv2macdriverinterface.cpp:290
CNTV2MacDriverInterface::SetAudioOutputMode
virtual bool SetAudioOutputMode(NTV2_GlobalAudioPlaybackMode mode)
Definition: ntv2macdriverinterface.cpp:1169
AUTOCIRCULATE_TASK_STRUCT
Definition: ntv2publicinterface.h:4755
ntv2publicinterface.h
Declares enums and structs used by all platform drivers and the SDK.
CNTV2MacDriverInterface::ReleaseStreamForApplicationWithReference
virtual bool ReleaseStreamForApplicationWithReference(ULWord inApplicationType, int32_t inProcessID)
A reference-counted version of CNTV2DriverInterface::ReleaseStreamForApplication useful for process g...
Definition: ntv2macdriverinterface.cpp:589
CNTV2DriverInterface
I'm the base class that undergirds the platform-specific derived classes (from which CNTV2Card is ult...
Definition: ntv2driverinterface.h:60
ntv2driverinterface.h
Declares the CNTV2DriverInterface base class.
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:430
CNTV2MacDriverInterface::GetPCISlotNumber
virtual ULWord GetPCISlotNumber(void) const
Definition: ntv2macdriverinterface.cpp:265
AUTOCIRCULATE_DATA
Definition: ntv2publicinterface.h:4369
AUTOCIRCULATE_TASK_STRUCT_64
Definition: ntv2publicinterface.h:4742
CNTV2MacDriverInterface::CloseLocalPhysical
virtual bool CloseLocalPhysical(void)
Releases host resources associated with the local/physical device connection.
Definition: ntv2macdriverinterface.cpp:243