AJA NTV2 SDK  18.0.0.2122
NTV2 SDK 18.0.0.2122
ntv2windriverinterface.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
7 #ifndef NTV2WINDRIVERINTERFACE_H
8 #define NTV2WINDRIVERINTERFACE_H
9 
10 #include "ajaexport.h"
11 #include "ajatypes.h"
12 #include <assert.h>
13 #include <stdio.h>
14 #include <string.h>
15 #include <tchar.h>
16 #include <ks.h>
17 #include <ksmedia.h>
18 #include <Setupapi.h>
19 #include <cfgmgr32.h>
20 #include "psapi.h"
21 
22 #include "ntv2driverinterface.h"
23 #include "ntv2winpublicinterface.h"
24 #include "ntv2devicefeatures.h"
25 #include <vector>
26 
27 
32 {
33  public:
35  virtual ~CNTV2WinDriverInterface();
36 
37  public:
38  AJA_VIRTUAL bool WriteRegister (const ULWord inRegNum, const ULWord inValue, const ULWord inMask = 0xFFFFFFFF, const ULWord inShift = 0);
39  AJA_VIRTUAL bool ReadRegister (const ULWord inRegNum, ULWord & outValue, const ULWord inMask = 0xFFFFFFFF, const ULWord inShift = 0);
40  AJA_VIRTUAL bool DmaTransfer (const NTV2DMAEngine inDMAEngine,
41  const bool inIsRead,
42  const ULWord inFrameNumber,
43  ULWord * pFrameBuffer,
44  const ULWord inCardOffsetBytes,
45  const ULWord inByteCount,
46  const bool inSynchronous = true);
47 
48  AJA_VIRTUAL bool DmaTransfer (const NTV2DMAEngine inDMAEngine,
49  const bool inIsRead,
50  const ULWord inFrameNumber,
51  ULWord * pFrameBuffer,
52  const ULWord inCardOffsetBytes,
53  const ULWord inByteCount,
54  const ULWord inNumSegments,
55  const ULWord inSegmentHostPitch,
56  const ULWord inSegmentCardPitch,
57  const bool inSynchronous = true);
58 
59  AJA_VIRTUAL bool DmaTransfer (const NTV2DMAEngine inDMAEngine,
60  const NTV2Channel inDMAChannel,
61  const bool inIsTarget,
62  const ULWord inFrameNumber,
63  const ULWord inCardOffsetBytes,
64  const ULWord inByteCount,
65  const ULWord inNumSegments,
66  const ULWord inSegmentHostPitch,
67  const ULWord inSegmentCardPitch,
68  const PCHANNEL_P2P_STRUCT & inP2PData);
69 
70  AJA_VIRTUAL bool ConfigureInterrupt (const bool bEnable, const INTERRUPT_ENUMS eInterruptType);
71  AJA_VIRTUAL bool ConfigureSubscription (const bool bSubscribe, const INTERRUPT_ENUMS eInterruptType, PULWord & hSubcription);
72  AJA_VIRTUAL bool GetInterruptCount (const INTERRUPT_ENUMS eInterrupt, ULWord & outCount);
73  AJA_VIRTUAL bool WaitForInterrupt (const INTERRUPT_ENUMS eInterruptType, const ULWord timeOutMs = 50);
74 
75  AJA_VIRTUAL bool AutoCirculate (AUTOCIRCULATE_DATA &autoCircData);
76  AJA_VIRTUAL bool NTV2Message (NTV2_HEADER * pInMessage);
77  AJA_VIRTUAL bool ControlDriverDebugMessages(NTV2_DriverDebugMessageSet msgSet, bool enable) {(void)msgSet; (void)enable; return false;}
78 
79  AJA_VIRTUAL bool SetAudioOutputMode (NTV2_GlobalAudioPlaybackMode mode);
80  AJA_VIRTUAL bool GetAudioOutputMode (NTV2_GlobalAudioPlaybackMode* mode);
81 
82  // Management of downloaded Xilinx bitfile
84  AJA_VIRTUAL bool DriverSetBitFileInformation (const BITFILE_INFO_STRUCT & inBitfileInfo);
85 
86  AJA_VIRTUAL bool RestoreHardwareProcampRegisters (void);
87 
88 #if !defined(NTV2_DEPRECATE_16_0)
89  AJA_VIRTUAL inline NTV2_DEPRECATED_16_0(bool SetStrictTiming(ULWord strictTiming)) {(void)strictTiming; return false;}
90  AJA_VIRTUAL inline NTV2_DEPRECATED_16_0(bool GetStrictTiming(ULWord* strictTiming)){(void)strictTiming; return false;}
91  AJA_VIRTUAL inline NTV2_DEPRECATED_16_0(bool GetStreamingApplication(ULWord & outAppType, int32_t & outPID)) {return CNTV2DriverInterface::GetStreamingApplication(outAppType,outPID);}
92  AJA_VIRTUAL inline NTV2_DEPRECATED_16_0(bool GetStreamingApplication(ULWord * pAppType, int32_t * pPID)) {return pAppType && pPID ? CNTV2DriverInterface::GetStreamingApplication(*pAppType,*pPID) : false;}
99  AJA_VIRTUAL NTV2_DEPRECATED_16_0(bool MapMemory(PVOID pvUserVa, ULWord ulNumBytes, bool bMap, ULWord* ulUser = NULL));
102  AJA_VIRTUAL NTV2_DEPRECATED_16_0(bool PrepareMemoryForDMA(ULWord * pFrameBuffer, const ULWord ulNumBytes));
103 #endif // !defined(NTV2_DEPRECATE_16_0)
104 #if !defined(NTV2_DEPRECATE_17_6)
105  AJA_VIRTUAL inline bool NTV2_DEPRECATED_17_6(HevcSendMessage(HevcMessageHeader* pMsg)) {(void)pMsg; return false;}
106 #endif
107 
108 #if !defined(NTV2_NULL_DEVICE)
109  // PRIVATE INSTANCE METHODS
110  protected:
111  AJA_VIRTUAL bool OpenLocalPhysical (const UWord inDeviceIndex);
112  AJA_VIRTUAL bool CloseLocalPhysical (void);
113 #endif // !defined(NTV2_NULL_DEVICE)
114 
115  // MEMBER DATA
116  protected:
117  PSP_DEVICE_INTERFACE_DETAIL_DATA _pspDevIFaceDetailData;
118  SP_DEVINFO_DATA _spDevInfoData;
119  HDEVINFO _hDevInfoSet;
124 #if !defined(NTV2_DEPRECATE_16_0)
125  typedef std::vector<ULWord *> DMA_LOCKED_VEC;
126  DMA_LOCKED_VEC _vecDmaLocked; // OEM save locked memory addresses in vector
127 #endif // !defined(NTV2_DEPRECATE_16_0)
128 }; // CNTV2WinDriverInterface
129 
130 #endif // NTV2WINDRIVERINTERFACE_H
Defines & structs shared between user-space and Windows kernel driver.
virtual bool UnmapFrameBuffers(void)
#define NULL
Declares the CNTV2DriverInterface base class.
virtual bool GetStreamingApplication(ULWord &outAppType, int32_t &outPID)
virtual bool MapFrameBuffers(void)
uint32_t * PULWord
Definition: ajatypes.h:224
virtual bool UnmapRegisters(void)
#define NTV2_DEPRECATED_17_6(__f__)
Definition: ajatypes.h:568
virtual bool ConfigureInterrupt(const bool bEnable, const INTERRUPT_ENUMS eInterruptType)
NTV2_DriverDebugMessageSet
Definition: ntv2enums.h:3829
uint32_t ULWord
Definition: ajatypes.h:223
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...
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They&#39;re also commonly use...
Definition: ntv2enums.h:1357
short HANDLE
Definition: ajatypes.h:285
PSP_DEVICE_INTERFACE_DETAIL_DATA _pspDevIFaceDetailData
virtual bool GetStreamingApplication(ULWord *pAppType, int32_t *pPID)
void * PVOID
Definition: ajatypes.h:286
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 ...
I&#39;m the base class that undergirds the platform-specific derived classes (from which CNTV2Card is ult...
virtual bool OpenLocalPhysical(const UWord inDeviceIndex)
Opens the local/physical device connection.
Defines the import/export macros for producing DLLs or LIBs.
#define AJA_VIRTUAL
Definition: ajatypes.h:130
NTV2DMAEngine
Definition: ntv2enums.h:1856
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...
Declares the most fundamental data types used by NTV2. Since Windows NT was the first principal devel...
virtual bool CloseLocalPhysical(void)
Releases host resources associated with the local/physical device connection.
enum _INTERRUPT_ENUMS_ INTERRUPT_ENUMS
All new NTV2 structs start with this common header.
virtual bool MapXena2Flash(void)
NTV2_GlobalAudioPlaybackMode
Definition: ntv2enums.h:2106
std::vector< ULWord * > DMA_LOCKED_VEC
virtual bool WriteRegister(const ULWord inRegNum, const ULWord inValue, const ULWord inMask=0xFFFFFFFF, const ULWord inShift=0)
Updates or replaces all or part of the 32-bit contents of a specific register (real or virtual) on th...
NTV2BitFileType
Definition: ntv2enums.h:3349
virtual bool UnmapXena2Flash(void)
virtual bool NTV2Message(NTV2_HEADER *pInMessage)
Sends a message to the NTV2 driver (the new, improved, preferred way).
virtual bool DriverGetBitFileInformation(BITFILE_INFO_STRUCT &outBitFileInfo, const NTV2BitFileType inBitFileType=NTV2_VideoProcBitFile)
defined(NTV2_DEPRECATE_17_2)
#define AJAExport
Definition: export.h:33
virtual bool MapRegisters(void)
virtual bool GetInterruptCount(const INTERRUPT_ENUMS eInterrupt, ULWord &outCount)
Answers with the number of interrupts of the given type processed by the driver.
uint16_t UWord
Definition: ajatypes.h:221
virtual bool SetStrictTiming(ULWord strictTiming)
virtual bool WaitForInterrupt(const INTERRUPT_ENUMS eInterrupt, const ULWord timeOutMs=68)
virtual bool PrepareMemoryForDMA(ULWord *pHostBuffer, const ULWord inNumBytes)
virtual bool ConfigureSubscription(const bool bSubscribe, const INTERRUPT_ENUMS inInterruptType, PULWord &outSubcriptionHdl)
virtual bool CompleteMemoryForDMA(ULWord *pHostBuffer)
virtual bool HevcSendMessage(HevcMessageHeader *pMsg)
#define NTV2_DEPRECATED_16_0(__f__)
Definition: ajatypes.h:529
virtual bool ControlDriverDebugMessages(NTV2_DriverDebugMessageSet msgSet, bool enable)
Physical device implementations of CNTV2DriverInterface methods through AJA Windows driver...
virtual bool AutoCirculate(AUTOCIRCULATE_DATA &pAutoCircData)
Sends an AutoCirculate command to the NTV2 driver.
Declares device capability functions.
virtual bool DmaUnlock(void)
virtual bool GetStrictTiming(ULWord *strictTiming)