AJA NTV2 SDK  17.1.3.1410
NTV2 SDK 17.1.3.1410
ntv2dma.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 #include "ntv2card.h"
9 #include "ntv2devicefeatures.h"
10 #include "ntv2utils.h"
11 #include "ajabase/system/debug.h"
12 #include <assert.h>
13 #include <map>
14 
15 
16 //#define HEX16(__x__) "0x" << hex << setw(16) << setfill('0') << uint64_t(__x__) << dec
17 #define INSTP(_p_) xHEX0N(uint64_t(_p_),16)
18 #define LOGGING_DMA_ANC (AJADebug::IsActive(AJA_DebugUnit_AncGeneric))
19 #define DMAANCFAIL(__x__) AJA_sERROR (AJA_DebugUnit_AncGeneric, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
20 #define DMAANCWARN(__x__) AJA_sWARNING(AJA_DebugUnit_AncGeneric, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
21 #define DMAANCNOTE(__x__) AJA_sNOTICE (AJA_DebugUnit_AncGeneric, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
22 #define DMAANCINFO(__x__) AJA_sINFO (AJA_DebugUnit_AncGeneric, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
23 #define DMAANCDBG(__x__) AJA_sDEBUG (AJA_DebugUnit_AncGeneric, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
24 
25 
26 using namespace std;
27 
28 
29 bool CNTV2Card::DMARead (const ULWord inFrameNumber, ULWord * pFrameBuffer, const ULWord inOffsetBytes, const ULWord inByteCount)
30 {
31  return DmaTransfer (NTV2_DMA_FIRST_AVAILABLE, true, inFrameNumber, pFrameBuffer, inOffsetBytes, inByteCount, true);
32 }
33 
34 
35 bool CNTV2Card::DMAWrite (const ULWord inFrameNumber, const ULWord * pFrameBuffer, const ULWord inOffsetBytes, const ULWord inByteCount)
36 {
37  return DmaTransfer (NTV2_DMA_FIRST_AVAILABLE, false, inFrameNumber, const_cast<ULWord*>(pFrameBuffer), inOffsetBytes, inByteCount, true);
38 }
39 
40 
41 bool CNTV2Card::DMAReadFrame (const ULWord inFrameNumber, ULWord * pFrameBuffer, const ULWord inByteCount)
42 {
43  return DmaTransfer (NTV2_DMA_FIRST_AVAILABLE, true, inFrameNumber, pFrameBuffer, ULWord(0), inByteCount, true);
44 }
45 
46 bool CNTV2Card::DMAReadFrame (const ULWord inFrameNumber, ULWord * pFrameBuffer, const ULWord inByteCount, const NTV2Channel inChannel)
47 {
48  if (!NTV2_IS_VALID_CHANNEL(inChannel))
49  return DMAReadFrame (inFrameNumber, pFrameBuffer, inByteCount);
50 
52  GetFrameBufferSize(inChannel, hwFrameSize);
53  ULWord actualFrameSize (::NTV2FramesizeToByteCount(hwFrameSize));
54  bool quadEnabled(false), quadQuadEnabled(false);
55  GetQuadFrameEnable(quadEnabled, inChannel);
56  GetQuadQuadFrameEnable(quadQuadEnabled, inChannel);
57  if (quadEnabled)
58  actualFrameSize *= 4;
59  if (quadQuadEnabled)
60  actualFrameSize *= 4;
61  return DmaTransfer (NTV2_DMA_FIRST_AVAILABLE, true, 0, pFrameBuffer, inFrameNumber * actualFrameSize, inByteCount, true);
62 }
63 
64 
65 bool CNTV2Card::DMAWriteFrame (const ULWord inFrameNumber, const ULWord * pFrameBuffer, const ULWord inByteCount)
66 {
67  return DmaTransfer (NTV2_DMA_FIRST_AVAILABLE, false, inFrameNumber, const_cast <ULWord *> (pFrameBuffer), ULWord(0), inByteCount, true);
68 }
69 
70 bool CNTV2Card::DMAWriteFrame (const ULWord inFrameNumber, const ULWord * pFrameBuffer, const ULWord inByteCount, const NTV2Channel inChannel)
71 {
72  if (!NTV2_IS_VALID_CHANNEL(inChannel))
73  return DMAWriteFrame (inFrameNumber, pFrameBuffer, inByteCount);
74 
76  GetFrameBufferSize(inChannel, hwFrameSize);
77  ULWord actualFrameSize (::NTV2FramesizeToByteCount(hwFrameSize));
78  bool quadEnabled(false), quadQuadEnabled(false);
79  GetQuadFrameEnable(quadEnabled, inChannel);
80  GetQuadQuadFrameEnable(quadQuadEnabled, inChannel);
81  if (quadEnabled)
82  actualFrameSize *= 4;
83  if (quadQuadEnabled)
84  actualFrameSize *= 4;
85  return DmaTransfer (NTV2_DMA_FIRST_AVAILABLE, false, 0, const_cast<ULWord*>(pFrameBuffer),
86  inFrameNumber * actualFrameSize, inByteCount, true);
87 }
88 
89 
90 bool CNTV2Card::DMAReadSegments ( const ULWord inFrameNumber,
91  ULWord * pFrameBuffer,
92  const ULWord inOffsetBytes,
93  const ULWord inTotalByteCount,
94  const ULWord inNumSegments,
95  const ULWord inSegmentHostPitch,
96  const ULWord inSegmentCardPitch)
97 {
98  return DmaTransfer (NTV2_DMA_FIRST_AVAILABLE, true, inFrameNumber, pFrameBuffer, inOffsetBytes, inTotalByteCount,
99  inNumSegments, inSegmentHostPitch, inSegmentCardPitch, true);
100 }
101 
102 
103 bool CNTV2Card::DMAWriteSegments ( const ULWord inFrameNumber,
104  const ULWord * pFrameBuffer,
105  const ULWord inOffsetBytes,
106  const ULWord inTotalByteCount,
107  const ULWord inNumSegments,
108  const ULWord inSegmentHostPitch,
109  const ULWord inSegmentCardPitch)
110 {
111  return DmaTransfer (NTV2_DMA_FIRST_AVAILABLE, false, inFrameNumber, const_cast<ULWord*>(pFrameBuffer),
112  inOffsetBytes, inTotalByteCount, inNumSegments, inSegmentHostPitch, inSegmentCardPitch, true);
113 }
114 
115 
116 bool CNTV2Card::DmaP2PTargetFrame (NTV2Channel channel, ULWord frameNumber, ULWord frameOffset, PCHANNEL_P2P_STRUCT pP2PData)
117 {
118  return DmaTransfer (NTV2_PIO, channel, true, frameNumber, frameOffset, 0, 0, 0, 0, pP2PData);
119 }
120 
121 
123  ULWord frameNumber,
124  ULWord frameOffset,
125  ULWord transferSize,
126  ULWord numSegments,
127  ULWord segmentTargetPitch,
128  ULWord segmentCardPitch,
129  PCHANNEL_P2P_STRUCT pP2PData)
130 {
131  return DmaTransfer (DMAEngine, NTV2_CHANNEL1, false, frameNumber, frameOffset, transferSize, numSegments,
132  segmentTargetPitch, segmentCardPitch, pP2PData);
133 }
134 
135 
136 bool CNTV2Card::DMAReadAudio ( const NTV2AudioSystem inAudioSystem,
137  ULWord * pOutAudioBuffer,
138  const ULWord inOffsetBytes,
139  const ULWord inByteCount)
140 {
141  if (!pOutAudioBuffer)
142  return false; // NULL buffer
143  if (!inByteCount)
144  return false; // Nothing to transfer
145 
146  ULWord absoluteByteOffset (0);
147  if (!GetAudioMemoryOffset (inOffsetBytes, absoluteByteOffset, inAudioSystem))
148  return false;
149 
150  return DmaTransfer (NTV2_DMA_FIRST_AVAILABLE, true, 0, pOutAudioBuffer, absoluteByteOffset, inByteCount, true);
151 }
152 
153 
154 bool CNTV2Card::DMAWriteAudio ( const NTV2AudioSystem inAudioSystem,
155  const ULWord * pInAudioBuffer,
156  const ULWord inOffsetBytes,
157  const ULWord inByteCount)
158 {
159  if (!pInAudioBuffer)
160  return false; // NULL buffer
161  if (!inByteCount)
162  return false; // Nothing to transfer
163 
164  ULWord absoluteByteOffset (0);
165  if (!GetAudioMemoryOffset (inOffsetBytes, absoluteByteOffset, inAudioSystem))
166  return false;
167 
168  return DmaTransfer (NTV2_DMA_FIRST_AVAILABLE, false, 0, const_cast <ULWord *> (pInAudioBuffer), absoluteByteOffset, inByteCount, true);
169 }
170 
171 
172 bool CNTV2Card::DMAReadAnc (const ULWord inFrameNumber,
173  NTV2Buffer & outAncF1Buffer,
174  NTV2Buffer & outAncF2Buffer,
175  const NTV2Channel inChannel)
176 {
177  ULWord F1Offset(0), F2Offset(0), inByteCount(0), bytesToTransfer(0), byteOffsetToAncData(0);
179  bool result(true);
180  if (!IsSupported(kDeviceCanDoCustomAnc))
181  return false;
182  if (!ReadRegister (kVRegAncField1Offset, F1Offset))
183  return false;
184  if (!ReadRegister (kVRegAncField2Offset, F2Offset))
185  return false;
186  if (outAncF1Buffer.IsNULL() && outAncF2Buffer.IsNULL())
187  return false;
188  if (!GetFrameBufferSize (inChannel, hwFrameSize))
189  return false;
190 
191  ULWord frameSizeInBytes(::NTV2FramesizeToByteCount(hwFrameSize));
192  bool quadEnabled(false), quadQuadEnabled(false);
193  GetQuadFrameEnable(quadEnabled, inChannel);
194  GetQuadQuadFrameEnable(quadQuadEnabled, inChannel);
195  if (quadEnabled)
196  frameSizeInBytes *= 4;
197  if (quadQuadEnabled)
198  frameSizeInBytes *= 4;
199 
200  // IMPORTANT ASSUMPTION: F1 data is first (at lower address) in the frame buffer...!
201  inByteCount = outAncF1Buffer.IsNULL() ? 0 : outAncF1Buffer.GetByteCount();
202  bytesToTransfer = inByteCount > F1Offset ? F1Offset : inByteCount;
203  if (bytesToTransfer)
204  {
205  byteOffsetToAncData = frameSizeInBytes - F1Offset;
206  result = DmaTransfer (NTV2_DMA_FIRST_AVAILABLE, /*isRead*/true, inFrameNumber,
207  reinterpret_cast <ULWord *> (outAncF1Buffer.GetHostPointer()),
208  byteOffsetToAncData, bytesToTransfer, true);
209  }
210  inByteCount = outAncF2Buffer.IsNULL() ? 0 : outAncF2Buffer.GetByteCount();
211  bytesToTransfer = inByteCount > F2Offset ? F2Offset : inByteCount;
212  if (result && bytesToTransfer)
213  {
214  byteOffsetToAncData = frameSizeInBytes - F2Offset;
215  result = DmaTransfer (NTV2_DMA_FIRST_AVAILABLE, /*isRead*/true, inFrameNumber,
216  reinterpret_cast <ULWord *> (outAncF2Buffer.GetHostPointer()),
217  byteOffsetToAncData, bytesToTransfer, true);
218  }
219  if (result && IsSupported(kDeviceCanDo2110))
220  // S2110 Capture: So that most OEM ingest apps "just work" with S2110 RTP Anc streams, our
221  // classic SDI Anc data that device firmware normally de-embeds into registers
222  // e.g. VPID & RP188 -- the SDK here will automatically try to do the same.
223  S2110DeviceAncFromBuffers (inChannel, outAncF1Buffer, outAncF2Buffer);
224  return result;
225 }
226 
227 
228 bool CNTV2Card::DMAWriteAnc (const ULWord inFrameNumber,
229  NTV2Buffer & inAncF1Buffer,
230  NTV2Buffer & inAncF2Buffer,
231  const NTV2Channel inChannel)
232 {
233  ULWord F1Offset(0), F2Offset(0), inByteCount(0), bytesToTransfer(0), byteOffsetToAncData(0);
235  bool result(true);
236  if (!IsSupported(kDeviceCanDoCustomAnc))
237  return false;
238  if (!ReadRegister (kVRegAncField1Offset, F1Offset))
239  return false;
240  if (!ReadRegister (kVRegAncField2Offset, F2Offset))
241  return false;
242  if (inAncF1Buffer.IsNULL() && inAncF2Buffer.IsNULL())
243  return false;
244  if (!GetFrameBufferSize (inChannel, hwFrameSize))
245  return false;
246 
247  ULWord frameSizeInBytes(::NTV2FramesizeToByteCount(hwFrameSize));
248  bool quadEnabled(false), quadQuadEnabled(false);
249  GetQuadFrameEnable(quadEnabled, inChannel);
250  GetQuadQuadFrameEnable(quadQuadEnabled, inChannel);
251  if (quadEnabled)
252  frameSizeInBytes *= 4;
253  if (quadQuadEnabled)
254  frameSizeInBytes *= 4;
255 
256  // Seamless Anc playout...
257  bool tmpLocalRP188F1AncBuffer(false), tmpLocalRP188F2AncBuffer(false);
258  if (IsSupported(kDeviceCanDo2110) && NTV2_IS_VALID_CHANNEL(inChannel))
259  // S2110 Playout: So that most Retail & OEM playout apps "just work" with S2110 RTP Anc streams,
260  // our classic SDI Anc data that device firmware normally embeds into SDI output
261  // as derived from registers -- e.g. VPID & RP188 -- the SDK here will automatically
262  // insert these packets into the outgoing RTP streams, even if the client didn't
263  // provide Anc buffers. (But they MUST call DMAWriteAnc for this to work!)
264  {
265  if (inAncF1Buffer.IsNULL())
266  tmpLocalRP188F1AncBuffer = inAncF1Buffer.Allocate(2048);
267  if (inAncF2Buffer.IsNULL())
268  tmpLocalRP188F2AncBuffer = inAncF2Buffer.Allocate(2048);
269  S2110DeviceAncToBuffers (inChannel, inAncF1Buffer, inAncF2Buffer);
270  }
271 
272  // IMPORTANT ASSUMPTION: F1 data is first (at lower address) in the frame buffer...!
273  inByteCount = inAncF1Buffer.IsNULL() ? 0 : inAncF1Buffer.GetByteCount();
274  bytesToTransfer = inByteCount > F1Offset ? F1Offset : inByteCount;
275  if (bytesToTransfer)
276  {
277  byteOffsetToAncData = frameSizeInBytes - F1Offset;
278  result = DmaTransfer (NTV2_DMA_FIRST_AVAILABLE, /*isRead*/false, inFrameNumber,
279  inAncF1Buffer, byteOffsetToAncData, bytesToTransfer, true);
280  }
281  inByteCount = inAncF2Buffer.IsNULL() ? 0 : inAncF2Buffer.GetByteCount();
282  bytesToTransfer = inByteCount > F2Offset ? F2Offset : inByteCount;
283  if (result && bytesToTransfer)
284  {
285  byteOffsetToAncData = frameSizeInBytes - F2Offset;
286  result = DmaTransfer (NTV2_DMA_FIRST_AVAILABLE, /*isRead*/false, inFrameNumber,
287  inAncF2Buffer, byteOffsetToAncData, bytesToTransfer, true);
288  }
289 
290  if (tmpLocalRP188F1AncBuffer) inAncF1Buffer.Deallocate();
291  if (tmpLocalRP188F2AncBuffer) inAncF2Buffer.Deallocate();
292  return result;
293 }
294 
295 bool CNTV2Card::DMAWriteLUTTable (const ULWord inFrameNumber, const ULWord * pInLUTBuffer, const ULWord inLUTIndex, const ULWord inByteCount)
296 {
297  if (!pInLUTBuffer)
298  return false; // NULL buffer
299 
300  ULWord LUTIndexByteOffset = LUTTablePartitionSize * inLUTIndex;
301 
303  GetFrameBufferSize(NTV2_CHANNEL1, hwFrameSize);
304  ULWord actualFrameSize (::NTV2FramesizeToByteCount(hwFrameSize));
305  bool quadEnabled(false), quadQuadEnabled(false);
306  GetQuadFrameEnable(quadEnabled, NTV2_CHANNEL1);
307  GetQuadQuadFrameEnable(quadQuadEnabled, NTV2_CHANNEL1);
308  if (quadEnabled)
309  actualFrameSize *= 4;
310  if (quadQuadEnabled)
311  actualFrameSize *= 4;
312  return DmaTransfer (NTV2_DMA_FIRST_AVAILABLE, false, 0, const_cast<ULWord*>(pInLUTBuffer),
313  (inFrameNumber * actualFrameSize) + LUTIndexByteOffset, inByteCount, true);
314 }
315 
316 
317 bool CNTV2Card::GetDeviceFrameInfo (const UWord inFrameNumber, const NTV2Channel inChannel, ULWord & outIntrinsicSize,
318  bool & outMultiFormat, bool & outQuad, bool & outQuadQuad, bool & outSquares, bool & outTSI,
319  uint64_t & outAddress, uint64_t & outLength)
320 {
321  outAddress = outLength = 0;
322  static const ULWord frameSizes[] = {2, 4, 8, 16}; // '00'=2MB '01'=4MB '10'=8MB '11'=16MB
323  UWord frameSizeNdx(0);
324  const bool isMRWidgetChannel(IsMultiRasterWidgetChannel(inChannel));
325  outIntrinsicSize = 0;
326  outMultiFormat = outQuad = outQuadQuad = outSquares = outTSI = false;
327  NTV2Channel chan (inChannel);
328  if (!IsSupported(kDeviceCanDoMultiFormat))
329  chan = NTV2_CHANNEL1; // Older uniformat-only device: use Ch1
330  else if (GetMultiFormatMode(outMultiFormat) && !outMultiFormat && !isMRWidgetChannel)
331  chan = NTV2_CHANNEL1; // Uniformat mode: Use Ch1
332 
334  outIntrinsicSize = frameSizes[frameSizeNdx] * 1024 * 1024;
335  if (IsSupported(kDeviceCanReportFrameSize))
336  { // All modern devices
337  ULWord quadMultiplier(1);
338  if (GetQuadFrameEnable(outQuad, chan) && outQuad)
339  quadMultiplier = 4; // 4!
340  if (GetQuadQuadFrameEnable(outQuadQuad, chan) && outQuadQuad)
341  quadMultiplier = 16;// 16!
342  outLength = outIntrinsicSize * quadMultiplier;
343  if (quadMultiplier > 1)
344  {
345  Get4kSquaresEnable (outSquares, chan);
346  GetTsiFrameEnable(outTSI, chan);
347  }
348  }
349  else
350  { // Corvid1, Corvid22, Corvid3G, IoExpress, Kona3G, Kona3GQuad, KonaLHe+, KonaLHi, TTap
351  if (::NTV2DeviceSoftwareCanChangeFrameBufferSize(GetDeviceID()))
352  { // Kona3G only at this point
353  bool frameSizeSetBySW(false);
355  if (!GetQuadFrameEnable(outQuad, chan) || !outQuad)
356  if (frameSizeSetBySW)
357  outLength = outIntrinsicSize;
358  if (outQuad)
359  Get4kSquaresEnable (outSquares, chan);
360  }
361  }
362  if (!outLength)
363  {
364  NTV2FrameBufferFormat frameBufferFormat(NTV2_FBF_10BIT_YCBCR);
365  GetFrameBufferFormat(NTV2_CHANNEL1, frameBufferFormat);
366  NTV2FrameGeometry frameGeometry;
367  GetFrameGeometry(frameGeometry, NTV2_CHANNEL1);
368  outLength = ::NTV2DeviceGetFrameBufferSize (GetDeviceID(), frameGeometry, frameBufferFormat);
369  }
370  outAddress = uint64_t(inFrameNumber) * outLength;
371  return true;
372 }
373 
374 
375 bool CNTV2Card::GetDeviceFrameInfo (const UWord inFrameNumber, const NTV2Channel inChannel, uint64_t & outAddr, uint64_t & outLgth)
376 {
377  bool isMultiFormat(false), isQuad(false), isQuadQuad(false), isSquares(false), isTSI(false);
378  ULWord intrinsicSize(0);
379  return GetDeviceFrameInfo (inFrameNumber, inChannel, intrinsicSize, isMultiFormat, isQuad, isQuadQuad, isSquares, isTSI, outAddr, outLgth);
380 }
381 
382 bool CNTV2Card::DeviceAddressToFrameNumber (const uint64_t inAddress, UWord & outFrameNumber, const NTV2Channel inChannel)
383 {
384  static const ULWord frameSizes[] = {2, 4, 8, 16}; // '00'=2MB '01'=4MB '10'=8MB '11'=16MB
385  UWord frameSizeNdx(0);
386  bool quadEnabled(false), isMultiFormatMode(false);
387  uint64_t frameBytes(0);
388  NTV2Channel chan (inChannel);
389  if (!IsSupported(kDeviceCanDoMultiFormat))
390  chan = NTV2_CHANNEL1; // Older uniformat-only device: use Ch1
391  else if (GetMultiFormatMode(isMultiFormatMode) && !isMultiFormatMode)
392  chan = NTV2_CHANNEL1; // Uniformat mode: Use Ch1
393 
394  outFrameNumber = 0;
396  if (IsSupported(kDeviceCanReportFrameSize))
397  { // All modern devices
398  ULWord quadMultiplier(1);
399  if (GetQuadFrameEnable(quadEnabled, chan) && quadEnabled)
400  quadMultiplier = 8; // 4!
401  if (GetQuadQuadFrameEnable(quadEnabled, chan) && quadEnabled)
402  quadMultiplier = 32;// 16!
403  frameBytes = frameSizes[frameSizeNdx] * 1024 * 1024 * quadMultiplier;
404  }
405  else
406  { // Corvid1, Corvid22, Corvid3G, IoExpress, Kona3G, Kona3GQuad, KonaLHe+, KonaLHi, TTap
407  if (::NTV2DeviceSoftwareCanChangeFrameBufferSize(GetDeviceID()))
408  { // Kona3G only at this point
409  bool frameSizeSetBySW(false);
411  if (!GetQuadFrameEnable(quadEnabled, chan) || !quadEnabled)
412  if (frameSizeSetBySW)
413  frameBytes = frameSizes[frameSizeNdx] * 1024 * 1024;
414  }
415  }
416  if (!frameBytes)
417  { // Corvid1, Corvid22, Corvid3G, IoExpress, Kona3G, Kona3GQuad, KonaLHe+, KonaLHi, TTap
418  NTV2FrameBufferFormat frameBufferFormat(NTV2_FBF_10BIT_YCBCR);
419  GetFrameBufferFormat(NTV2_CHANNEL1, frameBufferFormat);
420  NTV2FrameGeometry frameGeometry;
421  GetFrameGeometry(frameGeometry, NTV2_CHANNEL1);
422  frameBytes = ::NTV2DeviceGetFrameBufferSize (GetDeviceID(), frameGeometry, frameBufferFormat);
423  }
424  outFrameNumber = UWord(inAddress / frameBytes);
425  return true;
426 }
427 
428 
429 bool CNTV2Card::DMABufferLock (const NTV2Buffer & inBuffer, bool inMap, bool inRDMA)
430 {
431  if (!_boardOpened)
432  return false; // Device not open!
433 
434  if (!inBuffer)
435  return false;
436 
437  NTV2BufferLock lockMsg (inBuffer, (DMABUFFERLOCK_LOCK |
438  (inRDMA? DMABUFFERLOCK_RDMA : 0) |
439  (inMap? DMABUFFERLOCK_MAP : 0)));
440  return NTV2Message (reinterpret_cast<NTV2_HEADER*>(&lockMsg));
441 }
442 
443 
444 bool CNTV2Card::DMABufferUnlock (const NTV2Buffer & inBuffer)
445 {
446  if (!_boardOpened)
447  return false; // Device not open!
448 
449  if (!inBuffer)
450  return false;
451 
452  NTV2BufferLock lockMsg (inBuffer, DMABUFFERLOCK_UNLOCK);
453  return NTV2Message (reinterpret_cast<NTV2_HEADER*>(&lockMsg));
454 }
455 
456 
458 {
459  if (!_boardOpened)
460  return false; // Device not open!
461 
463  return NTV2Message (reinterpret_cast<NTV2_HEADER*>(&unlockAllMsg));
464 }
465 
466 bool CNTV2Card::DMABufferAutoLock (const bool inEnable, const bool inMap, const ULWord64 inMaxLockSize)
467 {
468  if (!_boardOpened)
469  return false; // Device not open!
470 
471  NTV2BufferLock autoMsg;
472  if (inEnable)
473  {
474  autoMsg.SetMaxLockSize (inMaxLockSize);
476  }
477  else
478  {
479  autoMsg.SetMaxLockSize (0);
481  }
482  return NTV2Message (reinterpret_cast<NTV2_HEADER*>(&autoMsg));
483 }
484 
485 typedef map<ULWord,NTV2AncDataRgn> OffsetAncRgns, SizeAncRgns;
486 typedef pair<ULWord,NTV2AncDataRgn> OffsetAncRgn, SizeAncRgn;
487 typedef OffsetAncRgns::const_iterator OffsetAncRgnsConstIter;
488 typedef OffsetAncRgns::const_reverse_iterator OffsetAncRgnsConstRIter;
489 typedef map<NTV2AncDataRgn,ULWord> AncRgnOffsets, AncRgnSizes;
490 typedef AncRgnOffsets::const_iterator AncRgnOffsetsConstIter;
491 typedef AncRgnSizes::const_iterator AncRgnSizesConstIter;
492 typedef pair<NTV2AncDataRgn,ULWord> AncRgnOffset, AncRgnSize;
493 
494 
495 bool CNTV2Card::DMAClearAncRegion (const UWord inStartFrameNumber, const UWord inEndFrameNumber,
496  const NTV2AncillaryDataRegion inAncRegion, const NTV2Channel inChannel)
497 {
498  if (!IsSupported(kDeviceCanDoCustomAnc))
499  return false; // no anc inserters/extractors
500 
501  ULWord offsetInBytes(0), sizeInBytes(0);
502  if (!GetAncRegionOffsetAndSize(offsetInBytes, sizeInBytes, inAncRegion))
503  return false; // no such region
504  NTV2Buffer zeroBuffer(sizeInBytes);
505  if (!zeroBuffer)
506  return false;
507  zeroBuffer.Fill(ULWord64(0));
508 
509  for (UWord ndx(inStartFrameNumber); ndx < inEndFrameNumber + 1; ndx++)
510  if (!DMAWriteAnc (ULWord(ndx), zeroBuffer, zeroBuffer, inChannel))
511  return false; // DMA write failure
512  return true;
513 }
514 
515 
516 bool CNTV2Card::GetAncRegionOffsetAndSize (ULWord & outByteOffset, ULWord & outByteCount, const NTV2AncillaryDataRegion inAncRegion)
517 {
518  outByteOffset = outByteCount = 0;
519  if (!IsSupported(kDeviceCanDoCustomAnc))
520  return false;
521  if (!NTV2_IS_VALID_ANC_RGN(inAncRegion))
522  return false; // Bad param
523 
525  if (!GetFrameBufferSize (NTV2_CHANNEL1, frameSize))
526  return false; // Bail
527 
528  const ULWord frameSizeInBytes(::NTV2FramesizeToByteCount(frameSize));
529  ULWord offsetFromEnd (0);
530 
531  // Map all Anc memory regions...
532  AncRgnOffsets ancRgnOffsets;
533  OffsetAncRgns offsetAncRgns;
534  for (NTV2AncDataRgn ancRgn(NTV2_AncRgn_Field1); ancRgn < NTV2_MAX_NUM_AncRgns; ancRgn = NTV2AncDataRgn(ancRgn+1))
535  {
536  ULWord bytesFromBottom(0);
537  if (GetAncRegionOffsetFromBottom(bytesFromBottom, ancRgn))
538  {
539  ancRgnOffsets.insert(AncRgnOffset(ancRgn, bytesFromBottom));
540  offsetAncRgns.insert(OffsetAncRgn(bytesFromBottom, ancRgn));
541  }
542  }
543  if (offsetAncRgns.empty())
544  return false;
545 
546  AncRgnSizes ancRgnSizes;
547  for (NTV2AncDataRgn ancRgn(NTV2_AncRgn_Field1); ancRgn < NTV2_MAX_NUM_AncRgns; ancRgn = NTV2AncDataRgn(ancRgn+1))
548  {
549  AncRgnOffsetsConstIter ancRgnOffsetIter (ancRgnOffsets.find(ancRgn));
550  if (ancRgnOffsetIter != ancRgnOffsets.end())
551  {
552  ULWord rgnSize(ancRgnOffsetIter->second); // Start with ancRgn's offset
553  OffsetAncRgnsConstIter offsetAncRgnIter (offsetAncRgns.find(ancRgnOffsetIter->second)); // Find ancRgn's offset in offsets table
554  if (offsetAncRgnIter != offsetAncRgns.end())
555  {
556  if (offsetAncRgnIter->second != ancRgn)
557  DMAANCWARN(::NTV2AncDataRgnToStr(ancRgn) << " and " << ::NTV2AncDataRgnToStr(offsetAncRgnIter->second) << " using same offset " << xHEX0N(offsetAncRgnIter->first,8));
558  else
559  {
560  if (offsetAncRgnIter != offsetAncRgns.begin() && --offsetAncRgnIter != offsetAncRgns.end()) // Has a neighbor?
561  rgnSize -= offsetAncRgnIter->first; // Yes -- subtract neighbor's offset
562  ancRgnSizes.insert(AncRgnSize(ancRgn, rgnSize));
563  //DMAANCDBG(::NTV2AncDataRgnToStr(ancRgn) << " offset=" << xHEX0N(ancRgnOffsets[ancRgn],8) << " size=" << xHEX0N(rgnSize,8));
564  }
565  }
566  //else DMAANCWARN("Offset " << xHEX0N(ancRgnOffsetIter->second,8) << " missing in OffsetAncRgns table");
567  }
568  //else DMAANCWARN(::NTV2AncDataRgnToStr(ancRgn) << " missing in AncRgnOffsets table");
569  }
570 
571  if (NTV2_IS_ALL_ANC_RGNS(inAncRegion))
572  {
573  // Use the largest offset-from-end, and the sum of all sizes
574  OffsetAncRgnsConstRIter rIter (offsetAncRgns.rbegin());
575  if (rIter == offsetAncRgns.rend())
576  return false; // Empty?
577  offsetFromEnd = rIter->first;
578  outByteOffset = frameSizeInBytes - offsetFromEnd; // Convert to offset from top of frame buffer
579  outByteCount = offsetFromEnd; // The whole shebang
580  return true;
581  }
582 
583  AncRgnOffsetsConstIter offIter(ancRgnOffsets.find(inAncRegion));
584  if (offIter == ancRgnOffsets.end())
585  return false; // Not there
586 
587  offsetFromEnd = offIter->second;
588  if (offsetFromEnd > frameSizeInBytes)
589  return false; // Bad offset
590 
591  AncRgnSizesConstIter sizeIter(ancRgnSizes.find(inAncRegion));
592  if (sizeIter == ancRgnSizes.end())
593  return false; // Not there
594 
595  outByteOffset = frameSizeInBytes - offsetFromEnd; // Convert to offset from top of frame buffer
596  outByteCount = sizeIter->second;
597  return outByteOffset && outByteCount;
598 }
599 
600 
601 bool CNTV2Card::GetAncRegionOffsetFromBottom (ULWord & bytesFromBottom, const NTV2AncillaryDataRegion inAncRegion)
602 {
603  bytesFromBottom = 0;
604 
605  if (!IsSupported(kDeviceCanDoCustomAnc))
606  return false; // No custom anc support
607 
608  // IoIP SDIOut5 monitor anc support added in SDK/driver 15.3...
609  UWord majV(0), minV(0), pt(0), bld(0);
610  GetDriverVersionComponents(majV, minV, pt, bld);
611  const bool is153OrLater ((majV > 15) || (majV == 15 && minV >= 3) || (!majV && !minV && !pt && !bld));
612 
613  switch (inAncRegion)
614  {
615  default: return false; // Bad index
616  case NTV2_AncRgn_Field1: return ReadRegister(kVRegAncField1Offset, bytesFromBottom) && bytesFromBottom;// F1
617  case NTV2_AncRgn_Field2: return ReadRegister(kVRegAncField2Offset, bytesFromBottom) && bytesFromBottom;// F2
618  case NTV2_AncRgn_MonField1: return is153OrLater && ReadRegister(kVRegMonAncField1Offset, bytesFromBottom) && bytesFromBottom;// MonF1
619  case NTV2_AncRgn_MonField2: return is153OrLater && ReadRegister(kVRegMonAncField2Offset, bytesFromBottom) && bytesFromBottom;// MonF2
620  case NTV2_AncRgn_All: break; // All Anc regions -- calculate below
621  }
622 
623  // Read all and determine the largest...
624  ULWord temp(0);
625  if (ReadRegister(kVRegAncField1Offset, temp) && temp > bytesFromBottom)
626  bytesFromBottom = temp;
627  if (ReadRegister(kVRegAncField2Offset, temp) && temp > bytesFromBottom)
628  bytesFromBottom = temp;
629 
630  if (is153OrLater && ((GetDeviceID() == DEVICE_ID_IOIP_2110) ||
631  (GetDeviceID() == DEVICE_ID_IOIP_2110_RGB12)))
632  {
633  if (ReadRegister(kVRegMonAncField1Offset, temp) && temp > bytesFromBottom)
634  bytesFromBottom = temp;
635  if (ReadRegister(kVRegMonAncField2Offset, temp) && temp > bytesFromBottom)
636  bytesFromBottom = temp;
637  }
638  return bytesFromBottom > 0;
639 }
kVRegMonAncField1Offset
@ kVRegMonAncField1Offset
Monitor Anc Field1 byte offset from end of frame buffer (IoIP only, GUMP)
Definition: ntv2virtualregisters.h:331
NTV2_MAX_NUM_AncRgns
@ NTV2_MAX_NUM_AncRgns
Definition: ntv2enums.h:4149
NTV2AncDataRgnToStr
std::string NTV2AncDataRgnToStr(const NTV2AncDataRgn inValue, const bool inCompactDisplay=false)
Definition: ntv2utils.cpp:6593
CNTV2Card::DMABufferUnlock
virtual bool DMABufferUnlock(const NTV2Buffer &inBuffer)
Unlocks the given host buffer that was previously locked using CNTV2Card::DMABufferLock.
Definition: ntv2dma.cpp:444
DMABUFFERLOCK_MAP
#define DMABUFFERLOCK_MAP
Used in NTV2BufferLock to IO map a buffer.
Definition: ntv2publicinterface.h:5546
CNTV2Card::GetAncRegionOffsetFromBottom
virtual bool GetAncRegionOffsetFromBottom(ULWord &outByteOffsetFromBottom, const NTV2AncillaryDataRegion inAncRegion=NTV2_AncRgn_All)
Answers with the byte offset to the start of an ancillary data region within a device frame buffer,...
Definition: ntv2dma.cpp:601
DMABUFFERLOCK_LOCK
#define DMABUFFERLOCK_LOCK
Used in NTV2BufferLock to page lock a buffer.
Definition: ntv2publicinterface.h:5544
ntv2devicefeatures.h
Declares device capability functions.
CNTV2Card::DMABufferAutoLock
virtual bool DMABufferAutoLock(const bool inEnable, const bool inMap=(0), const ULWord64 inMaxLockSize=0)
Enables or disables automatic buffer locking.
Definition: ntv2dma.cpp:466
CNTV2Card::DMAWriteSegments
virtual bool DMAWriteSegments(const ULWord inFrameNumber, const ULWord *pFrameBuffer, const ULWord inOffsetBytes, const ULWord inSegmentByteCount, const ULWord inNumSegments, const ULWord inSegmentHostPitch, const ULWord inSegmentCardPitch)
Performs a segmented data transfer from the host to the AJA device.
Definition: ntv2dma.cpp:103
DMABUFFERLOCK_RDMA
#define DMABUFFERLOCK_RDMA
Used in NTV2BufferLock to page lock a rdma buffer.
Definition: ntv2publicinterface.h:5551
NTV2Channel
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
Definition: ntv2enums.h:1305
NTV2Buffer
A generic user-space buffer object that has an address and a length. Used most often to share an arbi...
Definition: ntv2publicinterface.h:5993
NTV2Buffer::GetByteCount
ULWord GetByteCount(void) const
Definition: ntv2publicinterface.h:6066
NTV2DeviceGetFrameBufferSize
ULWord NTV2DeviceGetFrameBufferSize(NTV2DeviceID id, NTV2FrameGeometry fg, NTV2FrameBufferFormat fbf)
Definition: ntv2devicefeatures.cpp:323
CNTV2Card::DmaP2PTargetFrame
virtual bool DmaP2PTargetFrame(NTV2Channel channel, ULWord frameNumber, ULWord frameOffset, PCHANNEL_P2P_STRUCT pP2PData)
DirectGMA p2p transfers (not GPUDirect: see DMABufferLock)
Definition: ntv2dma.cpp:116
NTV2Buffer::Deallocate
bool Deallocate(void)
Deallocates my user-space storage (if I own it – i.e. from a prior call to Allocate).
Definition: ntv2publicinterface.cpp:1664
CNTV2Card::DMAWrite
virtual bool DMAWrite(const ULWord inFrameNumber, const ULWord *pFrameBuffer, const ULWord inOffsetBytes, const ULWord inByteCount)
Transfers data from the host to the AJA device.
Definition: ntv2dma.cpp:35
CNTV2Card::DMARead
virtual bool DMARead(const ULWord inFrameNumber, ULWord *pFrameBuffer, const ULWord inOffsetBytes, const ULWord inByteCount)
Transfers data from the AJA device to the host.
Definition: ntv2dma.cpp:29
CNTV2Card::DMAReadAnc
virtual bool DMAReadAnc(const ULWord inFrameNumber, NTV2Buffer &outAncF1Buffer, NTV2Buffer &outAncF2Buffer=NULL_POINTER, const NTV2Channel inChannel=NTV2_CHANNEL1)
Transfers the contents of the ancillary data buffer(s) from a given frame on the AJA device to the ho...
Definition: ntv2dma.cpp:172
DMABUFFERLOCK_MANUAL
#define DMABUFFERLOCK_MANUAL
Used in NTV2BufferLock to manual page lock buffers.
Definition: ntv2publicinterface.h:5549
NTV2_AncRgn_MonField1
@ NTV2_AncRgn_MonField1
Identifies the "monitor" or "auxiliary" Field 1 ancillary data region.
Definition: ntv2enums.h:4147
NTV2_AncRgn_Field2
@ NTV2_AncRgn_Field2
Identifies the "normal" Field 2 ancillary data region.
Definition: ntv2enums.h:4146
AncRgnOffsetsConstIter
AncRgnOffsets::const_iterator AncRgnOffsetsConstIter
Definition: ntv2dma.cpp:490
NTV2FrameBufferFormat
NTV2FrameBufferFormat
Identifies a particular video frame buffer format. See Device Frame Buffer Formats for details.
Definition: ntv2enums.h:207
NTV2Buffer::Allocate
bool Allocate(const size_t inByteCount, const bool inPageAligned=false)
Allocates (or re-allocates) my user-space storage using the given byte count. I assume full responsib...
Definition: ntv2publicinterface.cpp:1630
NTV2BufferLock
This is used to prelock a video/audio/anc buffer used as the source or target of DMA transfers....
Definition: ntv2publicinterface.h:8442
NTV2_CHANNEL1
@ NTV2_CHANNEL1
Specifies channel or Frame Store 1 (or the first item).
Definition: ntv2enums.h:1307
DMABUFFERLOCK_UNLOCK_ALL
#define DMABUFFERLOCK_UNLOCK_ALL
Used in NTV2BufferLock to unlock all locked buffers.
Definition: ntv2publicinterface.h:5545
NTV2FramesizeToByteCount
ULWord NTV2FramesizeToByteCount(const NTV2Framesize inFrameSize)
Converts the given NTV2Framesize value into an exact byte count.
Definition: ntv2utils.cpp:5319
AncRgnSizesConstIter
AncRgnSizes::const_iterator AncRgnSizesConstIter
Definition: ntv2dma.cpp:491
kVRegMonAncField2Offset
@ kVRegMonAncField2Offset
Monitor Anc Field2 byte offset from end of frame buffer (IoIP only, GUMP)
Definition: ntv2virtualregisters.h:332
NTV2BufferLock::SetFlags
void SetFlags(const ULWord inFlags)
Sets the action flags for use in a subsequent call to CNTV2Card::DMABufferLock.
Definition: ntv2publicinterface.h:8508
kVRegAncField2Offset
@ kVRegAncField2Offset
Anc Field2 byte offset from end of frame buffer (GUMP on all boards except RTP for SMPTE2022/IP)
Definition: ntv2virtualregisters.h:336
CNTV2Card::DMABufferLock
virtual bool DMABufferLock(const NTV2Buffer &inBuffer, bool inMap=(0), bool inRDMA=(0))
Page-locks the given host buffer to reduce transfer time and CPU usage of DMA transfers.
Definition: ntv2dma.cpp:429
CNTV2Card::GetAncRegionOffsetAndSize
virtual bool GetAncRegionOffsetAndSize(ULWord &outByteOffset, ULWord &outByteCount, const NTV2AncillaryDataRegion inAncRegion=NTV2_AncRgn_All)
Answers with the offset and size of an ancillary data region within a device frame buffer.
Definition: ntv2dma.cpp:516
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:403
AncRgnOffset
pair< NTV2AncDataRgn, ULWord > AncRgnOffset
Definition: ntv2dma.cpp:492
CNTV2Card::DMAWriteAudio
virtual bool DMAWriteAudio(const NTV2AudioSystem inAudioSystem, const ULWord *pInAudioBuffer, const ULWord inOffsetBytes, const ULWord inByteCount)
Synchronously transfers audio data from the specified host buffer to the given Audio System's buffer ...
Definition: ntv2dma.cpp:154
CNTV2Card::DMABufferUnlockAll
virtual bool DMABufferUnlockAll()
Unlocks all previously-locked buffers used for DMA transfers.
Definition: ntv2dma.cpp:457
NTV2_IS_VALID_ANC_RGN
#define NTV2_IS_VALID_ANC_RGN(_x_)
Definition: ntv2enums.h:4157
NTV2DMAEngine
NTV2DMAEngine
Definition: ntv2enums.h:1801
CNTV2Card::DMAReadSegments
virtual bool DMAReadSegments(const ULWord inFrameNumber, ULWord *pFrameBuffer, const ULWord inCardOffsetBytes, const ULWord inSegmentByteCount, const ULWord inNumSegments, const ULWord inSegmentHostPitch, const ULWord inSegmentCardPitch)
Performs a segmented data transfer from the AJA device to the host.
Definition: ntv2dma.cpp:90
kDeviceCanDo2110
@ kDeviceCanDo2110
True if device supports SMPTE ST2110.
Definition: ntv2devicefeatures.h:117
NTV2Buffer::IsNULL
bool IsNULL(void) const
Definition: ntv2publicinterface.h:6088
ULWord
uint32_t ULWord
Definition: ajatypes.h:253
kRegMaskFrameSizeSetBySW
@ kRegMaskFrameSizeSetBySW
Definition: ntv2publicinterface.h:1251
kVRegAncField1Offset
@ kVRegAncField1Offset
Anc Field1 byte offset from end of frame buffer (GUMP on all boards except RTP for SMPTE2022/IP)
Definition: ntv2virtualregisters.h:335
NTV2_AncRgn_Field1
@ NTV2_AncRgn_Field1
Identifies the "normal" Field 1 ancillary data region.
Definition: ntv2enums.h:4145
kK2RegShiftFrameSize
@ kK2RegShiftFrameSize
Definition: ntv2publicinterface.h:2327
DMAANCWARN
#define DMAANCWARN(__x__)
Definition: ntv2dma.cpp:20
NTV2DeviceSoftwareCanChangeFrameBufferSize
bool NTV2DeviceSoftwareCanChangeFrameBufferSize(const NTV2DeviceID inDeviceID)
Definition: ntv2devicefeatures.hpp:8172
ntv2card.h
Declares the CNTV2Card class.
CNTV2Card::GetDeviceFrameInfo
virtual bool GetDeviceFrameInfo(const UWord inFrameNumber, const NTV2Channel inChannel, uint64_t &outAddress, uint64_t &outLength)
Answers with the address and size of the given frame.
Definition: ntv2dma.cpp:375
NTV2_HEADER
All new NTV2 structs start with this common header.
Definition: ntv2publicinterface.h:6954
CNTV2Card::DMAWriteAnc
virtual bool DMAWriteAnc(const ULWord inFrameNumber, NTV2Buffer &inAncF1Buffer, NTV2Buffer &inAncF2Buffer=NULL_POINTER, const NTV2Channel inChannel=NTV2_CHANNEL1)
Transfers the contents of the ancillary data buffer(s) from the host to a given frame on the AJA devi...
Definition: ntv2dma.cpp:228
UWord
uint16_t UWord
Definition: ajatypes.h:251
AncRgnOffsets
map< NTV2AncDataRgn, ULWord > AncRgnOffsets
Definition: ntv2dma.cpp:489
DMAEngine
DMAEngine
Definition: ntv2macpublicinterface.h:104
ntv2utils.h
Declares numerous NTV2 utility functions.
NTV2Framesize
NTV2Framesize
Kona2/Xena2 specific enums.
Definition: ntv2enums.h:2061
CNTV2Card::DMAReadFrame
virtual bool DMAReadFrame(const ULWord inFrameNumber, ULWord *pOutFrameBuffer, const ULWord inByteCount)
Transfers a single frame from the AJA device to the host.
Definition: ntv2dma.cpp:41
CNTV2Card::DMAWriteLUTTable
virtual bool DMAWriteLUTTable(const ULWord inFrameNumber, const ULWord *pInLUTBuffer, const ULWord inLUTIndex, const ULWord inByteCount=LUTTablePartitionSize)
Synchronously transfers LUT data from the specified host buffer to the given buffer memory on the AJA...
Definition: ntv2dma.cpp:295
SizeAncRgns
map< ULWord, NTV2AncDataRgn > SizeAncRgns
Definition: ntv2dma.cpp:485
CNTV2Card::DMAReadAudio
virtual bool DMAReadAudio(const NTV2AudioSystem inAudioSystem, ULWord *pOutAudioBuffer, const ULWord inOffsetBytes, const ULWord inByteCount)
Synchronously transfers audio data from a given Audio System's buffer memory on the AJA device to the...
Definition: ntv2dma.cpp:136
kRegShiftFrameSizeSetBySW
@ kRegShiftFrameSizeSetBySW
Definition: ntv2publicinterface.h:2335
NTV2_AncRgn_MonField2
@ NTV2_AncRgn_MonField2
Identifies the "monitor" or "auxiliary" Field 2 ancillary data region.
Definition: ntv2enums.h:4148
NTV2_DMA_FIRST_AVAILABLE
@ NTV2_DMA_FIRST_AVAILABLE
Definition: ntv2enums.h:1810
NTV2_IS_VALID_CHANNEL
#define NTV2_IS_VALID_CHANNEL(__x__)
Definition: ntv2enums.h:1319
OffsetAncRgnsConstRIter
OffsetAncRgns::const_reverse_iterator OffsetAncRgnsConstRIter
Definition: ntv2dma.cpp:488
NTV2Buffer::GetHostPointer
void * GetHostPointer(void) const
Definition: ntv2publicinterface.h:6049
DEVICE_ID_IOIP_2110
@ DEVICE_ID_IOIP_2110
See Io IP.
Definition: ntv2enums.h:39
NTV2BufferLock::SetMaxLockSize
void SetMaxLockSize(const ULWord64 inNumBytes)
Sets the maximum lock size for use in a subsequent call to CNTV2Card::DMABufferLock.
Definition: ntv2publicinterface.h:8514
LUTTablePartitionSize
const ULWord LUTTablePartitionSize
Definition: ntv2publicinterface.h:84
SizeAncRgn
pair< ULWord, NTV2AncDataRgn > SizeAncRgn
Definition: ntv2dma.cpp:486
NTV2_FBF_10BIT_YCBCR
@ NTV2_FBF_10BIT_YCBCR
See 10-Bit YCbCr Format.
Definition: ntv2enums.h:210
kDeviceCanReportFrameSize
@ kDeviceCanReportFrameSize
True if device can report its frame size.
Definition: ntv2devicefeatures.h:91
CNTV2Card::DmaP2PTransferFrame
virtual bool DmaP2PTransferFrame(NTV2DMAEngine DMAEngine, ULWord frameNumber, ULWord frameOffset, ULWord transferSize, ULWord numSegments, ULWord segmentTargetPitch, ULWord segmentCardPitch, PCHANNEL_P2P_STRUCT pP2PData)
Definition: ntv2dma.cpp:122
AncRgnSize
pair< NTV2AncDataRgn, ULWord > AncRgnSize
Definition: ntv2dma.cpp:492
OffsetAncRgns
map< ULWord, NTV2AncDataRgn > OffsetAncRgns
Definition: ntv2dma.cpp:485
ULWord64
uint64_t ULWord64
Definition: ajatypes.h:256
std
Definition: json.hpp:5362
DMABUFFERLOCK_AUTO
#define DMABUFFERLOCK_AUTO
Used in NTV2BufferLock to auto page lock buffers.
Definition: ntv2publicinterface.h:5548
AUTOCIRCULATE_P2P_STRUCT
Definition: ntv2publicinterface.h:4657
AncRgnSizes
map< NTV2AncDataRgn, ULWord > AncRgnSizes
Definition: ntv2dma.cpp:489
NTV2FrameGeometry
NTV2FrameGeometry
Identifies a particular video frame geometry.
Definition: ntv2enums.h:336
kK2RegMaskFrameSize
@ kK2RegMaskFrameSize
Definition: ntv2publicinterface.h:1244
kRegCh1Control
@ kRegCh1Control
Definition: ntv2publicinterface.h:103
CNTV2Card::DeviceAddressToFrameNumber
virtual bool DeviceAddressToFrameNumber(const uint64_t inAddress, UWord &outFrameNumber, const NTV2Channel inChannel=NTV2_CHANNEL1)
Answers with the frame number that contains the given address.
Definition: ntv2dma.cpp:382
DMABUFFERLOCK_MAX_SIZE
#define DMABUFFERLOCK_MAX_SIZE
Used in NTV2BufferLock to set max locked size.
Definition: ntv2publicinterface.h:5550
kDeviceCanDoCustomAnc
@ kDeviceCanDoCustomAnc
True if device has SDI ANC inserter/extractor firmware.
Definition: ntv2devicefeatures.h:56
CNTV2Card::DMAWriteFrame
virtual bool DMAWriteFrame(const ULWord inFrameNumber, const ULWord *pInFrameBuffer, const ULWord inByteCount)
Transfers a single frame from the host to the AJA device.
Definition: ntv2dma.cpp:65
OffsetAncRgn
pair< ULWord, NTV2AncDataRgn > OffsetAncRgn
Definition: ntv2dma.cpp:486
CNTV2Card::DMAClearAncRegion
virtual bool DMAClearAncRegion(const UWord inStartFrameNumber, const UWord inEndFrameNumber, const NTV2AncillaryDataRegion inAncRegion=NTV2_AncRgn_All, const NTV2Channel=NTV2_CHANNEL1)
Clears the ancillary data region in the device frame buffer for the specified frames.
Definition: ntv2dma.cpp:495
NTV2AncDataRgn
enum NTV2AncillaryDataRegion NTV2AncDataRgn
NTV2Buffer::Fill
bool Fill(const T &inValue)
Fills me with the given scalar value.
Definition: ntv2publicinterface.h:6218
OffsetAncRgnsConstIter
OffsetAncRgns::const_iterator OffsetAncRgnsConstIter
Definition: ntv2dma.cpp:487
NTV2_PIO
@ NTV2_PIO
Definition: ntv2enums.h:1803
NTV2AncillaryDataRegion
NTV2AncillaryDataRegion
These enumerations identify the various ancillary data regions located at the bottom of each frame bu...
Definition: ntv2enums.h:4143
xHEX0N
#define xHEX0N(__x__, __n__)
Definition: ntv2publicinterface.h:5604
NTV2AudioSystem
NTV2AudioSystem
Used to identify an Audio System on an NTV2 device. See Audio System Operation for more information.
Definition: ntv2enums.h:3814
DEVICE_ID_IOIP_2110_RGB12
@ DEVICE_ID_IOIP_2110_RGB12
See Io IP.
Definition: ntv2enums.h:40
NTV2_IS_ALL_ANC_RGNS
#define NTV2_IS_ALL_ANC_RGNS(_x_)
Definition: ntv2enums.h:4156
NTV2_FRAMESIZE_INVALID
@ NTV2_FRAMESIZE_INVALID
Definition: ntv2enums.h:2080
DMABUFFERLOCK_UNLOCK
#define DMABUFFERLOCK_UNLOCK
Used in NTV2BufferLock to unlock a buffer.
Definition: ntv2publicinterface.h:5547
NTV2_AncRgn_All
@ NTV2_AncRgn_All
Identifies "all" ancillary data regions.
Definition: ntv2enums.h:4153
kDeviceCanDoMultiFormat
@ kDeviceCanDoMultiFormat
True if device can simultaneously handle different video formats on more than one SDI input or output...
Definition: ntv2devicefeatures.h:70
debug.h
Declares the AJADebug class.