AJA NTV2 SDK  17.5.0.1492
NTV2 SDK 17.5.0.1492
ntv2publicinterface.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
7 #include "ntv2publicinterface.h"
8 #include "ntv2devicefeatures.h"
9 #include "ntv2utils.h"
10 #include "ntv2endian.h"
11 #include "ajabase/system/memory.h"
12 #include "ajabase/system/debug.h"
13 #include "ajabase/common/common.h"
14 #include "ntv2registerexpert.h"
15 #include "ntv2nubtypes.h"
16 #include "ntv2version.h"
17 #include "ntv2debug.h"
18 #include <iomanip>
19 #include <locale> // For std::locale, std::numpunct, std::use_facet
20 #include <string.h> // For memset, et al.
21 #include <algorithm> // For set_difference
22 #include <iterator> // For std::inserter
23 #include "ntv2rp188.h"
24 #if !defined(MSWindows)
25  #include <unistd.h>
26 #endif
27 using namespace std;
28 
29 //#define NTV2BUFFER_NO_MEMCMP
30 
31 
33 
34 ostream & operator << (ostream & inOutStr, const NTV2AudioChannelPairs & inSet)
35 {
36  if (inSet.empty())
37  inOutStr << "(none)";
38  else
39  for (NTV2AudioChannelPairsConstIter iter (inSet.begin ()); iter != inSet.end (); ++iter)
40  inOutStr << (iter != inSet.begin() ? ", " : "") << ::NTV2AudioChannelPairToString (*iter, true);
41  return inOutStr;
42 }
43 
44 ostream & operator << (ostream & inOutStr, const NTV2AudioChannelQuads & inSet)
45 {
46  for (NTV2AudioChannelQuadsConstIter iter (inSet.begin ()); iter != inSet.end (); ++iter)
47  inOutStr << (iter != inSet.begin () ? ", " : "") << ::NTV2AudioChannelQuadToString (*iter, true);
48  return inOutStr;
49 }
50 
51 ostream & operator << (ostream & inOutStr, const NTV2AudioChannelOctets & inSet)
52 {
53  for (NTV2AudioChannelOctetsConstIter iter (inSet.begin ()); iter != inSet.end (); ++iter)
54  inOutStr << (iter != inSet.begin () ? ", " : "") << ::NTV2AudioChannelOctetToString (*iter, true);
55  return inOutStr;
56 }
57 
58 ostream & operator << (ostream & inOutStr, const NTV2DoubleArray & inVector)
59 {
60  for (NTV2DoubleArrayConstIter iter (inVector.begin ()); iter != inVector.end (); ++iter)
61  inOutStr << *iter << endl;
62  return inOutStr;
63 }
64 
65 ostream & operator << (ostream & inOutStr, const NTV2DIDSet & inDIDs)
66 {
67  for (NTV2DIDSetConstIter it (inDIDs.begin()); it != inDIDs.end(); )
68  {
69  inOutStr << xHEX0N(uint16_t(*it),2);
70  if (++it != inDIDs.end())
71  inOutStr << ", ";
72  }
73  return inOutStr;
74 }
75 
76 ostream & operator << (ostream & inOutStream, const UWordSequence & inData)
77 {
78  inOutStream << DEC(inData.size()) << " UWords: ";
79  for (UWordSequenceConstIter iter(inData.begin()); iter != inData.end(); )
80  {
81  inOutStream << HEX0N(*iter,4);
82  if (++iter != inData.end())
83  inOutStream << " ";
84  }
85  return inOutStream;
86 }
87 
88 ostream & operator << (ostream & inOutStream, const ULWordSequence & inData)
89 {
90  inOutStream << DEC(inData.size()) << " ULWords: ";
91  for (ULWordSequenceConstIter iter(inData.begin()); iter != inData.end(); )
92  {
93  inOutStream << HEX0N(*iter,8);
94  if (++iter != inData.end())
95  inOutStream << " ";
96  }
97  return inOutStream;
98 }
99 
100 ostream & operator << (ostream & inOutStream, const ULWord64Sequence & inData)
101 {
102  inOutStream << DEC(inData.size()) << " ULWord64s: ";
103  for (ULWord64SequenceConstIter iter(inData.begin()); iter != inData.end(); )
104  {
105  inOutStream << HEX0N(*iter,16);
106  if (++iter != inData.end())
107  inOutStream << " ";
108  }
109  return inOutStream;
110 }
111 
112 
114 {
115  Clear ();
116 }
117 
118 
120 {
121  mCRCTallyA = 0;
122  mCRCTallyB = 0;
123  mUnlockTally = 0;
124  mFrameRefClockCount = 0;
125  mGlobalClockCount = 0;
126  mFrameTRSError = false;
127  mLocked = false;
128  mVPIDValidA = false;
129  mVPIDValidB = false;
130 }
131 
132 
133 ostream & NTV2SDIInputStatus::Print (ostream & inOutStream) const
134 {
135  inOutStream << "[CRCA=" << DEC(mCRCTallyA)
136  << " CRCB=" << DEC(mCRCTallyB)
137  << " unlk=" << xHEX0N(mUnlockTally,8)
138  << " frmRefClkCnt=" << xHEX0N(mFrameRefClockCount,16)
139  << " globalClkCnt=" << xHEX0N(mGlobalClockCount,16)
140  << " frmTRS=" << YesNo(mFrameTRSError)
141  << " locked=" << YesNo(mLocked)
142  << " VPIDA=" << YesNo(mVPIDValidA)
143  << " VPIDB=" << YesNo(mVPIDValidB)
144  << "]";
145  return inOutStream;
146 }
147 
148 
150 {
151  mEnabled = false;
152  mPixel420 = false;
153  mColorSpace = NTV2_INVALID_HDMI_COLORSPACE;
154  mRGBRange = NTV2_INVALID_HDMI_RANGE;
155  mProtocol = NTV2_INVALID_HDMI_PROTOCOL;
156  mVideoStandard = NTV2_STANDARD_INVALID;
157  mVideoRate = NTV2_FRAMERATE_UNKNOWN;
158  mVideoBitDepth = NTV2_INVALID_HDMIBitDepth;
159  mAudioFormat = NTV2_AUDIO_FORMAT_INVALID;
160  mAudioRate = NTV2_AUDIO_RATE_INVALID;
161  mAudioChannels = NTV2_INVALID_HDMI_AUDIO_CHANNELS;
162 }
163 
165 {
166  Clear();
168  if (mVideoRate == NTV2_FRAMERATE_UNKNOWN)
169  return true; // Not enabled -- success
170  mEnabled = true;
171  mPixel420 = ((inData & kVRegMaskHDMOutPixel420) >> kVRegShiftHDMOutPixel420) == 1;
176  mVideoBitDepth = NTV2HDMIBitDepth((inData & kVRegMaskHDMOutBitDepth) >> kVRegShiftHDMOutBitDepth);
180  return true;
181 }
182 
183 ostream & NTV2HDMIOutputStatus::Print (ostream & inOutStream) const
184 {
185  inOutStream << "Enabled: " << YesNo(mEnabled);
186  if (mEnabled)
187  inOutStream << endl
188  << "Is 4:2:0: " << YesNo(mPixel420) << endl
189  << "Color Space: " << ::NTV2HDMIColorSpaceToString(mColorSpace,true) << endl;
190  if (mColorSpace == NTV2_HDMIColorSpaceRGB)
191  inOutStream << "RGB Range: " << ::NTV2HDMIRangeToString(mRGBRange,true) << endl;
192  inOutStream << "Protocol: " << ::NTV2HDMIProtocolToString(mProtocol,true) << endl
193  << "Video Standard: " << ::NTV2StandardToString(mVideoStandard,true) << endl
194  << "Frame Rate: " << ::NTV2FrameRateToString(mVideoRate,true) << endl
195  << "Bit Depth: " << ::NTV2HDMIBitDepthToString(mVideoBitDepth,true) << endl
196  << "Audio Format: " << ::NTV2AudioFormatToString(mAudioFormat,true) << endl
197  << "Audio Rate: " << ::NTV2AudioRateToString(mAudioRate,true) << endl
198  << "Audio Channels: " << ::NTV2HDMIAudioChannelsToString(mAudioChannels,true);
199  return inOutStream;
200 }
201 
202 
204  : mode (AUTOCIRCVIDPROCMODE_MIX),
205  foregroundVideoCrosspoint (NTV2CROSSPOINT_CHANNEL1),
206  backgroundVideoCrosspoint (NTV2CROSSPOINT_CHANNEL1),
207  foregroundKeyCrosspoint (NTV2CROSSPOINT_CHANNEL1),
208  backgroundKeyCrosspoint (NTV2CROSSPOINT_CHANNEL1),
209  transitionCoefficient (0),
210  transitionSoftness (0)
211 {
212 }
213 
214 
216  : eCommand (inCommand),
217  channelSpec (inCrosspoint),
218  lVal1 (0),
219  lVal2 (0),
220  lVal3 (0),
221  lVal4 (0),
222  lVal5 (0),
223  lVal6 (0),
224  bVal1 (false),
225  bVal2 (false),
226  bVal3 (false),
227  bVal4 (false),
228  bVal5 (false),
229  bVal6 (false),
230  bVal7 (false),
231  bVal8 (false),
232  pvVal1 (AJA_NULL),
233  pvVal2 (AJA_NULL),
234  pvVal3 (AJA_NULL),
235  pvVal4 (AJA_NULL)
236 {
237 }
238 
239 ostream & AUTOCIRCULATE_DATA::Print (ostream & oss) const
240 {
241  static const string sCmds [] = {"ACInit","ACStart","ACStop","ACPause","GetAC","ACFrmStmp",
242  "ACFlush","ACPreRoll","ACXfer","ACAbort","ACStartAt",
243  "ACXfer1","ACXfer2","ACFrmStmp2","ACTask","ACSetActFrm"};
244  if (size_t(eCommand) < sizeof(sCmds))
245  { oss << sCmds[eCommand];
246  switch (eCommand)
247  {
248  case eInitAutoCirc:
249  oss << " " << ::NTV2CrosspointToString(channelSpec);
250  oss << " frms " << DEC(lVal1) << "-" << DEC(lVal2);
251  if (lVal4 > 1) oss << " +" << DEC(lVal4) << " chls";
252  if (lVal6 & AUTOCIRCULATE_WITH_FIELDS) oss << " +FieldMode";
253  if (lVal6 & AUTOCIRCULATE_WITH_HDMIAUX) oss << " +HDMIAux";
254  if (bVal2) oss << " +RP188";
255  if (bVal3) oss << " +FBFChg";
256  if (bVal4) oss << " +FBOChg";
257  if (bVal5) oss << " +ColCorr";
258  if (bVal6) oss << " +VidProc";
259  if (bVal7) oss << " +Anc";
260  if (bVal8) oss << " +LTC";
261  oss << " " << ::NTV2AudioSystemToString(NTV2AudioSystem(lVal3 & 0xF), true);
262  if (!bVal1 && ((lVal3 & 0xF) == NTV2_MAX_NUM_AudioSystemEnums)) oss << " +AudCtrl";
263  if (lVal3 & NTV2_AUDIOSYSTEM_Plus1) oss << " +MLAud1";
264  if (lVal3 & NTV2_AUDIOSYSTEM_Plus2) oss << " +MLAud2";
265  if (lVal3 & NTV2_AUDIOSYSTEM_Plus3) oss << " +MLAud3";
266  break;
267  case eStartAutoCirc:
268  break;
270  if (lVal1 || lVal2)
271  oss << " at " << xHEX0N((uint64_t(lVal1) << 32) | uint64_t(lVal2),16);
272  break;
273  case eStopAutoCirc:
274  oss << " " << ::NTV2CrosspointToString(channelSpec);
275  break;
276  case eAbortAutoCirc:
277  oss << " " << ::NTV2CrosspointToString(channelSpec);
278  break;
279  case ePauseAutoCirc:
280  oss << " " << ::NTV2CrosspointToString(channelSpec);
281  if (!bVal1 && lVal6) oss << " at frame " << DEC(lVal6);
282  if (bVal1) oss << " +resume";
283  if (bVal1 && bVal2) oss << " +clearDropCount";
284  break;
285  case eFlushAutoCirculate:
286  oss << " " << ::NTV2CrosspointToString(channelSpec);
287  if (bVal1) oss << " +clearDropCount";
288  break;
290  oss << " " << ::NTV2CrosspointToString(channelSpec) << " " << DEC(ULWord(lVal1)) << " frame(s)";
291  break;
292  case eGetAutoCirc:
293  oss << " " << ::NTV2CrosspointToString(channelSpec);
294  break;
295  case eSetActiveFrame:
296  case eGetFrameStamp:
297  oss << " " << ::NTV2CrosspointToString(channelSpec) << " frm " << DEC(ULWord(lVal1));
298  break;
299  default:
300  break;
301  }
302  }
303  return oss;
304 }
305 
306 
307 NTV2_HEADER::NTV2_HEADER (const ULWord inStructureType, const ULWord inStructSizeInBytes)
308  : fHeaderTag (NTV2_HEADER_TAG),
309  fType (inStructureType),
310  fHeaderVersion (NTV2_CURRENT_HEADER_VERSION),
311  fVersion (AUTOCIRCULATE_STRUCT_VERSION),
312  fSizeInBytes (inStructSizeInBytes),
313  fPointerSize (sizeof(int*)),
314  fOperation (0),
315  fResultStatus (0)
316 {
317 }
318 
319 
320 ostream & operator << (ostream & inOutStream, const NTV2_HEADER & inObj)
321 {
322  return inObj.Print (inOutStream);
323 }
324 
325 
326 ostream & NTV2_HEADER::Print (ostream & inOutStream) const
327 {
328  inOutStream << "[";
329  if (NTV2_IS_VALID_HEADER_TAG (fHeaderTag))
330  inOutStream << NTV2_4CC_AS_STRING (fHeaderTag);
331  else
332  inOutStream << "BAD-" << HEX0N(fHeaderTag,8);
333  if (NTV2_IS_VALID_STRUCT_TYPE (fType))
334  inOutStream << NTV2_4CC_AS_STRING (fType);
335  else
336  inOutStream << "|BAD-" << HEX0N(fType,8);
337  inOutStream << " v" << fHeaderVersion << " vers=" << fVersion << " sz=" << fSizeInBytes;
338  return inOutStream << "]";
339 }
340 
342 {
343  const char * pU32 (reinterpret_cast<const char *>(&in4CC));
344  ostringstream result;
345  size_t badTally(0);
346  result << "'";
347  for (size_t charPos(0); charPos < 4; charPos++)
348  {
349  #if AJATargetBigEndian
350  const char ch(pU32[charPos]);
351  #else // little-endian:
352  const char ch(pU32[3-charPos]);
353  #endif
354  if (ch < ' ' || ch > 126)
355  {result << '.'; badTally++;} // not printable
356  else
357  result << ch;
358  }
359  result << "'";
360  if (badTally)
361  result << " (" << xHEX0N(in4CC,8) << ")";
362  return result.str();
363 }
364 
365 
366 ostream & operator << (ostream & inOutStream, const NTV2_TRAILER & inObj)
367 {
368  inOutStream << "[";
370  inOutStream << NTV2_4CC_AS_STRING(inObj.fTrailerTag);
371  else
372  inOutStream << "BAD-" << HEX0N(inObj.fTrailerTag,8);
373  return inOutStream << " rawVers=" << xHEX0N(inObj.fTrailerVersion,8) << " clientSDK="
377  << "." << DEC(NTV2SDKVersionDecode_Build(inObj.fTrailerVersion)) << "]";
378 }
379 
380 
381 ostream & operator << (ostream & inOutStream, const NTV2Buffer & inObj)
382 {
383  return inObj.Print (inOutStream);
384 }
385 
386 
387 ostream & NTV2Buffer::Print (ostream & inOutStream) const
388 {
389  inOutStream << (IsAllocatedBySDK() ? "0X" : "0x") << HEX0N(GetRawHostPointer(),16) << "/" << DEC(GetByteCount());
390  return inOutStream;
391 }
392 
393 
394 string NTV2Buffer::AsString (UWord inDumpMaxBytes) const
395 {
396  ostringstream oss;
397  oss << xHEX0N(GetRawHostPointer(),16) << ":" << DEC(GetByteCount()) << " bytes";
398  if (inDumpMaxBytes && GetHostPointer())
399  {
400  oss << ":";
401  if (inDumpMaxBytes > 256)
402  inDumpMaxBytes = 256;
403  if (ULWord(inDumpMaxBytes) > GetByteCount())
404  inDumpMaxBytes = UWord(GetByteCount());
405  const UByte * pBytes (reinterpret_cast<const UByte *>(GetHostPointer()));
406  for (UWord ndx(0); ndx < inDumpMaxBytes; ndx++)
407  oss << HEX0N(uint16_t(pBytes[ndx]),2);
408  }
409  return oss.str();
410 }
411 
412 bool NTV2Buffer::toHexString (std::string & outStr, const size_t inLineBreakInterval) const
413 {
414  outStr.clear();
415  ostringstream oss;
416  if (GetHostPointer() && GetByteCount())
417  for (int ndx(0); ndx < int(GetByteCount()); )
418  {
419  oss << HEX0N(uint16_t(U8(ndx++)),2);
420  if (inLineBreakInterval && ndx < int(GetByteCount()) && ((size_t(ndx) % inLineBreakInterval) == 0))
421  oss << endl;
422  }
423  outStr = oss.str();
424  return !outStr.empty();
425 }
426 
427 static string print_address_offset (const size_t inRadix, const ULWord64 inOffset)
428 {
429  const streamsize maxAddrWidth (sizeof(ULWord64) * 2);
430  ostringstream oss;
431  if (inRadix == 8)
432  oss << OCT0N(inOffset,maxAddrWidth) << ": ";
433  else if (inRadix == 10)
434  oss << DEC0N(inOffset,maxAddrWidth) << ": ";
435  else
436  oss << xHEX0N(inOffset,maxAddrWidth) << ": ";
437  return oss.str();
438 }
439 
440 ostream & NTV2Buffer::Dump (ostream & inOStream,
441  const size_t inStartOffset,
442  const size_t inByteCount,
443  const size_t inRadix,
444  const size_t inBytesPerGroup,
445  const size_t inGroupsPerRow,
446  const size_t inAddressRadix,
447  const bool inShowAscii,
448  const size_t inAddrOffset) const
449 {
450  if (IsNULL())
451  return inOStream;
452  if (inRadix != 8 && inRadix != 10 && inRadix != 16 && inRadix != 2)
453  return inOStream;
454  if (inAddressRadix != 0 && inAddressRadix != 8 && inAddressRadix != 10 && inAddressRadix != 16)
455  return inOStream;
456  if (inBytesPerGroup == 0) // || inGroupsPerRow == 0)
457  return inOStream;
458 
459  {
460  const void * pInStartAddress (GetHostAddress(ULWord(inStartOffset)));
461  size_t bytesRemaining (inByteCount ? inByteCount : GetByteCount());
462  size_t bytesInThisGroup (0);
463  size_t groupsInThisRow (0);
464  const unsigned maxByteWidth (inRadix == 8 ? 4 : (inRadix == 10 ? 3 : (inRadix == 2 ? 8 : 2)));
465  const UByte * pBuffer (reinterpret_cast <const UByte *> (pInStartAddress));
466  const size_t asciiBufferSize (inShowAscii && inGroupsPerRow ? (inBytesPerGroup * inGroupsPerRow + 1) * sizeof (UByte) : 0); // Size in bytes, not chars
467  UByte * pAsciiBuffer (asciiBufferSize ? new UByte[asciiBufferSize / sizeof(UByte)] : AJA_NULL);
468 
469  if (!pInStartAddress)
470  return inOStream;
471 
472  if (pAsciiBuffer)
473  ::memset (pAsciiBuffer, 0, asciiBufferSize);
474 
475  if (inGroupsPerRow && inAddressRadix)
476  inOStream << print_address_offset (inAddressRadix, ULWord64(pBuffer) - ULWord64(pInStartAddress) + ULWord64(inAddrOffset));
477  while (bytesRemaining)
478  {
479  if (inRadix == 2)
480  inOStream << BIN08(*pBuffer);
481  else if (inRadix == 8)
482  inOStream << oOCT(uint16_t(*pBuffer));
483  else if (inRadix == 10)
484  inOStream << DEC0N(uint16_t(*pBuffer),maxByteWidth);
485  else if (inRadix == 16)
486  inOStream << HEX0N(uint16_t(*pBuffer),2);
487 
488  if (pAsciiBuffer)
489  pAsciiBuffer[groupsInThisRow * inBytesPerGroup + bytesInThisGroup] = isprint(*pBuffer) ? *pBuffer : '.';
490  pBuffer++;
491  bytesRemaining--;
492 
493  bytesInThisGroup++;
494  if (bytesInThisGroup >= inBytesPerGroup)
495  {
496  groupsInThisRow++;
497  if (inGroupsPerRow && groupsInThisRow >= inGroupsPerRow)
498  {
499  if (pAsciiBuffer)
500  {
501  inOStream << " " << pAsciiBuffer;
502  ::memset (pAsciiBuffer, 0, asciiBufferSize);
503  }
504  inOStream << endl;
505  if (inAddressRadix && bytesRemaining)
506  inOStream << print_address_offset (inAddressRadix, reinterpret_cast <ULWord64> (pBuffer) - reinterpret_cast <ULWord64> (pInStartAddress) + ULWord64 (inAddrOffset));
507  groupsInThisRow = 0;
508  } // if time for new row
509  else
510  inOStream << " ";
511  bytesInThisGroup = 0;
512  } // if time for new group
513  } // loop til no bytes remaining
514 
515  if (bytesInThisGroup && bytesInThisGroup < inBytesPerGroup && pAsciiBuffer)
516  {
517  groupsInThisRow++;
518  inOStream << string ((inBytesPerGroup - bytesInThisGroup) * maxByteWidth + 1, ' ');
519  }
520 
521  if (groupsInThisRow)
522  {
523  if (groupsInThisRow < inGroupsPerRow && pAsciiBuffer)
524  inOStream << string (((inGroupsPerRow - groupsInThisRow) * inBytesPerGroup * maxByteWidth + (inGroupsPerRow - groupsInThisRow)), ' ');
525  if (pAsciiBuffer)
526  inOStream << pAsciiBuffer;
527  inOStream << endl;
528  }
529  else if (bytesInThisGroup && bytesInThisGroup < inBytesPerGroup)
530  inOStream << endl;
531 
532  if (pAsciiBuffer)
533  delete [] pAsciiBuffer;
534  } // else radix is 16, 10, 8 or 2
535 
536  return inOStream;
537 } // Dump
538 
539 string & NTV2Buffer::Dump ( string & inOutputString,
540  const size_t inStartOffset,
541  const size_t inByteCount,
542  const size_t inRadix,
543  const size_t inBytesPerGroup,
544  const size_t inGroupsPerRow,
545  const size_t inAddressRadix,
546  const bool inShowAscii,
547  const size_t inAddrOffset) const
548 {
549  ostringstream oss;
550  Dump (oss, inStartOffset, inByteCount, inRadix, inBytesPerGroup, inGroupsPerRow, inAddressRadix, inShowAscii, inAddrOffset);
551  inOutputString = oss.str();
552  return inOutputString;
553 }
554 
555 NTV2Buffer & NTV2Buffer::Segment (NTV2Buffer & outPtr, const ULWord inByteOffset, const ULWord inByteCount) const
556 {
557  outPtr.Set(AJA_NULL, 0); // Make invalid
558  if (inByteOffset >= GetByteCount())
559  return outPtr; // Offset past end
560  if (inByteOffset+inByteCount > GetByteCount())
561  return outPtr; // Segment too long
562  outPtr.Set(GetHostAddress(inByteOffset), inByteCount);
563  return outPtr;
564 }
565 
566 
567 bool NTV2Buffer::GetU64s (ULWord64Sequence & outUint64s, const size_t inU64Offset, const size_t inMaxSize, const bool inByteSwap) const
568 {
569  outUint64s.clear();
570  if (IsNULL())
571  return false;
572 
573  size_t maxSize (size_t(GetByteCount()) / sizeof(uint64_t));
574  if (maxSize < inU64Offset)
575  return false; // Past end
576  maxSize -= inU64Offset; // Remove starting offset
577 
578  const uint64_t * pU64 (reinterpret_cast <const uint64_t *> (GetHostAddress(ULWord(inU64Offset * sizeof(uint64_t)))));
579  if (!pU64)
580  return false; // Past end
581 
582  if (inMaxSize && inMaxSize < maxSize)
583  maxSize = inMaxSize;
584 
585  try
586  {
587  outUint64s.reserve(maxSize);
588  for (size_t ndx(0); ndx < maxSize; ndx++)
589  {
590  const uint64_t u64 (*pU64++);
591  outUint64s.push_back(inByteSwap ? NTV2EndianSwap64(u64) : u64);
592  }
593  }
594  catch (...)
595  {
596  outUint64s.clear();
597  outUint64s.reserve(0);
598  return false;
599  }
600  return true;
601 }
602 
603 
604 bool NTV2Buffer::GetU32s (ULWordSequence & outUint32s, const size_t inU32Offset, const size_t inMaxSize, const bool inByteSwap) const
605 {
606  outUint32s.clear();
607  if (IsNULL())
608  return false;
609 
610  size_t maxNumU32s (size_t(GetByteCount()) / sizeof(uint32_t));
611  if (maxNumU32s < inU32Offset)
612  return false; // Past end
613  maxNumU32s -= inU32Offset; // Remove starting offset
614 
615  const uint32_t * pU32 (reinterpret_cast<const uint32_t*>(GetHostAddress(ULWord(inU32Offset * sizeof(uint32_t)))));
616  if (!pU32)
617  return false; // Past end
618 
619  if (inMaxSize && inMaxSize < maxNumU32s)
620  maxNumU32s = inMaxSize;
621 
622  try
623  {
624  outUint32s.reserve(maxNumU32s);
625  for (size_t ndx(0); ndx < maxNumU32s; ndx++)
626  {
627  const uint32_t u32 (*pU32++);
628  outUint32s.push_back(inByteSwap ? NTV2EndianSwap32(u32) : u32);
629  }
630  }
631  catch (...)
632  {
633  outUint32s.clear();
634  outUint32s.reserve(0);
635  return false;
636  }
637  return true;
638 }
639 
640 
641 bool NTV2Buffer::GetU16s (UWordSequence & outUint16s, const size_t inU16Offset, const size_t inMaxSize, const bool inByteSwap) const
642 {
643  outUint16s.clear();
644  if (IsNULL())
645  return false;
646 
647  size_t maxSize (size_t(GetByteCount()) / sizeof(uint16_t));
648  if (maxSize < inU16Offset)
649  return false; // Past end
650  maxSize -= inU16Offset; // Remove starting offset
651 
652  const uint16_t * pU16 (reinterpret_cast <const uint16_t *> (GetHostAddress(ULWord(inU16Offset * sizeof(uint16_t)))));
653  if (!pU16)
654  return false; // Past end
655 
656  if (inMaxSize && inMaxSize < maxSize)
657  maxSize = inMaxSize;
658 
659  try
660  {
661  outUint16s.reserve(maxSize);
662  for (size_t ndx(0); ndx < maxSize; ndx++)
663  {
664  const uint16_t u16 (*pU16++);
665  outUint16s.push_back(inByteSwap ? NTV2EndianSwap16(u16) : u16);
666  }
667  }
668  catch (...)
669  {
670  outUint16s.clear();
671  outUint16s.reserve(0);
672  return false;
673  }
674  return true;
675 }
676 
677 
678 bool NTV2Buffer::GetU8s (UByteSequence & outUint8s, const size_t inU8Offset, const size_t inMaxSize) const
679 {
680  outUint8s.clear();
681  if (IsNULL())
682  return false;
683 
684  size_t maxSize (GetByteCount());
685  if (maxSize < inU8Offset)
686  return false; // Past end
687  maxSize -= inU8Offset; // Remove starting offset
688 
689  const uint8_t * pU8 (reinterpret_cast <const uint8_t *> (GetHostAddress(ULWord(inU8Offset))));
690  if (!pU8)
691  return false; // Past end
692 
693  if (inMaxSize && inMaxSize < maxSize)
694  maxSize = inMaxSize;
695 
696  try
697  {
698  outUint8s.reserve(maxSize);
699  for (size_t ndx(0); ndx < maxSize; ndx++)
700  outUint8s.push_back(*pU8++);
701  }
702  catch (...)
703  {
704  outUint8s.clear();
705  outUint8s.reserve(0);
706  return false;
707  }
708  return true;
709 }
710 
712 {
713  const uint8_t * pU8 (reinterpret_cast<const uint8_t*> (GetHostPointer()));
714  if (!pU8)
715  return false; // Past end
716  const size_t maxSize (GetByteCount());
717  try
718  {
719  for (size_t ndx(0); ndx < maxSize; ndx++)
720  outU8s.push_back(*pU8++);
721  }
722  catch (...)
723  {
724  return false;
725  }
726  return true;
727 }
728 
729 
730 bool NTV2Buffer::GetString (std::string & outString, const size_t inU8Offset, const size_t inMaxSize) const
731 {
732  outString.clear();
733  if (IsNULL())
734  return false;
735 
736  size_t maxSize(GetByteCount());
737  if (maxSize < inU8Offset)
738  return false; // Past end
739  maxSize -= inU8Offset; // Remove starting offset
740 
741  const uint8_t * pU8 (reinterpret_cast <const uint8_t *> (GetHostAddress(ULWord(inU8Offset))));
742  if (!pU8)
743  return false; // Past end
744 
745  if (inMaxSize && inMaxSize < maxSize)
746  maxSize = inMaxSize;
747 
748  try
749  {
750  outString.reserve(maxSize);
751  for (size_t ndx(0); ndx < maxSize; ndx++)
752  {
753  const char c = *pU8++;
754  if (c)
755  outString += c;
756  else
757  break;
758  }
759  }
760  catch (...)
761  {
762  outString.clear();
763  outString.reserve(0);
764  return false;
765  }
766  return true;
767 }
768 
769 
770 bool NTV2Buffer::PutU64s (const ULWord64Sequence & inU64s, const size_t inU64Offset, const bool inByteSwap)
771 {
772  if (IsNULL())
773  return false; // No buffer or space
774  if (inU64s.empty())
775  return true; // Nothing to copy
776 
777  size_t maxU64s (GetByteCount() / sizeof(uint64_t));
778  uint64_t * pU64 (reinterpret_cast<uint64_t*>(GetHostAddress(ULWord(inU64Offset * sizeof(uint64_t)))));
779  if (!pU64)
780  return false; // Start offset is past end
781  if (maxU64s > inU64Offset)
782  maxU64s -= inU64Offset; // Don't go past end
783  if (maxU64s > inU64s.size())
784  maxU64s = inU64s.size(); // Truncate incoming vector to not go past my end
785  if (inU64s.size() > maxU64s)
786  return false; // Will write past end
787 
788  for (unsigned ndx(0); ndx < maxU64s; ndx++)
789 #if defined(_DEBUG)
790  *pU64++ = inByteSwap ? NTV2EndianSwap64(inU64s.at(ndx)) : inU64s.at(ndx);
791 #else
792  *pU64++ = inByteSwap ? NTV2EndianSwap64(inU64s[ndx]) : inU64s[ndx];
793 #endif
794  return true;
795 }
796 
797 
798 bool NTV2Buffer::PutU32s (const ULWordSequence & inU32s, const size_t inU32Offset, const bool inByteSwap)
799 {
800  if (IsNULL())
801  return false; // No buffer or space
802  if (inU32s.empty())
803  return true; // Nothing to copy
804 
805  size_t maxU32s (GetByteCount() / sizeof(uint32_t));
806  uint32_t * pU32 (reinterpret_cast<uint32_t*>(GetHostAddress(ULWord(inU32Offset * sizeof(uint32_t)))));
807  if (!pU32)
808  return false; // Start offset is past end
809  if (maxU32s > inU32Offset)
810  maxU32s -= inU32Offset; // Don't go past end
811  if (maxU32s > inU32s.size())
812  maxU32s = inU32s.size(); // Truncate incoming vector to not go past my end
813  if (inU32s.size() > maxU32s)
814  return false; // Will write past end
815 
816  for (unsigned ndx(0); ndx < maxU32s; ndx++)
817 #if defined(_DEBUG)
818  *pU32++ = inByteSwap ? NTV2EndianSwap32(inU32s.at(ndx)) : inU32s.at(ndx);
819 #else
820  *pU32++ = inByteSwap ? NTV2EndianSwap32(inU32s[ndx]) : inU32s[ndx];
821 #endif
822  return true;
823 }
824 
825 
826 bool NTV2Buffer::PutU16s (const UWordSequence & inU16s, const size_t inU16Offset, const bool inByteSwap)
827 {
828  if (IsNULL())
829  return false; // No buffer or space
830  if (inU16s.empty())
831  return true; // Nothing to copy
832 
833  size_t maxU16s (GetByteCount() / sizeof(uint16_t));
834  uint16_t * pU16 (reinterpret_cast<uint16_t*>(GetHostAddress(ULWord(inU16Offset * sizeof(uint16_t)))));
835  if (!pU16)
836  return false; // Start offset is past end
837  if (maxU16s > inU16Offset)
838  maxU16s -= inU16Offset; // Don't go past end
839  if (maxU16s > inU16s.size())
840  maxU16s = inU16s.size(); // Truncate incoming vector to not go past my end
841  if (inU16s.size() > maxU16s)
842  return false; // Will write past end
843 
844  for (unsigned ndx(0); ndx < maxU16s; ndx++)
845 #if defined(_DEBUG)
846  *pU16++ = inByteSwap ? NTV2EndianSwap16(inU16s.at(ndx)) : inU16s.at(ndx);
847 #else
848  *pU16++ = inByteSwap ? NTV2EndianSwap16(inU16s[ndx]) : inU16s[ndx];
849 #endif
850  return true;
851 }
852 
853 
854 bool NTV2Buffer::PutU8s (const UByteSequence & inU8s, const size_t inU8Offset)
855 {
856  if (IsNULL())
857  return false; // No buffer or space
858  if (inU8s.empty())
859  return true; // Nothing to copy
860 
861  size_t maxU8s (GetByteCount());
862  uint8_t * pU8 (reinterpret_cast<uint8_t*>(GetHostAddress(ULWord(inU8Offset))));
863  if (!pU8)
864  return false; // Start offset is past end
865  if (maxU8s > inU8Offset)
866  maxU8s -= inU8Offset; // Don't go past end
867  if (maxU8s > inU8s.size())
868  maxU8s = inU8s.size(); // Truncate incoming vector to not go past end
869  if (inU8s.size() > maxU8s)
870  return false; // Will write past end
871 #if 1
872  ::memcpy(pU8, &inU8s[0], maxU8s);
873 #else
874  for (unsigned ndx(0); ndx < maxU8s; ndx++)
875  #if defined(_DEBUG)
876  *pU8++ = inU8s.at(ndx);
877  #else
878  *pU8++ = inU8s[ndx];
879  #endif
880 #endif
881  return true;
882 }
883 
884 
885 ostream & operator << (ostream & inOutStream, const NTV2_RP188 & inObj)
886 {
887  if (inObj.IsValid ())
888  return inOutStream << "{Dx" << HEX0N(inObj.fDBB,8) << "|Lx" << HEX0N(inObj.fLo,8) << "|Hx" << HEX0N(inObj.fHi,8) << "}";
889  else
890  return inOutStream << "{invalid}";
891 }
892 
893 
895 {
896  inOutList.push_back (inRP188);
897  return inOutList;
898 }
899 
900 
901 ostream & operator << (ostream & inOutStream, const NTV2TimeCodeList & inObj)
902 {
903  inOutStream << inObj.size () << ":[";
904  for (NTV2TimeCodeListConstIter iter (inObj.begin ()); iter != inObj.end (); )
905  {
906  inOutStream << *iter;
907  if (++iter != inObj.end ())
908  inOutStream << ", ";
909  }
910  return inOutStream << "]";
911 }
912 
913 
914 ostream & operator << (std::ostream & inOutStream, const NTV2TimeCodes & inObj)
915 {
916  inOutStream << inObj.size () << ":[";
917  for (NTV2TimeCodesConstIter iter (inObj.begin ()); iter != inObj.end (); )
918  {
919  inOutStream << ::NTV2TCIndexToString (iter->first,true) << "=" << iter->second;
920  if (++iter != inObj.end ())
921  inOutStream << ", ";
922  }
923  return inOutStream << "]";
924 }
925 
926 
927 ostream & operator << (std::ostream & inOutStream, const NTV2TCIndexes & inObj)
928 {
929  for (NTV2TCIndexesConstIter iter (inObj.begin ()); iter != inObj.end (); )
930  {
931  inOutStream << ::NTV2TCIndexToString (*iter);
932  if (++iter != inObj.end ())
933  inOutStream << ", ";
934  }
935  return inOutStream;
936 }
937 
938 
940 {
941  for (NTV2TCIndexesConstIter iter (inSet.begin ()); iter != inSet.end (); ++iter)
942  inOutSet.insert (*iter);
943  return inOutSet;
944 }
945 
946 
947 ostream & operator << (ostream & inOutStream, const FRAME_STAMP & inObj)
948 {
949  return inOutStream << inObj.acHeader
950  << " frmTime=" << inObj.acFrameTime
951  << " reqFrm=" << inObj.acRequestedFrame
952  << " audClkTS=" << inObj.acAudioClockTimeStamp
953  << " audExpAdr=" << hex << inObj.acAudioExpectedAddress << dec
954  << " audInStrtAdr=" << hex << inObj.acAudioInStartAddress << dec
955  << " audInStopAdr=" << hex << inObj.acAudioInStopAddress << dec
956  << " audOutStrtAdr=" << hex << inObj.acAudioOutStartAddress << dec
957  << " audOutStopAdr=" << hex << inObj.acAudioOutStopAddress << dec
958  << " totBytes=" << inObj.acTotalBytesTransferred
959  << " strtSamp=" << inObj.acStartSample
960  << " curTime=" << inObj.acCurrentTime
961  << " curFrm=" << inObj.acCurrentFrame
962  << " curFrmTime=" << inObj.acCurrentFrameTime
963  << " audClkCurTime=" << inObj.acAudioClockCurrentTime
964  << " curAudExpAdr=" << hex << inObj.acCurrentAudioExpectedAddress << dec
965  << " curAudStrtAdr=" << hex << inObj.acCurrentAudioStartAddress << dec
966  << " curFldCnt=" << inObj.acCurrentFieldCount
967  << " curLnCnt=" << inObj.acCurrentLineCount
968  << " curReps=" << inObj.acCurrentReps
969  << " curUsrCookie=" << hex << inObj.acCurrentUserCookie << dec
970  << " acFrame=" << inObj.acFrame
971  << " acRP188=" << inObj.acRP188 // deprecated
972  << " " << inObj.acTrailer;
973 }
974 
975 
976 ostream & operator << (ostream & inOutStream, const NTV2SegmentedDMAInfo & inObj)
977 {
978  if (inObj.acNumSegments > 1)
979  inOutStream << "segs=" << inObj.acNumSegments << " numActBPR=" << inObj.acNumActiveBytesPerRow
980  << " segHostPitc=" << inObj.acSegmentHostPitch << " segDevPitc=" << inObj.acSegmentDevicePitch;
981  else
982  inOutStream << "n/a";
983  return inOutStream;
984 }
985 
986 
987 ostream & operator << (ostream & inOutStream, const AUTOCIRCULATE_TRANSFER & inObj)
988 {
989  #if defined (_DEBUG)
990  NTV2_ASSERT (inObj.NTV2_IS_STRUCT_VALID ());
991  #endif
992  string str (::NTV2FrameBufferFormatToString (inObj.acFrameBufferFormat, true));
993  while (str.find (' ') != string::npos)
994  str.erase (str.find (' '), 1);
995  inOutStream << inObj.acHeader << " vid=" << inObj.acVideoBuffer
996  << " aud=" << inObj.acAudioBuffer
997  << " ancF1=" << inObj.acANCBuffer
998  << " ancF2=" << inObj.acANCField2Buffer
999  << " outTC(" << inObj.acOutputTimeCodes << ")"
1000  << " cookie=" << inObj.acInUserCookie
1001  << " vidDMAoff=" << inObj.acInVideoDMAOffset
1002  << " segDMA=" << inObj.acInSegmentedDMAInfo
1003  << " colcor=" << inObj.acColorCorrection
1004  << " fbf=" << str
1005  << " fbo=" << (inObj.acFrameBufferOrientation == NTV2_FRAMEBUFFER_ORIENTATION_BOTTOMUP ? "flip" : "norm")
1006  << " vidProc=" << inObj.acVidProcInfo
1007  << " quartsz=" << inObj.acVideoQuarterSizeExpand
1008  << " p2p=" << inObj.acPeerToPeerFlags
1009  << " repCnt=" << inObj.acFrameRepeatCount
1010  << " desFrm=" << inObj.acDesiredFrame
1011  << " rp188=" << inObj.acRP188 // deprecated
1012  << " xpt=" << inObj.acCrosspoint
1013  << " status{" << inObj.acTransferStatus << "}"
1014  << " " << inObj.acTrailer;
1015  return inOutStream;
1016 }
1017 
1018 
1019 ostream & operator << (ostream & inOutStream, const AUTOCIRCULATE_TRANSFER_STATUS & inObj)
1020 {
1021  inOutStream << inObj.acHeader << " state=" << ::NTV2AutoCirculateStateToString (inObj.acState)
1022  << " xferFrm=" << inObj.acTransferFrame
1023  << " bufLvl=" << inObj.acBufferLevel
1024  << " frms=" << inObj.acFramesProcessed
1025  << " drops=" << inObj.acFramesDropped
1026  << " " << inObj.acFrameStamp
1027  << " audXfrSz=" << inObj.acAudioTransferSize
1028  << " audStrtSamp=" << inObj.acAudioStartSample
1029  << " ancF1Siz=" << inObj.acAncTransferSize
1030  << " ancF2Siz=" << inObj.acAncField2TransferSize
1031  << " " << inObj.acTrailer;
1032  return inOutStream;
1033 }
1034 
1035 
1036 ostream & operator << (ostream & inOutStream, const NTV2RegisterValueMap & inObj)
1037 {
1038  NTV2RegValueMapConstIter iter (inObj.begin ());
1039  inOutStream << "RegValues:" << inObj.size () << "[";
1040  while (iter != inObj.end ())
1041  {
1042  const NTV2RegisterNumber registerNumber (static_cast <NTV2RegisterNumber> (iter->first));
1043  const ULWord registerValue (iter->second);
1044  inOutStream << ::NTV2RegisterNumberToString (registerNumber) << "=0x" << hex << registerValue << dec;
1045  if (++iter != inObj.end ())
1046  inOutStream << ",";
1047  }
1048  return inOutStream << "]";
1049 }
1050 
1051 
1052 ostream & operator << (ostream & inOutStream, const AutoCircVidProcInfo & inObj)
1053 {
1054  return inOutStream << "{mode=" << ::AutoCircVidProcModeToString (inObj.mode, true)
1055  << ", FGvid=" << ::NTV2CrosspointToString (inObj.foregroundVideoCrosspoint)
1056  << ", BGvid=" << ::NTV2CrosspointToString (inObj.backgroundVideoCrosspoint)
1057  << ", FGkey=" << ::NTV2CrosspointToString (inObj.foregroundKeyCrosspoint)
1058  << ", BGkey=" << ::NTV2CrosspointToString (inObj.backgroundKeyCrosspoint)
1059  << ", transCoeff=" << inObj.transitionCoefficient
1060  << ", transSoftn=" << inObj.transitionSoftness << "}";
1061 }
1062 
1063 
1064 ostream & operator << (ostream & inOutStream, const NTV2ColorCorrectionData & inObj)
1065 {
1066  return inOutStream << "{ccMode=" << ::NTV2ColorCorrectionModeToString (inObj.ccMode)
1067  << ", ccSatVal=" << inObj.ccSaturationValue
1068  << ", ccTables=" << inObj.ccLookupTables << "}";
1069 }
1070 
1071 
1073 {
1074  for (NTV2VideoFormatSetConstIter iter(inSet.begin()); iter != inSet.end(); ++iter)
1075  if (inOutSet.find(*iter) == inOutSet.end())
1076  inOutSet.insert(*iter);
1077  return inOutSet;
1078 }
1079 
1080 
1081 // Implementation of NTV2VideoFormatSet's ostream writer...
1082 ostream & operator << (ostream & inOStream, const NTV2VideoFormatSet & inFormats)
1083 {
1084  NTV2VideoFormatSet::const_iterator iter (inFormats.begin ());
1085 
1086  inOStream << inFormats.size ()
1087  << (inFormats.size () == 1 ? " video format: " : " video format(s): ");
1088 
1089  while (iter != inFormats.end ())
1090  {
1091  inOStream << std::string (::NTV2VideoFormatToString (*iter));
1092  inOStream << (++iter == inFormats.end () ? "" : ", ");
1093  }
1094 
1095  return inOStream;
1096 
1097 } // operator <<
1098 
1099 
1100 // Implementation of NTV2FrameBufferFormatSet's ostream writer...
1101 ostream & operator << (ostream & inOStream, const NTV2PixelFormats & inFormats)
1102 {
1103  NTV2PixelFormatsConstIter iter(inFormats.begin());
1104  inOStream << inFormats.size()
1105  << (inFormats.size() == 1 ? " pixel format: " : " pixel formats: ");
1106 
1107  while (iter != inFormats.end())
1108  {
1109  inOStream << ::NTV2FrameBufferFormatToString(*iter);
1110  inOStream << (++iter == inFormats.end() ? "" : ", ");
1111  }
1112  return inOStream;
1113 
1114 } // operator <<
1115 
1116 
1118 {
1119  for (NTV2PixelFormatsConstIter iter(inFBFs.begin()); iter != inFBFs.end(); ++iter)
1120  inOutSet.insert(*iter);
1121  return inOutSet;
1122 }
1123 
1124 
1125 // Implementation of NTV2StandardSet's ostream writer...
1126 ostream & operator << (ostream & inOStream, const NTV2StandardSet & inStandards)
1127 {
1128  NTV2StandardSetConstIter iter (inStandards.begin ());
1129 
1130  inOStream << inStandards.size ()
1131  << (inStandards.size () == 1 ? " standard: " : " standards: ");
1132 
1133  while (iter != inStandards.end ())
1134  {
1135  inOStream << ::NTV2StandardToString(*iter);
1136  inOStream << (++iter == inStandards.end () ? "" : ", ");
1137  }
1138 
1139  return inOStream;
1140 }
1141 
1142 
1144 {
1145  for (NTV2StandardSetConstIter iter(inSet.begin ()); iter != inSet.end(); ++iter)
1146  inOutSet.insert(*iter);
1147  return inOutSet;
1148 }
1149 
1150 
1151 // Implementation of NTV2GeometrySet's ostream writer...
1152 ostream & operator << (ostream & inOStream, const NTV2GeometrySet & inGeometries)
1153 {
1154  NTV2GeometrySetConstIter iter (inGeometries.begin ());
1155  inOStream << inGeometries.size ()
1156  << (inGeometries.size () == 1 ? " geometry: " : " geometries: ");
1157  while (iter != inGeometries.end ())
1158  {
1159  inOStream << ::NTV2FrameGeometryToString(*iter);
1160  inOStream << (++iter == inGeometries.end () ? "" : ", ");
1161  }
1162  return inOStream;
1163 }
1164 
1165 
1167 {
1168  for (NTV2GeometrySetConstIter iter(inSet.begin ()); iter != inSet.end(); ++iter)
1169  inOutSet.insert(*iter);
1170  return inOutSet;
1171 }
1172 
1173 
1174 // Implementation of NTV2FrameBufferFormatSet's ostream writer...
1175 ostream & operator << (ostream & inOStream, const NTV2InputSourceSet & inSet)
1176 {
1177  NTV2InputSourceSetConstIter iter(inSet.begin());
1178  inOStream << inSet.size()
1179  << (inSet.size() == 1 ? " input: " : " inputs: ");
1180  while (iter != inSet.end())
1181  {
1182  inOStream << ::NTV2InputSourceToString (*iter);
1183  inOStream << (++iter == inSet.end() ? "" : ", ");
1184  }
1185  return inOStream;
1186 } // operator <<
1187 
1188 
1190 {
1191  for (NTV2InputSourceSetConstIter iter (inSet.begin ()); iter != inSet.end (); ++iter)
1192  inOutSet.insert (*iter);
1193  return inOutSet;
1194 }
1195 
1196 
1197 ostream & operator << (ostream & inOStream, const NTV2OutputDestinations & inSet)
1198 {
1199  NTV2OutputDestinationsConstIter iter(inSet.begin());
1200  inOStream << inSet.size()
1201  << (inSet.size() == 1 ? " output: " : " outputs: ");
1202  while (iter != inSet.end())
1203  {
1204  inOStream << ::NTV2OutputDestinationToString(*iter);
1205  inOStream << (++iter == inSet.end() ? "" : ", ");
1206  }
1207  return inOStream;
1208 }
1209 
1210 
1212 {
1213  for (NTV2OutputDestinationsConstIter iter(inSet.begin()); iter != inSet.end(); ++iter)
1214  inOutSet.insert(*iter);
1215  return inOutSet;
1216 }
1217 
1219 {
1220  outFormats.clear();
1221  const NTV2DeviceIDSet devIDs (::NTV2GetSupportedDevices());
1222  for (NTV2DeviceIDSetConstIter it(devIDs.begin()); it != devIDs.end(); ++it)
1223  {
1224  NTV2PixelFormats fmts;
1226  for (NTV2PixelFormatsConstIter fit(fmts.begin()); fit != fmts.end(); ++fit)
1227  if (outFormats.find(*fit) == outFormats.end())
1228  outFormats.insert(*fit);
1229  }
1230  return true;
1231 }
1232 
1234 {
1235  NTV2PixelFormats usedFormats;
1236  ::NTV2GetSupportedPixelFormats(usedFormats);
1237  for (NTV2PixelFormat pf(NTV2_FBF_FIRST); pf < NTV2_FBF_LAST; pf = NTV2PixelFormat(pf+1))
1238  if (usedFormats.find(pf) == usedFormats.end()) // if unused
1239  outFormats.insert(pf);
1240  return true;
1241 }
1242 
1244 {
1245  outStandards.clear();
1246  const NTV2DeviceIDSet devIDs (::NTV2GetSupportedDevices());
1247  for (NTV2DeviceIDSetConstIter it(devIDs.begin()); it != devIDs.end(); ++it)
1248  {
1249  NTV2StandardSet stds;
1251  for (NTV2StandardSetConstIter sit(stds.begin()); sit != stds.end(); ++sit)
1252  if (outStandards.find(*sit) == outStandards.end())
1253  outStandards.insert(*sit);
1254  }
1255  return true;
1256 }
1257 
1259 {
1260  NTV2StandardSet usedStandards;
1261  ::NTV2GetSupportedStandards(usedStandards);
1263  if (usedStandards.find(st) == usedStandards.end()) // if unused
1264  outStandards.insert(st);
1265  return true;
1266 }
1267 
1268 
1269 // This needs to be moved into a C++ compatible "device features" module:
1271 {
1272  bool isOkay(true);
1273  outFormats.clear();
1274 
1276  {
1277  if (inDeviceID != DEVICE_ID_INVALID && !::NTV2DeviceCanDoVideoFormat(inDeviceID, vf))
1278  continue; // Valid devID specified and VF not supported on that device
1279  if (inDeviceID == DEVICE_ID_INVALID && !NTV2_IS_VALID_VIDEO_FORMAT(vf))
1280  continue; // Invalid devID specified and invalid VF
1281  try
1282  {
1283  outFormats.insert(vf);
1284  }
1285  catch (const std::bad_alloc &)
1286  {
1287  isOkay = false;
1288  outFormats.clear();
1289  break;
1290  }
1291  } // for each video format
1292 
1293  NTV2_ASSERT ((isOkay && !outFormats.empty()) || (!isOkay && outFormats.empty()));
1294  return isOkay;
1295 
1296 } // NTV2DeviceGetSupportedVideoFormats
1297 
1298 // This needs to be moved into a C++ compatible "device features" module:
1300 {
1301  bool isOkay(true);
1302  outFormats.clear();
1303 
1304  for (NTV2PixelFormat pixelFormat(NTV2_FBF_FIRST); pixelFormat < NTV2_FBF_LAST; pixelFormat = NTV2PixelFormat(pixelFormat+1))
1305  if (::NTV2DeviceCanDoFrameBufferFormat (inDeviceID, pixelFormat))
1306  try
1307  {
1308  outFormats.insert(pixelFormat);
1309  }
1310  catch (const std::bad_alloc &)
1311  {
1312  isOkay = false;
1313  outFormats.clear();
1314  break;
1315  }
1316 
1317  NTV2_ASSERT ((isOkay && !outFormats.empty() ) || (!isOkay && outFormats.empty() ));
1318  return isOkay;
1319 
1320 } // NTV2DeviceGetSupportedPixelFormats
1321 
1322 // This needs to be moved into a C++ compatible "device features" module:
1323 bool NTV2DeviceGetSupportedStandards (const NTV2DeviceID inDeviceID, NTV2StandardSet & outStandards)
1324 {
1325  NTV2VideoFormatSet videoFormats;
1326  outStandards.clear();
1327  if (!::NTV2DeviceGetSupportedVideoFormats(inDeviceID, videoFormats))
1328  return false;
1329  for (NTV2VideoFormatSetConstIter it(videoFormats.begin()); it != videoFormats.end(); ++it)
1330  {
1332  if (NTV2_IS_VALID_STANDARD(std) && outStandards.find(std) == outStandards.end())
1333  outStandards.insert(std);
1334  }
1335  return true;
1336 }
1337 
1338 // This needs to be moved into a C++ compatible "device features" module:
1339 bool NTV2DeviceGetSupportedGeometries (const NTV2DeviceID inDeviceID, NTV2GeometrySet & outGeometries)
1340 {
1341  NTV2VideoFormatSet videoFormats;
1342  outGeometries.clear();
1343  if (!::NTV2DeviceGetSupportedVideoFormats(inDeviceID, videoFormats))
1344  return false;
1345  for (NTV2VideoFormatSetConstIter it(videoFormats.begin()); it != videoFormats.end(); ++it)
1346  {
1349  outGeometries += ::GetRelatedGeometries(fg);
1350  }
1351  return true;
1352 }
1353 
1354 bool NTV2DeviceGetSupportedInputSources (const NTV2DeviceID inDeviceID, NTV2InputSourceSet & outInputSources, const NTV2IOKinds inKinds)
1355 {
1356  outInputSources.clear();
1357  if (!NTV2_IS_VALID_IOKINDS(inKinds))
1358  return false;
1360  { const bool ok (inDeviceID == DEVICE_ID_INVALID ? true : ::NTV2DeviceCanDoInputSource(inDeviceID, src));
1361  if (ok)
1362  if ( (NTV2_INPUT_SOURCE_IS_SDI(src) && (inKinds & NTV2_IOKINDS_SDI))
1363  || (NTV2_INPUT_SOURCE_IS_HDMI(src) && (inKinds & NTV2_IOKINDS_HDMI))
1364  || (NTV2_INPUT_SOURCE_IS_ANALOG(src) && (inKinds & NTV2_IOKINDS_ANALOG)) )
1365  outInputSources.insert(src);
1366  }
1367  return true;
1368 }
1369 
1370 bool NTV2DeviceGetSupportedOutputDests (const NTV2DeviceID inDeviceID, NTV2OutputDestinations & outOutputDests, const NTV2IOKinds inKinds)
1371 {
1375  outOutputDests.clear();
1376  if (!NTV2_IS_VALID_IOKINDS(inKinds))
1377  return false;
1378  for (size_t ndx(0); ndx < 10; ndx++)
1379  { const NTV2OutputDest dst(sDsts[ndx]);
1380  const bool ok (inDeviceID == DEVICE_ID_INVALID ? true : ::NTV2DeviceCanDoOutputDestination(inDeviceID, dst));
1381  if (ok)
1382  if ( (NTV2_OUTPUT_DEST_IS_SDI(dst) && (inKinds & NTV2_IOKINDS_SDI))
1383  || (NTV2_OUTPUT_DEST_IS_HDMI(dst) && (inKinds & NTV2_IOKINDS_HDMI))
1384  || (NTV2_OUTPUT_DEST_IS_ANALOG(dst) && (inKinds & NTV2_IOKINDS_ANALOG)) )
1385  outOutputDests.insert(dst);
1386  }
1387  return true;
1388 }
1389 
1390 ostream & operator << (ostream & oss, const NTV2FrameRateSet & inSet)
1391 {
1392  NTV2FrameRateSetConstIter it(inSet.begin());
1393  oss << inSet.size()
1394  << (inSet.size() == 1 ? " rate: " : " rates: ");
1395  while (it != inSet.end())
1396  {
1397  oss << ::NTV2FrameRateToString(*it);
1398  oss << (++it == inSet.end() ? "" : ", ");
1399  }
1400  return oss;
1401 }
1402 
1404 {
1405  for (NTV2FrameRateSetConstIter it(inSet.begin()); it != inSet.end(); ++it)
1406  if (inOutSet.find(*it) == inOutSet.end())
1407  inOutSet.insert(*it);
1408  return inOutSet;
1409 }
1410 
1412 {
1413  outRates.clear();
1414  NTV2VideoFormatSet vfs;
1415  if (!::NTV2DeviceGetSupportedVideoFormats (inDeviceID, vfs))
1416  return false;
1417  for (NTV2VideoFormatSetConstIter it(vfs.begin()); it != vfs.end(); ++it)
1418  { const NTV2FrameRate fr (::GetNTV2FrameRateFromVideoFormat(*it));
1420  outRates.insert(fr);
1421  }
1422  return true;
1423 }
1424 
1425 
1426 ostream & operator << (ostream & inOutStrm, const NTV2SegmentedXferInfo & inRun)
1427 {
1428  return inRun.Print(inOutStrm);
1429 }
1430 
1431 
1432 // Implementation of NTV2AutoCirculateStateToString...
1434 {
1435  static const char * sStateStrings [] = { "Disabled", "Initializing", "Starting", "Paused", "Stopping", "Running", "StartingAtTime", AJA_NULL};
1437  return string (sStateStrings [inState]);
1438  else
1439  return "<invalid>";
1440 }
1441 
1442 
1443 
1446  fTrailerTag (NTV2_TRAILER_TAG)
1447 {
1448 }
1449 
1450 
1451 NTV2FrameSize::operator NTV2FrameGeometry() const // Cast to NTV2FrameGeometry
1452 {
1453  return isValid() ? ::GetGeometryFromFrameDimensions(*this) : NTV2_FG_INVALID;
1454 }
1455 
1457 { // Requires C++11:
1458  static const FGSizesMap sFGWdths = { {NTV2_FG_720x486, 720},
1459  {NTV2_FG_720x508, 720},
1460  {NTV2_FG_720x514, 720},
1461  {NTV2_FG_720x576, 720},
1462  {NTV2_FG_720x598, 720},
1463  {NTV2_FG_720x612, 720},
1464  {NTV2_FG_1280x720, 1280},
1465  {NTV2_FG_1280x740, 1280},
1466  {NTV2_FG_1920x1080, 1920},
1467  {NTV2_FG_1920x1114, 1920},
1468  {NTV2_FG_1920x1112, 1920},
1469  {NTV2_FG_2048x1080, 2048},
1470  {NTV2_FG_2048x1112, 2048},
1471  {NTV2_FG_2048x1114, 2048},
1472  {NTV2_FG_2048x1556, 2048},
1473  {NTV2_FG_2048x1588, 2048},
1474  {NTV2_FG_3840x2160, 3840},
1475  {NTV2_FG_4096x2160, 4096},
1476  {NTV2_FG_7680x4320, 7680},
1477  {NTV2_FG_8192x4320, 8192} };
1478  FGSizesMapCI it (sFGWdths.find(fg));
1479  return it != sFGWdths.end() ? it->second : 0;
1480 }
1481 
1483 { // Requires C++11:
1484  static const FGSizesMap sFGHghts = { {NTV2_FG_720x486, 486},
1485  {NTV2_FG_720x508, 508},
1486  {NTV2_FG_720x514, 514},
1487  {NTV2_FG_720x576, 576},
1488  {NTV2_FG_720x598, 598},
1489  {NTV2_FG_720x612, 612},
1490  {NTV2_FG_1280x720, 720},
1491  {NTV2_FG_1280x740, 740},
1492  {NTV2_FG_2048x1556, 1556},
1493  {NTV2_FG_2048x1588, 1588},
1494  {NTV2_FG_1920x1080, 1080},
1495  {NTV2_FG_2048x1080, 1080},
1496  {NTV2_FG_1920x1114, 1114},
1497  {NTV2_FG_2048x1114, 1114},
1498  {NTV2_FG_1920x1112, 1112},
1499  {NTV2_FG_2048x1112, 1112},
1500  {NTV2_FG_3840x2160, 2160},
1501  {NTV2_FG_4096x2160, 2160},
1502  {NTV2_FG_7680x4320, 4320},
1503  {NTV2_FG_8192x4320, 4320} };
1504  FGSizesMapCI it (sFGHghts.find(fg));
1505  return it != sFGHghts.end() ? it->second : 0;
1506 }
1507 
1508 
1509 static const string sSegXferUnits[] = {"", " U8", " U16", "", " U32", "", "", "", " U64", ""};
1510 
1511 ostream & NTV2SegmentedXferInfo::Print (ostream & inStrm, const bool inDumpSegments) const
1512 {
1513  if (!isValid())
1514  return inStrm << "(invalid)";
1515  if (inDumpSegments)
1516  {
1517  // TBD
1518  }
1519  else
1520  {
1521  inStrm << DEC(getSegmentCount()) << " x " << DEC(getSegmentLength())
1522  << sSegXferUnits[getElementLength()] << " segs";
1523  if (getSourceOffset())
1524  inStrm << " srcOff=" << xHEX0N(getSourceOffset(),8);
1525  if (getSegmentCount() > 1)
1526  inStrm << " srcSpan=" << xHEX0N(getSourcePitch(),8) << (isSourceBottomUp()?" VF":"");
1527  if (getDestOffset())
1528  inStrm << " dstOff=" << xHEX0N(getDestOffset(),8);
1529  if (getSegmentCount() > 1)
1530  inStrm << " dstSpan=" << xHEX0N(getDestPitch(),8) << (isDestBottomUp()?" VF":"");
1531  inStrm << " totElm=" << DEC(getTotalElements()) << " totByt=" << xHEX0N(getTotalBytes(),8);
1532  }
1533  return inStrm;
1534 }
1535 
1536 string NTV2SegmentedXferInfo::getSourceCode (const bool inInclDecl) const
1537 {
1538  static string var("segInfo");
1539  ostringstream oss;
1540  string units("\t// bytes");
1541  if (!isValid())
1542  return "";
1543  if (inInclDecl)
1544  oss << "NTV2SegmentedXferInfo " << var << ";" << endl;
1545  if (getElementLength() > 1)
1546  {
1547  units = "\t// " + sSegXferUnits[getElementLength()] + "s";
1548  oss << var << ".setElementLength(" << getElementLength() << ");" << endl;
1549  }
1550  oss << var << ".setSegmentCount(" << DEC(getSegmentCount()) << ");" << endl;
1551  oss << var << ".setSegmentLength(" << DEC(getSegmentLength()) << ");" << units << endl;
1552  if (getSourceOffset())
1553  oss << var << ".setSourceOffset(" << DEC(getSourceOffset()) << ");" << units << endl;
1554  oss << var << ".setSourcePitch(" << DEC(getSourcePitch()) << ");" << units << endl;
1555  if (isSourceBottomUp())
1556  oss << var << ".setSourceDirection(false);" << endl;
1557  if (getDestOffset())
1558  oss << var << ".setDestOffset(" << DEC(getDestOffset()) << ");" << units << endl;
1559  if (getDestPitch())
1560  oss << var << ".setDestPitch(" << DEC(getDestPitch()) << ");" << units << endl;
1561  if (isDestBottomUp())
1562  oss << var << ".setDestDirection(false);" << endl;
1563  return oss.str();
1564 }
1565 
1566 bool NTV2SegmentedXferInfo::containsElementAtOffset (const ULWord inElementOffset) const
1567 {
1568  if (!isValid())
1569  return false;
1570  if (getSegmentCount() == 1)
1571  {
1572  if (inElementOffset >= getSourceOffset())
1573  if (inElementOffset < getSourceOffset()+getSegmentLength())
1574  return true;
1575  return false;
1576  }
1577  ULWord offset(getSourceOffset());
1578  for (ULWord seg(0); seg < getSegmentCount(); seg++)
1579  {
1580  if (inElementOffset < offset)
1581  return false; // past element of interest already
1582  if (inElementOffset < offset+getSegmentLength())
1583  return true; // must be within this segment
1584  offset += getSourcePitch(); // skip to next segment
1585  }
1586  return false;
1587 }
1588 
1590 {
1591  if (getElementLength() != inRHS.getElementLength())
1592  // FUTURE TBD: Need to transform RHS to match ElementLength so as to make apples-to-apples comparison
1593  return true; // For now, fail
1594  if (getSegmentCount() != inRHS.getSegmentCount())
1595  return true;
1596  if (getSegmentLength() != inRHS.getSegmentLength())
1597  return true;
1598  if (getSourceOffset() != inRHS.getSourceOffset())
1599  return true;
1600  if (getSourcePitch() != inRHS.getSourcePitch())
1601  return true;
1602  if (getDestOffset() != inRHS.getDestOffset())
1603  return true;
1604  if (getDestPitch() != inRHS.getDestPitch())
1605  return true;
1606  return false;
1607 }
1608 
1610 {
1611  mFlags = 0;
1612  mNumSegments = 0;
1613  mElementsPerSegment = 0;
1614  mInitialSrcOffset = 0;
1615  mInitialDstOffset = 0;
1616  mSrcElementsPerRow = 0;
1617  mDstElementsPerRow = 0;
1618  setElementLength(1); // elements == bytes
1619  return *this;
1620 }
1621 
1623 {
1624  std::swap(mSrcElementsPerRow, mDstElementsPerRow);
1625  std::swap(mInitialSrcOffset, mInitialDstOffset);
1626  const bool srcNormal(this->isSourceTopDown()), dstNormal(this->isDestTopDown());
1627  setSourceDirection(dstNormal).setDestDirection(srcNormal);
1628  return *this;
1629 }
1630 
1631 
1632 NTV2Buffer::NTV2Buffer (const void * pInUserPointer, const size_t inByteCount)
1633  : fUserSpacePtr (inByteCount ? NTV2Buffer_TO_ULWORD64(pInUserPointer) : 0),
1634  fByteCount (ULWord(pInUserPointer ? inByteCount : 0)),
1635  fFlags (0),
1636  #if defined (AJAMac)
1637  fKernelSpacePtr (0),
1638  fIOMemoryDesc (0),
1639  fIOMemoryMap (0)
1640  #else
1641  fKernelSpacePtr (0),
1642  fKernelHandle (0)
1643  #endif
1644 {
1645 }
1646 
1647 
1648 NTV2Buffer::NTV2Buffer (const size_t inByteCount)
1649  : fUserSpacePtr (0),
1650  fByteCount (0),
1651  fFlags (0),
1652  #if defined (AJAMac)
1653  fKernelSpacePtr (0),
1654  fIOMemoryDesc (0),
1655  fIOMemoryMap (0)
1656  #else
1657  fKernelSpacePtr (0),
1658  fKernelHandle (0)
1659  #endif
1660 {
1661  if (inByteCount)
1662  Allocate(inByteCount);
1663 }
1664 
1665 
1667  : fUserSpacePtr (0),
1668  fByteCount (0),
1669  fFlags (0),
1670  #if defined (AJAMac)
1671  fKernelSpacePtr (0),
1672  fIOMemoryDesc (0),
1673  fIOMemoryMap (0)
1674  #else
1675  fKernelSpacePtr (0),
1676  fKernelHandle (0)
1677  #endif
1678 {
1679  if (Allocate(inObj.GetByteCount()))
1680  SetFrom(inObj);
1681 }
1682 
1683 bool NTV2Buffer::Truncate (const size_t inNewByteCount)
1684 {
1685  if (inNewByteCount == GetByteCount())
1686  return true; // Same size -- done!
1687  if (inNewByteCount > GetByteCount())
1688  return false; // Cannot enlarge -- i.e. can't be greater than my current size
1689  if (!inNewByteCount && IsAllocatedBySDK())
1690  return Deallocate(); // A newByteCount of zero calls Deallocate
1691  fByteCount = ULWord(inNewByteCount);
1692  return true;
1693 }
1694 
1696 {
1697  if (&inRHS != this)
1698  {
1699  if (inRHS.IsNULL())
1700  Set (AJA_NULL, 0);
1701  else if (GetByteCount() == inRHS.GetByteCount())
1702  SetFrom(inRHS);
1703  else if (Allocate(inRHS.GetByteCount()))
1704  SetFrom(inRHS);
1705  //else; // Error
1706  }
1707  return *this;
1708 }
1709 
1710 
1712 {
1713  Set (AJA_NULL, 0); // Call 'Set' to delete the array (if I allocated it)
1714 }
1715 
1716 
1718 {
1719  uint64_t * pU64s(reinterpret_cast<uint64_t*>(GetHostPointer()));
1720  const size_t loopCount(GetByteCount() / sizeof(uint64_t));
1721  if (IsNULL())
1722  return false;
1723  for (size_t ndx(0); ndx < loopCount; ndx++)
1724  pU64s[ndx] = NTV2EndianSwap64(pU64s[ndx]);
1725  return true;
1726 }
1727 
1728 
1730 {
1731  uint32_t * pU32s(reinterpret_cast<uint32_t*>(GetHostPointer()));
1732  const size_t loopCount(GetByteCount() / sizeof(uint32_t));
1733  if (IsNULL())
1734  return false;
1735  for (size_t ndx(0); ndx < loopCount; ndx++)
1736  pU32s[ndx] = NTV2EndianSwap32(pU32s[ndx]);
1737  return true;
1738 }
1739 
1740 
1742 {
1743  uint16_t * pU16s(reinterpret_cast<uint16_t*>(GetHostPointer()));
1744  const size_t loopCount(GetByteCount() / sizeof(uint16_t));
1745  if (IsNULL())
1746  return false;
1747  for (size_t ndx(0); ndx < loopCount; ndx++)
1748  pU16s[ndx] = NTV2EndianSwap16(pU16s[ndx]);
1749  return true;
1750 }
1751 
1752 
1753 bool NTV2Buffer::Set (const void * pInUserPointer, const size_t inByteCount)
1754 {
1755  Deallocate();
1756  fUserSpacePtr = inByteCount ? NTV2Buffer_TO_ULWORD64(pInUserPointer) : 0;
1757  fByteCount = ULWord(pInUserPointer ? inByteCount : 0);
1758  // Return true only if both UserPointer and ByteCount are non-zero, or both are zero.
1759  return (pInUserPointer && inByteCount) || (!pInUserPointer && !inByteCount);
1760 }
1761 
1762 
1763 bool NTV2Buffer::SetAndFill (const void * pInUserPointer, const size_t inByteCount, const UByte inValue)
1764 {
1765  return Set(pInUserPointer, inByteCount) && Fill(inValue);
1766 }
1767 
1768 
1769 bool NTV2Buffer::Allocate (const size_t inByteCount, const bool inPageAligned)
1770 {
1771  if (GetByteCount() && fFlags & NTV2Buffer_ALLOCATED) // If already was Allocated
1772  if (inByteCount == GetByteCount()) // If same byte count
1773  {
1774  Fill(UByte(0)); // Zero it...
1775  return true; // ...and return true
1776  }
1777 
1778  bool result(Set(AJA_NULL, 0)); // Jettison existing buffer (if any)
1779  if (inByteCount)
1780  { // Allocate the byte array, and call Set...
1781  UByte * pBuffer(AJA_NULL);
1782  result = false;
1783  if (inPageAligned)
1784  pBuffer = reinterpret_cast<UByte*>(AJAMemory::AllocateAligned(inByteCount, DefaultPageSize()));
1785  else
1786  try
1787  {pBuffer = new UByte[inByteCount];}
1788  catch (const std::bad_alloc &)
1789  {pBuffer = AJA_NULL;}
1790  if (pBuffer && Set(pBuffer, inByteCount))
1791  { // SDK owns this memory -- set NTV2Buffer_ALLOCATED bit -- I'm responsible for deleting
1792  result = true;
1793  fFlags |= NTV2Buffer_ALLOCATED;
1794  if (inPageAligned)
1795  fFlags |= NTV2Buffer_PAGE_ALIGNED; // Set "page aligned" flag
1796  Fill(UByte(0)); // Zero it
1797  }
1798  } // if requested size is non-zero
1799  return result;
1800 }
1801 
1802 
1804 {
1805  if (IsAllocatedBySDK())
1806  {
1807  if (!IsNULL())
1808  {
1809  if (IsPageAligned())
1810  {
1812  fFlags &= ~NTV2Buffer_PAGE_ALIGNED;
1813  }
1814  else
1815  delete [] reinterpret_cast<UByte*>(GetHostPointer());
1816  }
1817  fUserSpacePtr = 0;
1818  fByteCount = 0;
1819  fFlags &= ~NTV2Buffer_ALLOCATED;
1820  }
1821  return true;
1822 }
1823 
1824 
1825 void * NTV2Buffer::GetHostAddress (const ULWord inByteOffset, const bool inFromEnd) const
1826 {
1827  if (IsNULL())
1828  return AJA_NULL;
1829  if (inByteOffset >= GetByteCount())
1830  return AJA_NULL;
1831  UByte * pBytes (reinterpret_cast<UByte*>(GetHostPointer()));
1832  if (inFromEnd)
1833  pBytes += GetByteCount() - inByteOffset;
1834  else
1835  pBytes += inByteOffset;
1836  return pBytes;
1837 }
1838 
1839 
1840 bool NTV2Buffer::SetFrom (const NTV2Buffer & inBuffer)
1841 {
1842  if (inBuffer.IsNULL())
1843  return false; // NULL or empty
1844  if (IsNULL())
1845  return false; // I am NULL or empty
1846  if (inBuffer.GetByteCount() == GetByteCount() && inBuffer.GetHostPointer() == GetHostPointer())
1847  return true; // Same buffer
1848 
1849  size_t bytesToCopy(inBuffer.GetByteCount());
1850  if (bytesToCopy > GetByteCount())
1851  bytesToCopy = GetByteCount();
1852  ::memcpy (GetHostPointer(), inBuffer.GetHostPointer(), bytesToCopy);
1853  return true;
1854 }
1855 
1856 
1857 bool NTV2Buffer::CopyFrom (const void * pInSrcBuffer, const ULWord inByteCount)
1858 {
1859  if (!inByteCount)
1860  return Set (AJA_NULL, 0); // Zero bytes
1861  if (!pInSrcBuffer)
1862  return false; // NULL src ptr
1863  if (!Allocate (inByteCount))
1864  return false; // Resize failed
1865  ::memcpy (GetHostPointer(), pInSrcBuffer, inByteCount);
1866  return true;
1867 }
1868 
1869 
1870 bool NTV2Buffer::CopyFrom (const NTV2Buffer & inBuffer,
1871  const ULWord inSrcByteOffset, const ULWord inDstByteOffset, const ULWord inByteCount)
1872 {
1873  if (inBuffer.IsNULL() || IsNULL())
1874  return false; // NULL or empty
1875  if (inSrcByteOffset + inByteCount > inBuffer.GetByteCount())
1876  return false; // Past end of src
1877  if (inDstByteOffset + inByteCount > GetByteCount())
1878  return false; // Past end of me
1879 
1880  const UByte * pSrc (inBuffer);
1881  pSrc += inSrcByteOffset;
1882 
1883  UByte * pDst (*this);
1884  pDst += inDstByteOffset;
1885 
1886  ::memcpy (pDst, pSrc, inByteCount);
1887  return true;
1888 }
1889 
1890 
1891 bool NTV2Buffer::CopyFrom (const NTV2Buffer & inSrcBuffer, const NTV2SegmentedXferInfo & inXferInfo)
1892 {
1893  if (!inXferInfo.isValid() || inSrcBuffer.IsNULL() || IsNULL())
1894  return false;
1895 
1896  // Copy every segment...
1897  LWord srcOffset (LWord(inXferInfo.getSourceOffset() * inXferInfo.getElementLength()));
1898  LWord dstOffset (LWord(inXferInfo.getDestOffset() * inXferInfo.getElementLength()));
1899  LWord srcPitch (LWord(inXferInfo.getSourcePitch() * inXferInfo.getElementLength()));
1900  LWord dstPitch (LWord(inXferInfo.getDestPitch() * inXferInfo.getElementLength()));
1901  const LWord bytesPerSeg (inXferInfo.getSegmentLength() * inXferInfo.getElementLength());
1902  if (inXferInfo.isSourceBottomUp())
1903  srcPitch = 0 - srcPitch;
1904  if (inXferInfo.isDestBottomUp())
1905  dstPitch = 0 - dstPitch;
1906  for (ULWord segNdx(0); segNdx < inXferInfo.getSegmentCount(); segNdx++)
1907  {
1908  const void * pSrc (inSrcBuffer.GetHostAddress(srcOffset));
1909  void * pDst (GetHostAddress(dstOffset));
1910  if (!pSrc) return false;
1911  if (!pDst) return false;
1912  if (srcOffset + bytesPerSeg > LWord(inSrcBuffer.GetByteCount()))
1913  return false; // memcpy will read past end of srcBuffer
1914  if (dstOffset + bytesPerSeg > LWord(GetByteCount()))
1915  return false; // memcpy will write past end of me
1916  ::memcpy (pDst, pSrc, size_t(bytesPerSeg));
1917  srcOffset += srcPitch; // Bump src offset
1918  dstOffset += dstPitch; // Bump dst offset
1919  } // for each segment
1920  return true;
1921 }
1922 
1923 bool NTV2Buffer::SetFromHexString (const string & inStr)
1924 {
1925  string str(inStr);
1926 
1927  // Remove all whitespace...
1928  const string newline("\n"), tab("\t");
1929  aja::replace(str, newline, string());
1930  aja::replace(str, tab, string());
1931  aja::upper(str);
1932 
1933  // Fail if any non-hex found...
1934  for (size_t ndx(0); ndx < str.size(); ndx++)
1935  if (!aja::is_hex_digit(str.at(ndx)))
1936  return false;
1937 
1938  if (str.size() & 1)
1939  return false; // Remaining length must be even
1940  if (!Allocate(str.size() / 2))
1941  return false; // Resize failed
1942 
1943  // Decode and copy in the data...
1944  for (size_t srcNdx(0), dstNdx(0); srcNdx < str.size(); srcNdx += 2)
1945  U8(int(dstNdx++)) = uint8_t(aja::stoul (str.substr(srcNdx,2), AJA_NULL, 16));
1946 
1947  return true;
1948 }
1949 
1951 {
1952  if (inBuffer.IsNULL ())
1953  return false; // NULL or empty
1954  if (IsNULL ())
1955  return false; // I am NULL or empty
1956  if (inBuffer.GetByteCount () != GetByteCount ())
1957  return false; // Different sizes
1958  if (fFlags != inBuffer.fFlags)
1959  return false; // Flags mismatch
1960  if (inBuffer.GetHostPointer () == GetHostPointer ())
1961  return true; // Same buffer
1962 
1963  ULWord64 tmp = fUserSpacePtr;
1964  fUserSpacePtr = inBuffer.fUserSpacePtr;
1965  inBuffer.fUserSpacePtr = tmp;
1966  return true;
1967 }
1968 
1969 set<ULWord> & NTV2Buffer::FindAll (set<ULWord> & outOffsets, const NTV2Buffer & inValue) const
1970 {
1971  outOffsets.clear();
1972  if (IsNULL())
1973  return outOffsets; // NULL buffer, return "no matches"
1974  if (inValue.IsNULL())
1975  return outOffsets; // NULL buffer, return "no matches"
1976  const ULWord srchByteCount(inValue.GetByteCount());
1977  if (GetByteCount() < srchByteCount)
1978  return outOffsets; // I'm smaller than the search data, return "no matches"
1979 
1980  const ULWord maxOffset(GetByteCount() - srchByteCount); // Don't search past here
1981  const uint8_t * pSrchData (inValue); // Pointer to search data
1982  const uint8_t * pMyData (*this); // Pointer to where search starts in me
1983  ULWord offset(0); // Search starts at this byte offset
1984  do
1985  {
1986  if (!::memcmp(pMyData, pSrchData, srchByteCount))
1987  outOffsets.insert(offset); // Record byte offset of match
1988  pMyData++; // Bump search pointer
1989  offset++; // Bump search byte offset
1990  } while (offset < maxOffset);
1991  return outOffsets;
1992 }
1993 
1994 bool NTV2Buffer::IsContentEqual (const NTV2Buffer & inBuffer, const ULWord inByteOffset, const ULWord inByteCount) const
1995 {
1996  if (IsNULL() || inBuffer.IsNULL())
1997  return false; // Buffer(s) are NULL/empty
1998  if (inBuffer.GetByteCount() != GetByteCount())
1999  return false; // Buffers are different sizes
2000 
2001  ULWord totalBytes(GetByteCount());
2002  if (inByteOffset >= totalBytes)
2003  return false; // Bad offset
2004 
2005  totalBytes -= inByteOffset;
2006 
2007  ULWord byteCount(inByteCount);
2008  if (byteCount > totalBytes)
2009  byteCount = totalBytes;
2010 
2011  if (inBuffer.GetHostPointer() == GetHostPointer())
2012  return true; // Same buffer
2013 
2014  const UByte * pByte1 (*this);
2015  const UByte * pByte2 (inBuffer);
2016  pByte1 += inByteOffset;
2017  pByte2 += inByteOffset;
2018  #if !defined(NTV2BUFFER_NO_MEMCMP)
2019  return ::memcmp (pByte1, pByte2, byteCount) == 0;
2020  #else // NTV2BUFFER_NO_MEMCMP
2021  ULWord offset(inByteOffset);
2022  while (byteCount)
2023  {
2024  if (*pByte1 != *pByte2)
2025  {
2026  cerr << "## ERROR: IsContentEqual: miscompare at offset " << xHEX0N(offset,8)
2027  << " (" << DEC(offset) << "): " << xHEX0N(UWord(*pByte1),2) << " != "
2028  << xHEX0N(UWord(*pByte2),2) << ", " << xHEX0N(byteCount,8) << " ("
2029  << DEC(byteCount) << ") bytes left to compare" << endl;
2030  return false;
2031  }
2032  pByte1++; pByte2++;
2033  byteCount--;
2034  offset++;
2035  }
2036  return true;
2037  #endif // NTV2BUFFER_NO_MEMCMP
2038 }
2039 
2040 bool NTV2Buffer::NextDifference (const NTV2Buffer & inBuffer, ULWord & byteOffset) const
2041 {
2042  if (byteOffset == 0xFFFFFFFF)
2043  return false; // bad offset
2044  if (IsNULL() || inBuffer.IsNULL())
2045  return false; // NULL or empty buffers
2046  if (inBuffer.GetByteCount() != GetByteCount())
2047  return false; // Different byte counts
2048  if (inBuffer.GetHostPointer() == GetHostPointer())
2049  {byteOffset = 0xFFFFFFFF; return true;} // Same buffer
2050 
2051  ULWord totalBytesToCompare(GetByteCount());
2052  if (byteOffset >= totalBytesToCompare)
2053  return false; // Bad offset
2054  totalBytesToCompare -= byteOffset;
2055 
2056  const UByte * pByte1 (*this);
2057  const UByte * pByte2 (inBuffer);
2058  while (totalBytesToCompare)
2059  {
2060  if (pByte1[byteOffset] != pByte2[byteOffset])
2061  return true;
2062  totalBytesToCompare--;
2063  byteOffset++;
2064  }
2065  byteOffset = 0xFFFFFFFF;
2066  return true;
2067 }
2068 
2069 bool NTV2Buffer::GetRingChangedByteRange (const NTV2Buffer & inBuffer, ULWord & outByteOffsetFirst, ULWord & outByteOffsetLast) const
2070 {
2071  outByteOffsetFirst = outByteOffsetLast = GetByteCount ();
2072  if (IsNULL () || inBuffer.IsNULL ())
2073  return false; // NULL or empty
2074  if (inBuffer.GetByteCount () != GetByteCount ())
2075  return false; // Different byte counts
2076  if (inBuffer.GetHostPointer () == GetHostPointer ())
2077  return true; // Same buffer
2078  if (GetByteCount() < 3)
2079  return false; // Too small
2080 
2081  const UByte * pByte1 (reinterpret_cast <const UByte *> (GetHostPointer()));
2082  const UByte * pByte2 (reinterpret_cast <const UByte *> (inBuffer.GetHostPointer()));
2083 
2084  outByteOffsetFirst = 0;
2085  while (outByteOffsetFirst < GetByteCount())
2086  {
2087  if (*pByte1 != *pByte2)
2088  break;
2089  pByte1++;
2090  pByte2++;
2091  outByteOffsetFirst++;
2092  }
2093  if (outByteOffsetFirst == 0)
2094  {
2095  // Wrap case -- look for first match...
2096  while (outByteOffsetFirst < GetByteCount())
2097  {
2098  if (*pByte1 == *pByte2)
2099  break;
2100  pByte1++;
2101  pByte2++;
2102  outByteOffsetFirst++;
2103  }
2104  if (outByteOffsetFirst < GetByteCount())
2105  outByteOffsetFirst--;
2106  }
2107  if (outByteOffsetFirst == GetByteCount())
2108  return true; // Identical --- outByteOffsetFirst == outByteOffsetLast == GetByteCount()
2109 
2110  // Now scan from the end...
2111  pByte1 = reinterpret_cast <const UByte *> (GetHostPointer());
2112  pByte2 = reinterpret_cast <const UByte *> (inBuffer.GetHostPointer());
2113  pByte1 += GetByteCount () - 1; // Point to last byte
2114  pByte2 += GetByteCount () - 1;
2115  while (--outByteOffsetLast)
2116  {
2117  if (*pByte1 != *pByte2)
2118  break;
2119  pByte1--;
2120  pByte2--;
2121  }
2122  if (outByteOffsetLast == (GetByteCount() - 1))
2123  {
2124  // Wrap case -- look for first match...
2125  while (outByteOffsetLast)
2126  {
2127  if (*pByte1 == *pByte2)
2128  break;
2129  pByte1--;
2130  pByte2--;
2131  outByteOffsetLast--;
2132  }
2133  if (outByteOffsetLast < GetByteCount())
2134  outByteOffsetLast++;
2135  if (outByteOffsetLast <= outByteOffsetFirst)
2136  cerr << "## WARNING: GetRingChangedByteRange: last " << outByteOffsetLast << " <= first " << outByteOffsetFirst << " in wrap condition" << endl;
2137  const ULWord tmp (outByteOffsetLast);
2138  outByteOffsetLast = outByteOffsetFirst;
2139  outByteOffsetFirst = tmp;
2140  if (outByteOffsetLast >= outByteOffsetFirst)
2141  cerr << "## WARNING: GetRingChangedByteRange: last " << outByteOffsetLast << " >= first " << outByteOffsetFirst << " in wrap condition" << endl;
2142  }
2143  return true;
2144 
2145 } // GetRingChangedByteRange
2146 
2147 
2148 static size_t gDefaultPageSize (AJA_PAGE_SIZE);
2149 
2151 {
2152  return gDefaultPageSize;
2153 }
2154 
2155 bool NTV2Buffer::SetDefaultPageSize (const size_t inNewSize)
2156 {
2157  const bool result (inNewSize && (!(inNewSize & (inNewSize - 1))));
2158  if (result)
2159  gDefaultPageSize = inNewSize;
2160  return result;
2161 }
2162 
2164 {
2165 #if defined(MSWindows) || defined(AJABareMetal)
2166  return AJA_PAGE_SIZE;
2167 #else
2168  return size_t(::getpagesize());
2169 #endif
2170 }
2171 
2172 
2174  : acHeader (NTV2_TYPE_ACFRAMESTAMP, sizeof(FRAME_STAMP)),
2175  acFrameTime (0),
2176  acRequestedFrame (0),
2177  acAudioClockTimeStamp (0),
2178  acAudioExpectedAddress (0),
2179  acAudioInStartAddress (0),
2180  acAudioInStopAddress (0),
2181  acAudioOutStopAddress (0),
2182  acAudioOutStartAddress (0),
2183  acTotalBytesTransferred (0),
2184  acStartSample (0),
2185  acTimeCodes (NTV2_MAX_NUM_TIMECODE_INDEXES * sizeof (NTV2_RP188)),
2186  acCurrentTime (0),
2187  acCurrentFrame (0),
2188  acCurrentFrameTime (0),
2189  acAudioClockCurrentTime (0),
2190  acCurrentAudioExpectedAddress (0),
2191  acCurrentAudioStartAddress (0),
2192  acCurrentFieldCount (0),
2193  acCurrentLineCount (0),
2194  acCurrentReps (0),
2195  acCurrentUserCookie (0),
2196  acFrame (0),
2197  acRP188 ()
2198 {
2200 }
2201 
2202 
2204  : acHeader (inObj.acHeader),
2205  acFrameTime (inObj.acFrameTime),
2206  acRequestedFrame (inObj.acRequestedFrame),
2207  acAudioClockTimeStamp (inObj.acAudioClockTimeStamp),
2208  acAudioExpectedAddress (inObj.acAudioExpectedAddress),
2209  acAudioInStartAddress (inObj.acAudioInStartAddress),
2210  acAudioInStopAddress (inObj.acAudioInStopAddress),
2211  acAudioOutStopAddress (inObj.acAudioOutStopAddress),
2212  acAudioOutStartAddress (inObj.acAudioOutStartAddress),
2213  acTotalBytesTransferred (inObj.acTotalBytesTransferred),
2214  acStartSample (inObj.acStartSample),
2215  acCurrentTime (inObj.acCurrentTime),
2216  acCurrentFrame (inObj.acCurrentFrame),
2217  acCurrentFrameTime (inObj.acCurrentFrameTime),
2218  acAudioClockCurrentTime (inObj.acAudioClockCurrentTime),
2219  acCurrentAudioExpectedAddress (inObj.acCurrentAudioExpectedAddress),
2220  acCurrentAudioStartAddress (inObj.acCurrentAudioStartAddress),
2221  acCurrentFieldCount (inObj.acCurrentFieldCount),
2222  acCurrentLineCount (inObj.acCurrentLineCount),
2223  acCurrentReps (inObj.acCurrentReps),
2224  acCurrentUserCookie (inObj.acCurrentUserCookie),
2225  acFrame (inObj.acFrame),
2226  acRP188 (inObj.acRP188),
2227  acTrailer (inObj.acTrailer)
2228 {
2230 }
2231 
2232 
2234 {
2235 }
2236 
2237 
2239 {
2241  ULWord numRP188s (acTimeCodes.GetByteCount () / sizeof (NTV2_RP188));
2242  const NTV2_RP188 * pArray (reinterpret_cast <const NTV2_RP188 *> (acTimeCodes.GetHostPointer ()));
2243  outValues.clear ();
2244  if (!pArray)
2245  return false; // No 'acTimeCodes' array!
2246 
2247  if (numRP188s > NTV2_MAX_NUM_TIMECODE_INDEXES)
2248  numRP188s = NTV2_MAX_NUM_TIMECODE_INDEXES; // clamp to this max number
2249 
2250  for (ULWord ndx (0); ndx < numRP188s; ndx++)
2251  outValues << pArray [ndx];
2252 
2253  return true;
2254 }
2255 
2256 
2257 bool FRAME_STAMP::GetInputTimeCode (NTV2_RP188 & outTimeCode, const NTV2TCIndex inTCIndex) const
2258 {
2260  ULWord numRP188s (acTimeCodes.GetByteCount () / sizeof (NTV2_RP188));
2261  const NTV2_RP188 * pArray (reinterpret_cast <const NTV2_RP188 *> (acTimeCodes.GetHostPointer ()));
2262  outTimeCode.Set (); // invalidate
2263  if (!pArray)
2264  return false; // No 'acTimeCodes' array!
2265  if (numRP188s > NTV2_MAX_NUM_TIMECODE_INDEXES)
2266  numRP188s = NTV2_MAX_NUM_TIMECODE_INDEXES; // clamp to this max number
2267  if (!NTV2_IS_VALID_TIMECODE_INDEX (inTCIndex))
2268  return false;
2269 
2270  outTimeCode = pArray [inTCIndex];
2271  return true;
2272 }
2273 
2274 
2275 bool FRAME_STAMP::GetInputTimeCodes (NTV2TimeCodes & outTimeCodes, const NTV2Channel inSDIInput, const bool inValidOnly) const
2276 {
2278  outTimeCodes.clear();
2279 
2280  if (!NTV2_IS_VALID_CHANNEL(inSDIInput))
2281  return false; // Bad SDI input
2282 
2283  NTV2TimeCodeList allTCs;
2284  if (!GetInputTimeCodes(allTCs))
2285  return false; // GetInputTimeCodes failed
2286 
2287  const NTV2TCIndexes tcIndexes (GetTCIndexesForSDIInput(inSDIInput));
2288  for (NTV2TCIndexesConstIter iter(tcIndexes.begin()); iter != tcIndexes.end(); ++iter)
2289  {
2290  const NTV2TCIndex tcIndex(*iter);
2292  const NTV2_RP188 tc(allTCs.at(tcIndex));
2293  if (!inValidOnly)
2294  outTimeCodes[tcIndex] = tc;
2295  else if (tc.IsValid())
2296  outTimeCodes[tcIndex] = tc;
2297  }
2298  return true;
2299 }
2300 
2301 
2302 bool FRAME_STAMP::GetSDIInputStatus(NTV2SDIInputStatus & outStatus, const UWord inSDIInputIndex0) const
2303 {
2305  (void)outStatus;
2306  (void)inSDIInputIndex0;
2307  return true;
2308 }
2309 
2310 bool FRAME_STAMP::SetInputTimecode (const NTV2TCIndex inTCNdx, const NTV2_RP188 & inTimecode)
2311 {
2312  ULWord numRP188s (acTimeCodes.GetByteCount() / sizeof(NTV2_RP188));
2313  NTV2_RP188 * pArray (reinterpret_cast<NTV2_RP188*>(acTimeCodes.GetHostPointer()));
2314  if (!pArray || !numRP188s)
2315  return false; // No 'acTimeCodes' array!
2316 
2317  if (numRP188s > NTV2_MAX_NUM_TIMECODE_INDEXES)
2318  numRP188s = NTV2_MAX_NUM_TIMECODE_INDEXES; // clamp to this max number
2319  if (ULWord(inTCNdx) >= numRP188s)
2320  return false; // Past end
2321 
2322  pArray[inTCNdx] = inTimecode; // Write the new value
2323  return true; // Success!
2324 }
2325 
2326 
2328 {
2329  if (this != &inRHS)
2330  {
2331  acTimeCodes = inRHS.acTimeCodes;
2332  acHeader = inRHS.acHeader;
2333  acFrameTime = inRHS.acFrameTime;
2342  acStartSample = inRHS.acStartSample;
2343  acCurrentTime = inRHS.acCurrentTime;
2351  acCurrentReps = inRHS.acCurrentReps;
2353  acFrame = inRHS.acFrame;
2354  acRP188 = inRHS.acRP188;
2355  acTrailer = inRHS.acTrailer;
2356  }
2357  return *this;
2358 }
2359 
2360 
2361 bool FRAME_STAMP::SetFrom (const FRAME_STAMP_STRUCT & inOldStruct)
2362 {
2364  //acCrosspoint = inOldStruct.channelSpec;
2365  acFrameTime = inOldStruct.frameTime;
2366  acRequestedFrame = inOldStruct.frame;
2373  acTotalBytesTransferred = inOldStruct.bytesRead;
2374  acStartSample = inOldStruct.startSample;
2375  acCurrentTime = inOldStruct.currentTime;
2376  acCurrentFrame = inOldStruct.currentFrame;
2377  acCurrentFrameTime = inOldStruct.currentFrameTime;
2381  acCurrentFieldCount = inOldStruct.currentFieldCount;
2382  acCurrentLineCount = inOldStruct.currentLineCount;
2383  acCurrentReps = inOldStruct.currentReps;
2384  acCurrentUserCookie = inOldStruct.currenthUser;
2385  acRP188 = NTV2_RP188 (inOldStruct.currentRP188);
2386  if (!acTimeCodes.IsNULL() && acTimeCodes.GetByteCount () >= sizeof (NTV2_RP188))
2387  {
2388  NTV2_RP188 * pTimecodes (reinterpret_cast <NTV2_RP188 *> (acTimeCodes.GetHostPointer ()));
2389  NTV2_ASSERT (pTimecodes);
2391  pTimecodes [NTV2_TCINDEX_DEFAULT] = acRP188;
2392  }
2393  return true;
2394 }
2395 
2396 
2397 bool FRAME_STAMP::CopyTo (FRAME_STAMP_STRUCT & outOldStruct) const
2398 {
2400  outOldStruct.frameTime = acFrameTime;
2401  outOldStruct.frame = acRequestedFrame;
2408  outOldStruct.bytesRead = acTotalBytesTransferred;
2409  outOldStruct.startSample = acStartSample;
2410  outOldStruct.currentTime = acCurrentTime;
2411  outOldStruct.currentFrame = acCurrentFrame;
2412  outOldStruct.currentFrameTime = acCurrentFrameTime;
2416  outOldStruct.currentFieldCount = acCurrentFieldCount;
2417  outOldStruct.currentLineCount = acCurrentLineCount;
2418  outOldStruct.currentReps = acCurrentReps;
2419  outOldStruct.currenthUser = ULWord(acCurrentUserCookie);
2420  outOldStruct.currentRP188 = acRP188;
2421  // Ticket 3367 -- Mark Gilbert of Gallery UK reports that after updating from AJA Retail Software 10.5 to 14.0,
2422  // their QuickTime app stopped receiving timecode during capture. Turns out the QuickTime components use the new
2423  // AutoCirculate APIs, but internally still use the old FRAME_STAMP_STRUCT for frame info, including timecode...
2424  // ...and only use the "currentRP188" field for the "retail" timecode.
2425  // Sadly, this FRAME_STAMP-to-FRAME_STAMP_STRUCT function historically only set "currentRP188" from the deprecated
2426  // (and completely unused) "acRP188" field, when it really should've been using the acTimeCodes[NTV2_TCINDEX_DEFAULT]
2427  // value all along...
2428  if (!acTimeCodes.IsNULL()) // If there's an acTimeCodes buffer...
2429  if (acTimeCodes.GetByteCount() >= sizeof(NTV2_RP188)) // ...and it has at least one timecode value...
2430  {
2431  const NTV2_RP188 * pDefaultTC (reinterpret_cast<const NTV2_RP188*>(acTimeCodes.GetHostPointer()));
2432  if (pDefaultTC)
2433  outOldStruct.currentRP188 = pDefaultTC[NTV2_TCINDEX_DEFAULT]; // Stuff the "default" (retail) timecode into "currentRP188".
2434  }
2435  return true;
2436 }
2437 
2438 
2439 string FRAME_STAMP::operator [] (const unsigned inIndexNum) const
2440 {
2441  ostringstream oss;
2442  NTV2_RP188 rp188;
2443  if (GetInputTimeCode (rp188, NTV2TimecodeIndex (inIndexNum)))
2444  {
2445  if (rp188.IsValid())
2446  {
2447  CRP188 foo (rp188);
2448  oss << foo;
2449  }
2450  else
2451  oss << "---";
2452  }
2453  else if (NTV2_IS_VALID_TIMECODE_INDEX (inIndexNum))
2454  oss << "---";
2455  return oss.str();
2456 }
2457 
2458 
2460  : mHeader(NTV2_TYPE_SDISTATS, sizeof(NTV2SDIInStatistics)),
2461  mInStatistics(NTV2_MAX_NUM_CHANNELS * sizeof(NTV2SDIInputStatus))
2462 {
2463  Clear();
2465 }
2466 
2468 {
2470  if (mInStatistics.IsNULL())
2471  return;
2472  NTV2SDIInputStatus * pArray(reinterpret_cast <NTV2SDIInputStatus *> (mInStatistics.GetHostPointer()));
2473  for (int i = 0; i < NTV2_MAX_NUM_CHANNELS; i++)
2474  pArray[i].Clear();
2475 }
2476 
2477 bool NTV2SDIInStatistics::GetSDIInputStatus(NTV2SDIInputStatus & outStatus, const UWord inSDIInputIndex0)
2478 {
2480  const ULWord numElements(mInStatistics.GetByteCount() / sizeof(NTV2SDIInputStatus));
2481  const NTV2SDIInputStatus * pArray(reinterpret_cast <const NTV2SDIInputStatus *> (mInStatistics.GetHostPointer()));
2482  outStatus.Clear();
2483  if (!pArray)
2484  return false;
2485  if (numElements != 8)
2486  return false;
2487  if (inSDIInputIndex0 >= numElements)
2488  return false;
2489  outStatus = pArray[inSDIInputIndex0];
2490  return true;
2491 }
2492 
2494 {
2496  static NTV2SDIInputStatus dummy;
2497  const ULWord numElements(mInStatistics.GetByteCount() / sizeof(NTV2SDIInputStatus));
2498  NTV2SDIInputStatus * pArray(reinterpret_cast<NTV2SDIInputStatus*>(mInStatistics.GetHostPointer()));
2499  if (!pArray)
2500  return dummy;
2501  if (numElements != 8)
2502  return dummy;
2503  if (inSDIInputIndex0 >= numElements)
2504  return dummy;
2505  return pArray[inSDIInputIndex0];
2506 }
2507 
2508 std::ostream & NTV2SDIInStatistics::Print(std::ostream & inOutStream) const
2509 {
2511  inOutStream << mHeader << ", " << mInStatistics << ", " << mTrailer; return inOutStream;
2512 }
2513 
2514 
2517  acState (NTV2_AUTOCIRCULATE_DISABLED),
2518  acTransferFrame (0),
2519  acBufferLevel (0),
2520  acFramesProcessed (0),
2521  acFramesDropped (0),
2522  acFrameStamp (),
2523  acAudioTransferSize (0),
2524  acAudioStartSample (0),
2525  acAncTransferSize (0),
2526  acAncField2TransferSize (0)
2527  //acTrailer ()
2528 {
2530 }
2531 
2532 
2534  : acHeader (NTV2_TYPE_ACSTATUS, sizeof (AUTOCIRCULATE_STATUS)),
2535  acCrosspoint (inCrosspoint),
2536  acState (NTV2_AUTOCIRCULATE_DISABLED),
2537  acStartFrame (0),
2538  acEndFrame (0),
2539  acActiveFrame (0),
2540  acRDTSCStartTime (0),
2541  acAudioClockStartTime (0),
2542  acRDTSCCurrentTime (0),
2543  acAudioClockCurrentTime (0),
2544  acFramesProcessed (0),
2545  acFramesDropped (0),
2546  acBufferLevel (0),
2547  acOptionFlags (0),
2548  acAudioSystem (NTV2_AUDIOSYSTEM_INVALID)
2549 {
2551 }
2552 
2553 
2555 {
2557  outOldStruct.channelSpec = acCrosspoint;
2558  outOldStruct.state = acState;
2559  outOldStruct.startFrame = acStartFrame;
2560  outOldStruct.endFrame = acEndFrame;
2561  outOldStruct.activeFrame = acActiveFrame;
2562  outOldStruct.rdtscStartTime = acRDTSCStartTime;
2564  outOldStruct.rdtscCurrentTime = acRDTSCCurrentTime;
2566  outOldStruct.framesProcessed = acFramesProcessed;
2567  outOldStruct.framesDropped = acFramesDropped;
2568  outOldStruct.bufferLevel = acBufferLevel;
2570  outOldStruct.bWithRP188 = acOptionFlags & AUTOCIRCULATE_WITH_RP188 ? 1 : 0;
2571  outOldStruct.bFbfChange = acOptionFlags & AUTOCIRCULATE_WITH_FBFCHANGE ? 1 : 0;
2572  outOldStruct.bFboChange = acOptionFlags & AUTOCIRCULATE_WITH_FBOCHANGE ? 1 : 0;
2574  outOldStruct.bWithVidProc = acOptionFlags & AUTOCIRCULATE_WITH_VIDPROC ? 1 : 0;
2575  outOldStruct.bWithCustomAncData = acOptionFlags & AUTOCIRCULATE_WITH_ANC ? 1 : 0;
2576  return true;
2577 }
2578 
2579 
2581 {
2583  acCrosspoint = inOldStruct.channelSpec;
2584  acState = inOldStruct.state;
2585  acStartFrame = inOldStruct.startFrame;
2586  acEndFrame = inOldStruct.endFrame;
2587  acActiveFrame = inOldStruct.activeFrame;
2588  acRDTSCStartTime = inOldStruct.rdtscStartTime;
2590  acRDTSCCurrentTime = inOldStruct.rdtscCurrentTime;
2592  acFramesProcessed = inOldStruct.framesProcessed;
2593  acFramesDropped = inOldStruct.framesDropped;
2594  acBufferLevel = inOldStruct.bufferLevel;
2595  acAudioSystem = NTV2_AUDIOSYSTEM_INVALID; // NTV2_AUDIOSYSTEM_1;
2596  acOptionFlags = (inOldStruct.bWithRP188 ? AUTOCIRCULATE_WITH_RP188 : 0) |
2597  (inOldStruct.bFbfChange ? AUTOCIRCULATE_WITH_FBFCHANGE : 0) |
2598  (inOldStruct.bFboChange ? AUTOCIRCULATE_WITH_FBOCHANGE : 0) |
2600  (inOldStruct.bWithVidProc ? AUTOCIRCULATE_WITH_VIDPROC : 0) |
2601  (inOldStruct.bWithCustomAncData ? AUTOCIRCULATE_WITH_ANC : 0);
2602  return true;
2603 }
2604 
2605 
2607 {
2611  acStartFrame = 0;
2612  acEndFrame = 0;
2613  acActiveFrame = 0;
2614  acRDTSCStartTime = 0;
2616  acRDTSCCurrentTime = 0;
2618  acFramesProcessed = 0;
2619  acFramesDropped = 0;
2620  acBufferLevel = 0;
2621  acOptionFlags = 0;
2623 }
2624 
2625 
2627 {
2629 }
2630 
2631 
2632 struct ThousandsSeparator : std::numpunct <char>
2633 {
2634  virtual inline char do_thousands_sep() const {return ',';}
2635  virtual inline std::string do_grouping() const {return "\03";}
2636 };
2637 
2638 
2639 template <class T> string CommaStr (const T & inNum)
2640 {
2641  ostringstream oss;
2642  const locale loc (oss.getloc(), new ThousandsSeparator);
2643  oss.imbue (loc);
2644  oss << inNum;
2645  return oss.str();
2646 } // CommaStr
2647 
2648 
2649 string AUTOCIRCULATE_STATUS::operator [] (const unsigned inIndexNum) const
2650 {
2651  ostringstream oss;
2652  if (inIndexNum == 0)
2654  else if (!IsStopped())
2655  switch (inIndexNum)
2656  {
2657  case 1: oss << DEC(GetStartFrame()); break;
2658  case 2: oss << DEC(GetEndFrame()); break;
2659  case 3: oss << DEC(GetFrameCount()); break;
2660  case 4: oss << DEC(GetActiveFrame()); break;
2661  case 5: oss << xHEX0N(acRDTSCStartTime,16); break;
2662  case 6: oss << xHEX0N(acAudioClockStartTime,16); break;
2663  case 7: oss << DEC(acRDTSCCurrentTime); break;
2664  case 8: oss << DEC(acAudioClockCurrentTime); break;
2665  case 9: oss << CommaStr(GetProcessedFrameCount()); break;
2666  case 10: oss << CommaStr(GetDroppedFrameCount()); break;
2667  case 11: oss << DEC(GetBufferLevel()); break;
2668  case 12: oss << ::NTV2AudioSystemToString(acAudioSystem, true); break;
2669  case 13: oss << (WithRP188() ? "Yes" : "No"); break;
2670  case 14: oss << (WithLTC() ? "Yes" : "No"); break;
2671  case 15: oss << (WithFBFChange() ? "Yes" : "No"); break;
2672  case 16: oss << (WithFBOChange() ? "Yes" : "No"); break;
2673  case 17: oss << (WithColorCorrect() ? "Yes" : "No"); break;
2674  case 18: oss << (WithVidProc() ? "Yes" : "No"); break;
2675  case 19: oss << (WithCustomAnc() ? "Yes" : "No"); break;
2676  case 20: oss << (WithHDMIAuxData() ? "Yes" : "No"); break;
2677  case 21: oss << (IsFieldMode() ? "Yes" : "No"); break;
2678  default: break;
2679  }
2680  else if (inIndexNum < 22)
2681  oss << "---";
2682  return oss.str();
2683 }
2684 
2685 
2686 ostream & operator << (ostream & oss, const AUTOCIRCULATE_STATUS & inObj)
2687 {
2688  if (!inObj.IsStopped())
2689  oss << ::NTV2ChannelToString(inObj.GetChannel(), true) << ": "
2690  << (inObj.IsInput() ? "Input " : (inObj.IsOutput() ? "Output" : "*BAD* "))
2691  << setw(12) << ::NTV2AutoCirculateStateToString(inObj.acState) << " "
2692  << setw( 5) << inObj.GetStartFrame()
2693  << setw( 6) << inObj.GetEndFrame()
2694  << setw( 6) << inObj.GetActiveFrame()
2695  << setw( 8) << inObj.GetProcessedFrameCount()
2696  << setw( 8) << inObj.GetDroppedFrameCount()
2697  << setw( 7) << inObj.GetBufferLevel()
2698  << setw(10) << ::NTV2AudioSystemToString(inObj.acAudioSystem, true)
2699  << setw(10) << (inObj.WithRP188() ? "+RP188" : "-RP188")
2700  << setw(10) << (inObj.WithLTC() ? "+LTC" : "-LTC")
2701  << setw(10) << (inObj.WithFBFChange() ? "+FBFchg" : "-FBFchg")
2702  << setw(10) << (inObj.WithFBOChange() ? "+FBOchg" : "-FBOchg")
2703  << setw(10) << (inObj.WithColorCorrect() ? "+ColCor" : "-ColCor")
2704  << setw(10) << (inObj.WithVidProc() ? "+VidProc" : "-VidProc")
2705  << setw(10) << (inObj.WithCustomAnc() ? "+AncData" : "-AncData")
2706  << setw(10) << (inObj.WithHDMIAuxData() ? "+HDMIAux" : "-HDMIAux")
2707  << setw(10) << (inObj.IsFieldMode() ? "+FldMode" : "-FldMode");
2708  return oss;
2709 }
2710 
2711 
2713 {
2714  Reset ();
2715 }
2716 
2717 
2718 NTV2SegmentedDMAInfo::NTV2SegmentedDMAInfo (const ULWord inNumSegments, const ULWord inNumActiveBytesPerRow, const ULWord inHostBytesPerRow, const ULWord inDeviceBytesPerRow)
2719 {
2720  Set (inNumSegments, inNumActiveBytesPerRow, inHostBytesPerRow, inDeviceBytesPerRow);
2721 }
2722 
2723 
2724 void NTV2SegmentedDMAInfo::Set (const ULWord inNumSegments, const ULWord inNumActiveBytesPerRow, const ULWord inHostBytesPerRow, const ULWord inDeviceBytesPerRow)
2725 {
2726  acNumSegments = inNumSegments;
2727  if (acNumSegments > 1)
2728  {
2729  acNumActiveBytesPerRow = inNumActiveBytesPerRow;
2730  acSegmentHostPitch = inHostBytesPerRow;
2731  acSegmentDevicePitch = inDeviceBytesPerRow;
2732  }
2733  else
2734  Reset ();
2735 }
2736 
2737 
2739 {
2741 }
2742 
2743 
2745  : ccMode (NTV2_CCMODE_INVALID),
2746  ccSaturationValue (0)
2747 {
2748 }
2749 
2750 
2752 {
2753  Clear ();
2754 }
2755 
2756 
2758 {
2760  ccSaturationValue = 0;
2762 }
2763 
2764 
2765 bool NTV2ColorCorrectionData::Set (const NTV2ColorCorrectionMode inMode, const ULWord inSaturation, const void * pInTableData)
2766 {
2767  Clear();
2769  return false;
2770 
2771  if (pInTableData)
2773  return false;
2774  ccMode = inMode;
2775  ccSaturationValue = (inMode == NTV2_CCMODE_3WAY) ? inSaturation : 0;
2776  return true;
2777 }
2778 
2779 
2781  : acHeader (NTV2_TYPE_ACXFER, sizeof(AUTOCIRCULATE_TRANSFER)),
2782  acOutputTimeCodes (NTV2_MAX_NUM_TIMECODE_INDEXES * sizeof (NTV2_RP188)),
2783  acTransferStatus (),
2784  acInUserCookie (0),
2785  acInVideoDMAOffset (0),
2786  acInSegmentedDMAInfo (),
2787  acColorCorrection (),
2788  acFrameBufferFormat (NTV2_FBF_10BIT_YCBCR),
2789  acFrameBufferOrientation (NTV2_FRAMEBUFFER_ORIENTATION_TOPDOWN),
2790  acVidProcInfo (),
2791  acVideoQuarterSizeExpand (NTV2_QuarterSizeExpandOff),
2792  acPeerToPeerFlags (0),
2793  acFrameRepeatCount (1),
2794  acDesiredFrame (-1),
2795  acRP188 (),
2796  acCrosspoint (NTV2CROSSPOINT_INVALID)
2797 {
2801 }
2802 
2803 
2804 AUTOCIRCULATE_TRANSFER::AUTOCIRCULATE_TRANSFER (ULWord * pInVideoBuffer, const ULWord inVideoByteCount, ULWord * pInAudioBuffer,
2805  const ULWord inAudioByteCount, ULWord * pInANCBuffer, const ULWord inANCByteCount,
2806  ULWord * pInANCF2Buffer, const ULWord inANCF2ByteCount)
2807  : acHeader (NTV2_TYPE_ACXFER, sizeof(AUTOCIRCULATE_TRANSFER)),
2808  acVideoBuffer (pInVideoBuffer, inVideoByteCount),
2809  acAudioBuffer (pInAudioBuffer, inAudioByteCount),
2810  acANCBuffer (pInANCBuffer, inANCByteCount),
2811  acANCField2Buffer (pInANCF2Buffer, inANCF2ByteCount),
2812  acOutputTimeCodes (NTV2_MAX_NUM_TIMECODE_INDEXES * sizeof (NTV2_RP188)),
2813  acTransferStatus (),
2814  acInUserCookie (0),
2815  acInVideoDMAOffset (0),
2816  acInSegmentedDMAInfo (),
2817  acColorCorrection (),
2818  acFrameBufferFormat (NTV2_FBF_10BIT_YCBCR),
2819  acFrameBufferOrientation (NTV2_FRAMEBUFFER_ORIENTATION_TOPDOWN),
2820  acVidProcInfo (),
2821  acVideoQuarterSizeExpand (NTV2_QuarterSizeExpandOff),
2822  acPeerToPeerFlags (0),
2823  acFrameRepeatCount (1),
2824  acDesiredFrame (-1),
2825  acRP188 (),
2826  acCrosspoint (NTV2CROSSPOINT_INVALID)
2827 {
2831 }
2832 
2833 
2835 {
2836 }
2837 
2838 
2839 bool AUTOCIRCULATE_TRANSFER::SetBuffers (ULWord * pInVideoBuffer, const ULWord inVideoByteCount,
2840  ULWord * pInAudioBuffer, const ULWord inAudioByteCount,
2841  ULWord * pInANCBuffer, const ULWord inANCByteCount,
2842  ULWord * pInANCF2Buffer, const ULWord inANCF2ByteCount)
2843 {
2845  return SetVideoBuffer (pInVideoBuffer, inVideoByteCount)
2846  && SetAudioBuffer (pInAudioBuffer, inAudioByteCount)
2847  && SetAncBuffers (pInANCBuffer, inANCByteCount, pInANCF2Buffer, inANCF2ByteCount);
2848 }
2849 
2850 
2851 bool AUTOCIRCULATE_TRANSFER::SetVideoBuffer (ULWord * pInVideoBuffer, const ULWord inVideoByteCount)
2852 {
2854  acVideoBuffer.Set (pInVideoBuffer, inVideoByteCount);
2855  return true;
2856 }
2857 
2858 
2859 bool AUTOCIRCULATE_TRANSFER::SetAudioBuffer (ULWord * pInAudioBuffer, const ULWord inAudioByteCount)
2860 {
2862  acAudioBuffer.Set (pInAudioBuffer, inAudioByteCount);
2863  return true;
2864 }
2865 
2866 
2867 bool AUTOCIRCULATE_TRANSFER::SetAncBuffers (ULWord * pInANCBuffer, const ULWord inANCByteCount, ULWord * pInANCF2Buffer, const ULWord inANCF2ByteCount)
2868 {
2870  acANCBuffer.Set (pInANCBuffer, inANCByteCount);
2871  acANCField2Buffer.Set (pInANCF2Buffer, inANCF2ByteCount);
2872  return true;
2873 }
2874 
2876 
2877 
2879 {
2881  ULWord maxNumValues (acOutputTimeCodes.GetByteCount() / sizeof(NTV2_RP188));
2882  NTV2_RP188 * pArray (reinterpret_cast<NTV2_RP188*>(acOutputTimeCodes.GetHostPointer()));
2883  if (!pArray)
2884  return false;
2885  if (maxNumValues > NTV2_MAX_NUM_TIMECODE_INDEXES)
2886  maxNumValues = NTV2_MAX_NUM_TIMECODE_INDEXES;
2887 
2888  for (UWord ndx (0); ndx < UWord(maxNumValues); ndx++)
2889  {
2890  const NTV2TCIndex tcIndex (static_cast<NTV2TCIndex>(ndx));
2891  NTV2TimeCodesConstIter iter (inValues.find(tcIndex));
2892  pArray[ndx] = (iter != inValues.end()) ? iter->second : INVALID_TIMECODE_VALUE;
2893  } // for each possible NTV2TCSource value
2894  return true;
2895 }
2896 
2897 
2898 bool AUTOCIRCULATE_TRANSFER::SetOutputTimeCode (const NTV2_RP188 & inTimeCode, const NTV2TCIndex inTCIndex)
2899 {
2901  ULWord maxNumValues (acOutputTimeCodes.GetByteCount() / sizeof(NTV2_RP188));
2902  NTV2_RP188 * pArray (reinterpret_cast<NTV2_RP188*>(acOutputTimeCodes.GetHostPointer()));
2903  if (!pArray)
2904  return false;
2905  if (maxNumValues > NTV2_MAX_NUM_TIMECODE_INDEXES)
2906  maxNumValues = NTV2_MAX_NUM_TIMECODE_INDEXES;
2907  if (!NTV2_IS_VALID_TIMECODE_INDEX(inTCIndex))
2908  return false;
2909 
2910  pArray[inTCIndex] = inTimeCode;
2911  return true;
2912 }
2913 
2914 bool AUTOCIRCULATE_TRANSFER::SetAllOutputTimeCodes (const NTV2_RP188 & inTimeCode, const bool inIncludeF2)
2915 {
2917  ULWord maxNumValues (acOutputTimeCodes.GetByteCount() / sizeof(NTV2_RP188));
2918  NTV2_RP188 * pArray (reinterpret_cast<NTV2_RP188*>(acOutputTimeCodes.GetHostPointer()));
2919  if (!pArray)
2920  return false;
2921  if (maxNumValues > NTV2_MAX_NUM_TIMECODE_INDEXES)
2922  maxNumValues = NTV2_MAX_NUM_TIMECODE_INDEXES;
2923 
2924  for (ULWord tcIndex(0); tcIndex < maxNumValues; tcIndex++)
2925  if (NTV2_IS_ATC_VITC2_TIMECODE_INDEX(tcIndex))
2926  pArray[tcIndex] = inIncludeF2 ? inTimeCode : INVALID_TIMECODE_VALUE;
2927  else
2928  pArray[tcIndex] = inTimeCode;
2929  return true;
2930 }
2931 
2932 
2934 {
2936  if (!NTV2_IS_VALID_FRAME_BUFFER_FORMAT (inNewFormat))
2937  return false;
2938  acFrameBufferFormat = inNewFormat;
2939  return true;
2940 }
2941 
2942 
2944 {
2946  SetBuffers (AJA_NULL, 0, AJA_NULL, 0, AJA_NULL, 0, AJA_NULL, 0);
2947 }
2948 
2949 
2950 bool AUTOCIRCULATE_TRANSFER::EnableSegmentedDMAs (const ULWord inNumSegments, const ULWord inNumActiveBytesPerRow,
2951  const ULWord inHostBytesPerRow, const ULWord inDeviceBytesPerRow)
2952 {
2954  // Cannot allow segmented DMAs if video buffer was self-allocated by the SDK, since the video buffer size holds the segment size (in bytes)...
2956  return false; // Disallow
2957  acInSegmentedDMAInfo.Set (inNumSegments, inNumActiveBytesPerRow, inHostBytesPerRow, inDeviceBytesPerRow);
2958  return true;
2959 }
2960 
2961 
2963 {
2966  return true;
2967 }
2968 
2969 
2971 {
2974 }
2975 
2976 
2978 {
2980  return acTransferStatus.acFrameStamp.GetInputTimeCodes (outValues);
2981 }
2982 
2983 
2984 bool AUTOCIRCULATE_TRANSFER::GetInputTimeCode (NTV2_RP188 & outTimeCode, const NTV2TCIndex inTCIndex) const
2985 {
2987  return acTransferStatus.acFrameStamp.GetInputTimeCode (outTimeCode, inTCIndex);
2988 }
2989 
2990 
2991 bool AUTOCIRCULATE_TRANSFER::GetInputTimeCodes (NTV2TimeCodes & outTimeCodes, const NTV2Channel inSDIInput, const bool inValidOnly) const
2992 {
2994  return acTransferStatus.acFrameStamp.GetInputTimeCodes (outTimeCodes, inSDIInput, inValidOnly);
2995 }
2996 
2997 
2999  : mHeader (NTV2_TYPE_AJADEBUGLOGGING, sizeof (NTV2DebugLogging)),
3000  mSharedMemory (inEnable ? AJADebug::GetPrivateDataLoc() : AJA_NULL, inEnable ? AJADebug::GetPrivateDataLen() : 0)
3001 {
3002 }
3003 
3004 
3005 ostream & NTV2DebugLogging::Print (ostream & inOutStream) const
3006 {
3008  inOutStream << mHeader << " shMem=" << mSharedMemory << " " << mTrailer;
3009  return inOutStream;
3010 }
3011 
3012 
3013 
3015  : mHeader (NTV2_TYPE_AJABUFFERLOCK, sizeof(NTV2BufferLock))
3016 {
3018  SetFlags(0);
3019  SetMaxLockSize(0);
3020 }
3021 
3022 NTV2BufferLock::NTV2BufferLock (const NTV2Buffer & inBuffer, const ULWord inFlags)
3023  : mHeader (NTV2_TYPE_AJABUFFERLOCK, sizeof(NTV2BufferLock))
3024 {
3026  SetBuffer(inBuffer);
3027  SetFlags(inFlags);
3028  SetMaxLockSize(0);
3029 }
3030 
3031 NTV2BufferLock::NTV2BufferLock(const ULWord * pInBuffer, const ULWord inByteCount, const ULWord inFlags)
3032  : mHeader (NTV2_TYPE_AJABUFFERLOCK, sizeof(NTV2BufferLock))
3033 {
3035  SetBuffer (NTV2Buffer(pInBuffer, inByteCount));
3036  SetFlags (inFlags);
3037  SetMaxLockSize(0);
3038 }
3039 
3040 NTV2BufferLock::NTV2BufferLock(const ULWord64 inMaxLockSize, const ULWord inFlags)
3041  : mHeader (NTV2_TYPE_AJABUFFERLOCK, sizeof(NTV2BufferLock))
3042 {
3044  SetBuffer (NTV2Buffer());
3045  SetFlags (inFlags);
3046  SetMaxLockSize(inMaxLockSize);
3047 }
3048 
3049 bool NTV2BufferLock::SetBuffer (const NTV2Buffer & inBuffer)
3050 { // Just use address & length (don't deep copy)...
3052  return mBuffer.Set (inBuffer.GetHostPointer(), inBuffer.GetByteCount());
3053 }
3054 
3055 ostream & NTV2BufferLock::Print (ostream & inOutStream) const
3056 {
3058  inOutStream << mHeader << mBuffer << " flags=" << xHEX0N(mFlags,8) << " " << mTrailer;
3059  return inOutStream;
3060 }
3061 
3062 
3064  : mHeader (NTV2_TYPE_AJABITSTREAM, sizeof(NTV2Bitstream))
3065 {
3067 }
3068 
3069 NTV2Bitstream::NTV2Bitstream (const NTV2Buffer & inBuffer, const ULWord inFlags)
3070  : mHeader (NTV2_TYPE_AJABITSTREAM, sizeof(NTV2Bitstream))
3071 {
3073  SetBuffer(inBuffer);
3074  SetFlags(inFlags);
3075 }
3076 
3077 NTV2Bitstream::NTV2Bitstream(const ULWord * pInBuffer, const ULWord inByteCount, const ULWord inFlags)
3078  : mHeader (NTV2_TYPE_AJABITSTREAM, sizeof(NTV2Bitstream))
3079 {
3081  SetBuffer (NTV2Buffer(pInBuffer, inByteCount));
3082  SetFlags (inFlags);
3083 }
3084 
3085 bool NTV2Bitstream::SetBuffer (const NTV2Buffer & inBuffer)
3086 { // Just use address & length (don't deep copy)...
3088  return mBuffer.Set (inBuffer.GetHostPointer(), inBuffer.GetByteCount());
3089 }
3090 
3091 ostream & NTV2Bitstream::Print (ostream & inOutStream) const
3092 {
3094  inOutStream << mHeader << mBuffer << " flags=" << xHEX0N(mFlags,8) << " " << mTrailer;
3095  return inOutStream;
3096 }
3097 
3099  : mHeader (NTV2_TYPE_AJASTREAMCHANNEL, sizeof(NTV2StreamChannel))
3100 {
3102 }
3103 
3104 ostream & NTV2StreamChannel::Print (ostream & inOutStream) const
3105 {
3107  inOutStream << mHeader << mChannel << " flags=" << xHEX0N(mFlags,8) << xHEX0N(mStatus, 8) << " " << mTrailer;
3108  return inOutStream;
3109 }
3110 
3112  : mHeader (NTV2_TYPE_AJASTREAMBUFFER, sizeof(NTV2StreamBuffer))
3113 {
3115 }
3116 
3117 ostream & NTV2StreamBuffer::Print (ostream & inOutStream) const
3118 {
3120  inOutStream << mHeader << mChannel << " flags=" << xHEX0N(mFlags,8) << xHEX0N(mStatus, 8) << " " << mTrailer;
3121  return inOutStream;
3122 }
3123 
3125  : mHeader (NTV2_TYPE_GETREGS, sizeof(NTV2GetRegisters)),
3126  mInNumRegisters (ULWord (inRegisterNumbers.size ())),
3127  mOutNumRegisters (0)
3128 {
3130  ResetUsing (inRegisterNumbers);
3131 }
3132 
3133 
3135  : mHeader (NTV2_TYPE_GETREGS, sizeof(NTV2GetRegisters)),
3136  mInNumRegisters (ULWord (inRegReads.size ())),
3137  mOutNumRegisters (0)
3138 {
3140  ResetUsing (inRegReads);
3141 }
3142 
3143 
3144 bool NTV2GetRegisters::ResetUsing (const NTV2RegNumSet & inRegisterNumbers)
3145 {
3147  mInNumRegisters = ULWord(inRegisterNumbers.size());
3148  mOutNumRegisters = 0;
3149  bool result ( mInRegisters.Allocate(mInNumRegisters * sizeof(ULWord))
3150  && mOutGoodRegisters.Allocate(mInNumRegisters * sizeof(ULWord))
3151  && mOutValues.Allocate(mInNumRegisters * sizeof(ULWord)));
3152  if (!result)
3153  return false;
3154  mInRegisters.Fill(ULWord(0)); mOutGoodRegisters.Fill(ULWord(0)); mOutValues.Fill(ULWord(0));
3155 
3156  ULWord * pRegArray(mInRegisters);
3157  if (!pRegArray)
3158  return false;
3159 
3160  ULWord ndx(0);
3161  for (NTV2RegNumSetConstIter iter(inRegisterNumbers.begin()); iter != inRegisterNumbers.end(); ++iter)
3162  pRegArray[ndx++] = *iter;
3163  return (ndx * sizeof(ULWord)) == mInRegisters.GetByteCount();
3164 }
3165 
3167 {
3168  outRegNums.clear();
3169  if (!mInNumRegisters)
3170  return true; // None requested
3171  if (!mInRegisters)
3172  return false; // Empty/NULL reg num buffer
3173  if (mInRegisters.GetByteCount()/4 < mInNumRegisters)
3174  return false; // Sanity check failed: Reg num buffer too small
3175 
3176  const ULWord * pRegNums(mInRegisters);
3177  for (ULWord ndx(0); ndx < mInNumRegisters; ndx++)
3178  if (outRegNums.find(pRegNums[ndx]) == outRegNums.end())
3179  outRegNums.insert(pRegNums[ndx]);
3180  return true;
3181 }
3182 
3183 
3185 {
3187  outGoodRegNums.clear();
3188  if (!mOutGoodRegisters)
3189  return false; // Empty/NULL 'mOutGoodRegisters' array!
3190  if (!mOutNumRegisters)
3191  return false; // The driver says zero successfully read!
3192  if (mOutNumRegisters > mInNumRegisters)
3193  return false; // Sanity check failed: mOutNumRegisters must be less than or equal to mInNumRegisters!
3194 
3195  const ULWord * pRegArray (mOutGoodRegisters);
3196  for (ULWord ndx(0); ndx < mOutNumRegisters; ndx++)
3197  outGoodRegNums.insert(pRegArray[ndx]);
3198  return true;
3199 }
3200 
3202 {
3204  outBadRegNums.clear();
3205  NTV2RegNumSet reqRegNums, goodRegNums;
3206  if (!GetRequestedRegisterNumbers(reqRegNums))
3207  return false;
3208  if (!GetGoodRegisters(goodRegNums))
3209  return false;
3210  if (reqRegNums == goodRegNums)
3211  return true; // Requested reg nums identical to those that were read successfully
3212 
3213  // Subtract goodRegNums from reqRegNums...
3214  std::set_difference (reqRegNums.begin(), reqRegNums.end(),
3215  goodRegNums.begin(), goodRegNums.end(),
3216  std::inserter(outBadRegNums, outBadRegNums.begin()));
3217  return true;
3218 }
3219 
3220 bool NTV2GetRegisters::PatchRegister (const ULWord inRegNum, const ULWord inValue)
3221 {
3222  if (!mOutGoodRegisters)
3223  return false; // Empty/null 'mOutGoodRegisters' array!
3224  if (!mOutNumRegisters)
3225  return false; // Driver says zero successfully read!
3226  if (mOutNumRegisters > mInNumRegisters)
3227  return false; // Sanity check failed: mOutNumRegisters must be less than or equal to mInNumRegisters!
3228  if (!mOutValues)
3229  return false; // Empty/null 'mOutValues' array!
3230  if (mOutGoodRegisters.GetByteCount() != mOutValues.GetByteCount())
3231  return false; // Sanity check failed: These sizes should match
3232  const ULWord * pRegArray (mOutGoodRegisters);
3233  ULWord * pValArray (mOutValues);
3234  for (ULWord ndx(0); ndx < mOutNumRegisters; ndx++)
3235  if (pRegArray[ndx] == inRegNum)
3236  {
3237  pValArray[ndx] = inValue;
3238  return true;
3239  }
3240  return false; // Not found
3241 }
3242 
3243 
3245 {
3247  outValues.clear ();
3248  if (!mOutGoodRegisters)
3249  return false; // Empty/null 'mOutGoodRegisters' array!
3250  //if (!mOutNumRegisters)
3251  // return false; // Driver says zero successfully read!
3252  //if (mOutNumRegisters > mInNumRegisters)
3253  // return false; // Sanity check failed: mOutNumRegisters must be less than or equal to mInNumRegisters!
3254  //if (!mOutValues)
3255  // return false; // Empty/null 'mOutValues' array!
3256  //if (mOutGoodRegisters.GetByteCount() != mOutValues.GetByteCount())
3257  // return false; // Sanity check failed: These sizes should match
3258 
3259  const ULWord * pRegArray (mOutGoodRegisters);
3260  const ULWord * pValArray (mOutValues);
3261  for (ULWord ndx(0); ndx < mOutNumRegisters; ndx++)
3262  outValues [pRegArray[ndx]] = pValArray[ndx];
3263  return true;
3264 }
3265 
3266 
3268 {
3269  NTV2RegisterValueMap regValMap;
3270  if (!GetRegisterValues(regValMap))
3271  return false;
3272 
3273  if (outValues.empty())
3274  {
3275  for (NTV2RegValueMapConstIter it(regValMap.begin()); it != regValMap.end(); ++it)
3276  outValues.push_back(NTV2RegInfo(/*regNum*/it->first, /*regVal*/it->second));
3277  return true;
3278  }
3279  else
3280  {
3281  uint32_t missingTally(0);
3282  for (NTV2RegisterReadsIter it (outValues.begin()); it != outValues.end(); ++it)
3283  {
3284  NTV2RegValueMapConstIter mapIter(regValMap.find(it->registerNumber));
3285  if (mapIter == regValMap.end())
3286  missingTally++; // Missing register
3287  it->registerValue = mapIter->second;
3288  }
3289  return !missingTally;
3290  }
3291 }
3292 
3293 
3294 ostream & NTV2GetRegisters::Print (ostream & inOutStream) const
3295 {
3296  inOutStream << mHeader << ", numRegs=" << mInNumRegisters << ", inRegs=" << mInRegisters << ", outNumGoodRegs=" << mOutNumRegisters
3297  << ", outGoodRegs=" << mOutGoodRegisters << ", outValues=" << mOutValues << ", " << mTrailer;
3298  return inOutStream;
3299 }
3300 
3301 
3303  : mHeader (NTV2_TYPE_SETREGS, sizeof(NTV2SetRegisters)),
3304  mInNumRegisters (ULWord(inRegWrites.size())),
3305  mOutNumFailures (0)
3306 {
3307  ResetUsing(inRegWrites);
3308 }
3309 
3310 
3312 {
3314  mInNumRegisters = ULWord(inRegWrites.size());
3315  mOutNumFailures = 0;
3316  const bool result (mInRegInfos.Allocate (mInNumRegisters * sizeof(NTV2RegInfo))
3318  if (!result)
3319  return false;
3320 
3321  ULWord ndx (0);
3322  NTV2RegInfo * pRegInfoArray (mInRegInfos);
3323  UWord * pBadRegIndexes (mOutBadRegIndexes);
3324 
3325  for (NTV2RegisterWritesConstIter it(inRegWrites.begin()); it != inRegWrites.end(); ++it)
3326  {
3327  if (pBadRegIndexes)
3328  pBadRegIndexes[ndx] = 0;
3329  if (pRegInfoArray)
3330  pRegInfoArray[ndx++] = *it;
3331  }
3332  NTV2_ASSERT((ndx * sizeof(NTV2RegInfo)) == mInRegInfos.GetByteCount());
3333  NTV2_ASSERT((ndx * sizeof(UWord)) == mOutBadRegIndexes.GetByteCount());
3334  return result;
3335 }
3336 
3337 
3339 {
3341  outFailedRegWrites.clear();
3342  return true;
3343 }
3344 
3346 {
3347  outRegWrites.clear();
3348  if (!mInNumRegisters)
3349  return false;
3350  if (!mInRegInfos)
3351  return false;
3352 
3353  outRegWrites.reserve(size_t(mInNumRegisters));
3354  const NTV2RegInfo * pRegInfos(mInRegInfos);
3355  for (ULWord ndx(0); ndx < mInNumRegisters; ndx++)
3356  outRegWrites.push_back(pRegInfos[ndx]);
3357  return true;
3358 }
3359 
3360 ostream & NTV2SetRegisters::Print (ostream & oss) const
3361 {
3363  oss << mHeader << ": numRegs=" << mInNumRegisters << " inRegInfos=" << mInRegInfos << " numFailures=" << DEC(mOutNumFailures)
3364  << " outBadRegIndexes=" << mOutBadRegIndexes << ": " << mTrailer;
3365  const UWord * pBadRegIndexes (mOutBadRegIndexes);
3366  const UWord maxNumBadRegIndexes (UWord(mOutBadRegIndexes.GetByteCount() / sizeof(UWord)));
3367  const NTV2RegInfo * pRegInfoArray (mInRegInfos);
3368  const UWord maxNumRegInfos (UWord(mInRegInfos.GetByteCount() / sizeof(NTV2RegInfo)));
3369  if (pBadRegIndexes && maxNumBadRegIndexes && pRegInfoArray && maxNumRegInfos && mOutNumFailures)
3370  {
3371  oss << endl;
3372  for (UWord num(0); num < maxNumBadRegIndexes; num++)
3373  {
3374  const UWord badRegIndex (pBadRegIndexes[num]);
3375  if (badRegIndex < maxNumRegInfos)
3376  {
3377  const NTV2RegInfo & badRegInfo (pRegInfoArray[badRegIndex]);
3378  oss << "Failure " << num << ": " << badRegInfo << endl;
3379  }
3380  }
3381  }
3382  return oss;
3383 }
3384 
3385 
3386 bool NTV2RegInfo::operator < (const NTV2RegInfo & inRHS) const
3387 {
3388  typedef std::pair <ULWord, ULWord> ULWordPair;
3389  typedef std::pair <ULWordPair, ULWordPair> ULWordPairs;
3390  const ULWordPairs rhs (ULWordPair (inRHS.registerNumber, inRHS.registerValue), ULWordPair (inRHS.registerMask, inRHS.registerShift));
3391  const ULWordPairs mine(ULWordPair (registerNumber, registerValue), ULWordPair (registerMask, registerShift));
3392  return mine < rhs;
3393 }
3394 
3395 ostream & NTV2RegInfo::Print (ostream & oss, const bool inAsCode) const
3396 {
3397  if (inAsCode)
3398  return PrintCode(oss);
3400  oss << "[" << regName << "|" << DEC(registerNumber) << ": val=" << xHEX0N(registerValue,8);
3401  if (registerMask != 0xFFFFFFFF)
3402  oss << " msk=" << xHEX0N(registerMask,8);
3403  if (registerShift)
3404  oss << " shf=" << DEC(registerShift);
3405  return oss << "]";
3406 }
3407 
3408 ostream & NTV2RegInfo::PrintCode (ostream & oss, const int inRadix, const NTV2DeviceID inDeviceID) const
3409 {
3411  const bool readOnly (CNTV2RegisterExpert::IsReadOnly(registerNumber));
3412  const bool badName (regName.find(' ') != string::npos);
3413  if (readOnly)
3414  oss << "//\t";
3415  oss << "theDevice.WriteRegister (";
3416  if (badName)
3417  oss << DEC(registerNumber);
3418  else
3419  oss << regName;
3420  switch (inRadix)
3421  {
3422  case 2: oss << ", " << BIN032(registerValue); break;
3423  case 8: oss << ", " << OCT(registerValue); break;
3424  case 10: oss << ", " << DEC(registerValue); break;
3425  default: oss << ", " << xHEX0N(registerValue,8); break;
3426  }
3427  if (registerMask != 0xFFFFFFFF)
3428  switch (inRadix)
3429  {
3430  case 2: oss << ", " << BIN032(registerMask); break;
3431  case 8: oss << ", " << OCT(registerMask); break;
3432  case 10: oss << ", " << DEC(registerMask); break;
3433  default: oss << ", " << xHEX0N(registerMask,8); break;
3434  }
3435  if (registerShift)
3436  oss << ", " << DEC(registerShift);
3437  oss << "); // ";
3438  if (badName)
3439  oss << regName;
3440  else
3441  oss << "Reg " << DEC(registerNumber);
3442  // Decode the reg value...
3444  if (!info.empty()) // and add to end of comment
3445  oss << " // " << aja::replace(info, "\n", ", ");
3446  return oss;
3447 }
3448 
3449 
3450 ostream & NTV2PrintULWordVector (const NTV2ULWordVector & inObj, ostream & inOutStream)
3451 {
3452  for (NTV2ULWordVector::const_iterator it(inObj.begin()); it != inObj.end(); ++it)
3453  inOutStream << " " << HEX0N(*it,8);
3454  return inOutStream;
3455 }
3456 
3457 
3458 ostream & NTV2PrintChannelList (const NTV2ChannelList & inObj, const bool inCompact, ostream & inOutStream)
3459 {
3460  inOutStream << (inCompact ? "Ch[" : "[");
3461  for (NTV2ChannelListConstIter it(inObj.begin()); it != inObj.end(); )
3462  {
3463  if (inCompact)
3464  inOutStream << DEC(*it+1);
3465  else
3466  inOutStream << ::NTV2ChannelToString(*it);
3467  if (++it != inObj.end())
3468  inOutStream << (inCompact ? "|" : ",");
3469  }
3470  return inOutStream << "]";
3471 }
3472 
3473 string NTV2ChannelListToStr (const NTV2ChannelList & inObj, const bool inCompact)
3474 { ostringstream oss;
3475  ::NTV2PrintChannelList (inObj, inCompact, oss);
3476  return oss.str();
3477 }
3478 
3479 ostream & NTV2PrintChannelSet (const NTV2ChannelSet & inObj, const bool inCompact, ostream & inOutStream)
3480 {
3481  inOutStream << (inCompact ? "Ch{" : "{");
3482  for (NTV2ChannelSetConstIter it(inObj.begin()); it != inObj.end(); )
3483  {
3484  if (inCompact)
3485  inOutStream << DEC(*it+1);
3486  else
3487  inOutStream << ::NTV2ChannelToString(*it);
3488  if (++it != inObj.end())
3489  inOutStream << (inCompact ? "|" : ",");
3490  }
3491  return inOutStream << "}";
3492 }
3493 
3494 string NTV2ChannelSetToStr (const NTV2ChannelSet & inObj, const bool inCompact)
3495 { ostringstream oss;
3496  ::NTV2PrintChannelSet (inObj, inCompact, oss);
3497  return oss.str();
3498 }
3499 
3500 NTV2ChannelSet NTV2MakeChannelSet (const NTV2Channel inFirstChannel, const UWord inNumChannels)
3501 {
3502  NTV2ChannelSet result;
3503  for (NTV2Channel ch(inFirstChannel); ch < NTV2Channel(inFirstChannel+inNumChannels); ch = NTV2Channel(ch+1))
3504  if (NTV2_IS_VALID_CHANNEL(ch))
3505  result.insert(ch);
3506  return result;
3507 }
3508 
3510 {
3511  NTV2ChannelSet result;
3512  for (NTV2ChannelListConstIter it(inChannels.begin()); it != inChannels.end(); ++it)
3513  result.insert(*it);
3514  return result;
3515 }
3516 
3517 NTV2ChannelList NTV2MakeChannelList (const NTV2Channel inFirstChannel, const UWord inNumChannels)
3518 {
3519  NTV2ChannelList result;
3520  for (NTV2Channel ch(inFirstChannel); ch < NTV2Channel(inFirstChannel+inNumChannels); ch = NTV2Channel(ch+1))
3521  if (NTV2_IS_VALID_CHANNEL(ch))
3522  result.push_back(ch);
3523  return result;
3524 }
3525 
3527 {
3528  NTV2ChannelList result;
3529  for (NTV2ChannelSetConstIter it(inChannels.begin()); it != inChannels.end(); ++it)
3530  result.push_back(*it);
3531  return result;
3532 }
3533 
3534 ostream & NTV2PrintAudioSystemSet (const NTV2AudioSystemSet & inObj, const bool inCompact, std::ostream & inOutStream)
3535 {
3536  inOutStream << (inCompact ? "AudSys{" : "{");
3537  for (NTV2AudioSystemSetConstIter it(inObj.begin()); it != inObj.end(); )
3538  {
3539  if (inCompact)
3540  inOutStream << DEC(*it+1);
3541  else
3542  inOutStream << ::NTV2AudioSystemToString(*it);
3543  if (++it != inObj.end())
3544  inOutStream << (inCompact ? "|" : ",");
3545  }
3546  return inOutStream << "}";
3547 }
3548 
3549 string NTV2AudioSystemSetToStr (const NTV2AudioSystemSet & inObj, const bool inCompact)
3550 { ostringstream oss;
3551  ::NTV2PrintAudioSystemSet (inObj, inCompact, oss);
3552  return oss.str();
3553 }
3554 
3555 NTV2AudioSystemSet NTV2MakeAudioSystemSet (const NTV2AudioSystem inFirstAudioSystem, const UWord inCount)
3556 {
3557  NTV2AudioSystemSet result;
3558  for (NTV2AudioSystem audSys(inFirstAudioSystem); audSys < NTV2AudioSystem(inFirstAudioSystem+inCount); audSys = NTV2AudioSystem(audSys+1))
3559  if (NTV2_IS_VALID_AUDIO_SYSTEM(audSys))
3560  result.insert(audSys);
3561  return result;
3562 }
3563 
3565 {
3566  NTV2RegNumSet result;
3567  for (NTV2RegisterReadsConstIter it(inRegInfos.begin()); it != inRegInfos.end(); ++it)
3568  if (result.find(it->registerNumber) == result.end())
3569  result.insert(it->registerNumber);
3570  return result;
3571 }
3572 
3574 {
3575  for (NTV2RegisterReadsConstIter iter(inRegInfos.begin()); iter != inRegInfos.end(); ++iter) // Ugh -- linear search
3576  if (iter->registerNumber == inRegNum)
3577  return iter;
3578  return inRegInfos.end();
3579 }
3580 
3581 
3582 ostream & operator << (std::ostream & inOutStream, const NTV2RegInfo & inObj)
3583 {
3584  return inObj.Print(inOutStream);
3585 }
3586 
3587 
3588 ostream & operator << (ostream & inOutStream, const NTV2RegisterWrites & inObj)
3589 {
3590  inOutStream << inObj.size () << " regs:" << endl;
3591  for (NTV2RegisterWritesConstIter iter (inObj.begin ()); iter != inObj.end (); ++iter)
3592  inOutStream << *iter << endl;
3593  return inOutStream;
3594 }
3595 
3596 
3597 NTV2BankSelGetSetRegs::NTV2BankSelGetSetRegs (const NTV2RegInfo & inBankSelect, const NTV2RegInfo & inOutRegInfo, const bool inDoWrite)
3598  : mHeader (NTV2_TYPE_BANKGETSET, sizeof (NTV2BankSelGetSetRegs)),
3599  mIsWriting (inDoWrite), // Default to reading
3600  mInBankInfos (sizeof(NTV2RegInfo)), // Room for one bank select
3601  mInRegInfos (sizeof(NTV2RegInfo)) // Room for one register read or write
3602 {
3603  NTV2RegInfo * pRegInfo (mInBankInfos);
3604  if (pRegInfo)
3605  *pRegInfo = inBankSelect; // Store bank select regInfo
3606  pRegInfo = mInRegInfos;
3607  if (pRegInfo)
3608  *pRegInfo = inOutRegInfo; // Store regInfo
3610 }
3611 
3612 
3614 {
3616  NTV2RegInfo result;
3617  if (mInRegInfos)
3618  {
3619  const NTV2RegInfo * pRegInfos (mInRegInfos);
3620  const ULWord maxNum (mInRegInfos.GetByteCount() / ULWord(sizeof(NTV2RegInfo)));
3621  if (ULWord(inIndex0) < maxNum)
3622  result = pRegInfos[inIndex0];
3623  }
3624  return result;
3625 }
3626 
3627 
3628 ostream & NTV2BankSelGetSetRegs::Print (ostream & oss) const
3629 {
3631  const NTV2RegInfo * pBankRegInfo (mInBankInfos);
3632  const NTV2RegInfo * pRegInfo (mInRegInfos);
3633  oss << mHeader << (mIsWriting ? " WRIT" : " READ") << " bankReg=";
3634  if (mInBankInfos) oss << *pBankRegInfo; else oss << "-";
3635  oss << " regInfos=";
3636  if (mInRegInfos) oss << *pRegInfo; else oss << "-";
3637  return oss;
3638 }
3639 
3640 
3641 NTV2VirtualData::NTV2VirtualData (const ULWord inTag, const void* inVirtualData, const size_t inVirtualDataSize, const bool inDoWrite)
3642  : mHeader (NTV2_TYPE_VIRTUAL_DATA_RW, sizeof (NTV2VirtualData)),
3643  mTag (inTag), // setup tag
3644  mIsWriting (inDoWrite), // setup write/read
3645  mVirtualData (inVirtualData, inVirtualDataSize) // setup virtual data
3646 {
3648 }
3649 
3650 
3651 ostream & NTV2VirtualData::Print (ostream & inOutStream) const
3652 {
3654  inOutStream << mHeader << ", mTag=" << mTag << ", mIsWriting=" << mIsWriting;
3655  return inOutStream;
3656 }
3657 
3658 using namespace ntv2nub;
3659 
3660  /*********************************************************************************************************************
3661  RPC ENCODE/DECODE FUNCTIONS
3662  *********************************************************************************************************************/
3663  #define AsU8Ref(_x_) reinterpret_cast<uint8_t&>(_x_)
3664  #define AsU16Ref(_x_) reinterpret_cast<uint16_t&>(_x_)
3665  #define AsU32Ref(_x_) reinterpret_cast<uint32_t&>(_x_)
3666  #define AsU64Ref(_x_) reinterpret_cast<uint64_t&>(_x_)
3667 
3669  {
3670  PUSHU32(fHeaderTag, outBlob); // ULWord fHeaderTag
3671  PUSHU32(fType, outBlob); // ULWord fType
3672  PUSHU32(fHeaderVersion, outBlob); // ULWord fHeaderVersion
3673  PUSHU32(fVersion, outBlob); // ULWord fVersion
3674  PUSHU32(fSizeInBytes, outBlob); // ULWord fSizeInBytes
3675  PUSHU32(fPointerSize, outBlob); // ULWord fPointerSize
3676  PUSHU32(fOperation, outBlob); // ULWord fOperation
3677  PUSHU32(fResultStatus, outBlob); // ULWord fResultStatus
3678  return true;
3679  }
3680 
3681  bool NTV2_HEADER::RPCDecode (const UByteSequence & inBlob, size_t & inOutIndex)
3682  {
3683  POPU32(fHeaderTag, inBlob, inOutIndex); // ULWord fHeaderTag
3684  POPU32(fType, inBlob, inOutIndex); // ULWord fType
3685  POPU32(fHeaderVersion, inBlob, inOutIndex); // ULWord fHeaderVersion
3686  POPU32(fVersion, inBlob, inOutIndex); // ULWord fVersion
3687  POPU32(fSizeInBytes, inBlob, inOutIndex); // ULWord fSizeInBytes
3688  POPU32(fPointerSize, inBlob, inOutIndex); // ULWord fPointerSize
3689  POPU32(fOperation, inBlob, inOutIndex); // ULWord fOperation
3690  POPU32(fResultStatus, inBlob, inOutIndex); // ULWord fResultStatus
3691  return true;
3692  }
3693 
3695  {
3696  PUSHU32(fTrailerVersion, outBlob); // ULWord fTrailerVersion
3697  PUSHU32(fTrailerTag, outBlob); // ULWord fTrailerTag
3698  return true;
3699  }
3700 
3701  bool NTV2_TRAILER::RPCDecode (const UByteSequence & inBlob, size_t & inOutIndex)
3702  {
3703  POPU32(fTrailerVersion, inBlob, inOutIndex); // ULWord fTrailerVersion
3704  POPU32(fTrailerTag, inBlob, inOutIndex); // ULWord fTrailerTag
3705  return true;
3706  }
3707 
3708 
3710  {
3711  PUSHU32(fByteCount, outBlob); // ULWord fByteCount
3712  PUSHU32(fFlags, outBlob); // ULWord fFlags
3713  if (!IsNULL())
3714  AppendU8s(outBlob); // NOTE: My buffer content should already have been made BigEndian, if necessary
3715  return true;
3716  }
3717 
3718  bool NTV2Buffer::RPCDecode (const UByteSequence & inBlob, size_t & inOutIndex)
3719  {
3720  ULWord byteCount(0), flags(0);
3721  POPU32(byteCount, inBlob, inOutIndex); // ULWord fByteCount
3722  POPU32(flags, inBlob, inOutIndex); // ULWord fFlags
3723  if (!Allocate(byteCount, flags & NTV2Buffer_PAGE_ALIGNED))
3724  return false;
3725  if ((inOutIndex + byteCount) > inBlob.size())
3726  return false; // past end of inBlob
3727  for (ULWord cnt(0); cnt < byteCount; cnt++)
3728  U8(int(cnt)) = inBlob.at(inOutIndex++); // Caller is responsible for byte-swapping if needed
3729  return true;
3730  }
3731 
3733  {
3734  const size_t totBytes (mHeader.GetSizeInBytes() // Header + natural size of all structs/fields inbetween + Trailer
3735  + mInRegisters.GetByteCount() + mOutGoodRegisters.GetByteCount() + mOutValues.GetByteCount()); // NTV2Buffer fields
3736  if (outBlob.capacity() < totBytes)
3737  outBlob.reserve(totBytes);
3738  if (!NTV2HostIsBigEndian)
3739  { // All of my NTV2Buffers store arrays of ULWords that must be BigEndian BEFORE encoding into outBlob...
3740  mInRegisters.ByteSwap32();
3741  mOutGoodRegisters.ByteSwap32();
3742  mOutValues.ByteSwap32();
3743  }
3744  bool ok = mHeader.RPCEncode(outBlob); // NTV2_HEADER mHeader
3745  PUSHU32(mInNumRegisters, outBlob); // ULWord mInNumRegisters
3746  ok &= mInRegisters.RPCEncode(outBlob); // NTV2Buffer mInRegisters
3747  PUSHU32(mOutNumRegisters, outBlob); // ULWord mOutNumRegisters
3748  ok &= mOutGoodRegisters.RPCEncode(outBlob) // NTV2Buffer mOutGoodRegisters
3749  && mOutValues.RPCEncode(outBlob) // NTV2Buffer mOutValues
3750  && mTrailer.RPCEncode(outBlob); // NTV2_TRAILER mTrailer
3751  if (!NTV2HostIsBigEndian && !ok)
3752  { // FAILED: Un-byteswap NTV2Buffer data...
3753  mInRegisters.ByteSwap32();
3754  mOutGoodRegisters.ByteSwap32();
3755  mOutValues.ByteSwap32();
3756  }
3757  return ok;
3758  }
3759 
3760  bool NTV2GetRegisters::RPCDecode (const UByteSequence & inBlob, size_t & inOutIndex)
3761  {
3762  bool ok = mHeader.RPCDecode(inBlob, inOutIndex); // NTV2_HEADER mHeader
3763  if (!ok) return false;
3764  POPU32(mInNumRegisters, inBlob, inOutIndex); // ULWord mInNumRegisters
3765  ok &= mInRegisters.RPCDecode(inBlob, inOutIndex); // NTV2Buffer mInRegisters
3766  POPU32(mOutNumRegisters, inBlob, inOutIndex); // ULWord mOutNumRegisters
3767  ok &= mOutGoodRegisters.RPCDecode(inBlob, inOutIndex); // NTV2Buffer mOutGoodRegisters
3768  ok &= mOutValues.RPCDecode(inBlob, inOutIndex); // NTV2Buffer mOutValues
3769  ok &= mTrailer.RPCDecode(inBlob, inOutIndex); // NTV2_TRAILER mTrailer
3770  if (!NTV2HostIsBigEndian)
3771  { // Re-byteswap NTV2Buffer data after decoding...
3772  mInRegisters.ByteSwap32();
3773  mOutGoodRegisters.ByteSwap32();
3774  mOutValues.ByteSwap32();
3775  }
3776  return ok;
3777  }
3778 
3780  {
3781  const size_t totBytes (mHeader.GetSizeInBytes() // Header + natural size of all structs/fields inbetween + Trailer
3782  + mInRegInfos.GetByteCount() + mOutBadRegIndexes.GetByteCount()); // NTV2Buffer fields
3783  if (outBlob.capacity() < totBytes)
3784  outBlob.reserve(totBytes);
3785  if (!NTV2HostIsBigEndian)
3786  { // All of my NTV2Buffers store arrays of ULWords that must be BigEndian BEFORE encoding into outBlob...
3787  mInRegInfos.ByteSwap32();
3788  mOutBadRegIndexes.ByteSwap32();
3789  }
3790  bool ok = mHeader.RPCEncode(outBlob); // NTV2_HEADER mHeader
3791  PUSHU32(mInNumRegisters, outBlob); // ULWord mInNumRegisters
3792  ok &= mInRegInfos.RPCEncode(outBlob); // NTV2Buffer mInRegInfos
3793  PUSHU32(mOutNumFailures, outBlob); // ULWord mOutNumFailures
3794  ok &= mOutBadRegIndexes.RPCEncode(outBlob) // NTV2Buffer mOutBadRegIndexes
3795  && mTrailer.RPCEncode(outBlob); // NTV2_TRAILER mTrailer
3796  if (!NTV2HostIsBigEndian && !ok)
3797  { // FAILED: Un-byteswap NTV2Buffer data...
3798  mInRegInfos.ByteSwap32();
3799  mOutBadRegIndexes.ByteSwap16();
3800  }
3801  return ok;
3802  }
3803 
3804  bool NTV2SetRegisters::RPCDecode (const UByteSequence & inBlob, size_t & inOutIndex)
3805  {
3806  bool ok = mHeader.RPCDecode(inBlob, inOutIndex); // NTV2_HEADER mHeader
3807  POPU32(mInNumRegisters, inBlob, inOutIndex); // ULWord mInNumRegisters
3808  ok &= mInRegInfos.RPCDecode(inBlob, inOutIndex); // NTV2Buffer mInRegInfos
3809  POPU32(mOutNumFailures, inBlob, inOutIndex); // ULWord mOutNumFailures
3810  ok &= mOutBadRegIndexes.RPCDecode(inBlob, inOutIndex); // NTV2Buffer mOutBadRegIndexes
3811  ok &= mTrailer.RPCDecode(inBlob, inOutIndex); // NTV2_TRAILER mTrailer
3812  if (!NTV2HostIsBigEndian)
3813  { // Re-byteswap NTV2Buffer data after decoding...
3814  mInRegInfos.ByteSwap32();
3815  mOutBadRegIndexes.ByteSwap16();
3816  }
3817  return ok;
3818  }
3819 
3821  {
3822  const size_t totBytes (mHeader.GetSizeInBytes() // Header + natural size of all structs/fields inbetween + Trailer
3823  + mInBankInfos.GetByteCount() + mInRegInfos.GetByteCount()); // NTV2Buffer fields
3824  if (outBlob.capacity() < totBytes)
3825  outBlob.reserve(totBytes);
3826  if (!NTV2HostIsBigEndian)
3827  { // All of my NTV2Buffers store arrays of ULWords that must be BigEndian BEFORE encoding into outBlob...
3828  mInBankInfos.ByteSwap32();
3829  mInRegInfos.ByteSwap32();
3830  }
3831  bool ok = mHeader.RPCEncode(outBlob); // NTV2_HEADER mHeader
3832  PUSHU32(mIsWriting, outBlob); // ULWord mIsWriting
3833  ok &= mInBankInfos.RPCEncode(outBlob); // NTV2Buffer mInBankInfos
3834  ok &= mInRegInfos.RPCEncode(outBlob) // NTV2Buffer mInRegInfos
3835  && mTrailer.RPCEncode(outBlob); // NTV2_TRAILER mTrailer
3836  if (!NTV2HostIsBigEndian && !ok)
3837  { // FAILED: Un-byteswap NTV2Buffer data...
3838  mInBankInfos.ByteSwap32();
3839  mInRegInfos.ByteSwap32();
3840  }
3841  return ok;
3842  }
3843 
3844  bool NTV2BankSelGetSetRegs::RPCDecode (const UByteSequence & inBlob, size_t & inOutIndex)
3845  {
3846  bool ok = mHeader.RPCDecode(inBlob, inOutIndex); // NTV2_HEADER mHeader
3847  POPU32(mIsWriting, inBlob, inOutIndex); // ULWord mIsWriting
3848  ok &= mInBankInfos.RPCDecode(inBlob, inOutIndex); // NTV2Buffer mInBankInfos
3849  ok &= mInRegInfos.RPCDecode(inBlob, inOutIndex); // NTV2Buffer mInRegInfos
3850  ok &= mTrailer.RPCDecode(inBlob, inOutIndex); // NTV2_TRAILER mTrailer
3851  if (!NTV2HostIsBigEndian)
3852  { // Re-byteswap NTV2Buffer data after decoding...
3853  mInBankInfos.ByteSwap32();
3854  mInRegInfos.ByteSwap32();
3855  }
3856  return ok;
3857  }
3858 
3860  {
3861  const size_t totBytes (acHeader.GetSizeInBytes()); // Header + natural size of all structs/fields inbetween + Trailer
3862  if (outBlob.capacity() < totBytes)
3863  outBlob.reserve(totBytes);
3864  bool ok = acHeader.RPCEncode(outBlob); // NTV2_HEADER acHeader
3865  PUSHU16(UWord(acCrosspoint), outBlob); // NTV2Crosspoint acCrosspoint
3866  PUSHU16(UWord(acState), outBlob); // NTV2AutoCirculateState acState
3867  PUSHU32(ULWord(acStartFrame), outBlob); // LWord acStartFrame
3868  PUSHU32(ULWord(acEndFrame), outBlob); // LWord acEndFrame
3869  PUSHU32(ULWord(acActiveFrame), outBlob); // LWord acActiveFrame
3870  PUSHU64(acRDTSCStartTime, outBlob); // ULWord64 acRDTSCStartTime
3871  PUSHU64(acAudioClockStartTime, outBlob); // ULWord64 acAudioClockStartTime
3872  PUSHU64(acRDTSCCurrentTime, outBlob); // ULWord64 acRDTSCCurrentTime
3873  PUSHU64(acAudioClockCurrentTime, outBlob); // ULWord64 acAudioClockCurrentTime
3874  PUSHU32(acFramesProcessed, outBlob); // ULWord acFramesProcessed
3875  PUSHU32(acFramesDropped, outBlob); // ULWord acFramesDeopped
3876  PUSHU32(acBufferLevel, outBlob); // ULWord acBufferLevel
3877  PUSHU32(acOptionFlags, outBlob); // ULWord acOptionFlags
3878  PUSHU16(UWord(acAudioSystem), outBlob); // NTV2AudioSystem acAudioSystem
3879  ok &= acTrailer.RPCEncode(outBlob); // NTV2_TRAILER acTrailer
3880  return ok;
3881  }
3882 
3883  bool AUTOCIRCULATE_STATUS::RPCDecode (const UByteSequence & inBlob, size_t & inOutIndex)
3884  { uint16_t v16(0); uint32_t v32(0);
3885  bool ok = acHeader.RPCDecode(inBlob, inOutIndex); // NTV2_HEADER acHeader
3886  POPU16(v16, inBlob, inOutIndex); // NTV2Crosspoint acCrosspoint
3887  acCrosspoint = NTV2Crosspoint(v16);
3888  POPU16(v16, inBlob, inOutIndex); // NTV2AutoCirculateState acState
3889  acState = NTV2AutoCirculateState(v16);
3890  POPU32(v32, inBlob, inOutIndex); // LWord acStartFrame
3891  acStartFrame = LWord(v32);
3892  POPU32(v32, inBlob, inOutIndex); // LWord acEndFrame
3893  acEndFrame = LWord(v32);
3894  POPU32(v32, inBlob, inOutIndex); // LWord acActiveFrame
3895  acActiveFrame = LWord(v32);
3896  POPU64(acRDTSCStartTime, inBlob, inOutIndex); // ULWord64 acRDTSCStartTime
3897  POPU64(acAudioClockStartTime, inBlob, inOutIndex); // ULWord64 acAudioClockStartTime
3898  POPU64(acRDTSCCurrentTime, inBlob, inOutIndex); // ULWord64 acRDTSCCurrentTime
3899  POPU64(acAudioClockCurrentTime, inBlob, inOutIndex); // ULWord64 acAudioClockCurrentTime
3900  POPU32(acFramesProcessed, inBlob, inOutIndex); // ULWord acFramesProcessed
3901  POPU32(acFramesDropped, inBlob, inOutIndex); // ULWord acFramesDropped
3902  POPU32(acBufferLevel, inBlob, inOutIndex); // ULWord acBufferLevel
3903  POPU32(acOptionFlags, inBlob, inOutIndex); // ULWord acOptionFlags
3904  POPU16(v16, inBlob, inOutIndex); // NTV2AudioSystem acAudioSystem
3905  acAudioSystem = NTV2AudioSystem(v16);
3906  ok &= acTrailer.RPCDecode(inBlob, inOutIndex); // NTV2_TRAILER acTrailer
3907  return ok;
3908  }
3909 
3911  {
3912  const size_t totBytes (acHeader.GetSizeInBytes()); // Header + natural size of all structs/fields inbetween + Trailer
3913  if (outBlob.capacity() < totBytes)
3914  outBlob.reserve(totBytes);
3915  bool ok = acHeader.RPCEncode(outBlob); // NTV2_HEADER acHeader
3916  PUSHU64(ULWord64(acFrameTime), outBlob); // LWord64 acFrameTime
3917  PUSHU32(acRequestedFrame, outBlob); // ULWord acRequestedFrame
3918  PUSHU64(acAudioClockTimeStamp, outBlob); // ULWord64 acAudioClockTimeStamp
3919  PUSHU32(acAudioExpectedAddress, outBlob); // ULWord acAudioExpectedAddress
3920  PUSHU32(acAudioInStartAddress, outBlob); // ULWord acAudioInStartAddress
3921  PUSHU32(acAudioInStopAddress, outBlob); // ULWord acAudioInStopAddress
3922  PUSHU32(acAudioOutStopAddress, outBlob); // ULWord acAudioOutStopAddress
3923  PUSHU32(acAudioOutStartAddress, outBlob); // ULWord acAudioOutStartAddress
3924  PUSHU32(acTotalBytesTransferred, outBlob); // ULWord acTotalBytesTransferred
3925  PUSHU32(acStartSample, outBlob); // ULWord acStartSample
3926 
3927  ok &= acTimeCodes.RPCEncode(outBlob); // NTV2Buffer acTimeCodes
3928  PUSHU64(ULWord64(acCurrentTime), outBlob); // LWord64 acCurrentTime
3929  PUSHU32(acCurrentFrame, outBlob); // ULWord acCurrentFrame
3930  PUSHU64(ULWord64(acCurrentFrameTime), outBlob); // LWord64 acCurrentFrameTime
3931  PUSHU64(acAudioClockCurrentTime, outBlob); // ULWord64 acAudioClockCurrentTime
3932  PUSHU32(acCurrentAudioExpectedAddress, outBlob); // ULWord acCurrentAudioExpectedAddress
3933  PUSHU32(acCurrentAudioStartAddress, outBlob); // ULWord acCurrentAudioStartAddress
3934  PUSHU32(acCurrentFieldCount, outBlob); // ULWord acCurrentFieldCount
3935  PUSHU32(acCurrentLineCount, outBlob); // ULWord acCurrentLineCount
3936  PUSHU32(acCurrentReps, outBlob); // ULWord acCurrentReps
3937  PUSHU64(acCurrentUserCookie, outBlob); // ULWord64 acCurrentUserCookie
3938  PUSHU32(acFrame, outBlob); // ULWord acFrame
3939  PUSHU32(acRP188.fDBB, outBlob); // ULWord acRP188.fDBB
3940  PUSHU32(acRP188.fLo, outBlob); // ULWord acRP188.fLo
3941  PUSHU32(acRP188.fHi, outBlob); // ULWord acRP188.fHi
3942  ok &= acTrailer.RPCEncode(outBlob); // NTV2_TRAILER acTrailer
3943  return ok;
3944  }
3945 
3946  bool FRAME_STAMP::RPCDecode (const UByteSequence & inBlob, size_t & inOutIndex)
3947  { uint64_t v64(0);
3948  bool ok = acHeader.RPCDecode(inBlob, inOutIndex); // NTV2_HEADER acHeader
3949  POPU64(v64, inBlob, inOutIndex); // LWord64 acFrameTime
3950  acFrameTime = LWord64(v64);
3951  POPU32(acRequestedFrame, inBlob, inOutIndex); // ULWord acRequestedFrame
3952  POPU64(acAudioClockTimeStamp, inBlob, inOutIndex); // ULWord64 acAudioClockTimeStamp
3953  POPU32(acAudioExpectedAddress, inBlob, inOutIndex); // ULWord acAudioExpectedAddress
3954  POPU32(acAudioInStartAddress, inBlob, inOutIndex); // ULWord acAudioInStartAddress
3955  POPU32(acAudioInStopAddress, inBlob, inOutIndex); // ULWord acAudioInStopAddress
3956  POPU32(acAudioOutStopAddress, inBlob, inOutIndex); // ULWord acAudioOutStopAddress
3957  POPU32(acAudioOutStartAddress, inBlob, inOutIndex); // ULWord acAudioOutStartAddress
3958  POPU32(acTotalBytesTransferred, inBlob, inOutIndex); // ULWord acTotalBytesTransferred
3959  POPU32(acStartSample, inBlob, inOutIndex); // ULWord acStartSample
3960 
3961  ok &= acTimeCodes.RPCDecode(inBlob, inOutIndex); // NTV2Buffer acTimeCodes
3962  POPU64(v64, inBlob, inOutIndex); // LWord64 acCurrentTime
3963  acCurrentTime = LWord64(v64);
3964  POPU32(acCurrentFrame, inBlob, inOutIndex); // ULWord acCurrentFrame
3965  POPU64(v64, inBlob, inOutIndex); // LWord64 acCurrentFrameTime
3966  acCurrentFrameTime = LWord64(v64);
3967  POPU64(acAudioClockCurrentTime, inBlob, inOutIndex); // ULWord64 acAudioClockCurrentTime
3968  POPU32(acCurrentAudioExpectedAddress, inBlob, inOutIndex); // ULWord acCurrentAudioExpectedAddress
3969  POPU32(acCurrentAudioStartAddress, inBlob, inOutIndex); // ULWord acCurrentAudioStartAddress
3970  POPU32(acCurrentFieldCount, inBlob, inOutIndex); // ULWord acCurrentFieldCount
3971  POPU32(acCurrentLineCount, inBlob, inOutIndex); // ULWord acCurrentLineCount
3972  POPU32(acCurrentReps, inBlob, inOutIndex); // ULWord acCurrentReps
3973  POPU64(acCurrentUserCookie, inBlob, inOutIndex); // ULWord64 acCurrentUserCookie
3974  POPU32(acFrame, inBlob, inOutIndex); // ULWord acFrame
3975  POPU32(acRP188.fDBB, inBlob, inOutIndex); // ULWord acRP188.fDBB
3976  POPU32(acRP188.fLo, inBlob, inOutIndex); // ULWord acRP188.fLo
3977  POPU32(acRP188.fHi, inBlob, inOutIndex); // ULWord acRP188.fHi
3978  ok &= acTrailer.RPCDecode(inBlob, inOutIndex); // NTV2_TRAILER acTrailer
3979  return ok;
3980  }
3981 
3983  {
3984  const size_t totBytes (acHeader.GetSizeInBytes()); // Header + natural size of all structs/fields inbetween + Trailer
3985  if (outBlob.capacity() < totBytes)
3986  outBlob.reserve(totBytes);
3987  bool ok = acHeader.RPCEncode(outBlob); // NTV2_HEADER acHeader
3988  PUSHU16(acState, outBlob); // UWord acState
3989  PUSHU32(ULWord(acTransferFrame), outBlob); // LWord acTransferFrame
3990  PUSHU32(acBufferLevel, outBlob); // ULWord acBufferLevel
3991  PUSHU32(acFramesProcessed, outBlob); // ULWord acFramesProcessed
3992  PUSHU32(acFramesDropped, outBlob); // ULWord acFramesDropped
3993  ok &= acFrameStamp.RPCEncode(outBlob); // FRAME_STAMP acFrameStamp
3994  PUSHU32(acAudioTransferSize, outBlob); // ULWord acAudioTransferSize
3995  PUSHU32(acAudioStartSample, outBlob); // ULWord acAudioStartSample
3996  PUSHU32(acAncTransferSize, outBlob); // ULWord acAncTransferSize
3997  PUSHU32(acAncField2TransferSize, outBlob); // ULWord acAncField2TransferSize
3998  ok &= acTrailer.RPCEncode(outBlob); // NTV2_TRAILER acTrailer
3999  return ok;
4000  }
4001 
4002  bool AUTOCIRCULATE_TRANSFER_STATUS::RPCDecode (const UByteSequence & inBlob, size_t & inOutIndex)
4003  { uint16_t v16(0); uint32_t v32(0);
4004  bool ok = acHeader.RPCDecode(inBlob, inOutIndex); // NTV2_HEADER acHeader
4005  POPU16(v16, inBlob, inOutIndex); // NTV2AutoCirculateState acState
4006  acState = NTV2AutoCirculateState(v16);
4007  POPU32(v32, inBlob, inOutIndex); // LWord acTransferFrame
4008  acTransferFrame = LWord(v32);
4009  POPU32(acBufferLevel, inBlob, inOutIndex); // ULWord acBufferLevel
4010  POPU32(acFramesProcessed, inBlob, inOutIndex); // ULWord acFramesProcessed
4011  POPU32(acFramesDropped, inBlob, inOutIndex); // ULWord acFramesDropped
4012  ok &= acFrameStamp.RPCDecode(inBlob, inOutIndex); // FRAME_STAMP acFrameStamp
4013  POPU32(acAudioTransferSize, inBlob, inOutIndex); // ULWord acAudioTransferSize
4014  POPU32(acAudioStartSample, inBlob, inOutIndex); // ULWord acAudioStartSample
4015  POPU32(acAncTransferSize, inBlob, inOutIndex); // ULWord acAncTransferSize
4016  POPU32(acAncField2TransferSize, inBlob, inOutIndex); // ULWord acAncField2TransferSize
4017  ok &= acTrailer.RPCDecode(inBlob, inOutIndex); // NTV2_TRAILER acTrailer
4018  return ok;
4019  }
4020 
4022  {
4023  PUSHU32(acNumSegments, outBlob); // ULWord acNumSegments
4024  PUSHU32(acNumActiveBytesPerRow, outBlob); // ULWord acNumActiveBytesPerRow
4025  PUSHU32(acSegmentHostPitch, outBlob); // ULWord acSegmentHostPitch
4026  PUSHU32(acSegmentDevicePitch, outBlob); // ULWord acSegmentDevicePitch
4027  return true;
4028  }
4029 
4030  bool NTV2SegmentedDMAInfo::RPCDecode (const UByteSequence & inBlob, size_t & inOutIndex)
4031  {
4032  POPU32(acNumSegments, inBlob, inOutIndex); // ULWord acNumSegments
4033  POPU32(acNumActiveBytesPerRow, inBlob, inOutIndex); // ULWord acNumActiveBytesPerRow
4034  POPU32(acSegmentHostPitch, inBlob, inOutIndex); // ULWord acSegmentHostPitch
4035  POPU32(acSegmentDevicePitch, inBlob, inOutIndex); // ULWord acSegmentDevicePitch
4036  return true;
4037  }
4038 
4040  {
4041  PUSHU16(ccMode, outBlob); // NTV2ColorCorrectionMode ccMode
4042  PUSHU32(ccSaturationValue, outBlob); // ULWord ccSaturationValue
4043  return ccLookupTables.RPCEncode(outBlob); // NTV2Buffer ccLookupTables
4044  }
4045 
4046  bool NTV2ColorCorrectionData::RPCDecode (const UByteSequence & inBlob, size_t & inOutIndex)
4047  { uint16_t u16(0);
4048  POPU16(u16, inBlob, inOutIndex); // NTV2ColorCorrectionMode ccMode
4049  ccMode = NTV2ColorCorrectionMode(u16);
4050  POPU32(ccSaturationValue, inBlob, inOutIndex); // ULWord ccSaturationValue
4051  return ccLookupTables.RPCDecode(inBlob, inOutIndex); // NTV2Buffer ccLookupTables
4052  }
4053 
4055  {
4056  PUSHU16(mode, outBlob); // AutoCircVidProcMode mode
4057  PUSHU16(foregroundVideoCrosspoint, outBlob); // NTV2Crosspoint foregroundVideoCrosspoint
4058  PUSHU16(backgroundVideoCrosspoint, outBlob); // NTV2Crosspoint backgroundVideoCrosspoint
4059  PUSHU16(foregroundKeyCrosspoint, outBlob); // NTV2Crosspoint foregroundKeyCrosspoint
4060  PUSHU16(backgroundKeyCrosspoint, outBlob); // NTV2Crosspoint backgroundKeyCrosspoint
4061  PUSHU32(ULWord(transitionCoefficient), outBlob); // Fixed_ transitionCoefficient
4062  PUSHU32(ULWord(transitionSoftness), outBlob); // Fixed_ transitionSoftness
4063  return true;
4064  }
4065 
4066  bool AutoCircVidProcInfo::RPCDecode (const UByteSequence & inBlob, size_t & inOutIndex)
4067  { uint16_t v16(0); uint32_t v32(0);
4068  POPU16(v16, inBlob, inOutIndex); // AutoCircVidProcMode mode
4069  mode = AutoCircVidProcMode(v16);
4070  POPU16(v16, inBlob, inOutIndex); // NTV2Crosspoint foregroundVideoCrosspoint
4071  foregroundVideoCrosspoint = NTV2Crosspoint(v16);
4072  POPU16(v16, inBlob, inOutIndex); // NTV2Crosspoint backgroundVideoCrosspoint
4073  backgroundVideoCrosspoint = NTV2Crosspoint(v16);
4074  POPU16(v16, inBlob, inOutIndex); // NTV2Crosspoint foregroundKeyCrosspoint
4075  foregroundKeyCrosspoint = NTV2Crosspoint(v16);
4076  POPU16(v16, inBlob, inOutIndex); // NTV2Crosspoint backgroundKeyCrosspoint
4077  backgroundKeyCrosspoint = NTV2Crosspoint(v16);
4078  POPU32(v32, inBlob, inOutIndex); // Fixed_ transitionCoefficient
4079  transitionCoefficient = Fixed_(v32);
4080  POPU32(v32, inBlob, inOutIndex); // Fixed_ transitionSoftness
4081  transitionSoftness = Fixed_(v32);
4082  return true;
4083  }
4084 
4086  {
4087  PUSHU32(fDBB, outBlob); // ULWord fDBB
4088  PUSHU32(fLo, outBlob); // ULWord fLo
4089  PUSHU32(fHi, outBlob); // ULWord fHi
4090  return true;
4091  }
4092 
4093  bool NTV2_RP188::RPCDecode (const UByteSequence & inBlob, size_t & inOutIndex)
4094  {
4095  POPU32(fDBB, inBlob, inOutIndex); // ULWord fDBB
4096  POPU32(fLo, inBlob, inOutIndex); // ULWord fLo
4097  POPU32(fHi, inBlob, inOutIndex); // ULWord fHi
4098  return true;
4099  }
4100 
4102  {
4104  const size_t totBytes (acHeader.GetSizeInBytes() + acVideoBuffer.GetByteCount() + acAudioBuffer.GetByteCount()
4105  + acANCBuffer.GetByteCount() + acANCField2Buffer.GetByteCount() + acOutputTimeCodes.GetByteCount()
4106  + acHDMIAuxData.GetByteCount() + 64); // Header + natural size of all structs/fields inbetween + Trailer
4107  if (outBlob.capacity() < totBytes)
4108  outBlob.reserve(totBytes);
4109  bool ok = acHeader.RPCEncode(outBlob); // NTV2_HEADER acHeader
4110  ok &= acVideoBuffer.RPCEncode(outBlob); // NTV2Buffer acVideoBuffer
4111  ok &= acAudioBuffer.RPCEncode(outBlob); // NTV2Buffer acAudioBuffer
4112  ok &= acANCBuffer.RPCEncode(outBlob); // NTV2Buffer acANCBuffer
4113  ok &= acANCField2Buffer.RPCEncode(outBlob); // NTV2Buffer acANCField2Buffer
4114  ok &= acOutputTimeCodes.RPCEncode(outBlob); // NTV2Buffer acOutputTimeCodes
4115  ok &= acTransferStatus.RPCEncode(outBlob); // AUTOCIRCULATE_TRANSFER_STATUS acTransferStatus
4116  PUSHU64(acInUserCookie, outBlob); // ULWord64 acInUserCookie
4117  PUSHU32(acInVideoDMAOffset, outBlob); // ULWord acInVideoDMAOffset
4118  ok &= acInSegmentedDMAInfo.RPCEncode(outBlob); // NTV2SegmentedDMAInfo acInSegmentedDMAInfo
4119  ok &= acColorCorrection.RPCEncode(outBlob); // NTV2ColorCorrectionData acColorCorrection
4120  PUSHU16(acFrameBufferFormat, outBlob); // NTV2PixelFormat acFrameBufferFormat
4121  PUSHU16(acFrameBufferOrientation, outBlob); // NTV2FBOrientation acFrameBufferOrientation
4122  ok &= acVidProcInfo.RPCEncode(outBlob); // AutoCircVidProcInfo acVidProcInfo
4123  PUSHU16(acVideoQuarterSizeExpand, outBlob); // NTV2QtrSizeExpandMode acVideoQuarterSizeExpand
4124  ok &= acHDMIAuxData.RPCEncode(outBlob); // NTV2Buffer acHDMIAuxData
4125  PUSHU32(acPeerToPeerFlags, outBlob); // ULWord acPeerToPeerFlags
4126  PUSHU32(acFrameRepeatCount, outBlob); // ULWord acFrameRepeatCount
4127  PUSHU32(ULWord(acDesiredFrame), outBlob); // LWord acDesiredFrame
4128  ok &= acRP188.RPCEncode(outBlob); // NTV2_RP188 acRP188
4129  PUSHU16(acCrosspoint, outBlob); // NTV2Crosspoint acCrosspoint
4130  ok &= acTrailer.RPCEncode(outBlob); // NTV2_TRAILER acTrailer
4132  return ok;
4133  }
4134 
4135  bool AUTOCIRCULATE_TRANSFER::RPCDecode (const UByteSequence & inBlob, size_t & inOutIndex)
4136  { uint16_t v16(0); uint32_t v32(0);
4138  bool ok = acHeader.RPCDecode(inBlob, inOutIndex); // NTV2_HEADER acHeader
4139  ok &= acVideoBuffer.RPCDecode(inBlob, inOutIndex); // NTV2Buffer acVideoBuffer
4140  ok &= acAudioBuffer.RPCDecode(inBlob, inOutIndex); // NTV2Buffer acAudioBuffer
4141  ok &= acANCBuffer.RPCDecode(inBlob, inOutIndex); // NTV2Buffer acANCBuffer
4142  ok &= acANCField2Buffer.RPCDecode(inBlob, inOutIndex); // NTV2Buffer acANCField2Buffer
4143  ok &= acOutputTimeCodes.RPCDecode(inBlob, inOutIndex); // NTV2Buffer acOutputTimeCodes
4144  ok &= acTransferStatus.RPCDecode(inBlob, inOutIndex); // AUTOCIRCULATE_TRANSFER_STATUS acTransferStatus
4145  POPU64(acInUserCookie, inBlob, inOutIndex); // ULWord64 acInUserCookie
4146  POPU32(acInVideoDMAOffset, inBlob, inOutIndex); // ULWord acInVideoDMAOffset
4147  ok &= acInSegmentedDMAInfo.RPCDecode(inBlob, inOutIndex);// NTV2Buffer acInSegmentedDMAInfo
4148  ok &= acColorCorrection.RPCDecode(inBlob, inOutIndex); // NTV2Buffer acColorCorrection
4149  POPU16(v16, inBlob, inOutIndex); // NTV2PixelFormat acFrameBufferFormat
4150  acFrameBufferFormat = NTV2FrameBufferFormat(v16);
4151  POPU16(v16, inBlob, inOutIndex); // NTV2FBOrientation acFrameBufferOrientation
4152  acFrameBufferOrientation = NTV2FBOrientation(v16);
4153  ok &= acVidProcInfo.RPCDecode(inBlob, inOutIndex); // AutoCircVidProcInfo acVidProcInfo
4154  POPU16(v16, inBlob, inOutIndex); // NTV2QtrSizeExpandMode acVideoQuarterSizeExpand
4155  acVideoQuarterSizeExpand = NTV2QtrSizeExpandMode(v16);
4156  ok &= acHDMIAuxData.RPCDecode(inBlob, inOutIndex); // NTV2Buffer acHDMIAuxData
4157  POPU32(acPeerToPeerFlags, inBlob, inOutIndex); // ULWord acPeerToPeerFlags
4158  POPU32(acFrameRepeatCount, inBlob, inOutIndex); // ULWord acFrameRepeatCount
4159  POPU32(v32, inBlob, inOutIndex); // LWord acDesiredFrame
4160  acDesiredFrame = LWord(v32);
4161  ok &= acRP188.RPCDecode(inBlob, inOutIndex); // NTV2_RP188 acRP188
4162  POPU16(v16, inBlob, inOutIndex); // NTV2Crosspoint acCrosspoint
4163  acCrosspoint = NTV2Crosspoint(v16);
4164  ok &= acTrailer.RPCDecode(inBlob, inOutIndex); // NTV2_TRAILER acTrailer
4166  return ok;
4167  }
4168 
4170  {
4171  NTV2Buffer buff;
4172  PUSHU16(UWord(channelSpec), outBlob); // NTV2Crosspoint channelSpec
4173 // PUSHU64(ULWord64(videoBuffer), outBlob) // ULWord * videoBuffer
4174  PUSHU32(videoBufferSize, outBlob); // ULWord videoBufferSize
4175  if (videoBuffer && videoBufferSize)
4176  { buff.Set(videoBuffer, videoBufferSize);
4177  buff.AppendU8s(outBlob);
4178  }
4179  PUSHU32(videoDmaOffset, outBlob); // ULWord videoDmaOffset
4180 // PUSHU64(ULWord64(audioBuffer), outBlob) // ULWord * audioBuffer
4181  PUSHU32(audioBufferSize, outBlob); // ULWord audioBufferSize
4182  if (audioBuffer && audioBufferSize)
4183  { buff.Set(audioBuffer, audioBufferSize);
4184  buff.AppendU8s(outBlob);
4185  }
4186  PUSHU32(audioStartSample, outBlob); // ULWord audioStartSample
4187  PUSHU32(audioNumChannels, outBlob); // ULWord audioNumChannels
4188  PUSHU32(frameRepeatCount, outBlob); // ULWord frameRepeatCount
4189  rp188.RPCEncode(outBlob); // RP188_STRUCT rp188
4190  PUSHU32(ULWord(desiredFrame), outBlob); // LWord desiredFrame
4191  PUSHU32(hUser, outBlob); // ULWord hUser
4192  PUSHU32(transferFlags, outBlob); // ULWord transferFlags
4193  PUSHU8(bDisableExtraAudioInfo, outBlob); // BOOL_ bDisableExtraAudioInfo
4194  PUSHU16(UWord(frameBufferFormat), outBlob); // NTV2PixelFormat frameBufferFormat
4195  PUSHU16(UWord(frameBufferOrientation), outBlob); // NTV2FBOrientation frameBufferOrientation
4196  // Skip color correction for now // NTV2ColorCorrectionInfo colorCorrectionInfo
4197  vidProcInfo.RPCEncode(outBlob); // AutoCircVidProcInfo vidProcInfo
4198  PUSHU32(customAncInfo.Group1, outBlob); // CUSTOM_ANC_STRUCT customAncInfo
4199  PUSHU32(customAncInfo.Group2, outBlob);
4200  PUSHU32(customAncInfo.Group3, outBlob);
4201  PUSHU32(customAncInfo.Group4, outBlob);
4202  PUSHU32(videoNumSegments, outBlob); // ULWord videoNumSegments
4203  PUSHU32(videoSegmentHostPitch, outBlob); // ULWord videoSegmentHostPitch
4204  PUSHU32(videoSegmentCardPitch, outBlob); // ULWord videoSegmentCardPitch
4205  PUSHU16(UWord(videoQuarterSizeExpand), outBlob); // NTV2QtrSizeExpandMode videoQuarterSizeExpand
4206  return true;
4207  }
4208 
4209  bool AUTOCIRCULATE_TRANSFER_STRUCT::RPCDecode (const UByteSequence & inBlob, size_t & inOutIndex)
4210  { UWord v16(0); ULWord v32(0);
4211  POPU16(v16, inBlob, inOutIndex); // NTV2Crosspoint channelSpec
4212  channelSpec = NTV2Crosspoint(v16);
4213 // POPU64(u64, inBlob, inOutIndex); // ULWord * videoBuffer
4214 // videoBuffer = reinterpret_cast<ULWord*>(u64);
4215  POPU32(videoBufferSize, inBlob, inOutIndex); // ULWord videoBufferSize
4216  if (videoBufferSize && !videoBuffer)
4217  {
4218  videoBuffer = reinterpret_cast<ULWord*>(AJAMemory::AllocateAligned(videoBufferSize, NTV2Buffer::DefaultPageSize()));
4219  if (!videoBuffer)
4220  return false;
4221  if ((inOutIndex + videoBufferSize) >= inBlob.size())
4222  return false; // past end of inBlob
4223  UByte* pBuffer = reinterpret_cast<UByte*>(videoBuffer);
4224  for (ULWord cnt(0); cnt < videoBufferSize; cnt++)
4225  pBuffer[cnt] = inBlob.at(inOutIndex++); // Caller is responsible for byte-swapping if needed
4226  }
4227  POPU32(videoDmaOffset, inBlob, inOutIndex); // ULWord videoDmaOffset
4228 // POPU64(u64, inBlob, inOutIndex); // ULWord * audioBuffer
4229 // audioBuffer = reinterpret_cast<ULWord*>(u64);
4230  POPU32(audioBufferSize, inBlob, inOutIndex); // ULWord audioBufferSize
4231  if (audioBufferSize && !audioBuffer)
4232  {
4233  audioBuffer = reinterpret_cast<ULWord*>(AJAMemory::AllocateAligned(audioBufferSize, NTV2Buffer::DefaultPageSize()));
4234  if (!audioBuffer)
4235  return false;
4236  if ((inOutIndex + audioBufferSize) >= inBlob.size())
4237  return false; // past end of inBlob
4238  UByte* pBuffer = reinterpret_cast<UByte*>(audioBuffer);
4239  for (ULWord cnt(0); cnt < audioBufferSize; cnt++)
4240  pBuffer[cnt] = inBlob.at(inOutIndex++); // Caller is responsible for byte-swapping if needed
4241  }
4242  POPU32(audioStartSample, inBlob, inOutIndex); // ULWord audioStartSample
4243  POPU32(audioNumChannels, inBlob, inOutIndex); // ULWord audioNumChannels
4244  POPU32(frameRepeatCount, inBlob, inOutIndex); // ULWord frameRepeatCount
4245  rp188.RPCDecode(inBlob, inOutIndex); // RP188_STRUCT rp188
4246  POPU32(v32, inBlob, inOutIndex); // LWord desiredFrame
4247  desiredFrame = LWord(v32);
4248  POPU32(hUser, inBlob, inOutIndex); // ULWord hUser
4249  POPU32(transferFlags, inBlob, inOutIndex); // ULWord transferFlags
4250  POPU8(AsU8Ref(bDisableExtraAudioInfo), inBlob, inOutIndex); // BOOL_ bDisableExtraAudioInfo
4251  POPU16(v16, inBlob, inOutIndex); // NTV2PixelFormat frameBufferFormat
4252  frameBufferFormat = NTV2PixelFormat(v16);
4253  POPU16(v16, inBlob, inOutIndex); // NTV2FBOrientation frameBufferOrientation
4254  frameBufferOrientation = NTV2FBOrientation(v16);
4255  // Skip color correction for now // NTV2ColorCorrectionInfo colorCorrectionInfo
4256  vidProcInfo.RPCDecode(inBlob, inOutIndex); // AutoCircVidProcInfo vidProcInfo
4257  POPU32(customAncInfo.Group1, inBlob, inOutIndex); // CUSTOM_ANC_STRUCT customAncInfo
4258  POPU32(customAncInfo.Group2, inBlob, inOutIndex);
4259  POPU32(customAncInfo.Group3, inBlob, inOutIndex);
4260  POPU32(customAncInfo.Group4, inBlob, inOutIndex);
4261  POPU32(videoNumSegments, inBlob, inOutIndex); // ULWord videoNumSegments
4262  POPU32(videoSegmentHostPitch, inBlob, inOutIndex); // ULWord videoSegmentHostPitch
4263  POPU32(videoSegmentCardPitch, inBlob, inOutIndex); // ULWord videoSegmentCardPitch
4264  POPU16(v16, inBlob, inOutIndex); // NTV2QtrSizeExpandMode videoQuarterSizeExpand
4265  videoQuarterSizeExpand = NTV2QtrSizeExpandMode(v16);
4266  return true;
4267  }
4268 
4270  {
4271  const size_t totBytes (mHeader.GetSizeInBytes()); // Header + natural size of all structs/fields inbetween + Trailer
4272  if (outBlob.capacity() < totBytes)
4273  outBlob.reserve(totBytes);
4274  bool ok = mHeader.RPCEncode(outBlob); // NTV2_HEADER mHeader
4275  ok &= mBuffer.RPCEncode(outBlob); // NTV2Buffer mBuffer
4276  PUSHU32(mFlags, outBlob); // ULWord mFlags
4277  PUSHU32(mStatus, outBlob); // ULWord mStatus
4278  for (size_t ndx(0); ndx < 16; ndx++)
4279  PUSHU32(mRegisters[ndx], outBlob); // ULWord mRegisters[16]
4280  for (size_t ndx(0); ndx < 32; ndx++)
4281  PUSHU32(mReserved[ndx], outBlob); // ULWord mReserved[32]
4282  ok &= mTrailer.RPCEncode(outBlob); // NTV2_TRAILER mTrailer
4283  return ok;
4284  }
4285 
4286  bool NTV2Bitstream::RPCDecode (const UByteSequence & inBlob, size_t & inOutIndex)
4287  {
4288  bool ok = mHeader.RPCDecode(inBlob, inOutIndex); // NTV2_HEADER acHeader
4289  ok &= mBuffer.RPCDecode(inBlob, inOutIndex); // NTV2Buffer mBuffer
4290  POPU32(mFlags, inBlob, inOutIndex); // ULWord mFlags
4291  POPU32(mStatus, inBlob, inOutIndex); // ULWord mStatus
4292  for (size_t ndx(0); ndx < 16; ndx++)
4293  POPU32(mRegisters[ndx], inBlob, inOutIndex); // ULWord mRegisters[16]
4294  for (size_t ndx(0); ndx < 16; ndx++)
4295  POPU32(mReserved[ndx], inBlob, inOutIndex); // ULWord mReserved[16]
4296  ok &= mTrailer.RPCDecode(inBlob, inOutIndex); // NTV2_TRAILER mTrailer
4297  return ok;
4298  }
4299 
4301  {
4302  PUSHU16(UWord(channelSpec), outBlob); // NTV2Crosspoint channelSpec
4303  PUSHU16(UWord(state), outBlob); // NTV2AutoCirculateState state
4304  PUSHU32(ULWord(startFrame), outBlob); // LWord startFrame
4305  PUSHU32(ULWord(endFrame), outBlob); // LWord endFrame
4306  PUSHU32(ULWord(activeFrame), outBlob); // LWord activeFrame
4307  PUSHU64(rdtscStartTime, outBlob); // ULWord64 rdtscStartTime
4308  PUSHU64(audioClockStartTime, outBlob); // ULWord64 audioClockStartTime
4309  PUSHU64(rdtscCurrentTime, outBlob); // ULWord64 rdtscCurrentTime
4310  PUSHU64(audioClockCurrentTime, outBlob); // ULWord64 audioClockCurrentTime
4311  PUSHU32(framesProcessed, outBlob); // ULWord framesProcessed
4312  PUSHU32(framesDropped, outBlob); // ULWord framesDropped
4313  PUSHU32(bufferLevel, outBlob); // ULWord bufferLevel
4314  PUSHU8(bWithAudio, outBlob); // BOOL_ bWithAudio
4315  PUSHU8(bWithRP188, outBlob); // BOOL_ bWithRP188
4316  PUSHU8(bFbfChange, outBlob); // BOOL_ bFbfChange
4317  PUSHU8(bFboChange, outBlob); // BOOL_ bFboChange
4318  PUSHU8(bWithColorCorrection, outBlob); // BOOL_ bWithColorCorrection
4319  PUSHU8(bWithVidProc, outBlob); // BOOL_ bWithVidProc
4320  PUSHU8(bWithCustomAncData, outBlob); // BOOL_ bWithCustomAncData
4321  return true;
4322  }
4323 
4324  bool AUTOCIRCULATE_STATUS_STRUCT::RPCDecode (const UByteSequence & inBlob, size_t & inOutIndex)
4325  { uint16_t v16(0); uint32_t v32(0);
4326  POPU16(v16, inBlob, inOutIndex); // NTV2Crosspoint channelSpec
4327  channelSpec = NTV2Crosspoint(v16);
4328  POPU16(v16, inBlob, inOutIndex); // NTV2AutoCirculateState state
4329  state = NTV2AutoCirculateState(v16);
4330  POPU32(v32, inBlob, inOutIndex); // LWord startFrame
4331  startFrame = LWord(v32);
4332  POPU32(v32, inBlob, inOutIndex); // LWord endFrame
4333  endFrame = LWord(v32);
4334  POPU32(v32, inBlob, inOutIndex); // LWord activeFrame
4335  activeFrame = LWord(v32);
4336  POPU64(rdtscStartTime, inBlob, inOutIndex); // ULWord64 rdtscStartTime
4337  POPU64(audioClockStartTime, inBlob, inOutIndex); // ULWord64 audioClockStartTime
4338  POPU64(rdtscCurrentTime, inBlob, inOutIndex); // ULWord64 rdtscCurrentTime
4339  POPU64(audioClockCurrentTime, inBlob, inOutIndex); // ULWord64 audioClockCurrentTime
4340  POPU32(framesProcessed, inBlob, inOutIndex); // ULWord framesProcessed
4341  POPU32(framesDropped, inBlob, inOutIndex); // ULWord framesDropped
4342  POPU32(bufferLevel, inBlob, inOutIndex); // ULWord bufferLevel
4343  POPU8(AsU8Ref(bWithAudio), inBlob, inOutIndex); // BOOL_ bWithAudio
4344  POPU8(AsU8Ref(bWithRP188), inBlob, inOutIndex); // BOOL_ bWithRP188
4345  POPU8(AsU8Ref(bFbfChange), inBlob, inOutIndex); // BOOL_ bFbfChange
4346  POPU8(AsU8Ref(bFboChange), inBlob, inOutIndex); // BOOL_ bFboChange
4347  POPU8(AsU8Ref(bWithColorCorrection), inBlob, inOutIndex);// BOOL_ bWithColorCorrection
4348  POPU8(AsU8Ref(bWithVidProc), inBlob, inOutIndex); // BOOL_ bWithVidProc
4349  POPU8(AsU8Ref(bWithCustomAncData), inBlob, inOutIndex); // BOOL_ bWithCustomAncData
4350  return true;
4351  }
4352 
4354  {
4355  PUSHU32(DBB, outBlob); // ULWord DBB
4356  PUSHU32(Low, outBlob); // ULWord Low
4357  PUSHU32(High, outBlob); // ULWord High
4358  return true;
4359  }
4360 
4361  bool RP188_STRUCT::RPCDecode (const UByteSequence & inBlob, size_t & inOutIndex)
4362  {
4363  POPU32(DBB, inBlob, inOutIndex); // ULWord DBB
4364  POPU32(Low, inBlob, inOutIndex); // ULWord Low
4365  POPU32(High, inBlob, inOutIndex); // ULWord High
4366  return true;
4367  }
4368 
4369 
4371  {
4372  PUSHU32(taskVersion, outBlob); // ULWord taskVersion
4373  PUSHU32(taskSize, outBlob); // ULWord taskSize
4374  PUSHU32(numTasks, outBlob); // ULWord numTasks
4375  PUSHU32(maxTasks, outBlob); // ULWord maxTasks
4376  PUSHU64(ULWord64(taskArray), outBlob); // ULWord taskArray
4377  if (taskArray && numTasks)
4378  for (ULWord num(0); num < numTasks; num++)
4379  {
4380  const AutoCircGenericTask & task (taskArray[num]);
4381  PUSHU32(task.taskType, outBlob); // AutoCircTaskType taskType
4382  const ULWord * pULWords = reinterpret_cast<const ULWord*>(&task.u);
4383  ULWord numWords(0);
4384  if (NTV2_IS_REGISTER_TASK(task.taskType))
4385  numWords = sizeof(AutoCircRegisterTask)/sizeof(ULWord);
4386  else if (NTV2_IS_TIMECODE_TASK(task.taskType))
4387  numWords = sizeof(AutoCircTimeCodeTask)/sizeof(ULWord);
4388  for (ULWord word(0); word < numWords; word++)
4389  PUSHU32(pULWords[word], outBlob);
4390  }
4391  return true;
4392  }
4393 
4394  bool AUTOCIRCULATE_TASK_STRUCT::RPCDecode (const UByteSequence & inBlob, size_t & inOutIndex)
4395  { ULWord u32(0); ULWord64 u64(0);
4396  POPU32(taskVersion, inBlob, inOutIndex); // ULWord taskVersion
4397  POPU32(taskSize, inBlob, inOutIndex); // ULWord taskSize
4398  POPU32(numTasks, inBlob, inOutIndex); // ULWord numTasks
4399  POPU32(maxTasks, inBlob, inOutIndex); // ULWord maxTasks
4400  POPU64(u64, inBlob, inOutIndex); // ULWord taskArray
4401  taskArray = reinterpret_cast<AutoCircGenericTask*>(u64);
4402  if (taskArray && numTasks)
4403  for (ULWord num(0); num < numTasks; num++)
4404  {
4405  AutoCircGenericTask & task (taskArray[num]);
4406  POPU32(u32, inBlob, inOutIndex); // AutoCircTaskType taskType
4407  task.taskType = AutoCircTaskType(u32);
4408  ULWord * pULWords = reinterpret_cast<ULWord*>(&task.u);
4409  ULWord numWords(0);
4410  if (NTV2_IS_REGISTER_TASK(task.taskType))
4411  numWords = sizeof(AutoCircRegisterTask)/sizeof(ULWord);
4412  else if (NTV2_IS_TIMECODE_TASK(task.taskType))
4413  numWords = sizeof(AutoCircTimeCodeTask)/sizeof(ULWord);
4414  for (ULWord word(0); word < numWords; word++)
4415  POPU32(pULWords[word], inBlob, inOutIndex);
4416  }
4417  return true;
4418  }
4419 
4421  {
4422  PUSHU16(UWord(channelSpec), outBlob); // NTV2Crosspoint channelSpec
4423  PUSHU64(ULWord64(frameTime), outBlob); // LWord64 frameTime
4424  PUSHU32(frame, outBlob); // ULWord frame
4425  PUSHU64(audioClockTimeStamp, outBlob); // ULWord64 audioClockTimeStamp
4426  PUSHU32(audioExpectedAddress, outBlob); // ULWord audioExpectedAddress
4427  PUSHU32(audioInStartAddress, outBlob); // ULWord audioInStartAddress
4428  PUSHU32(audioInStopAddress, outBlob); // ULWord audioInStopAddress
4429  PUSHU32(audioOutStopAddress, outBlob); // ULWord audioOutStopAddress
4430  PUSHU32(audioOutStartAddress, outBlob); // ULWord audioOutStartAddress
4431  PUSHU32(bytesRead, outBlob); // ULWord bytesRead
4432  PUSHU32(startSample, outBlob); // ULWord startSample
4433  PUSHU64(ULWord64(currentTime), outBlob); // LWord64 currentTime
4434  PUSHU32(currentFrame, outBlob); // ULWord currentFrame
4435  currentRP188.RPCEncode(outBlob); // RP188_STRUCT currentRP188
4436  PUSHU64(ULWord64(currentFrameTime), outBlob); // LWord64 currentFrameTime
4437  PUSHU64(audioClockCurrentTime, outBlob); // ULWord64 audioClockCurrentTime
4438  PUSHU32(currentAudioExpectedAddress, outBlob); // ULWord currentAudioExpectedAddress
4439  PUSHU32(currentAudioStartAddress, outBlob); // ULWord currentAudioStartAddress
4440  PUSHU32(currentFieldCount, outBlob); // ULWord currentFieldCount
4441  PUSHU32(currentLineCount, outBlob); // ULWord currentLineCount
4442  PUSHU32(currentReps, outBlob); // ULWord currentReps
4443  PUSHU32(currenthUser, outBlob); // ULWord currenthUser
4444  return true;
4445  }
4446 
4447  bool FRAME_STAMP_STRUCT::RPCDecode (const UByteSequence & inBlob, size_t & inOutIndex)
4448  { uint16_t v16(0); uint64_t v64(0);
4449  POPU16(v16, inBlob, inOutIndex); // NTV2Crosspoint channelSpec
4450  channelSpec = NTV2Crosspoint(v16);
4451  POPU64(v64, inBlob, inOutIndex); // LWord64 frameTime
4452  frameTime = LWord64(v64);
4453  POPU32(frame, inBlob, inOutIndex); // ULWord frame
4454  POPU64(audioClockTimeStamp, inBlob, inOutIndex); // ULWord64 audioClockTimeStamp
4455  POPU32(audioExpectedAddress, inBlob, inOutIndex); // ULWord audioExpectedAddress
4456  POPU32(audioInStartAddress, inBlob, inOutIndex); // ULWord audioInStartAddress
4457  POPU32(audioInStopAddress, inBlob, inOutIndex); // ULWord audioInStopAddress
4458  POPU32(audioOutStopAddress, inBlob, inOutIndex); // ULWord audioOutStopAddress
4459  POPU32(audioOutStartAddress, inBlob, inOutIndex); // ULWord audioOutStartAddress
4460  POPU32(bytesRead, inBlob, inOutIndex); // ULWord bytesRead
4461  POPU32(startSample, inBlob, inOutIndex); // ULWord startSample
4462  POPU64(v64, inBlob, inOutIndex); // LWord64 currentTime
4463  currentTime = LWord64(v64);
4464  POPU32(currentFrame, inBlob, inOutIndex); // ULWord currentFrame
4465  currentRP188.RPCDecode(inBlob, inOutIndex); // RP188_STRUCT currentRP188
4466  POPU64(v64, inBlob, inOutIndex); // LWord64 currentFrameTime
4467  currentFrameTime = LWord64(v64);
4468  POPU64(audioClockCurrentTime, inBlob, inOutIndex); // ULWord64 audioClockCurrentTime
4469  POPU32(currentAudioExpectedAddress, inBlob, inOutIndex);// ULWord currentAudioExpectedAddress
4470  POPU32(currentAudioStartAddress, inBlob, inOutIndex); // ULWord currentAudioStartAddress
4471  POPU32(currentFieldCount, inBlob, inOutIndex); // ULWord currentFieldCount
4472  POPU32(currentLineCount, inBlob, inOutIndex); // ULWord currentLineCount
4473  POPU32(currentReps, inBlob, inOutIndex); // ULWord currentReps
4474  POPU32(currenthUser, inBlob, inOutIndex); // ULWord currenthUser
4475  return true;
4476  }
4477 
4479  {
4480  PUSHU16(UWord(eCommand), outBlob); // AUTO_CIRC_COMMAND eCommand
4481  PUSHU16(UWord(channelSpec), outBlob); // NTV2Crosspoint channelSpec
4482  PUSHU32(ULWord(lVal1), outBlob); // LWord lVal1
4483  PUSHU32(ULWord(lVal2), outBlob); // LWord lVal2
4484  PUSHU32(ULWord(lVal3), outBlob); // LWord lVal3
4485  PUSHU32(ULWord(lVal4), outBlob); // LWord lVal4
4486  PUSHU32(ULWord(lVal5), outBlob); // LWord lVal5
4487  PUSHU32(ULWord(lVal6), outBlob); // LWord lVal6
4488  PUSHU8(bVal1, outBlob); // BOOL_ bVal1
4489  PUSHU8(bVal2, outBlob); // BOOL_ bVal2
4490  PUSHU8(bVal3, outBlob); // BOOL_ bVal3
4491  PUSHU8(bVal4, outBlob); // BOOL_ bVal4
4492  PUSHU8(bVal5, outBlob); // BOOL_ bVal5
4493  PUSHU8(bVal6, outBlob); // BOOL_ bVal6
4494  PUSHU8(bVal7, outBlob); // BOOL_ bVal7
4495  PUSHU8(bVal8, outBlob); // BOOL_ bVal8
4496  PUSHU64(ULWord64(pvVal1), outBlob); // void* pvVal1
4497  PUSHU64(ULWord64(pvVal2), outBlob); // void* pvVal2
4498  PUSHU64(ULWord64(pvVal3), outBlob); // void* pvVal3
4499  PUSHU64(ULWord64(pvVal4), outBlob); // void* pvVal4
4500  if (eCommand == eGetAutoCirc && pvVal1)
4501  reinterpret_cast<AUTOCIRCULATE_STATUS_STRUCT*>(pvVal1)->RPCEncode(outBlob);
4502  if ((eCommand == eGetFrameStamp || eCommand == eGetFrameStampEx2) && pvVal1)
4503  reinterpret_cast<FRAME_STAMP_STRUCT*>(pvVal1)->RPCEncode(outBlob);
4504  if (eCommand == eGetFrameStampEx2 && pvVal2)
4505  reinterpret_cast<AUTOCIRCULATE_TASK_STRUCT*>(pvVal2)->RPCEncode(outBlob);
4506  if (eCommand == eTransferAutoCirculate && pvVal1)
4507  reinterpret_cast<AUTOCIRCULATE_TRANSFER_STRUCT*>(pvVal1)->RPCEncode(outBlob);
4508  return true;
4509  }
4510 
4511  bool AUTOCIRCULATE_DATA::RPCDecode (const UByteSequence & inBlob, size_t & inOutIndex)
4512  {
4513 #if defined(AJA_LINUX)
4514  #pragma GCC diagnostic push
4515  #pragma GCC diagnostic ignored "-Wstrict-aliasing"
4516 #endif
4517  uint16_t v16(0); uint32_t v32(0);
4518  POPU16(v16, inBlob, inOutIndex); // AUTO_CIRC_COMMAND eCommand
4519  eCommand = AUTO_CIRC_COMMAND(v16);
4520  POPU16(v16, inBlob, inOutIndex); // NTV2Crosspoint channelSpec
4521  channelSpec = NTV2Crosspoint(v16);
4522  POPU32(v32, inBlob, inOutIndex); lVal1 = LWord(v32); // LWord lVal1
4523  POPU32(v32, inBlob, inOutIndex); lVal2 = LWord(v32); // LWord lVal2
4524  POPU32(v32, inBlob, inOutIndex); lVal3 = LWord(v32); // LWord lVal3
4525  POPU32(v32, inBlob, inOutIndex); lVal4 = LWord(v32); // LWord lVal4
4526  POPU32(v32, inBlob, inOutIndex); lVal5 = LWord(v32); // LWord lVal5
4527  POPU32(v32, inBlob, inOutIndex); lVal6 = LWord(v32); // LWord lVal6
4528  POPU8(AsU8Ref(bVal1), inBlob, inOutIndex); // BOOL_ bVal1
4529  POPU8(AsU8Ref(bVal2), inBlob, inOutIndex); // BOOL_ bVal2
4530  POPU8(AsU8Ref(bVal3), inBlob, inOutIndex); // BOOL_ bVal3
4531  POPU8(AsU8Ref(bVal4), inBlob, inOutIndex); // BOOL_ bVal4
4532  POPU8(AsU8Ref(bVal5), inBlob, inOutIndex); // BOOL_ bVal5
4533  POPU8(AsU8Ref(bVal6), inBlob, inOutIndex); // BOOL_ bVal6
4534  POPU8(AsU8Ref(bVal7), inBlob, inOutIndex); // BOOL_ bVal7
4535  POPU8(AsU8Ref(bVal8), inBlob, inOutIndex); // BOOL_ bVal8
4536  POPU64(AsU64Ref(pvVal1), inBlob, inOutIndex); // void* pvVal1
4537  POPU64(AsU64Ref(pvVal2), inBlob, inOutIndex); // void* pvVal2
4538  POPU64(AsU64Ref(pvVal3), inBlob, inOutIndex); // void* pvVal3
4539  POPU64(AsU64Ref(pvVal4), inBlob, inOutIndex); // void* pvVal4
4540 #if defined(AJA_LINUX)
4541  #pragma GCC diagnostic pop
4542 #endif
4543  if (eCommand == eGetAutoCirc && pvVal1)
4544  reinterpret_cast<AUTOCIRCULATE_STATUS_STRUCT*>(pvVal1)->RPCDecode(inBlob, inOutIndex);
4545  if ((eCommand == eGetFrameStamp || eCommand == eGetFrameStampEx2) && pvVal1)
4546  reinterpret_cast<FRAME_STAMP_STRUCT*>(pvVal1)->RPCDecode(inBlob, inOutIndex);
4547  if (eCommand == eGetFrameStampEx2 && pvVal2)
4548  reinterpret_cast<AUTOCIRCULATE_TASK_STRUCT*>(pvVal2)->RPCDecode(inBlob, inOutIndex);
4549  if (eCommand == eTransferAutoCirculate && pvVal1)
4550  reinterpret_cast<AUTOCIRCULATE_TRANSFER_STRUCT*>(pvVal1)->RPCDecode(inBlob, inOutIndex);
4551  return true;
4552  }
NTV2InputSourceSet
std::set< NTV2InputSource > NTV2InputSourceSet
A set of distinct NTV2InputSource values.
Definition: ntv2publicinterface.h:8975
ntv2nub::POPU32
void POPU32(uint32_t &outVal, const std::vector< uint8_t > &inArr, std::size_t &inOutNdx, const bool dontSwap=false)
Definition: ntv2nubtypes.h:69
NTV2BankSelGetSetRegs::mHeader
NTV2_HEADER mHeader
The common structure header – ALWAYS FIRST!
Definition: ntv2publicinterface.h:7736
NTV2SegmentedDMAInfo::acSegmentHostPitch
ULWord acSegmentHostPitch
Offset, in bytes, between the start of one host segment and the start of the next host segment (i....
Definition: ntv2publicinterface.h:7164
NTV2GetRegisters::GetGoodRegisters
bool GetGoodRegisters(NTV2RegNumSet &outGoodRegNums) const
Returns an NTV2RegNumSet built from my mOutGoodRegisters field.
Definition: ntv2publicinterface.cpp:3184
AUTOCIRCULATE_TRANSFER::acFrameBufferFormat
NTV2FrameBufferFormat acFrameBufferFormat
Specifies the frame buffer format to change to. Ignored if AUTOCIRCULATE_WITH_FBFCHANGE option is not...
Definition: ntv2publicinterface.h:8232
NTV2GetRegisters::NTV2GetRegisters
NTV2GetRegisters(const NTV2RegNumSet &inRegisterNumbers=NTV2RegNumSet())
Constructs an NTV2GetRegisters struct from the given set of register numbers.
Definition: ntv2publicinterface.cpp:3124
AUTOCIRCULATE_STATUS_STRUCT::RPCDecode
bool RPCDecode(const NTV2_RPC_BLOB_TYPE &inBlob, size_t &inOutIndex)
Definition: ntv2publicinterface.cpp:4324
NTV2SegmentedDMAInfo::acNumActiveBytesPerRow
ULWord acNumActiveBytesPerRow
Number of active bytes in a row of video.
Definition: ntv2publicinterface.h:7163
NTV2_AUDIOSYSTEM_Plus3
@ NTV2_AUDIOSYSTEM_Plus3
Definition: ntv2enums.h:3880
FRAME_STAMP_STRUCT::currentAudioStartAddress
ULWord currentAudioStartAddress
As found by isr.
Definition: ntv2publicinterface.h:4567
aja::stoul
unsigned long stoul(const std::string &str, std::size_t *idx, int base)
Definition: common.cpp:143
print_address_offset
static string print_address_offset(const size_t inRadix, const ULWord64 inOffset)
Definition: ntv2publicinterface.cpp:427
ULWordSequenceConstIter
ULWordSequence::const_iterator ULWordSequenceConstIter
A handy const iterator for iterating over a ULWordSequence.
Definition: ntv2publicinterface.h:47
FRAME_STAMP::acRP188
NTV2_RP188 acRP188
Deprecated – call FRAME_STAMP::GetInputTimeCode instead.
Definition: ntv2publicinterface.h:7964
NTV2SegmentedDMAInfo::NTV2SegmentedDMAInfo
NTV2SegmentedDMAInfo()
Constructs a disabled NTV2SegmentedDMAInfo struct.
Definition: ntv2publicinterface.cpp:2712
NTV2SDIInputStatus::Clear
void Clear(void)
Constructs a default NTV2SDIInputStatus.
Definition: ntv2publicinterface.cpp:119
AutoCircRegisterTask
Definition: ntv2publicinterface.h:4755
NTV2ChannelSetToStr
string NTV2ChannelSetToStr(const NTV2ChannelSet &inObj, const bool inCompact)
Definition: ntv2publicinterface.cpp:3494
NTV2Buffer::GetU8s
bool GetU8s(UByteSequence &outU8s, const size_t inU8Offset=0, const size_t inMaxSize=128) const
Answers with my contents as a vector of unsigned 8-bit values.
Definition: ntv2publicinterface.cpp:678
NTV2_AUDIOSYSTEM_Plus1
@ NTV2_AUDIOSYSTEM_Plus1
Definition: ntv2enums.h:3878
NTV2RegisterWritesConstIter
NTV2RegWrites::const_iterator NTV2RegisterWritesConstIter
Definition: ntv2publicinterface.h:4070
NTV2SegmentedXferInfo::reset
NTV2SegmentedXferInfo & reset(void)
Resets me to an invalid (all zero) state.
Definition: ntv2publicinterface.cpp:1609
NTV2DoubleArray
std::vector< double > NTV2DoubleArray
An array of double-precision floating-point values.
Definition: ntv2publicinterface.h:70
LWord
int32_t LWord
Definition: ajatypes.h:254
NTV2Buffer::SetDefaultPageSize
static bool SetDefaultPageSize(const size_t inNewSize)
Changes the default page size for use in future page-aligned allocations.
Definition: ntv2publicinterface.cpp:2155
GetRegisterNumbers
NTV2RegNumSet GetRegisterNumbers(const NTV2RegReads &inRegInfos)
Definition: ntv2publicinterface.cpp:3564
FRAME_STAMP::acTrailer
NTV2_TRAILER acTrailer
The common message trailer – ALWAYS LAST!
Definition: ntv2publicinterface.h:7966
AUTOCIRCULATE_STATUS::acFramesProcessed
ULWord acFramesProcessed
Total number of frames successfully processed since CNTV2Card::AutoCirculateStart called.
Definition: ntv2publicinterface.h:7285
AJADebug::StatTimerStop
static AJAStatus StatTimerStop(const uint32_t inKey)
Definition: debug.cpp:1155
CNTV2RegisterExpert::IsReadOnly
static bool IsReadOnly(const uint32_t inRegNum)
Definition: ntv2registerexpert.h:116
AUTOCIRCULATE_DATA::channelSpec
NTV2Crosspoint channelSpec
Definition: ntv2publicinterface.h:4430
NTV2SegmentedDMAInfo::RPCDecode
bool RPCDecode(const NTV2_RPC_BLOB_TYPE &inBlob, size_t &inOutIndex)
Definition: ntv2publicinterface.cpp:4030
NTV2SDIInStatistics::Clear
void Clear(void)
Resets the struct to its initialized state.
Definition: ntv2publicinterface.cpp:2467
NTV2Bitstream::RPCEncode
bool RPCEncode(NTV2_RPC_BLOB_TYPE &outBlob)
Definition: ntv2publicinterface.cpp:4269
NTV2RegNumSetConstIter
ULWordSetConstIter NTV2RegNumSetConstIter
A const iterator that iterates over a set of distinct NTV2RegisterNumbers.
Definition: ntv2publicinterface.h:7531
NTV2RegisterValueMap
std::map< ULWord, ULWord > NTV2RegisterValueMap
A mapping of distinct NTV2RegisterNumbers to their corresponding ULWord values.
Definition: ntv2publicinterface.h:7548
NTV2_IOKINDS_HDMI
@ NTV2_IOKINDS_HDMI
Specifies HDMI input/output kinds.
Definition: ntv2enums.h:1284
NTV2_NUM_STANDARDS
@ NTV2_NUM_STANDARDS
Definition: ntv2enums.h:174
AUTOCIRCULATE_STATUS::WithFBOChange
bool WithFBOChange(void) const
Definition: ntv2publicinterface.h:7469
NTV2GetRegisters::RPCDecode
bool RPCDecode(const NTV2_RPC_BLOB_TYPE &inBlob, size_t &inOutIndex)
Definition: ntv2publicinterface.cpp:3760
FRAME_STAMP::acCurrentTime
LWord64 acCurrentTime
The absolute timestamp at the moment the CNTV2Card::AutoCirculateTransfer or CNTV2Card::AutoCirculate...
Definition: ntv2publicinterface.h:7937
kVRegShiftHDMOutVideoFrameRate
@ kVRegShiftHDMOutVideoFrameRate
Definition: ntv2virtualregisters.h:664
AUTOCIRCULATE_TRANSFER::acFrameRepeatCount
ULWord acFrameRepeatCount
Intended for playout. The number of times to repeat the frame being transferred.
Definition: ntv2publicinterface.h:8244
NTV2_TRAILER::RPCEncode
bool RPCEncode(NTV2_RPC_BLOB_TYPE &outBlob)
Definition: ntv2publicinterface.cpp:3694
NTV2SegmentedDMAInfo
This struct is used to augment the default full-frame AutoCirculate DMA transfer to accommodate multi...
Definition: ntv2publicinterface.h:7160
AUTOCIRCULATE_STATUS_STRUCT::bFboChange
BOOL_ bFboChange
Definition: ntv2publicinterface.h:4388
NTV2_OUTPUTDESTINATION_HDMI1
@ NTV2_OUTPUTDESTINATION_HDMI1
Definition: ntv2enums.h:1313
NTV2FrameGeometryToString
std::string NTV2FrameGeometryToString(const NTV2FrameGeometry inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:7202
NTV2ChannelListToStr
string NTV2ChannelListToStr(const NTV2ChannelList &inObj, const bool inCompact)
Definition: ntv2publicinterface.cpp:3473
NTV2_IS_VALID_NTV2FrameGeometry
#define NTV2_IS_VALID_NTV2FrameGeometry(__s__)
Definition: ntv2enums.h:371
FRAME_STAMP::acCurrentFrame
ULWord acCurrentFrame
Last vertical blank frame for this autocirculate channel (when CNTV2Card::AutoCirculateGetFrameStamp ...
Definition: ntv2publicinterface.h:7942
AUTOCIRCULATE_TRANSFER_STRUCT::RPCEncode
bool RPCEncode(NTV2_RPC_BLOB_TYPE &outBlob)
Definition: ntv2publicinterface.cpp:4169
NTV2StreamChannel
Definition: ntv2publicinterface.h:8861
NTV2HDMIBitDepth
NTV2HDMIBitDepth
Indicates or specifies the HDMI video bit depth.
Definition: ntv2enums.h:3662
NTV2_COLORCORRECTOR_TABLESIZE
#define NTV2_COLORCORRECTOR_TABLESIZE
Definition: ntv2publicinterface.h:4193
FRAME_STAMP::GetInputTimeCode
bool GetInputTimeCode(NTV2_RP188 &outTimeCode, const NTV2TCIndex inTCIndex=NTV2_TCINDEX_SDI1) const
Answers with a specific timecode captured in my acTimeCodes member.
Definition: ntv2publicinterface.cpp:2257
NTV2Buffer::GetU32s
bool GetU32s(ULWordSequence &outU32s, const size_t inU32Offset=0, const size_t inMaxSize=32, const bool inByteSwap=false) const
Answers with my contents as a vector of unsigned 32-bit values.
Definition: ntv2publicinterface.cpp:604
AUTOCIRCULATE_STATUS::acCrosspoint
NTV2Crosspoint acCrosspoint
The crosspoint (channel number with direction)
Definition: ntv2publicinterface.h:7276
AUTOCIRCULATE_STATUS_STRUCT::activeFrame
LWord activeFrame
Definition: ntv2publicinterface.h:4377
AUTOCIRCULATE_WITH_FIELDS
#define AUTOCIRCULATE_WITH_FIELDS
Use this to AutoCirculate with fields as frames for interlaced formats.
Definition: ntv2publicinterface.h:5589
kVRegShiftHDMOutAudioFormat
@ kVRegShiftHDMOutAudioFormat
Definition: ntv2virtualregisters.h:670
NTV2BufferLock::mBuffer
NTV2Buffer mBuffer
Virtual address of a buffer to prelock, and its length.
Definition: ntv2publicinterface.h:8636
AUTOCIRCULATE_DATA::bVal2
BOOL_ bVal2
Definition: ntv2publicinterface.h:4440
RP188_STRUCT::RPCDecode
bool RPCDecode(const NTV2_RPC_BLOB_TYPE &inBlob, size_t &inOutIndex)
Definition: ntv2publicinterface.cpp:4361
NTV2PixelFormats
NTV2FrameBufferFormatSet NTV2PixelFormats
Definition: ntv2publicinterface.h:8966
NTV2_MAX_NUM_AudioSystemEnums
@ NTV2_MAX_NUM_AudioSystemEnums
Definition: ntv2enums.h:3875
NTV2_FG_1920x1114
@ NTV2_FG_1920x1114
1920x1080, NTV2_VANCMODE_TALLER
Definition: ntv2enums.h:346
NTV2OutputDestinations
std::set< NTV2OutputDestination > NTV2OutputDestinations
A set of distinct NTV2OutputDestination values.
Definition: ntv2publicinterface.h:8978
FRAME_STAMP_STRUCT::currentTime
LWord64 currentTime
Current processor time ... on Windows, this is derived from KeQueryPerformanceCounter.
Definition: ntv2publicinterface.h:4549
ntv2devicefeatures.h
Declares device capability functions.
NTV2_FG_720x576
@ NTV2_FG_720x576
720x576, for PAL 625i, NTV2_VANCMODE_OFF
Definition: ntv2enums.h:345
NTV2_FG_720x508
@ NTV2_FG_720x508
720x486, for NTSC 525i, NTV2_VANCMODE_TALL
Definition: ntv2enums.h:348
AUTOCIRCULATE_STATUS::WithVidProc
bool WithVidProc(void) const
Definition: ntv2publicinterface.h:7479
kVRegShiftHDMOutAudioRate
@ kVRegShiftHDMOutAudioRate
Definition: ntv2virtualregisters.h:671
NTV2ColorCorrectionData::RPCDecode
bool RPCDecode(const NTV2_RPC_BLOB_TYPE &inBlob, size_t &inOutIndex)
Definition: ntv2publicinterface.cpp:4046
NTV2Bitstream::SetFlags
void SetFlags(const ULWord inFlags)
Sets the action flags for use in a subsequent call to CNTV2Card::LoadBitstream.
Definition: ntv2publicinterface.h:8794
AJA_NTV2_SDK_VERSION_POINT
#define AJA_NTV2_SDK_VERSION_POINT
The SDK "point" release version, an unsigned decimal integer.
Definition: ntv2version.h:15
FRAME_STAMP::acCurrentUserCookie
ULWord64 acCurrentUserCookie
The frame's AUTOCIRCULATE_TRANSFER::acInUserCookie value that was set when CNTV2Card::AutoCirculateTr...
Definition: ntv2publicinterface.h:7959
AutoCircVidProcMode
AutoCircVidProcMode
Definition: ntv2publicinterface.h:4251
NTV2TCIndexes
std::set< NTV2TCIndex > NTV2TCIndexes
Definition: ntv2publicinterface.h:6960
NTV2SegmentedXferInfo::swapSourceAndDestination
NTV2SegmentedXferInfo & swapSourceAndDestination(void)
Swaps my source and destination offsets, pitches and scan directions.
Definition: ntv2publicinterface.cpp:1622
AUTOCIRCULATE_TRANSFER::SetAudioBuffer
bool SetAudioBuffer(ULWord *pInAudioBuffer, const ULWord inAudioByteCount)
Sets my audio buffer for use in a subsequent call to CNTV2Card::AutoCirculateTransfer.
Definition: ntv2publicinterface.cpp:2859
NTV2TimeCodeListConstIter
NTV2TimeCodeList::const_iterator NTV2TimeCodeListConstIter
A handy const interator for iterating over an NTV2TimeCodeList.
Definition: ntv2publicinterface.h:6955
NTV2AudioChannelPairs
std::set< NTV2AudioChannelPair > NTV2AudioChannelPairs
A set of distinct NTV2AudioChannelPair values.
Definition: ntv2publicinterface.h:58
NTV2GetSupportedDevices
NTV2DeviceIDSet NTV2GetSupportedDevices(const NTV2DeviceKinds inKinds=NTV2_DEVICEKIND_ALL)
Returns an NTV2DeviceIDSet of devices supported by the SDK.
Definition: ntv2utils.cpp:7598
NTV2DeviceGetSupportedOutputDests
bool NTV2DeviceGetSupportedOutputDests(const NTV2DeviceID inDeviceID, NTV2OutputDestinations &outOutputDests, const NTV2IOKinds inKinds)
Returns a set of distinct NTV2OutputDest values supported on the given device.
Definition: ntv2publicinterface.cpp:1370
GetNTV2FrameGeometryFromVideoFormat
NTV2FrameGeometry GetNTV2FrameGeometryFromVideoFormat(const NTV2VideoFormat inVideoFormat)
Definition: ntv2utils.cpp:2548
aja::is_hex_digit
bool is_hex_digit(const char inChr)
Definition: common.cpp:511
NTV2_TYPE_ACSTATUS
#define NTV2_TYPE_ACSTATUS
Identifies AUTOCIRCULATE_STATUS struct.
Definition: ntv2publicinterface.h:5525
NTV2AudioFormat
NTV2AudioFormat
Definition: ntv2enums.h:1937
NTV2_TYPE_BANKGETSET
#define NTV2_TYPE_BANKGETSET
Identifies NTV2BankSelGetSetRegs struct.
Definition: ntv2publicinterface.h:5523
NTV2Channel
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
Definition: ntv2enums.h:1343
NTV2HDMIColorSpace
NTV2HDMIColorSpace
Indicates or specifies HDMI Color Space.
Definition: ntv2enums.h:3575
NTV2AudioFormatToString
std::string NTV2AudioFormatToString(const NTV2AudioFormat inValue, const bool inCompactDisplay=false)
Definition: ntv2utils.cpp:6754
FRAME_STAMP_STRUCT::bytesRead
ULWord bytesRead
Total audio and video bytes transfered.
Definition: ntv2publicinterface.h:4529
NTV2Buffer
Describes a user-space buffer on the host computer. I have an address and a length,...
Definition: ntv2publicinterface.h:6094
AUTOCIRCULATE_STATUS::acStartFrame
LWord acStartFrame
First frame to circulate. FIXFIXFIX Why is this signed? CHANGE TO ULWord??
Definition: ntv2publicinterface.h:7278
NTV2Buffer::RPCDecode
bool RPCDecode(const NTV2_RPC_BLOB_TYPE &inBlob, size_t &inOutIndex)
Definition: ntv2publicinterface.cpp:3718
NTV2SetRegisters::NTV2SetRegisters
NTV2SetRegisters(const NTV2RegWrites &inRegWrites=NTV2RegWrites())
Constructs an NTV2SetRegisters struct from the given NTV2RegisterWrites collection.
Definition: ntv2publicinterface.cpp:3302
NTV2PixelFormatsConstIter
NTV2FrameBufferFormatSetConstIter NTV2PixelFormatsConstIter
Definition: ntv2publicinterface.h:8967
NTV2_TYPE_ACXFER
#define NTV2_TYPE_ACXFER
Identifies AUTOCIRCULATE_TRANSFER struct.
Definition: ntv2publicinterface.h:5526
NTV2PrintChannelSet
ostream & NTV2PrintChannelSet(const NTV2ChannelSet &inObj, const bool inCompact, ostream &inOutStream)
Definition: ntv2publicinterface.cpp:3479
NTV2CROSSPOINT_CHANNEL1
@ NTV2CROSSPOINT_CHANNEL1
Definition: ntv2enums.h:1688
NTV2VirtualData::Print
std::ostream & Print(std::ostream &inOutStream) const
Prints a human-readable representation of me to the given output stream.
Definition: ntv2publicinterface.cpp:3651
AJADebug::StatTimerStart
static AJAStatus StatTimerStart(const uint32_t inKey)
Definition: debug.cpp:1135
NTV2Buffer::GetByteCount
ULWord GetByteCount(void) const
Definition: ntv2publicinterface.h:6168
NTV2_STANDARD_INVALID
@ NTV2_STANDARD_INVALID
Definition: ntv2enums.h:176
AUTOCIRCULATE_STATUS::acOptionFlags
ULWord acOptionFlags
AutoCirculate options used when CNTV2Card::AutoCirculateInitForInput or CNTV2Card::AutoCirculateInitF...
Definition: ntv2publicinterface.h:7288
NTV2_ASSERT
#define NTV2_ASSERT(_expr_)
Definition: ajatypes.h:508
NTV2VideoFormatSet
std::set< NTV2VideoFormat > NTV2VideoFormatSet
A set of distinct NTV2VideoFormat values.
Definition: ntv2publicinterface.h:8961
NTV2_STANDARD_1080
@ NTV2_STANDARD_1080
Identifies SMPTE HD 1080i or 1080psf.
Definition: ntv2enums.h:158
kVRegMaskHDMOutColorRGB
@ kVRegMaskHDMOutColorRGB
Definition: ntv2virtualregisters.h:647
GetNTV2FrameRateFromVideoFormat
NTV2FrameRate GetNTV2FrameRateFromVideoFormat(const NTV2VideoFormat inVideoFormat)
Definition: ntv2utils.cpp:3534
NTV2TimecodeIndex
enum NTV2TCIndex NTV2TimecodeIndex
NTV2Buffer::AppendU8s
bool AppendU8s(UByteSequence &outU8s) const
Appends my contents to an existing UByteSequence.
Definition: ntv2publicinterface.cpp:711
AUTOCIRCULATE_TRANSFER_STATUS::acTransferFrame
LWord acTransferFrame
Frame buffer number the frame was transferred to/from. (-1 if failed)
Definition: ntv2publicinterface.h:8075
NTV2SetRegisters::mHeader
NTV2_HEADER mHeader
The common structure header – ALWAYS FIRST!
Definition: ntv2publicinterface.h:7673
NTV2ColorCorrectionData::ccSaturationValue
ULWord ccSaturationValue
My saturation value, used only in 3-way color correction mode.
Definition: ntv2publicinterface.h:7220
NTV2StandardSet
std::set< NTV2Standard > NTV2StandardSet
A set of distinct NTV2Standard values.
Definition: ntv2publicinterface.h:8972
AUTOCIRCULATE_STATUS::operator[]
std::string operator[](const unsigned inIndexNum) const
Definition: ntv2publicinterface.cpp:2649
AUTOCIRCULATE_TRANSFER::DisableSegmentedDMAs
bool DisableSegmentedDMAs(void)
Disables segmented DMAs, performing a Reset on my acInSegmentedDMAInfo.
Definition: ntv2publicinterface.cpp:2962
NTV2_HEADER::RPCDecode
bool RPCDecode(const NTV2_RPC_BLOB_TYPE &inBlob, size_t &inOutIndex)
Definition: ntv2publicinterface.cpp:3681
NTV2ColorCorrectionData::Set
bool Set(const NTV2ColorCorrectionMode inMode, const ULWord inSaturation, const void *pInTableData)
Sets this struct from the given mode, saturation and table data, replacing any existing mode,...
Definition: ntv2publicinterface.cpp:2765
UByteSequence
std::vector< uint8_t > UByteSequence
An ordered sequence of UByte (uint8_t) values.
Definition: ntv2publicinterface.h:38
NTV2DeviceCanDoOutputDestination
bool NTV2DeviceCanDoOutputDestination(const NTV2DeviceID id, const NTV2OutputDest od)
Definition: ntv2devicefeatures.cpp:137
NTV2_FG_2048x1080
@ NTV2_FG_2048x1080
2048x1080, for 2Kx1080p, NTV2_VANCMODE_OFF
Definition: ntv2enums.h:352
AUTOCIRCULATE_STATUS_STRUCT::bWithColorCorrection
BOOL_ bWithColorCorrection
Definition: ntv2publicinterface.h:4389
AUTOCIRCULATE_TRANSFER_STATUS::acAncField2TransferSize
ULWord acAncField2TransferSize
Total ancillary data bytes for field 2 transferred (capture only).
Definition: ntv2publicinterface.h:8083
NTV2SetRegisters::mOutBadRegIndexes
NTV2Buffer mOutBadRegIndexes
Array of UWords containing index numbers of the register writes that failed. The SDK owns this memory...
Definition: ntv2publicinterface.h:7677
NTV2StandardSetConstIter
NTV2StandardSet::const_iterator NTV2StandardSetConstIter
A handy const iterator for iterating over an NTV2StandardSet.
Definition: ntv2publicinterface.h:8973
NTV2GeometrySetConstIter
NTV2GeometrySet::const_iterator NTV2GeometrySetConstIter
A handy const iterator for iterating over an NTV2GeometrySet.
Definition: ntv2publicinterface.h:8970
NTV2_FG_INVALID
@ NTV2_FG_INVALID
Definition: ntv2enums.h:368
AUTOCIRCULATE_TRANSFER::EnableSegmentedDMAs
bool EnableSegmentedDMAs(const ULWord inNumSegments, const ULWord inNumActiveBytesPerLine, const ULWord inHostBytesPerLine, const ULWord inDeviceBytesPerLine)
Enables segmented DMAs given a segment count, a host pitch, and device pitch value.
Definition: ntv2publicinterface.cpp:2950
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:1803
NTV2SetRegisters::GetFailedRegisterWrites
bool GetFailedRegisterWrites(NTV2RegWrites &outFailedRegWrites) const
Returns an NTV2RegisterWrites built from my mOutBadRegInfos field.
Definition: ntv2publicinterface.cpp:3338
NTV2_OUTPUTDESTINATION_SDI2
@ NTV2_OUTPUTDESTINATION_SDI2
Definition: ntv2enums.h:1315
NTV2StreamBuffer::NTV2StreamBuffer
NTV2StreamBuffer()
Constructs a default NTV2StreamBuffer struct.
Definition: ntv2publicinterface.cpp:3111
NTV2BufferLock::Print
std::ostream & Print(std::ostream &inOutStream) const
Prints a human-readable representation of me to the given output stream.
Definition: ntv2publicinterface.cpp:3055
NTV2_IS_VALID_TRAILER_TAG
#define NTV2_IS_VALID_TRAILER_TAG(_x_)
Definition: ntv2publicinterface.h:5520
NTV2_OUTPUTDESTINATION_SDI3
@ NTV2_OUTPUTDESTINATION_SDI3
Definition: ntv2enums.h:1316
AUTOCIRCULATE_STATUS::GetProcessedFrameCount
ULWord GetProcessedFrameCount(void) const
Definition: ntv2publicinterface.h:7330
NTV2_HEADER_TAG
#define NTV2_HEADER_TAG
Identifies the struct header.
Definition: ntv2publicinterface.h:5516
NTV2_IS_VALID_TIMECODE_INDEX
#define NTV2_IS_VALID_TIMECODE_INDEX(__x__)
Definition: ntv2enums.h:3954
NTV2FrameSize::FGSizesMapCI
FGSizesMap::const_iterator FGSizesMapCI
Definition: ntv2publicinterface.h:5772
FRAME_STAMP_STRUCT::currentFrame
ULWord currentFrame
Last vertical blank frame for this channel's auto-circulate. (at the time of the IOCTL_NTV2_GET_FRAME...
Definition: ntv2publicinterface.h:4550
ntv2endian.h
Defines a number of handy byte-swapping macros.
NTV2HDMIAudioChannels
NTV2HDMIAudioChannels
Indicates or specifies the HDMI audio channel count.
Definition: ntv2enums.h:3637
NTV2OutputDestinationsConstIter
NTV2OutputDestinations::const_iterator NTV2OutputDestinationsConstIter
A handy const iterator for iterating over an NTV2OutputDestinations.
Definition: ntv2publicinterface.h:8979
NTV2_HEADER::RPCEncode
bool RPCEncode(NTV2_RPC_BLOB_TYPE &outBlob)
Definition: ntv2publicinterface.cpp:3668
AUTOCIRCULATE_TRANSFER::acAudioBuffer
NTV2Buffer acAudioBuffer
The host audio buffer. This field is owned by the client application, and thus is responsible for all...
Definition: ntv2publicinterface.h:8176
eStartAutoCircAtTime
@ eStartAutoCircAtTime
Definition: ntv2publicinterface.h:4312
NTV2_TYPE_VIRTUAL_DATA_RW
#define NTV2_TYPE_VIRTUAL_DATA_RW
Identifies NTV2VirtualData struct.
Definition: ntv2publicinterface.h:5522
NTV2GetRegisters::GetBadRegisters
bool GetBadRegisters(NTV2RegNumSet &outBadRegNums) const
Returns the set of register numbers that were not read successfully.
Definition: ntv2publicinterface.cpp:3201
NTV2BufferLock::SetBuffer
bool SetBuffer(const NTV2Buffer &inBuffer)
Sets the buffer to lock for use in a subsequent call to CNTV2Card::DMABufferLock.
Definition: ntv2publicinterface.cpp:3049
NTV2DebugLogging::NTV2DebugLogging
NTV2DebugLogging(const bool inEnable=false)
Constructs an NTV2DebugLogging struct.
Definition: ntv2publicinterface.cpp:2998
NTV2_RP188::Set
void Set(const ULWord inDBB=0xFFFFFFFF, const ULWord inLow=0xFFFFFFFF, const ULWord inHigh=0xFFFFFFFF)
Sets my fields from the given DBB, low and high ULWord components.
Definition: ntv2publicinterface.h:6934
AUTOCIRCULATE_DATA::bVal3
BOOL_ bVal3
Definition: ntv2publicinterface.h:4441
NTV2SetRegisters::RPCDecode
bool RPCDecode(const NTV2_RPC_BLOB_TYPE &inBlob, size_t &inOutIndex)
Definition: ntv2publicinterface.cpp:3804
FRAME_STAMP_STRUCT::audioExpectedAddress
ULWord audioExpectedAddress
The address that was used to transfer.
Definition: ntv2publicinterface.h:4514
NTV2Buffer::SetFrom
bool SetFrom(const NTV2Buffer &inBuffer)
Replaces my contents from the given memory buffer without resizing me.
Definition: ntv2publicinterface.cpp:1840
AUTOCIRCULATE_STATUS::GetBufferLevel
ULWord GetBufferLevel(void) const
Definition: ntv2publicinterface.h:7335
AUTOCIRCULATE_TRANSFER::GetInputTimeCode
bool GetInputTimeCode(NTV2_RP188 &outTimeCode, const NTV2TCIndex inTCIndex=NTV2_TCINDEX_SDI1) const
Intended for capture, answers with a specific timecode captured in my acTransferStatus member's acFra...
Definition: ntv2publicinterface.cpp:2984
kVRegShiftHDMOutBitDepth
@ kVRegShiftHDMOutBitDepth
Definition: ntv2virtualregisters.h:665
NTV2PrintChannelList
ostream & NTV2PrintChannelList(const NTV2ChannelList &inObj, const bool inCompact, ostream &inOutStream)
Definition: ntv2publicinterface.cpp:3458
NTV2DeviceID
NTV2DeviceID
Identifies a specific AJA NTV2 device model number. The NTV2DeviceID is actually the PROM part number...
Definition: ntv2enums.h:20
NTV2BankSelGetSetRegs::NTV2BankSelGetSetRegs
NTV2BankSelGetSetRegs(const NTV2RegInfo &inBankSelect, const NTV2RegInfo &inRegInfo, const bool inDoWrite=false)
Constructs an NTV2BankSelGetSetRegs struct for atomically reading or writing the given bank-selected ...
Definition: ntv2publicinterface.cpp:3597
FRAME_STAMP_STRUCT::audioOutStartAddress
ULWord audioOutStartAddress
For play - end position (exclusive) in buffer of audio.
Definition: ntv2publicinterface.h:4526
DEC0N
#define DEC0N(__x__, __n__)
Definition: ntv2publicinterface.h:5649
ThousandsSeparator::do_grouping
virtual std::string do_grouping() const
Definition: ntv2publicinterface.cpp:2635
NTV2RegisterNumberToString
std::string NTV2RegisterNumberToString(const NTV2RegisterNumber inValue)
Definition: ntv2utils.cpp:7757
AJADebug
Definition: debug.h:243
NTV2GetRegisters::GetRequestedRegisterNumbers
bool GetRequestedRegisterNumbers(NTV2RegNumSet &outRegNums) const
Answers with the set of register numbers that were requested.
Definition: ntv2publicinterface.cpp:3166
AUTOCIRCULATE_TRANSFER::SetFrameBufferFormat
bool SetFrameBufferFormat(const NTV2FrameBufferFormat inNewFormat)
Sets my acFrameBufferFormat value to the given new value (if valid and circulating with AUTOCIRCULATE...
Definition: ntv2publicinterface.cpp:2933
kVRegMaskHDMOutVideoStandard
@ kVRegMaskHDMOutVideoStandard
Definition: ntv2virtualregisters.h:644
FRAME_STAMP::acAudioOutStopAddress
ULWord acAudioOutStopAddress
(output/playback only) Audio play head position when this frame was stamped.
Definition: ntv2publicinterface.h:7908
NTV2FrameBufferFormat
NTV2FrameBufferFormat
Identifies a particular video frame buffer format. See Device Frame Buffer Formats for details.
Definition: ntv2enums.h:210
AUTOCIRCULATE_STATUS::WithHDMIAuxData
bool WithHDMIAuxData(void) const
Definition: ntv2publicinterface.h:7489
AutoCircGenericTask::taskType
AutoCircTaskType taskType
Definition: ntv2publicinterface.h:4787
NTV2_FG_720x486
@ NTV2_FG_720x486
720x486, for NTSC 525i and 525p60, NTV2_VANCMODE_OFF
Definition: ntv2enums.h:344
NTV2_IS_ATC_VITC2_TIMECODE_INDEX
#define NTV2_IS_ATC_VITC2_TIMECODE_INDEX(__x__)
Definition: ntv2enums.h:3961
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:1769
NTV2ColorCorrectionModeToString
std::string NTV2ColorCorrectionModeToString(const NTV2ColorCorrectionMode inValue, const bool inCompactDisplay=false)
Definition: ntv2utils.cpp:7777
NTV2DeviceGetSupportedPixelFormats
bool NTV2DeviceGetSupportedPixelFormats(const NTV2DeviceID inDeviceID, NTV2PixelFormats &outFormats)
Returns a set of distinct NTV2FrameBufferFormat values supported on the given device.
Definition: ntv2publicinterface.cpp:1299
NTV2Buffer::NTV2Buffer
NTV2Buffer(const void *pInUserPointer, const size_t inByteCount)
Constructs me from a client-supplied address and size.
Definition: ntv2publicinterface.cpp:1632
NTV2DeviceIDSetConstIter
NTV2DeviceIDSet::const_iterator NTV2DeviceIDSetConstIter
A convenient const iterator for NTV2DeviceIDSet.
Definition: ntv2utils.h:1041
NTV2Buffer::PutU32s
bool PutU32s(const ULWordSequence &inU32s, const size_t inU32Offset=0, const bool inByteSwap=false)
Copies a vector of unsigned 32-bit values into me.
Definition: ntv2publicinterface.cpp:798
NTV2BufferLock
This is used to prelock a video/audio/anc buffer used as the source or target of DMA transfers....
Definition: ntv2publicinterface.h:8634
NTV2Buffer::toHexString
bool toHexString(std::string &outStr, const size_t inLineBreakInterval=0) const
Converts my contents into a hex-encoded string.
Definition: ntv2publicinterface.cpp:412
AUTOCIRCULATE_TRANSFER_STRUCT::RPCDecode
bool RPCDecode(const NTV2_RPC_BLOB_TYPE &inBlob, size_t &inOutIndex)
Definition: ntv2publicinterface.cpp:4209
AUTOCIRCULATE_TRANSFER::SetAncBuffers
bool SetAncBuffers(ULWord *pInANCBuffer, const ULWord inANCByteCount, ULWord *pInANCF2Buffer=NULL, const ULWord inANCF2ByteCount=0)
Sets my ancillary data buffers for use in a subsequent call to CNTV2Card::AutoCirculateTransfer.
Definition: ntv2publicinterface.cpp:2867
NTV2_INVALID_HDMI_AUDIO_CHANNELS
@ NTV2_INVALID_HDMI_AUDIO_CHANNELS
Definition: ntv2enums.h:3642
NTV2AudioChannelQuadsConstIter
NTV2AudioChannelQuads::const_iterator NTV2AudioChannelQuadsConstIter
Handy const iterator to iterate over a set of distinct NTV2AudioChannelQuad values.
Definition: ntv2publicinterface.h:63
NTV2Buffer::Dump
std::ostream & Dump(std::ostream &inOutputStream=std::cout, const size_t inStartByteOffset=0, const size_t inByteCount=0, const size_t inRadix=16, const size_t inBytesPerGroup=4, const size_t inGroupsPerLine=8, const size_t inAddressRadix=0, const bool inShowAscii=false, const size_t inAddrOffset=0) const
Dumps me in hex/octal/decimal, with/without Ascii, to the given output stream.
NTV2ChannelSetConstIter
NTV2ChannelSet::const_iterator NTV2ChannelSetConstIter
A handy const iterator into an NTV2ChannelSet.
Definition: ntv2publicinterface.h:3870
NTV2PixelFormat
NTV2FrameBufferFormat NTV2PixelFormat
An alias for NTV2FrameBufferFormat.
Definition: ntv2enums.h:251
NTV2TimeCodesConstIter
NTV2TimeCodes::const_iterator NTV2TimeCodesConstIter
A handy const interator for iterating over NTV2TCIndex/NTV2TimeCodeList pairs.
Definition: ntv2publicinterface.h:6958
kVRegShiftHDMOutColorRGB
@ kVRegShiftHDMOutColorRGB
Definition: ntv2virtualregisters.h:666
NTV2DeviceCanDoFrameBufferFormat
bool NTV2DeviceCanDoFrameBufferFormat(const NTV2DeviceID inDeviceID, const NTV2FrameBufferFormat inFBFormat)
Definition: ntv2devicefeatures.hpp:16044
NTV2SDIInStatistics::NTV2SDIInStatistics
NTV2SDIInStatistics()
Constructs an NTV2GetSDIStatistics struct and initializes it to its default state.
Definition: ntv2publicinterface.cpp:2459
NTV2SDIInputStatus::NTV2SDIInputStatus
NTV2SDIInputStatus()
Constructs a default NTV2SDIInputStatus.
Definition: ntv2publicinterface.cpp:113
AUTOCIRCULATE_TRANSFER::SetOutputTimeCode
bool SetOutputTimeCode(const NTV2_RP188 &inTimecode, const NTV2TCIndex inTCIndex=NTV2_TCINDEX_SDI1)
Intended for playout, sets one element of my acOutputTimeCodes member.
Definition: ntv2publicinterface.cpp:2898
ntv2debug.h
NTV2GetRegisters::Print
std::ostream & Print(std::ostream &inOutStream) const
Prints a human-readable representation of me to the given output stream.
Definition: ntv2publicinterface.cpp:3294
NTV2HDMIOutputStatus::Clear
void Clear(void)
Resets me to an invalid state.
Definition: ntv2publicinterface.cpp:149
BIN032
#define BIN032(__x__)
Definition: ntv2publicinterface.h:5662
NTV2DebugLogging::Print
std::ostream & Print(std::ostream &inOutStream) const
Prints a human-readable representation of me to the given output stream.
Definition: ntv2publicinterface.cpp:3005
kVRegShiftHDMOutProtocol
@ kVRegShiftHDMOutProtocol
Definition: ntv2virtualregisters.h:669
NTV2SetRegisters::mTrailer
NTV2_TRAILER mTrailer
The common structure trailer – ALWAYS LAST!
Definition: ntv2publicinterface.h:7678
NTV2_TYPE_GETREGS
#define NTV2_TYPE_GETREGS
Identifies NTV2GetRegisters struct.
Definition: ntv2publicinterface.h:5530
nlohmann::json_abiNLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON_v3_11_NLOHMANN_JSON_VERSION_PATCH::detail::void
j template void())
Definition: json.hpp:4893
NTV2AutoCirculateStateToString
string NTV2AutoCirculateStateToString(const NTV2AutoCirculateState inState)
Definition: ntv2publicinterface.cpp:1433
ePrerollAutoCirculate
@ ePrerollAutoCirculate
Definition: ntv2publicinterface.h:4309
AUTOCIRCULATE_DATA::bVal6
BOOL_ bVal6
Definition: ntv2publicinterface.h:4444
NTV2_IOKINDS_ANALOG
@ NTV2_IOKINDS_ANALOG
Specifies analog input/output kinds.
Definition: ntv2enums.h:1285
NTV2HDMIRange
NTV2HDMIRange
Indicates or specifies the HDMI RGB range.
Definition: ntv2enums.h:3605
FRAME_STAMP::acAudioExpectedAddress
ULWord acAudioExpectedAddress
Audio transfer address.
Definition: ntv2publicinterface.h:7903
AUTOCIRCULATE_STATUS_STRUCT::audioClockStartTime
ULWord64 audioClockStartTime
Definition: ntv2publicinterface.h:4379
FRAME_STAMP_STRUCT::currentReps
ULWord currentReps
At Call Line# currently being OUTPUT (at the time of the IOCTL_NTV2_GET_FRAMESTAMP)
Definition: ntv2publicinterface.h:4572
AUTOCIRCULATE_STATUS::acRDTSCCurrentTime
ULWord64 acRDTSCCurrentTime
Timestamp when CNTV2Card::AutoCirculateGetStatus called, using the host OS system clock.
Definition: ntv2publicinterface.h:7283
NTV2RegWrites
std::vector< NTV2RegInfo > NTV2RegWrites
An ordered sequence of zero or more NTV2RegInfo structs intended for WriteRegister.
Definition: ntv2publicinterface.h:4069
NTV2_TRAILER
All new NTV2 structs end with this common trailer.
Definition: ntv2publicinterface.h:7120
FRAME_STAMP::acTotalBytesTransferred
ULWord acTotalBytesTransferred
Total audio and video bytes transferred.
Definition: ntv2publicinterface.h:7912
NTV2FrameRate
NTV2FrameRate
Identifies a particular video frame rate.
Definition: ntv2enums.h:403
AJA_DebugStat_ACXferRPCDecode
@ AJA_DebugStat_ACXferRPCDecode
Definition: debugshare.h:249
kVRegMaskHDMOutVideoFrameRate
@ kVRegMaskHDMOutVideoFrameRate
Definition: ntv2virtualregisters.h:645
AutoCircGenericTask
Definition: ntv2publicinterface.h:4785
NTV2ColorCorrectionMode
NTV2ColorCorrectionMode
Definition: ntv2enums.h:2065
NTV2SDKVersionDecode_Minor
#define NTV2SDKVersionDecode_Minor
Definition: ntv2publicinterface.h:5445
FRAME_STAMP::acCurrentFrameTime
LWord64 acCurrentFrameTime
The VBI timestamp of the current/active frame currently being ingested on the device (capture),...
Definition: ntv2publicinterface.h:7943
FRAME_STAMP
This class/object reports information about the current and/or requested AutoCirculate frame.
Definition: ntv2publicinterface.h:7884
NTV2VirtualData::mTag
ULWord mTag
Tag for virtual data. This value is used to recal saved data by tag.
Definition: ntv2publicinterface.h:7787
NTV2SDIInputStatus
For devices that support it (see NTV2DeviceCanDoSDIErrorChecks ), this struct reports SDI input error...
Definition: ntv2publicinterface.h:6977
NTV2AudioChannelQuadToString
std::string NTV2AudioChannelQuadToString(const NTV2Audio4ChannelSelect inValue, const bool inCompactDisplay=false)
Definition: ntv2utils.cpp:6495
NTV2DeviceGetSupportedInputSources
bool NTV2DeviceGetSupportedInputSources(const NTV2DeviceID inDeviceID, NTV2InputSourceSet &outInputSources, const NTV2IOKinds inKinds)
Returns a set of distinct NTV2InputSource values supported on the given device.
Definition: ntv2publicinterface.cpp:1354
NTV2Buffer::IsPageAligned
bool IsPageAligned(void) const
Definition: ntv2publicinterface.h:6185
AUTOCIRCULATE_STATUS_STRUCT::framesProcessed
ULWord framesProcessed
Definition: ntv2publicinterface.h:4382
NTV2DeviceCanDoVideoFormat
bool NTV2DeviceCanDoVideoFormat(const NTV2DeviceID inDeviceID, const NTV2VideoFormat inVideoFormat)
Definition: ntv2devicefeatures.hpp:19327
FRAME_STAMP::operator=
FRAME_STAMP & operator=(const FRAME_STAMP &inRHS)
Definition: ntv2publicinterface.cpp:2327
NTV2SegmentedDMAInfo::acSegmentDevicePitch
ULWord acSegmentDevicePitch
Offset, in bytes, between the start of one device segment and the start of the next device segment (i...
Definition: ntv2publicinterface.h:7166
NTV2OutputDest
enum NTV2OutputDestination NTV2OutputDest
NTV2BankSelGetSetRegs::RPCDecode
bool RPCDecode(const NTV2_RPC_BLOB_TYPE &inBlob, size_t &inOutIndex)
Definition: ntv2publicinterface.cpp:3844
NTV2SegmentedXferInfo::setDestDirection
NTV2SegmentedXferInfo & setDestDirection(const bool inTopDown)
Sets the scan direction for the destination.
Definition: ntv2publicinterface.h:5995
FRAME_STAMP::acCurrentAudioStartAddress
ULWord acCurrentAudioStartAddress
As set by play.
Definition: ntv2publicinterface.h:7955
operator+=
NTV2TCIndexes & operator+=(NTV2TCIndexes &inOutSet, const NTV2TCIndexes &inSet)
Appends the given NTV2TCIndexes contents into the given set.
Definition: ntv2publicinterface.cpp:939
NTV2AudioChannelQuads
std::set< NTV2AudioChannelQuad > NTV2AudioChannelQuads
A set of distinct NTV2AudioChannelQuad values.
Definition: ntv2publicinterface.h:62
NTV2RegNumSet
NTV2RegisterNumberSet NTV2RegNumSet
A set of distinct NTV2RegisterNumbers.
Definition: ntv2publicinterface.h:7530
NTV2BufferLock::SetFlags
void SetFlags(const ULWord inFlags)
Sets the action flags for use in a subsequent call to CNTV2Card::DMABufferLock.
Definition: ntv2publicinterface.h:8700
NTV2GetUnsupportedStandards
bool NTV2GetUnsupportedStandards(NTV2StandardSet &outStandards)
Returns a set of NTV2Standard values not suported by any NTV2 device.
Definition: ntv2publicinterface.cpp:1258
NTV2_TYPE_AJABUFFERLOCK
#define NTV2_TYPE_AJABUFFERLOCK
Identifies NTV2BufferLock struct.
Definition: ntv2publicinterface.h:5534
AUTOCIRCULATE_TRANSFER::acTrailer
NTV2_TRAILER acTrailer
The common structure trailer – ALWAYS LAST!
Definition: ntv2publicinterface.h:8249
NTV2BankSelGetSetRegs
This is used to atomically perform bank-selected register reads or writes.
Definition: ntv2publicinterface.h:7735
AUTOCIRCULATE_STATUS::acState
NTV2AutoCirculateState acState
Current AutoCirculate state.
Definition: ntv2publicinterface.h:7277
FRAME_STAMP_STRUCT::currentLineCount
ULWord currentLineCount
Definition: ntv2publicinterface.h:4571
NTV2SegmentedXferInfo
Describes a segmented data transfer (copy or move) from a source memory location to a destination loc...
Definition: ntv2publicinterface.h:5802
AUTOCIRCULATE_TRANSFER::acInSegmentedDMAInfo
NTV2SegmentedDMAInfo acInSegmentedDMAInfo
Optional segmented DMA info, for use with specialized data transfers.
Definition: ntv2publicinterface.h:8230
FRAME_STAMP_STRUCT::startSample
ULWord startSample
Definition: ntv2publicinterface.h:4539
NTV2StreamChannel::NTV2StreamChannel
NTV2StreamChannel()
Constructs a default NTV2StreamChannel struct.
Definition: ntv2publicinterface.cpp:3098
NTV2_QuarterSizeExpandOff
@ NTV2_QuarterSizeExpandOff
Definition: ntv2enums.h:2474
NTV2Buffer::Print
std::ostream & Print(std::ostream &inOutStream) const
Prints a human-readable representation of me into the given output stream.
Definition: ntv2publicinterface.cpp:387
AUTOCIRCULATE_STATUS::IsInput
bool IsInput(void) const
Definition: ntv2publicinterface.h:7494
NTV2BufferLock::mHeader
NTV2_HEADER mHeader
The common structure header – ALWAYS FIRST!
Definition: ntv2publicinterface.h:8635
FRAME_STAMP::acAudioInStartAddress
ULWord acAudioInStartAddress
(input/ingest/capture only) Starting audio record head position when this frame was stamped.
Definition: ntv2publicinterface.h:7904
NTV2_INPUTSOURCE_ANALOG1
@ NTV2_INPUTSOURCE_ANALOG1
Identifies the first analog video input.
Definition: ntv2enums.h:1255
AUTOCIRCULATE_WITH_ANC
#define AUTOCIRCULATE_WITH_ANC
Use this to AutoCirculate with ancillary data.
Definition: ntv2publicinterface.h:5587
NTV2_TYPE_ACXFERSTATUS
#define NTV2_TYPE_ACXFERSTATUS
Identifies AUTOCIRCULATE_TRANSFER_STATUS struct.
Definition: ntv2publicinterface.h:5527
NTV2HDMIAudioChannelsToString
std::string NTV2HDMIAudioChannelsToString(const NTV2HDMIAudioChannels inValue, const bool inCompactDisplay=false)
Definition: ntv2utils.cpp:6709
ntv2nub::PUSHU64
void PUSHU64(const uint64_t inVal, std::vector< uint8_t > &inArr, const bool dontSwap=false)
Definition: ntv2nubtypes.h:46
AUTOCIRCULATE_DATA::lVal3
LWord lVal3
Definition: ntv2publicinterface.h:4434
NTV2RegInfo::Print
std::ostream & Print(std::ostream &outputStream, const bool inAsCode=false) const
Renders me to the given output stream in a human-readable format.
Definition: ntv2publicinterface.cpp:3395
AJAMemory::FreeAligned
static void FreeAligned(void *pMemory)
Definition: memory.cpp:145
AUTO_CIRC_COMMAND
enum _AutoCircCommand_ AUTO_CIRC_COMMAND
AUTOCIRCULATE_WITH_FBFCHANGE
#define AUTOCIRCULATE_WITH_FBFCHANGE
Use this to AutoCirculate with the possibility of frame buffer format changes.
Definition: ntv2publicinterface.h:5583
NTV2Buffer::GetRingChangedByteRange
bool GetRingChangedByteRange(const NTV2Buffer &inBuffer, ULWord &outByteOffsetFirst, ULWord &outByteOffsetLast) const
Assuming my contents and the contents of the given buffer comprise ring buffers that periodically get...
Definition: ntv2publicinterface.cpp:2069
NTV2_IOKINDS_SDI
@ NTV2_IOKINDS_SDI
Specifies SDI input/output kinds.
Definition: ntv2enums.h:1283
eAbortAutoCirc
@ eAbortAutoCirc
Definition: ntv2publicinterface.h:4311
FRAME_STAMP::acTimeCodes
NTV2Buffer acTimeCodes
Intended for capture, this is a sequence of NTV2_RP188 values received from the device (in NTV2TCInde...
Definition: ntv2publicinterface.h:7927
eTransferAutoCirculate
@ eTransferAutoCirculate
Definition: ntv2publicinterface.h:4310
NTV2_RP188::fLo
ULWord fLo
| BG 4 | Secs10 | BG 3 | Secs 1 | BG 2 | Frms10 | BG 1 | Frms 1 |
Definition: ntv2publicinterface.h:6873
NTV2Buffer::DefaultPageSize
static size_t DefaultPageSize(void)
Definition: ntv2publicinterface.cpp:2150
NTV2Bitstream::mHeader
NTV2_HEADER mHeader
The common structure header – ALWAYS FIRST!
Definition: ntv2publicinterface.h:8739
NTV2_IS_VALID_IOKINDS
#define NTV2_IS_VALID_IOKINDS(_k_)
Definition: ntv2enums.h:1298
NTV2ColorCorrectionData::ccMode
NTV2ColorCorrectionMode ccMode
My mode (off, RGB, YCbCr, or 3-way)
Definition: ntv2publicinterface.h:7219
NTV2_OUTPUTDESTINATION_SDI1
@ NTV2_OUTPUTDESTINATION_SDI1
Definition: ntv2enums.h:1314
NTV2InputSourceToString
std::string NTV2InputSourceToString(const NTV2InputSource inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:7263
NTV2CROSSPOINT_INVALID
@ NTV2CROSSPOINT_INVALID
Definition: ntv2enums.h:1707
NTV2_FG_4096x2160
@ NTV2_FG_4096x2160
Definition: ntv2enums.h:361
AutoCircVidProcModeToString
std::string AutoCircVidProcModeToString(const AutoCircVidProcMode inValue, const bool inCompactDisplay=false)
Definition: ntv2utils.cpp:7763
AUTOCIRCULATE_STATUS::acAudioClockCurrentTime
ULWord64 acAudioClockCurrentTime
Timestamp when CNTV2Card::AutoCirculateGetStatus called, using "64-bit clean" value of the device's 4...
Definition: ntv2publicinterface.h:7284
NTV2_FG_8192x4320
@ NTV2_FG_8192x4320
Definition: ntv2enums.h:365
NTV2TCIndexToString
std::string NTV2TCIndexToString(const NTV2TCIndex inValue, const bool inCompactDisplay=false)
Definition: ntv2utils.cpp:6446
NTV2_RP188::fHi
ULWord fHi
| BG 8 | Hrs 10 | BG 7 | Hrs 1 | BG 6 | Mins10 | BG 5 | Mins 1 |
Definition: ntv2publicinterface.h:6874
AutoCircVidProcInfo
Definition: ntv2publicinterface.h:4264
NTV2GetRegisters
This is used by the CNTV2Card::ReadRegisters function.
Definition: ntv2publicinterface.h:7559
AutoCircVidProcInfo::foregroundKeyCrosspoint
NTV2Crosspoint foregroundKeyCrosspoint
Definition: ntv2publicinterface.h:4269
eGetFrameStamp
@ eGetFrameStamp
Definition: ntv2publicinterface.h:4307
NTV2Bitstream::mTrailer
NTV2_TRAILER mTrailer
The common structure trailer – ALWAYS LAST!
Definition: ntv2publicinterface.h:8745
FRAME_STAMP_STRUCT
Definition: ntv2publicinterface.h:4495
NTV2_FG_2048x1588
@ NTV2_FG_2048x1588
2048x1556, for 2Kx1556psf film format, NTV2_VANCMODE_TALL
Definition: ntv2enums.h:354
ntv2nub::POPU64
void POPU64(uint64_t &outVal, const std::vector< uint8_t > &inArr, std::size_t &inOutNdx, const bool dontSwap=false)
Definition: ntv2nubtypes.h:78
AUTOCIRCULATE_DATA::eCommand
AUTO_CIRC_COMMAND eCommand
Definition: ntv2publicinterface.h:4429
AUTOCIRCULATE_TRANSFER::acFrameBufferOrientation
NTV2FBOrientation acFrameBufferOrientation
Specifies the frame buffer orientation to change to. Ignored if AUTOCIRCULATE_WITH_FBOCHANGE option i...
Definition: ntv2publicinterface.h:8233
NTV2Standard
NTV2Standard
Identifies a particular video standard.
Definition: ntv2enums.h:156
NTV2_MAX_NUM_CHANNELS
@ NTV2_MAX_NUM_CHANNELS
Definition: ntv2enums.h:1353
NTV2EndianSwap16
#define NTV2EndianSwap16(__val__)
Definition: ntv2endian.h:15
NTV2_TRAILER::fTrailerVersion
ULWord fTrailerVersion
Trailer version, set when created. Before SDK 15.1: always zero; 15.1 or later: set to calling SDK ve...
Definition: ntv2publicinterface.h:7121
nlohmann::json_abiNLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON_v3_11_NLOHMANN_JSON_VERSION_PATCH::detail::value_t::string
@ string
string value
AUTOCIRCULATE_STATUS_STRUCT::bWithVidProc
BOOL_ bWithVidProc
Definition: ntv2publicinterface.h:4390
aja::replace
std::string & replace(std::string &str, const std::string &from, const std::string &to)
Definition: common.cpp:110
NTV2AudioChannelPairToString
std::string NTV2AudioChannelPairToString(const NTV2AudioChannelPair inValue, const bool inCompactDisplay=false)
Definition: ntv2utils.cpp:6483
NTV2Buffer::IsNULL
bool IsNULL(void) const
Definition: ntv2publicinterface.h:6190
NTV2Buffer::GetRawHostPointer
ULWord64 GetRawHostPointer(void) const
Definition: ntv2publicinterface.h:6163
NTV2VirtualData::mIsWriting
ULWord mIsWriting
If non-zero, virtual data will be written; otherwise, virtual data will be read.
Definition: ntv2publicinterface.h:7788
NTV2SegmentedXferInfo::Print
std::ostream & Print(std::ostream &inStrm, const bool inDumpSegments=false) const
Writes a human-readable description of me into a given output stream.
Definition: ntv2publicinterface.cpp:1511
ULWord
uint32_t ULWord
Definition: ajatypes.h:255
ntv2nub
Definition: ntv2nubtypes.h:21
NTV2StreamChannel::mStatus
ULWord mStatus
Action status.
Definition: ntv2publicinterface.h:8865
NTV2_CURRENT_HEADER_VERSION
#define NTV2_CURRENT_HEADER_VERSION
Current version of NTV2_HEADER struct, originally 0.
Definition: ntv2publicinterface.h:5511
AUTOCIRCULATE_STATUS::CopyFrom
bool CopyFrom(const AUTOCIRCULATE_STATUS_STRUCT &inOldStruct)
Copies the given AUTOCIRCULATE_STATUS_STRUCT into me.
Definition: ntv2publicinterface.cpp:2580
FRAME_STAMP::acAudioClockTimeStamp
ULWord64 acAudioClockTimeStamp
(input/ingest/capture only) The absolute timestamp at the VBI when the frame started recording into d...
Definition: ntv2publicinterface.h:7897
NTV2SetRegisters::mInNumRegisters
ULWord mInNumRegisters
The number of NTV2RegInfo's to be set.
Definition: ntv2publicinterface.h:7674
NTV2SDIInputStatus::Print
std::ostream & Print(std::ostream &inOutStream) const
Prints a human-readable representation of me into the given output stream.
Definition: ntv2publicinterface.cpp:133
NTV2AudioSystemSetToStr
string NTV2AudioSystemSetToStr(const NTV2AudioSystemSet &inObj, const bool inCompact)
Definition: ntv2publicinterface.cpp:3549
NTV2SegmentedDMAInfo::RPCEncode
bool RPCEncode(NTV2_RPC_BLOB_TYPE &outBlob)
Definition: ntv2publicinterface.cpp:4021
AUTOCIRCULATE_STATUS
This is returned from the CNTV2Card::AutoCirculateGetStatus function.
Definition: ntv2publicinterface.h:7274
NTV2_OUTPUT_DEST_IS_HDMI
#define NTV2_OUTPUT_DEST_IS_HDMI(_dest_)
Definition: ntv2enums.h:1330
AUTOCIRCULATE_STATUS::WithRP188
bool WithRP188(void) const
Definition: ntv2publicinterface.h:7454
AUTOCIRCULATE_TRANSFER::acHeader
NTV2_HEADER acHeader
The common structure header – ALWAYS FIRST!
Definition: ntv2publicinterface.h:8162
NTV2_AUDIOSYSTEM_Plus2
@ NTV2_AUDIOSYSTEM_Plus2
Definition: ntv2enums.h:3879
AutoCircVidProcInfo::mode
AutoCircVidProcMode mode
Definition: ntv2publicinterface.h:4266
FRAME_STAMP::~FRAME_STAMP
~FRAME_STAMP()
My destructor.
Definition: ntv2publicinterface.cpp:2233
NTV2_CCMODE_3WAY
@ NTV2_CCMODE_3WAY
Definition: ntv2enums.h:2070
NTV2FrameSize::FGSizesMap
std::map< NTV2FrameGeometry, ULWord > FGSizesMap
Definition: ntv2publicinterface.h:5771
CNTV2RegisterExpert::GetDisplayName
static std::string GetDisplayName(const uint32_t inRegNum)
Definition: ntv2registerexpert.cpp:4651
NTV2DeviceGetSupportedStandards
bool NTV2DeviceGetSupportedStandards(const NTV2DeviceID inDeviceID, NTV2StandardSet &outStandards)
Returns a set of distinct NTV2Standard values supported on the given device.
Definition: ntv2publicinterface.cpp:1323
AUTOCIRCULATE_TRANSFER::acVideoQuarterSizeExpand
NTV2QuarterSizeExpandMode acVideoQuarterSizeExpand
Turns on the "quarter-size expand" (2x H + 2x V) hardware. Defaults to off (1:1).
Definition: ntv2publicinterface.h:8235
ThousandsSeparator
Definition: ntv2publicinterface.cpp:2632
NTV2EndianSwap32
#define NTV2EndianSwap32(__val__)
Definition: ntv2endian.h:19
AUTOCIRCULATE_TRANSFER_STATUS::acHeader
NTV2_HEADER acHeader
The common structure header – ALWAYS FIRST!
Definition: ntv2publicinterface.h:8073
AUTOCIRCULATE_DATA::lVal1
LWord lVal1
Definition: ntv2publicinterface.h:4432
NTV2PrintULWordVector
ostream & NTV2PrintULWordVector(const NTV2ULWordVector &inObj, ostream &inOutStream)
Definition: ntv2publicinterface.cpp:3450
NTV2_FG_720x612
@ NTV2_FG_720x612
720x576, for PAL 625i, NTV2_VANCMODE_TALLER
Definition: ntv2enums.h:357
NTV2GetUnsupportedPixelFormats
bool NTV2GetUnsupportedPixelFormats(NTV2PixelFormats &outFormats)
Returns a set of NTV2PixelFormat values not suported by any NTV2 device.
Definition: ntv2publicinterface.cpp:1233
BIN08
#define BIN08(__x__)
Definition: ntv2publicinterface.h:5670
NTV2FrameRateSetConstIter
NTV2FrameRateSet::const_iterator NTV2FrameRateSetConstIter
A handy const iterator for iterating over an NTV2FrameRateSet.
Definition: ntv2publicinterface.h:8982
AUTOCIRCULATE_TRANSFER::SetOutputTimeCodes
bool SetOutputTimeCodes(const NTV2TimeCodes &inValues)
Intended for playout, replaces the contents of my acOutputTimeCodes member.
Definition: ntv2publicinterface.cpp:2878
NTV2ColorCorrectionData::~NTV2ColorCorrectionData
~NTV2ColorCorrectionData()
My destructor, which frees my private color correction table buffer.
Definition: ntv2publicinterface.cpp:2751
FRAME_STAMP::GetInputTimeCodes
bool GetInputTimeCodes(NTV2TimeCodeList &outValues) const
Returns all RP188 timecodes associated with the frame in NTV2TCIndex order.
Definition: ntv2publicinterface.cpp:2238
NTV2Buffer::IsAllocatedBySDK
bool IsAllocatedBySDK(void) const
Definition: ntv2publicinterface.h:6174
UWordSequenceConstIter
UWordSequence::const_iterator UWordSequenceConstIter
A handy const iterator for iterating over a UWordSequence.
Definition: ntv2publicinterface.h:43
UWordSequence
std::vector< uint16_t > UWordSequence
An ordered sequence of UWord (uint16_t) values.
Definition: ntv2publicinterface.h:42
AUTOCIRCULATE_STATUS::acActiveFrame
LWord acActiveFrame
Current frame actually being captured/played when CNTV2Card::AutoCirculateGetStatus called....
Definition: ntv2publicinterface.h:7280
NTV2GeometrySet
std::set< NTV2FrameGeometry > NTV2GeometrySet
A set of distinct NTV2FrameGeometry values.
Definition: ntv2publicinterface.h:8969
FRAME_STAMP::acStartSample
ULWord acStartSample
The actual audio start sample when this frame was started at the VBI, which may be used to check sync...
Definition: ntv2publicinterface.h:7913
AUTOCIRCULATE_TRANSFER_STRUCT
Definition: ntv2publicinterface.h:4632
AUTOCIRCULATE_TASK_STRUCT::RPCDecode
bool RPCDecode(const NTV2_RPC_BLOB_TYPE &inBlob, size_t &inOutIndex)
Definition: ntv2publicinterface.cpp:4394
NTV2_CCMODE_INVALID
@ NTV2_CCMODE_INVALID
Definition: ntv2enums.h:2072
NTV2HDMIProtocol
NTV2HDMIProtocol
Indicates or specifies the HDMI protocol.
Definition: ntv2enums.h:3591
NTV2_IS_VALID_STANDARD
#define NTV2_IS_VALID_STANDARD(__s__)
Definition: ntv2enums.h:179
NTV2AudioSystemSet
std::set< NTV2AudioSystem > NTV2AudioSystemSet
A set of distinct NTV2AudioSystem values. New in SDK 16.2.
Definition: ntv2publicinterface.h:3915
oOCT
#define oOCT(__x__)
Definition: ntv2publicinterface.h:5652
NTV2_MAX_NUM_VIDEO_FORMATS
@ NTV2_MAX_NUM_VIDEO_FORMATS
Definition: ntv2enums.h:713
FRAME_STAMP::acAudioInStopAddress
ULWord acAudioInStopAddress
(input/ingest/capture only) Ending audio record head position (exclusive) AFTER this frame was stampe...
Definition: ntv2publicinterface.h:7906
AutoCircVidProcInfo::RPCEncode
bool RPCEncode(NTV2_RPC_BLOB_TYPE &outBlob)
Definition: ntv2publicinterface.cpp:4054
eFlushAutoCirculate
@ eFlushAutoCirculate
Definition: ntv2publicinterface.h:4308
kVRegShiftHDMOutRangeFull
@ kVRegShiftHDMOutRangeFull
Definition: ntv2virtualregisters.h:667
FRAME_STAMP::GetSDIInputStatus
bool GetSDIInputStatus(NTV2SDIInputStatus &outStatus, const UWord inSDIInputIndex0=0) const
Answers with the NTV2SDIInputStatus for the given SDI input spigot.
Definition: ntv2publicinterface.cpp:2302
NTV2StreamChannel::Print
std::ostream & Print(std::ostream &inOutStream) const
Definition: ntv2publicinterface.cpp:3104
NTV2_RP188::RPCEncode
bool RPCEncode(NTV2_RPC_BLOB_TYPE &outBlob)
Definition: ntv2publicinterface.cpp:4085
NTV2SetRegisters::ResetUsing
bool ResetUsing(const NTV2RegWrites &inRegWrites)
Resets me, starting over, now using the given NTV2RegisterNumberSet.
Definition: ntv2publicinterface.cpp:3311
AUTOCIRCULATE_STATUS_STRUCT::bFbfChange
BOOL_ bFbfChange
Definition: ntv2publicinterface.h:4387
NTV2TCIndex
NTV2TCIndex
These enum values are indexes into the capture/playout AutoCirculate timecode arrays.
Definition: ntv2enums.h:3921
AUTOCIRCULATE_TRANSFER_STATUS::acBufferLevel
ULWord acBufferLevel
The number of frames ready to record/play after the transfer.
Definition: ntv2publicinterface.h:8076
eGetAutoCirc
@ eGetAutoCirc
Definition: ntv2publicinterface.h:4306
ntv2nub::POPU8
void POPU8(uint8_t &outVal, const std::vector< uint8_t > &inArr, std::size_t &inOutNdx)
Definition: ntv2nubtypes.h:56
AUTOCIRCULATE_STATUS::GetActiveFrame
LWord GetActiveFrame(void) const
Definition: ntv2publicinterface.h:7389
NTV2Buffer::ByteSwap32
bool ByteSwap32(void)
Byte-swaps my contents 32-bits at a time.
Definition: ntv2publicinterface.cpp:1729
NTV2RegisterReadsConstIter
NTV2RegWritesConstIter NTV2RegisterReadsConstIter
Definition: ntv2publicinterface.h:4073
AUTOCIRCULATE_STATUS::AUTOCIRCULATE_STATUS
AUTOCIRCULATE_STATUS(const NTV2Crosspoint inCrosspoint=NTV2CROSSPOINT_CHANNEL1)
Constructs a default AUTOCIRCULATE_STATUS struct for the given NTV2Crosspoint.
Definition: ntv2publicinterface.cpp:2533
AUTOCIRCULATE_DATA::lVal2
LWord lVal2
Definition: ntv2publicinterface.h:4433
NTV2_OUTPUTDESTINATION_SDI6
@ NTV2_OUTPUTDESTINATION_SDI6
Definition: ntv2enums.h:1319
NTV2StandardToString
std::string NTV2StandardToString(const NTV2Standard inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:6962
AUTOCIRCULATE_TRANSFER::acDesiredFrame
LWord acDesiredFrame
Used to specify a different frame in the circulate ring to transfer to/from.
Definition: ntv2publicinterface.h:8245
NTV2Bitstream::SetBuffer
bool SetBuffer(const NTV2Buffer &inBuffer)
Sets the buffer to lock for use in a subsequent call to CNTV2Card::LoadBitstream.
Definition: ntv2publicinterface.cpp:3085
FRAME_STAMP::SetFrom
bool SetFrom(const FRAME_STAMP_STRUCT &inOldStruct)
Sets my fields from the given FRAME_STAMP_STRUCT.
Definition: ntv2publicinterface.cpp:2361
AutoCircVidProcInfo::AutoCircVidProcInfo
AutoCircVidProcInfo()
Definition: ntv2publicinterface.cpp:203
NTV2_HDMIColorSpaceYCbCr
@ NTV2_HDMIColorSpaceYCbCr
YCbCr color space.
Definition: ntv2enums.h:3579
NTV2_TYPE_SDISTATS
#define NTV2_TYPE_SDISTATS
Identifies NTV2SDIStatus struct.
Definition: ntv2publicinterface.h:5532
AUTOCIRCULATE_STATUS_STRUCT::channelSpec
NTV2Crosspoint channelSpec
Definition: ntv2publicinterface.h:4373
NTV2BufferLock::mTrailer
NTV2_TRAILER mTrailer
The common structure trailer – ALWAYS LAST!
Definition: ntv2publicinterface.h:8641
NTV2Bitstream::mFlags
ULWord mFlags
Action flags (lock, unlock, etc)
Definition: ntv2publicinterface.h:8741
NTV2Buffer::PutU16s
bool PutU16s(const UWordSequence &inU16s, const size_t inU16Offset=0, const bool inByteSwap=false)
Copies a vector of unsigned 16-bit values into me.
Definition: ntv2publicinterface.cpp:826
FRAME_STAMP::acHeader
NTV2_HEADER acHeader
The common message header – ALWAYS FIRST!
Definition: ntv2publicinterface.h:7885
AUTOCIRCULATE_TRANSFER::acCrosspoint
NTV2Crosspoint acCrosspoint
Will be deprecated – used internally by the SDK. Will be removed when the driver changes to use NTV2C...
Definition: ntv2publicinterface.h:8247
NTV2_FG_720x514
@ NTV2_FG_720x514
720x486, for NTSC 525i and 525p60, NTV2_VANCMODE_TALLER
Definition: ntv2enums.h:356
kVRegMaskHDMOutAudioRate
@ kVRegMaskHDMOutAudioRate
Definition: ntv2virtualregisters.h:652
NTV2_FG_3840x2160
@ NTV2_FG_3840x2160
Definition: ntv2enums.h:359
AUTOCIRCULATE_DATA::AUTOCIRCULATE_DATA
AUTOCIRCULATE_DATA(const AUTO_CIRC_COMMAND inCommand=AUTO_CIRC_COMMAND_INVALID, const NTV2Crosspoint inCrosspoint=NTV2CROSSPOINT_INVALID)
Definition: ntv2publicinterface.cpp:215
NTV2Buffer::IsContentEqual
bool IsContentEqual(const NTV2Buffer &inBuffer, const ULWord inByteOffset=0, const ULWord inByteCount=0xFFFFFFFF) const
Definition: ntv2publicinterface.cpp:1994
NTV2_HEADER
All new NTV2 structs start with this common header.
Definition: ntv2publicinterface.h:7065
NTV2_OUTPUT_DEST_IS_ANALOG
#define NTV2_OUTPUT_DEST_IS_ANALOG(_dest_)
Definition: ntv2enums.h:1331
NTV2Buffer::CopyFrom
bool CopyFrom(const void *pInSrcBuffer, const ULWord inByteCount)
Replaces my contents from the given memory buffer, resizing me to the new byte count.
Definition: ntv2publicinterface.cpp:1857
NTV2_IS_VALID_STRUCT_TYPE
#define NTV2_IS_VALID_STRUCT_TYPE(_x_)
Definition: ntv2publicinterface.h:5549
aja::upper
std::string & upper(std::string &str)
Definition: common.cpp:442
UWord
uint16_t UWord
Definition: ajatypes.h:253
NTV2RegisterReads
NTV2RegWrites NTV2RegisterReads
Definition: ntv2publicinterface.h:4072
sSegXferUnits
static const string sSegXferUnits[]
Definition: ntv2publicinterface.cpp:1509
NTV2_RP188::RPCDecode
bool RPCDecode(const NTV2_RPC_BLOB_TYPE &inBlob, size_t &inOutIndex)
Definition: ntv2publicinterface.cpp:4093
NTV2_TRAILER::RPCDecode
bool RPCDecode(const NTV2_RPC_BLOB_TYPE &inBlob, size_t &inOutIndex)
Definition: ntv2publicinterface.cpp:3701
AUTOCIRCULATE_DATA::bVal5
BOOL_ bVal5
Definition: ntv2publicinterface.h:4443
AUTOCIRCULATE_STATUS_STRUCT::state
NTV2AutoCirculateState state
Definition: ntv2publicinterface.h:4374
AUTOCIRCULATE_TRANSFER
This object specifies the information that will be transferred to or from the AJA device in the CNTV2...
Definition: ntv2publicinterface.h:8161
NTV2_OUTPUTDESTINATION_SDI8
@ NTV2_OUTPUTDESTINATION_SDI8
Definition: ntv2enums.h:1321
ntv2utils.h
Declares numerous NTV2 utility functions.
NTV2ColorCorrectionData
Color correction data used with AUTOCIRCULATE_WITH_COLORCORRECT option.
Definition: ntv2publicinterface.h:7218
FRAME_STAMP::acFrame
ULWord acFrame
(input/ingest/capture only) Current/active frame number.
Definition: ntv2publicinterface.h:7963
NTV2_TYPE_AJADEBUGLOGGING
#define NTV2_TYPE_AJADEBUGLOGGING
Identifies NTV2DebugLogging struct.
Definition: ntv2publicinterface.h:5533
YesNo
#define YesNo(__x__)
Definition: ntv2registerexpert.h:25
NTV2VideoFormatToString
std::string NTV2VideoFormatToString(const NTV2VideoFormat inValue, const bool inUseFrameRate=false)
Definition: ntv2utils.cpp:6798
NTV2VideoFormatSetConstIter
NTV2VideoFormatSet::const_iterator NTV2VideoFormatSetConstIter
A handy const iterator for iterating over an NTV2VideoFormatSet.
Definition: ntv2publicinterface.h:8962
AUTOCIRCULATE_TRANSFER_STATUS::acTrailer
NTV2_TRAILER acTrailer
The common structure trailer – ALWAYS LAST!
Definition: ntv2publicinterface.h:8084
AUTOCIRCULATE_DATA::RPCDecode
bool RPCDecode(const NTV2_RPC_BLOB_TYPE &inBlob, size_t &inOutIndex)
Definition: ntv2publicinterface.cpp:4511
NTV2_INPUT_SOURCE_IS_HDMI
#define NTV2_INPUT_SOURCE_IS_HDMI(_inpSrc_)
Definition: ntv2enums.h:1272
NTV2DeviceGetSupportedGeometries
bool NTV2DeviceGetSupportedGeometries(const NTV2DeviceID inDeviceID, NTV2GeometrySet &outGeometries)
Returns a set of distinct NTV2FrameGeometry values supported on the given device.
Definition: ntv2publicinterface.cpp:1339
NTV2_MAX_NUM_TIMECODE_INDEXES
@ NTV2_MAX_NUM_TIMECODE_INDEXES
Definition: ntv2enums.h:3950
AUTOCIRCULATE_TRANSFER::SetVideoBuffer
bool SetVideoBuffer(ULWord *pInVideoBuffer, const ULWord inVideoByteCount)
Sets my video buffer for use in a subsequent call to CNTV2Card::AutoCirculateTransfer.
Definition: ntv2publicinterface.cpp:2851
NTV2BankSelGetSetRegs::GetRegInfo
NTV2RegInfo GetRegInfo(const UWord inIndex0=0) const
Definition: ntv2publicinterface.cpp:3613
NTV2HDMIRangeToString
std::string NTV2HDMIRangeToString(const NTV2HDMIRange inValue, const bool inCompactDisplay=false)
Definition: ntv2utils.cpp:6731
FRAME_STAMP::acCurrentLineCount
ULWord acCurrentLineCount
At Call Line# currently being OUTPUT (at the time of the IOCTL_NTV2_GET_FRAMESTAMP)
Definition: ntv2publicinterface.h:7957
NTV2VirtualData::NTV2VirtualData
NTV2VirtualData(const ULWord inTag, const void *inVirtualData, const size_t inVirtualDataSize, const bool inDoWrite=false)
Constructs an NTV2VirtualData struct for reading or writing virtual data.
Definition: ntv2publicinterface.cpp:3641
FRAME_STAMP_STRUCT::audioClockCurrentTime
ULWord64 audioClockCurrentTime
48kHz clock in reg 28 extended to 64 bits
Definition: ntv2publicinterface.h:4559
AsU64Ref
#define AsU64Ref(_x_)
Definition: ntv2publicinterface.cpp:3666
NTV2SDKVersionEncode
#define NTV2SDKVersionEncode
Definition: ntv2publicinterface.h:5443
NTV2Bitstream::RPCDecode
bool RPCDecode(const NTV2_RPC_BLOB_TYPE &inBlob, size_t &inOutIndex)
Definition: ntv2publicinterface.cpp:4286
AUTOCIRCULATE_STATUS::IsStopped
bool IsStopped(void) const
Definition: ntv2publicinterface.h:7424
NTV2Buffer::GetString
bool GetString(std::string &outString, const size_t inU8Offset=0, const size_t inMaxSize=128) const
Answers with my contents as a character string.
Definition: ntv2publicinterface.cpp:730
ThousandsSeparator::do_thousands_sep
virtual char do_thousands_sep() const
Definition: ntv2publicinterface.cpp:2634
AUTOCIRCULATE_TRANSFER::RPCDecode
bool RPCDecode(const NTV2_RPC_BLOB_TYPE &inBlob, size_t &inOutIndex)
Definition: ntv2publicinterface.cpp:4135
NTV2Buffer::Segment
NTV2Buffer & Segment(NTV2Buffer &outPtr, const ULWord inByteOffset, const ULWord inByteCount) const
Resets an NTV2Buffer instance to reference a contiguous segment (portion) of my memory buffer.
Definition: ntv2publicinterface.cpp:555
AUTOCIRCULATE_STATUS_STRUCT::startFrame
LWord startFrame
Definition: ntv2publicinterface.h:4375
AUTOCIRCULATE_STATUS::RPCEncode
bool RPCEncode(NTV2_RPC_BLOB_TYPE &outBlob)
Definition: ntv2publicinterface.cpp:3859
NTV2ULWordVector
std::vector< ULWord > NTV2ULWordVector
An ordered sequence of ULWords.
Definition: ntv2publicinterface.h:3840
FRAME_STAMP::operator[]
std::string operator[](const unsigned inIndexNum) const
Definition: ntv2publicinterface.cpp:2439
AUTOCIRCULATE_TRANSFER::acColorCorrection
NTV2ColorCorrectionData acColorCorrection
Color correction data. This field is ignored if AUTOCIRCULATE_WITH_COLORCORRECT option is not set.
Definition: ntv2publicinterface.h:8231
AUTOCIRCULATE_DATA::lVal4
LWord lVal4
Definition: ntv2publicinterface.h:4435
eStartAutoCirc
@ eStartAutoCirc
Definition: ntv2publicinterface.h:4303
DEVICE_ID_INVALID
@ DEVICE_ID_INVALID
Definition: ntv2enums.h:93
NTV2Buffer::GetU64s
bool GetU64s(ULWord64Sequence &outU64s, const size_t inU64Offset=0, const size_t inMaxSize=16, const bool inByteSwap=false) const
Answers with my contents as a vector of unsigned 16-bit values.
Definition: ntv2publicinterface.cpp:567
NTV2_NUM_INPUTSOURCES
@ NTV2_NUM_INPUTSOURCES
Definition: ntv2enums.h:1269
NTV2AudioChannelOctetToString
std::string NTV2AudioChannelOctetToString(const NTV2Audio8ChannelSelect inValue, const bool inCompactDisplay=false)
Definition: ntv2utils.cpp:6507
NTV2_FG_1280x720
@ NTV2_FG_1280x720
1280x720, for 720p, NTV2_VANCMODE_OFF
Definition: ntv2enums.h:343
FRAME_STAMP_STRUCT::frameTime
LWord64 frameTime
Definition: ntv2publicinterface.h:4505
NTV2HDMIProtocolToString
std::string NTV2HDMIProtocolToString(const NTV2HDMIProtocol inValue, const bool inCompactDisplay=false)
Definition: ntv2utils.cpp:6720
NTV2Buffer::U8
uint8_t U8(const int inIndex) const
Definition: ntv2publicinterface.h:6617
NTV2AudioChannelOctetsConstIter
NTV2AudioChannelOctets::const_iterator NTV2AudioChannelOctetsConstIter
Handy const iterator to iterate over a set of distinct NTV2AudioChannelOctet values.
Definition: ntv2publicinterface.h:67
NTV2_TYPE_ACFRAMESTAMP
#define NTV2_TYPE_ACFRAMESTAMP
Identifies FRAME_STAMP struct.
Definition: ntv2publicinterface.h:5529
AUTOCIRCULATE_STATUS::GetChannel
NTV2Channel GetChannel(void) const
Definition: ntv2publicinterface.cpp:2626
NTV2_RP188::fDBB
ULWord fDBB
Definition: ntv2publicinterface.h:6872
NTV2BankSelGetSetRegs::Print
std::ostream & Print(std::ostream &inOutStream) const
Prints a human-readable representation of me to the given output stream.
Definition: ntv2publicinterface.cpp:3628
NTV2ChannelSet
std::set< NTV2Channel > NTV2ChannelSet
A set of distinct NTV2Channel values.
Definition: ntv2publicinterface.h:3869
ntv2version.h
Defines for the NTV2 SDK version number, used by ajantv2/includes/ntv2enums.h. See the ajantv2/includ...
AUTOCIRCULATE_STATUS_STRUCT::RPCEncode
bool RPCEncode(NTV2_RPC_BLOB_TYPE &outBlob)
Definition: ntv2publicinterface.cpp:4300
AUTOCIRCULATE_TRANSFER_STATUS::acFrameStamp
FRAME_STAMP acFrameStamp
Frame stamp for the transferred frame.
Definition: ntv2publicinterface.h:8079
AUTOCIRCULATE_TRANSFER_STATUS
This object is embedded in the AUTOCIRCULATE_TRANSFER struct that's returned from the CNTV2Card::Auto...
Definition: ntv2publicinterface.h:8072
AUTOCIRCULATE_TRANSFER::acANCField2Buffer
NTV2Buffer acANCField2Buffer
The host "Field 2" ancillary data buffer. This field is owned by the client application,...
Definition: ntv2publicinterface.h:8198
NTV2_FBF_FIRST
@ NTV2_FBF_FIRST
Definition: ntv2enums.h:212
CRP188
Definition: ntv2rp188.h:55
AUTOCIRCULATE_STATUS::GetEndFrame
uint16_t GetEndFrame(void) const
Definition: ntv2publicinterface.h:7399
NTV2Buffer::~NTV2Buffer
~NTV2Buffer()
My destructor. If I'm responsible for the memory, I free it here.
Definition: ntv2publicinterface.cpp:1711
NTV2SetRegisters::mInRegInfos
NTV2Buffer mInRegInfos
Read-only array of NTV2RegInfo structs to be set. The SDK owns this memory.
Definition: ntv2publicinterface.h:7675
AJA_NTV2_SDK_VERSION_MAJOR
#define AJA_NTV2_SDK_VERSION_MAJOR
The SDK major version number, an unsigned decimal integer.
Definition: ntv2version.h:13
NTV2_FRAMEBUFFER_ORIENTATION_TOPDOWN
@ NTV2_FRAMEBUFFER_ORIENTATION_TOPDOWN
Definition: ntv2enums.h:2033
AUTOCIRCULATE_TRANSFER::RPCEncode
bool RPCEncode(NTV2_RPC_BLOB_TYPE &outBlob)
Definition: ntv2publicinterface.cpp:4101
AUTOCIRCULATE_STATUS::acBufferLevel
ULWord acBufferLevel
Number of buffered frames in driver ready to capture or play.
Definition: ntv2publicinterface.h:7287
CommaStr
string CommaStr(const T &inNum)
Definition: ntv2publicinterface.cpp:2639
NTV2Buffer::PutU64s
bool PutU64s(const ULWord64Sequence &inU64s, const size_t inU64Offset=0, const bool inByteSwap=false)
Copies a vector of unsigned 64-bit values into me.
Definition: ntv2publicinterface.cpp:770
NTV2Buffer::ByteSwap16
bool ByteSwap16(void)
Byte-swaps my contents 16-bits at a time.
Definition: ntv2publicinterface.cpp:1741
NTV2_INVALID_HDMI_PROTOCOL
@ NTV2_INVALID_HDMI_PROTOCOL
Definition: ntv2enums.h:3596
AutoCircGenericTask::u
union AutoCircGenericTask::@33 u
FRAME_STAMP::acCurrentFieldCount
ULWord acCurrentFieldCount
As found by ISR at Call Field0 or Field1 currently being OUTPUT (when CNTV2Card::AutoCirculateGetFram...
Definition: ntv2publicinterface.h:7956
NTV2_INVALID_HDMI_RANGE
@ NTV2_INVALID_HDMI_RANGE
Definition: ntv2enums.h:3610
AUTOCIRCULATE_STATUS_STRUCT::endFrame
LWord endFrame
Definition: ntv2publicinterface.h:4376
AUTOCIRCULATE_STRUCT_VERSION
#define AUTOCIRCULATE_STRUCT_VERSION
Version number of AutoCirculate structures, originally 0.
Definition: ntv2publicinterface.h:5514
NTV2_OUTPUT_DEST_IS_SDI
#define NTV2_OUTPUT_DEST_IS_SDI(_dest_)
Definition: ntv2enums.h:1332
NTV2AutoCirculateState
NTV2AutoCirculateState
Describes the state of an AutoCirculate channel. See AUTOCIRCULATE_STATUS.
Definition: ntv2publicinterface.h:4328
gDefaultPageSize
static size_t gDefaultPageSize(AJA_PAGE_SIZE)
AJA_NULL
#define AJA_NULL
Definition: ajatypes.h:199
AUTOCIRCULATE_TRANSFER::acTransferStatus
AUTOCIRCULATE_TRANSFER_STATUS acTransferStatus
Contains status information that's valid after CNTV2Card::AutoCirculateTransfer returns,...
Definition: ntv2publicinterface.h:8213
NTV2_IS_VALID_CHANNEL
#define NTV2_IS_VALID_CHANNEL(__x__)
Definition: ntv2enums.h:1357
NTV2RegInfo::registerValue
ULWord registerValue
My register value to use in a ReadRegister or WriteRegister call.
Definition: ntv2publicinterface.h:3979
GetRelatedGeometries
NTV2GeometrySet GetRelatedGeometries(const NTV2FrameGeometry inFrameGeometry)
Definition: ntv2utils.cpp:3906
AUTOCIRCULATE_DATA::bVal1
BOOL_ bVal1
Definition: ntv2publicinterface.h:4439
NTV2BankSelGetSetRegs::mInRegInfos
NTV2Buffer mInRegInfos
NTV2RegInfo array of registers be read/written. The SDK owns this memory.
Definition: ntv2publicinterface.h:7739
AUTOCIRCULATE_TRANSFER_STATUS::RPCEncode
bool RPCEncode(NTV2_RPC_BLOB_TYPE &outBlob)
Definition: ntv2publicinterface.cpp:3982
GetGeometryFromFrameDimensions
NTV2FrameGeometry GetGeometryFromFrameDimensions(const NTV2FrameDimensions &inFD)
Definition: ntv2utils.cpp:3861
NTV2SegmentedXferInfo::setSourceDirection
NTV2SegmentedXferInfo & setSourceDirection(const bool inTopDown)
Sets the scan direction for the source.
Definition: ntv2publicinterface.h:5952
NTV2CrosspointToString
std::string NTV2CrosspointToString(const NTV2Crosspoint inChannel)
Definition: ntv2utils.cpp:5870
AutoCircVidProcInfo::backgroundVideoCrosspoint
NTV2Crosspoint backgroundVideoCrosspoint
Definition: ntv2publicinterface.h:4268
AUTOCIRCULATE_STATUS_STRUCT::rdtscStartTime
ULWord64 rdtscStartTime
Definition: ntv2publicinterface.h:4378
NTV2Buffer::GetHostAddress
void * GetHostAddress(const ULWord inByteOffset, const bool inFromEnd=false) const
Definition: ntv2publicinterface.cpp:1825
NTV2Buffer::operator=
NTV2Buffer & operator=(const NTV2Buffer &inRHS)
Assigns me from another NTV2Buffer instance.
Definition: ntv2publicinterface.cpp:1695
NTV2ChannelList
std::vector< NTV2Channel > NTV2ChannelList
An ordered sequence of NTV2Channel values.
Definition: ntv2publicinterface.h:3850
NTV2SegmentedDMAInfo::Set
void Set(const ULWord inNumSegments, const ULWord inNumActiveBytesPerRow, const ULWord inHostBytesPerRow, const ULWord inDeviceBytesPerRow)
Sets the NTV2SegmentedDMAInfo struct members.
Definition: ntv2publicinterface.cpp:2724
NTV2Buffer::GetHostPointer
void * GetHostPointer(void) const
Definition: ntv2publicinterface.h:6151
NTV2_FG_1920x1112
@ NTV2_FG_1920x1112
1920x1080, for 1080i and 1080p, NTV2_VANCMODE_TALL
Definition: ntv2enums.h:350
NTV2_INVALID_HDMIBitDepth
@ NTV2_INVALID_HDMIBitDepth
Definition: ntv2enums.h:3668
NTV2InputSource
NTV2InputSource
Identifies a specific video input source.
Definition: ntv2enums.h:1253
NTV2_IS_VALID_HEADER_TAG
#define NTV2_IS_VALID_HEADER_TAG(_x_)
Definition: ntv2publicinterface.h:5519
kVRegMaskHDMOutBitDepth
@ kVRegMaskHDMOutBitDepth
Definition: ntv2virtualregisters.h:646
NTV2SegmentedXferInfo::operator!=
bool operator!=(const NTV2SegmentedXferInfo &inRHS) const
Definition: ntv2publicinterface.cpp:1589
AUTOCIRCULATE_TRANSFER::SegmentedDMAsEnabled
bool SegmentedDMAsEnabled(void) const
Definition: ntv2publicinterface.cpp:2970
NTV2BufferLock::SetMaxLockSize
void SetMaxLockSize(const ULWord64 inNumBytes)
Sets the maximum lock size for use in a subsequent call to CNTV2Card::DMABufferLock.
Definition: ntv2publicinterface.h:8706
NTV2SegmentedXferInfo::setElementLength
NTV2SegmentedXferInfo & setElementLength(const ULWord inBytesPerElement)
Sets my element length.
Definition: ntv2publicinterface.h:6015
kVRegShiftHDMOutVideoStandard
@ kVRegShiftHDMOutVideoStandard
Definition: ntv2virtualregisters.h:663
NTV2Buffer::AsString
std::string AsString(UWord inDumpMaxBytes=0) const
Definition: ntv2publicinterface.cpp:394
NTV2_FORMAT_UNKNOWN
@ NTV2_FORMAT_UNKNOWN
Definition: ntv2enums.h:525
NTV2StreamChannel::mTrailer
NTV2_TRAILER mTrailer
The common structure trailer – ALWAYS LAST!
Definition: ntv2publicinterface.h:8876
AUTOCIRCULATE_STATUS::acEndFrame
LWord acEndFrame
Last frame to circulate. FIXFIXFIX Why is this signed? CHANGE TO ULWord??
Definition: ntv2publicinterface.h:7279
NTV2BankSelGetSetRegs::mIsWriting
ULWord mIsWriting
If non-zero, register(s) will be written; otherwise, register(s) will be read.
Definition: ntv2publicinterface.h:7737
AUTOCIRCULATE_TRANSFER_STATUS::RPCDecode
bool RPCDecode(const NTV2_RPC_BLOB_TYPE &inBlob, size_t &inOutIndex)
Definition: ntv2publicinterface.cpp:4002
FRAME_STAMP::acAudioClockCurrentTime
ULWord64 acAudioClockCurrentTime
The absolute timestamp at the moment the CNTV2Card::AutoCirculateTransfer or CNTV2Card::AutoCirculate...
Definition: ntv2publicinterface.h:7947
AUTOCIRCULATE_WITH_VIDPROC
#define AUTOCIRCULATE_WITH_VIDPROC
Use this to AutoCirculate with video processing.
Definition: ntv2publicinterface.h:5586
AUTOCIRCULATE_STATUS_STRUCT::bWithCustomAncData
BOOL_ bWithCustomAncData
Definition: ntv2publicinterface.h:4391
ntv2nub::PUSHU32
void PUSHU32(const uint32_t inVal, std::vector< uint8_t > &inArr, const bool dontSwap=false)
Definition: ntv2nubtypes.h:38
kVRegMaskHDMOutAudioFormat
@ kVRegMaskHDMOutAudioFormat
Definition: ntv2virtualregisters.h:651
AUTOCIRCULATE_WITH_FBOCHANGE
#define AUTOCIRCULATE_WITH_FBOCHANGE
Use this to AutoCirculate with the possibility of frame buffer orientation changes.
Definition: ntv2publicinterface.h:5584
NTV2SetRegisters::RPCEncode
bool RPCEncode(NTV2_RPC_BLOB_TYPE &outBlob)
Definition: ntv2publicinterface.cpp:3779
FRAME_STAMP_STRUCT::currentAudioExpectedAddress
ULWord currentAudioExpectedAddress
As set by play.
Definition: ntv2publicinterface.h:4564
AUTOCIRCULATE_TRANSFER::~AUTOCIRCULATE_TRANSFER
~AUTOCIRCULATE_TRANSFER()
My default destructor, which frees all allocatable fields that I own.
Definition: ntv2publicinterface.cpp:2834
NTV2DIDSetConstIter
NTV2DIDSet::const_iterator NTV2DIDSetConstIter
Handy const iterator to iterate over an NTV2DIDSet.
Definition: ntv2publicinterface.h:78
AUTOCIRCULATE_DATA::lVal6
LWord lVal6
Definition: ntv2publicinterface.h:4437
AutoCircVidProcInfo::foregroundVideoCrosspoint
NTV2Crosspoint foregroundVideoCrosspoint
Definition: ntv2publicinterface.h:4267
NTV2QtrSizeExpandMode
enum NTV2QuarterSizeExpandMode NTV2QtrSizeExpandMode
NTV2_FG_720x598
@ NTV2_FG_720x598
720x576, for PAL 625i, NTV2_VANCMODE_TALL
Definition: ntv2enums.h:349
NTV2_HEADER::FourCCToString
static std::string FourCCToString(const ULWord in4CC)
Definition: ntv2publicinterface.cpp:341
NTV2AudioRate
NTV2AudioRate
Definition: ntv2enums.h:1914
AUTOCIRCULATE_STATUS::RPCDecode
bool RPCDecode(const NTV2_RPC_BLOB_TYPE &inBlob, size_t &inOutIndex)
Definition: ntv2publicinterface.cpp:3883
AutoCircVidProcInfo::transitionCoefficient
Fixed_ transitionCoefficient
Definition: ntv2publicinterface.h:4271
NTV2_FBF_10BIT_YCBCR
@ NTV2_FBF_10BIT_YCBCR
See 10-Bit YCbCr Format.
Definition: ntv2enums.h:213
AJA_NTV2_SDK_BUILD_NUMBER
#define AJA_NTV2_SDK_BUILD_NUMBER
The SDK build number, an unsigned decimal integer.
Definition: ntv2version.h:16
FRAME_STAMP::acAudioOutStartAddress
ULWord acAudioOutStartAddress
(output/playback only) Audio play head position (exclusive) AFTER this frame was stamped.
Definition: ntv2publicinterface.h:7910
FRAME_STAMP_STRUCT::currentRP188
RP188_STRUCT currentRP188
Last vertical blank timecode (RP-188)
Definition: ntv2publicinterface.h:4553
AUTOCIRCULATE_TRANSFER::Clear
void Clear(void)
Resets the struct to its initialized state, with timecode capture disabled, freeing all buffers that ...
Definition: ntv2publicinterface.cpp:2943
FRAME_STAMP::FRAME_STAMP
FRAME_STAMP()
Constructs a default FRAME_STAMP structure.
Definition: ntv2publicinterface.cpp:2173
AUTOCIRCULATE_STATUS::WithLTC
bool WithLTC(void) const
Definition: ntv2publicinterface.h:7459
NTV2StreamChannel::mChannel
NTV2Channel mChannel
Stream channel.
Definition: ntv2publicinterface.h:8863
NTV2SDIInStatistics::GetSDIInputStatus
bool GetSDIInputStatus(NTV2SDIInputStatus &outStatus, const UWord inSDIInputIndex0=0)
Answers with the NTV2SDIInputStatus for the given SDI input spigot.
Definition: ntv2publicinterface.cpp:2477
AUTOCIRCULATE_STATUS_STRUCT
Definition: ntv2publicinterface.h:4371
NTV2RegisterNumber
NTV2RegisterNumber
Definition: ntv2publicinterface.h:100
LWord64
int64_t LWord64
Definition: ajatypes.h:257
NTV2StreamBuffer::mChannel
NTV2Channel mChannel
Stream channel.
Definition: ntv2publicinterface.h:8923
NTV2SegmentedDMAInfo::Reset
void Reset(void)
Resets the NTV2SegmentedDMAInfo struct members to their default values (normal, non-segmented AutoCir...
Definition: ntv2publicinterface.cpp:2738
ULWord64SequenceConstIter
ULWord64Sequence::const_iterator ULWord64SequenceConstIter
A handy const iterator for iterating over a ULWord64Sequence.
Definition: ntv2publicinterface.h:51
DEC
#define DEC(__x__)
Definition: ntv2publicinterface.h:5647
NTV2SDIInStatistics
This is used by the CNTV2Card::ReadSDIStatistics function.
Definition: ntv2publicinterface.h:7826
AUTOCIRCULATE_STATUS::acRDTSCStartTime
ULWord64 acRDTSCStartTime
Timestamp of the first VBI received after CNTV2Card::AutoCirculateStart called, using host OS system ...
Definition: ntv2publicinterface.h:7281
AUTOCIRCULATE_STATUS_STRUCT::framesDropped
ULWord framesDropped
Definition: ntv2publicinterface.h:4383
false
#define false
Definition: ntv2devicefeatures.h:25
NTV2HDMIColorSpaceToString
std::string NTV2HDMIColorSpaceToString(const NTV2HDMIColorSpace inValue, const bool inCompactDisplay=false)
Definition: ntv2utils.cpp:6742
NTV2RegInfo
Everything needed to call CNTV2Card::ReadRegister or CNTV2Card::WriteRegister functions.
Definition: ntv2publicinterface.h:3977
OCT
#define OCT(__x__)
Definition: ntv2publicinterface.h:5650
common.h
Private include file for all ajabase sources.
AUTOCIRCULATE_TRANSFER::acInUserCookie
ULWord64 acInUserCookie
Intended for playout, an optional app-specific cookie value that tags this frame, such that if this s...
Definition: ntv2publicinterface.h:8220
NTV2Buffer_ALLOCATED
#define NTV2Buffer_ALLOCATED
Allocated using Allocate function?
Definition: ntv2publicinterface.h:5566
UByte
uint8_t UByte
Definition: ajatypes.h:250
NTV2AudioSystemSetConstIter
NTV2AudioSystemSet::const_iterator NTV2AudioSystemSetConstIter
A handy const iterator into an NTV2AudioSystemSet. New in SDK 16.2.
Definition: ntv2publicinterface.h:3916
AUTOCIRCULATE_WITH_RP188
#define AUTOCIRCULATE_WITH_RP188
Use this to AutoCirculate with RP188.
Definition: ntv2publicinterface.h:5581
NTV2RegisterWrites
std::vector< NTV2RegInfo > NTV2RegisterWrites
Definition: ntv2publicinterface.h:4069
NTV2Bitstream
This is used for bitstream maintainance. (New in SDK 16.0)
Definition: ntv2publicinterface.h:8738
FRAME_STAMP::RPCDecode
bool RPCDecode(const NTV2_RPC_BLOB_TYPE &inBlob, size_t &inOutIndex)
Definition: ntv2publicinterface.cpp:3946
FRAME_STAMP::SetInputTimecode
bool SetInputTimecode(const NTV2TCIndex inTCNdx, const NTV2_RP188 &inTimecode)
Sets one of my input timecodes.
Definition: ntv2publicinterface.cpp:2310
kVRegMaskHDMOutAudioChannels
@ kVRegMaskHDMOutAudioChannels
Definition: ntv2virtualregisters.h:653
NTV2TCIndexesConstIter
NTV2TCIndexes::const_iterator NTV2TCIndexesConstIter
Definition: ntv2publicinterface.h:6961
NTV2Buffer_TO_ULWORD64
#define NTV2Buffer_TO_ULWORD64(__p__)
Definition: ntv2publicinterface.h:5572
NTV2StreamBuffer::mTrailer
NTV2_TRAILER mTrailer
The common structure trailer – ALWAYS LAST!
Definition: ntv2publicinterface.h:8938
AUTOCIRCULATE_TRANSFER_STATUS::acAncTransferSize
ULWord acAncTransferSize
Total ancillary data bytes for field 1 transferred (capture only).
Definition: ntv2publicinterface.h:8082
NTV2StreamChannel::mHeader
NTV2_HEADER mHeader
The common structure header – ALWAYS FIRST!
Definition: ntv2publicinterface.h:8862
HEX0N
#define HEX0N(__x__, __n__)
Definition: debug.cpp:1175
AUTOCIRCULATE_TRANSFER_STATUS::acState
NTV2AutoCirculateState acState
Current AutoCirculate state after the transfer.
Definition: ntv2publicinterface.h:8074
NTV2RegInfo::registerNumber
ULWord registerNumber
My register number to use in a ReadRegister or WriteRegister call.
Definition: ntv2publicinterface.h:3978
NTV2Buffer::SetFromHexString
bool SetFromHexString(const std::string &inStr)
Replaces my contents from the given hex-encoded string, resizing me if necessary.
Definition: ntv2publicinterface.cpp:1923
NTV2_RP188::IsValid
bool IsValid(void) const
Answers true if I'm valid, or false if I'm not valid.
Definition: ntv2publicinterface.h:6913
FRAME_STAMP_STRUCT::currenthUser
ULWord currenthUser
Contains validCount (Play - reps remaining, Record - drops on frame)
Definition: ntv2publicinterface.h:4573
RP188_STRUCT::RPCEncode
bool RPCEncode(NTV2_RPC_BLOB_TYPE &outBlob)
Definition: ntv2publicinterface.cpp:4353
NTV2_TRAILER::NTV2_TRAILER
NTV2_TRAILER()
Constructs a default NTV2_TRAILER having the proper version and tag.
Definition: ntv2publicinterface.cpp:1444
NTV2FrameBufferFormatToString
std::string NTV2FrameBufferFormatToString(const NTV2FrameBufferFormat inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:6988
NTV2SetRegisters::Print
std::ostream & Print(std::ostream &inOutStream) const
Prints a human-readable representation of me to the given output stream.
Definition: ntv2publicinterface.cpp:3360
NTV2_HEADER::Print
std::ostream & Print(std::ostream &inOutStream) const
Prints a human-readable representation of me into the given output stream.
Definition: ntv2publicinterface.cpp:326
AUTOCIRCULATE_STATUS::Clear
void Clear(void)
Clears my data.
Definition: ntv2publicinterface.cpp:2606
AutoCircTimeCodeTask
Definition: ntv2publicinterface.h:4763
NTV2SetRegisters::GetRequestedRegisterWrites
bool GetRequestedRegisterWrites(NTV2RegWrites &outRegWrites) const
Definition: ntv2publicinterface.cpp:3345
NTV2_TYPE_AJASTREAMBUFFER
#define NTV2_TYPE_AJASTREAMBUFFER
Identifies NTV2StreamBuffer struct.
Definition: ntv2publicinterface.h:5537
NTV2SDKVersionDecode_Major
#define NTV2SDKVersionDecode_Major
Definition: ntv2publicinterface.h:5444
NTV2DebugLogging::mSharedMemory
NTV2Buffer mSharedMemory
Virtual address of AJADebug shared memory in calling process' context,.
Definition: ntv2publicinterface.h:8600
FRAME_STAMP_STRUCT::audioInStartAddress
ULWord audioInStartAddress
For record - first position in buffer of audio (includes base offset)
Definition: ntv2publicinterface.h:4517
NTV2DeviceCanDoInputSource
bool NTV2DeviceCanDoInputSource(const NTV2DeviceID inDeviceID, const NTV2InputSource inInputSource)
Definition: ntv2devicefeatures.hpp:18228
NTV2TimeCodes
std::map< NTV2TCIndex, NTV2_RP188 > NTV2TimeCodes
A mapping of NTV2TCIndex enum values to NTV2_RP188 structures.
Definition: ntv2publicinterface.h:6957
NTV2_IS_VALID_COLOR_CORRECTION_MODE
#define NTV2_IS_VALID_COLOR_CORRECTION_MODE(__x__)
Definition: ntv2enums.h:2075
NTV2RegInfo::operator<
bool operator<(const NTV2RegInfo &inRHS) const
Definition: ntv2publicinterface.cpp:3386
NTV2SegmentedDMAInfo::acNumSegments
ULWord acNumSegments
Number of segments of size ::AUTOCIRCULATE_TRANSFER::acVideoBuffer.fByteCount to transfer....
Definition: ntv2publicinterface.h:7161
NTV2InputSourceSetConstIter
NTV2InputSourceSet::const_iterator NTV2InputSourceSetConstIter
A handy const iterator for iterating over an NTV2InputSourceSet.
Definition: ntv2publicinterface.h:8976
ULWord64
uint64_t ULWord64
Definition: ajatypes.h:258
std
Definition: json.hpp:5362
AUTOCIRCULATE_TRANSFER::acVidProcInfo
AutoCircVidProcInfo acVidProcInfo
Specifies the mixer/keyer transition to make. Ignored if AUTOCIRCULATE_WITH_VIDPROC option is not set...
Definition: ntv2publicinterface.h:8234
NTV2_RP188
This struct replaces the old RP188_STRUCT.
Definition: ntv2publicinterface.h:6871
AUTOCIRCULATE_TRANSFER::acVideoBuffer
NTV2Buffer acVideoBuffer
The host video buffer. This field is owned by the client application, and thus is responsible for all...
Definition: ntv2publicinterface.h:8169
AUTOCIRCULATE_WITH_HDMIAUX
#define AUTOCIRCULATE_WITH_HDMIAUX
Use this to AutoCirculate with HDMI auxiliary data.
Definition: ntv2publicinterface.h:5590
NTV2DeviceGetSupportedVideoFormats
bool NTV2DeviceGetSupportedVideoFormats(const NTV2DeviceID inDeviceID, NTV2VideoFormatSet &outFormats)
Returns a set of distinct NTV2VideoFormat values supported on the given device.
Definition: ntv2publicinterface.cpp:1270
NTV2StreamBuffer::Print
std::ostream & Print(std::ostream &inOutStream) const
Definition: ntv2publicinterface.cpp:3117
AUTOCIRCULATE_STATUS_STRUCT::bWithRP188
BOOL_ bWithRP188
Definition: ntv2publicinterface.h:4386
NTV2FrameSize::FGHeight
static ULWord FGHeight(const NTV2FrameGeometry fg)
Definition: ntv2publicinterface.cpp:1482
NTV2MakeChannelList
NTV2ChannelList NTV2MakeChannelList(const NTV2Channel inFirstChannel, const UWord inNumChannels)
Definition: ntv2publicinterface.cpp:3517
NTV2RegInfo::registerShift
ULWord registerShift
My register shift value to use in a ReadRegister or WriteRegister call.
Definition: ntv2publicinterface.h:3981
NTV2GetRegisters::GetRegisterValues
bool GetRegisterValues(NTV2RegisterValueMap &outValues) const
Returns an NTV2RegisterValueMap built from my mOutGoodRegisters and mOutValues fields.
Definition: ntv2publicinterface.cpp:3244
FRAME_STAMP_STRUCT::RPCDecode
bool RPCDecode(const NTV2_RPC_BLOB_TYPE &inBlob, size_t &inOutIndex)
Definition: ntv2publicinterface.cpp:4447
AutoCircVidProcInfo::RPCDecode
bool RPCDecode(const NTV2_RPC_BLOB_TYPE &inBlob, size_t &inOutIndex)
Definition: ntv2publicinterface.cpp:4066
NTV2DeviceGetSupportedFrameRates
bool NTV2DeviceGetSupportedFrameRates(const NTV2DeviceID inDeviceID, NTV2FrameRateSet &outRates)
Returns a set of distinct NTV2FrameRate values supported on the given device.
Definition: ntv2publicinterface.cpp:1411
ePauseAutoCirc
@ ePauseAutoCirc
Definition: ntv2publicinterface.h:4305
NTV2_FRAMERATE_UNKNOWN
@ NTV2_FRAMERATE_UNKNOWN
Represents an unknown or invalid frame rate.
Definition: ntv2enums.h:405
eInitAutoCirc
@ eInitAutoCirc
Definition: ntv2publicinterface.h:4302
ULWordSequence
std::vector< uint32_t > ULWordSequence
An ordered sequence of ULWord (uint32_t) values.
Definition: ntv2publicinterface.h:46
AUTOCIRCULATE_TRANSFER::acInVideoDMAOffset
ULWord acInVideoDMAOffset
Optional byte offset into the device frame buffer. Defaults to zero. If non-zero, should be a multipl...
Definition: ntv2publicinterface.h:8228
NTV2ColorCorrectionData::Clear
void Clear(void)
Frees my private color correction table buffer and resets my mode to "invalid".
Definition: ntv2publicinterface.cpp:2757
AUTOCIRCULATE_STATUS::GetDroppedFrameCount
ULWord GetDroppedFrameCount(void) const
Definition: ntv2publicinterface.h:7325
AUTOCIRCULATE_TRANSFER::SetAllOutputTimeCodes
bool SetAllOutputTimeCodes(const NTV2_RP188 &inTimecode, const bool inIncludeF2=true)
Intended for playout, replaces all elements of my acOutputTimeCodes member with the given timecode va...
Definition: ntv2publicinterface.cpp:2914
AUTOCIRCULATE_STATUS_STRUCT::bWithAudio
BOOL_ bWithAudio
Definition: ntv2publicinterface.h:4385
AUTOCIRCULATE_STATUS::GetStartFrame
uint16_t GetStartFrame(void) const
Definition: ntv2publicinterface.h:7394
NTV2VideoFormat
enum _NTV2VideoFormat NTV2VideoFormat
Identifies a particular video format.
eStopAutoCirc
@ eStopAutoCirc
Definition: ntv2publicinterface.h:4304
NTV2_TCINDEX_DEFAULT
@ NTV2_TCINDEX_DEFAULT
The "default" timecode (mostly used by the AJA "Retail" service and Control Panel)
Definition: ntv2enums.h:3923
AUTOCIRCULATE_STATUS::acAudioSystem
NTV2AudioSystem acAudioSystem
The audio system being used for this channel (NTV2_AUDIOSYSTEM_INVALID if none)
Definition: ntv2publicinterface.h:7289
AUTOCIRCULATE_STATUS::acAudioClockStartTime
ULWord64 acAudioClockStartTime
Timestamp of the first VBI received after CNTV2Card::AutoCirculateStart called, using "64-bit clean" ...
Definition: ntv2publicinterface.h:7282
eGetFrameStampEx2
@ eGetFrameStampEx2
Definition: ntv2publicinterface.h:4315
NTV2_FG_2048x1112
@ NTV2_FG_2048x1112
2048x1080, for 2Kx1080p, NTV2_VANCMODE_TALL
Definition: ntv2enums.h:355
NTV2TimeCodeList
std::vector< NTV2_RP188 > NTV2TimeCodeList
An ordered sequence of zero or more NTV2_RP188 structures. An NTV2TCIndex enum value can be used as a...
Definition: ntv2publicinterface.h:6952
NTV2FrameGeometry
NTV2FrameGeometry
Identifies a particular video frame geometry.
Definition: ntv2enums.h:339
FRAME_STAMP_STRUCT::RPCEncode
bool RPCEncode(NTV2_RPC_BLOB_TYPE &outBlob)
User cookie at last vblank.
Definition: ntv2publicinterface.cpp:4420
ntv2rp188.h
Declares the CRP188 class. See SMPTE RP188 standard for details.
FRAME_STAMP::CopyTo
bool CopyTo(FRAME_STAMP_STRUCT &outOldStruct) const
Copies my fields into the given FRAME_STAMP_STRUCT.
Definition: ntv2publicinterface.cpp:2397
std::swap
void swap(nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass > &j1, nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass > &j2) noexcept(//NOLINT(readability-inconsistent-declaration-parameter-name, cert-dcl58-cpp) is_nothrow_move_constructible< nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass > >::value &&//NOLINT(misc-redundant-expression, cppcoreguidelines-noexcept-swap, performance-noexcept-swap) is_nothrow_move_assignable< nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass > >::value)
exchanges the values of two JSON objects
Definition: json.hpp:24538
FindFirstMatchingRegisterNumber
NTV2RegisterReadsConstIter FindFirstMatchingRegisterNumber(const uint32_t inRegNum, const NTV2RegisterReads &inRegInfos)
Returns a const iterator to the first entry in the NTV2RegInfo collection with a matching register nu...
Definition: ntv2publicinterface.cpp:3573
NTV2_IS_REGISTER_TASK
#define NTV2_IS_REGISTER_TASK(_x_)
Definition: ntv2publicinterface.h:4748
NTV2DeviceIDSet
std::set< NTV2DeviceID > NTV2DeviceIDSet
A set of NTV2DeviceIDs.
Definition: ntv2utils.h:1039
AUTOCIRCULATE_TRANSFER_STATUS::acFramesDropped
ULWord acFramesDropped
Total number of frames dropped since AutoCirculateStart.
Definition: ntv2publicinterface.h:8078
NTV2Bitstream::mBuffer
NTV2Buffer mBuffer
Virtual address of a bitstream buffer and its length.
Definition: ntv2publicinterface.h:8740
AUTOCIRCULATE_STATUS::WithFBFChange
bool WithFBFChange(void) const
Definition: ntv2publicinterface.h:7464
NTV2_OUTPUTDESTINATION_SDI7
@ NTV2_OUTPUTDESTINATION_SDI7
Definition: ntv2enums.h:1320
NTV2Buffer::PutU8s
bool PutU8s(const UByteSequence &inU8s, const size_t inU8Offset=0)
Copies a vector of unsigned 8-bit values into me.
Definition: ntv2publicinterface.cpp:854
AUTOCIRCULATE_STATUS_STRUCT::rdtscCurrentTime
ULWord64 rdtscCurrentTime
Definition: ntv2publicinterface.h:4380
kVRegMaskHDMOutProtocol
@ kVRegMaskHDMOutProtocol
Definition: ntv2virtualregisters.h:650
INVALID_TIMECODE_VALUE
static const NTV2_RP188 INVALID_TIMECODE_VALUE
Definition: ntv2publicinterface.cpp:2875
NTV2SetRegisters
This is used by the CNTV2Card::WriteRegisters function.
Definition: ntv2publicinterface.h:7672
NTV2MakeChannelSet
NTV2ChannelSet NTV2MakeChannelSet(const NTV2Channel inFirstChannel, const UWord inNumChannels)
Definition: ntv2publicinterface.cpp:3500
NTV2_FG_2048x1114
@ NTV2_FG_2048x1114
2048x1080, NTV2_VANCMODE_TALLER
Definition: ntv2enums.h:347
AsU8Ref
#define AsU8Ref(_x_)
Definition: ntv2publicinterface.cpp:3663
NTV2SetRegisters::mOutNumFailures
ULWord mOutNumFailures
The number of registers unsuccessfully written.
Definition: ntv2publicinterface.h:7676
NTV2_IS_VALID_NTV2FrameRate
#define NTV2_IS_VALID_NTV2FrameRate(__r__)
Definition: ntv2enums.h:435
NTV2CrosspointToNTV2Channel
NTV2Channel NTV2CrosspointToNTV2Channel(const NTV2Crosspoint inCrosspointChannel)
Definition: ntv2utils.cpp:4773
FRAME_STAMP::acCurrentAudioExpectedAddress
ULWord acCurrentAudioExpectedAddress
Definition: ntv2publicinterface.h:7954
AUTOCIRCULATE_TRANSFER_STATUS::AUTOCIRCULATE_TRANSFER_STATUS
AUTOCIRCULATE_TRANSFER_STATUS()
Constructs a default AUTOCIRCULATE_TRANSFER_STATUS structure.
Definition: ntv2publicinterface.cpp:2515
kVRegMaskHDMOutPixel420
@ kVRegMaskHDMOutPixel420
Definition: ntv2virtualregisters.h:649
ULWord64Sequence
std::vector< uint64_t > ULWord64Sequence
An ordered sequence of ULWord64 (uint64_t) values.
Definition: ntv2publicinterface.h:50
AUTOCIRCULATE_DATA::bVal4
BOOL_ bVal4
Definition: ntv2publicinterface.h:4442
NTV2SDKVersionDecode_Point
#define NTV2SDKVersionDecode_Point
Definition: ntv2publicinterface.h:5446
AUTOCIRCULATE_STATUS_STRUCT::audioClockCurrentTime
ULWord64 audioClockCurrentTime
Definition: ntv2publicinterface.h:4381
NTV2_OUTPUTDESTINATION_SDI4
@ NTV2_OUTPUTDESTINATION_SDI4
Definition: ntv2enums.h:1317
NTV2Buffer_PAGE_ALIGNED
#define NTV2Buffer_PAGE_ALIGNED
Allocated page-aligned?
Definition: ntv2publicinterface.h:5567
FRAME_STAMP::RPCEncode
bool RPCEncode(NTV2_RPC_BLOB_TYPE &outBlob)
Definition: ntv2publicinterface.cpp:3910
NTV2_ASSERT_STRUCT_VALID
#define NTV2_ASSERT_STRUCT_VALID
Definition: ntv2publicinterface.h:3960
NTV2RegInfo::registerMask
ULWord registerMask
My register mask value to use in a ReadRegister or WriteRegister call.
Definition: ntv2publicinterface.h:3980
FRAME_STAMP_STRUCT::audioClockTimeStamp
ULWord64 audioClockTimeStamp
48kHz clock (in reg 28, extended to 64 bits) at time of play or record.
Definition: ntv2publicinterface.h:4511
NTV2Buffer::Truncate
bool Truncate(const size_t inByteCount)
Truncates me to the given length. No reallocation takes place.
Definition: ntv2publicinterface.cpp:1683
ntv2nubtypes.h
Declares data types and structures used in NTV2 "nub" packets.
NTV2Buffer::RPCEncode
bool RPCEncode(NTV2_RPC_BLOB_TYPE &outBlob)
Definition: ntv2publicinterface.cpp:3709
NTV2ColorCorrectionData::RPCEncode
bool RPCEncode(NTV2_RPC_BLOB_TYPE &outBlob)
Definition: ntv2publicinterface.cpp:4039
NTV2HDMIOutputStatus::Print
std::ostream & Print(std::ostream &inOutStream) const
Prints a human-readable representation of me into the given output stream.
Definition: ntv2publicinterface.cpp:183
AUTOCIRCULATE_STATUS::WithCustomAnc
bool WithCustomAnc(void) const
Definition: ntv2publicinterface.h:7449
AUTOCIRCULATE_TRANSFER::acOutputTimeCodes
NTV2Buffer acOutputTimeCodes
Intended for playout, this is an ordered sequence of NTV2_RP188 values to send to the device....
Definition: ntv2publicinterface.h:8206
ntv2nub::POPU16
void POPU16(uint16_t &outVal, const std::vector< uint8_t > &inArr, std::size_t &inOutNdx, const bool dontSwap=false)
Definition: ntv2nubtypes.h:61
FRAME_STAMP_STRUCT::audioOutStopAddress
ULWord audioOutStopAddress
For play - first position in buffer of audio.
Definition: ntv2publicinterface.h:4523
eSetActiveFrame
@ eSetActiveFrame
Definition: ntv2publicinterface.h:4317
OCT0N
#define OCT0N(__x__, __n__)
Definition: ntv2publicinterface.h:5651
AJA_NTV2_SDK_VERSION_MINOR
#define AJA_NTV2_SDK_VERSION_MINOR
The SDK minor version number, an unsigned decimal integer.
Definition: ntv2version.h:14
AutoCircVidProcInfo::backgroundKeyCrosspoint
NTV2Crosspoint backgroundKeyCrosspoint
Definition: ntv2publicinterface.h:4270
NTV2AudioChannelPairsConstIter
NTV2AudioChannelPairs::const_iterator NTV2AudioChannelPairsConstIter
Handy const iterator to iterate over a set of distinct NTV2AudioChannelPair values.
Definition: ntv2publicinterface.h:59
NTV2HDMIOutputStatus::SetFromRegValue
bool SetFromRegValue(const ULWord inData)
Sets my fields from the given status register value.
Definition: ntv2publicinterface.cpp:164
NTV2StreamBuffer::mHeader
NTV2_HEADER mHeader
The common structure header – ALWAYS FIRST!
Definition: ntv2publicinterface.h:8922
NTV2GetSupportedStandards
bool NTV2GetSupportedStandards(NTV2StandardSet &outStandards)
Returns a set of all NTV2Standard values supported (used) by any/all supported NTV2 devices.
Definition: ntv2publicinterface.cpp:1243
NTV2_FRAMEBUFFER_ORIENTATION_BOTTOMUP
@ NTV2_FRAMEBUFFER_ORIENTATION_BOTTOMUP
Definition: ntv2enums.h:2035
NTV2SDKVersionDecode_Build
#define NTV2SDKVersionDecode_Build
Definition: ntv2publicinterface.h:5447
NTV2_INVALID_HDMI_COLORSPACE
@ NTV2_INVALID_HDMI_COLORSPACE
Definition: ntv2enums.h:3581
AutoCircVidProcInfo::transitionSoftness
Fixed_ transitionSoftness
Definition: ntv2publicinterface.h:4272
NTV2VirtualData
This is used to perform virtual data reads or writes.
Definition: ntv2publicinterface.h:7785
AUTOCIRCULATE_STATUS::WithColorCorrect
bool WithColorCorrect(void) const
Definition: ntv2publicinterface.h:7474
FRAME_STAMP_STRUCT::currentFrameTime
LWord64 currentFrameTime
Vertical blank start of current frame.
Definition: ntv2publicinterface.h:4556
NTV2ChannelToString
std::string NTV2ChannelToString(const NTV2Channel inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:5792
NTV2_INPUT_SOURCE_IS_SDI
#define NTV2_INPUT_SOURCE_IS_SDI(_inpSrc_)
Definition: ntv2enums.h:1274
NTV2Buffer::NextDifference
bool NextDifference(const NTV2Buffer &inBuffer, ULWord &byteOffset) const
Answers with the byte offset to the first or next difference.
Definition: ntv2publicinterface.cpp:2040
GetNTV2StandardFromVideoFormat
NTV2Standard GetNTV2StandardFromVideoFormat(const NTV2VideoFormat inVideoFormat)
Definition: ntv2utils.cpp:2279
NTV2BufferLock::mFlags
ULWord mFlags
Action flags (lock, unlock, etc)
Definition: ntv2publicinterface.h:8638
NTV2Buffer::ByteSwap64
bool ByteSwap64(void)
Byte-swaps my contents 64-bits at a time.
Definition: ntv2publicinterface.cpp:1717
NTV2StreamChannel::mFlags
ULWord mFlags
Action flags.
Definition: ntv2publicinterface.h:8864
AUTOCIRCULATE_TASK_STRUCT
Definition: ntv2publicinterface.h:4814
NTV2BankSelGetSetRegs::mInBankInfos
NTV2Buffer mInBankInfos
Bank select NTV2RegInfo. The SDK owns this memory.
Definition: ntv2publicinterface.h:7738
NTV2Buffer::Fill
bool Fill(const T &inValue)
Fills me with the given scalar value.
Definition: ntv2publicinterface.h:6320
NTV2_FG_7680x4320
@ NTV2_FG_7680x4320
Definition: ntv2enums.h:363
NTV2VirtualData::mHeader
NTV2_HEADER mHeader
The common structure header – ALWAYS FIRST!
Definition: ntv2publicinterface.h:7786
NTV2_HDMIColorSpaceRGB
@ NTV2_HDMIColorSpaceRGB
RGB color space.
Definition: ntv2enums.h:3578
NTV2RegReads
NTV2RegWrites NTV2RegReads
An ordered sequence of zero or more NTV2RegInfo structs intended for ReadRegister.
Definition: ntv2publicinterface.h:4072
AUTOCIRCULATE_DATA::bVal8
BOOL_ bVal8
Definition: ntv2publicinterface.h:4446
NTV2AudioRateToString
std::string NTV2AudioRateToString(const NTV2AudioRate inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:5821
kVRegShiftHDMOutPixel420
@ kVRegShiftHDMOutPixel420
Definition: ntv2virtualregisters.h:668
NTV2BufferLock::NTV2BufferLock
NTV2BufferLock()
Constructs a default NTV2BufferLock struct.
Definition: ntv2publicinterface.cpp:3014
NTV2DebugLogging::mTrailer
NTV2_TRAILER mTrailer
The common structure trailer – ALWAYS LAST!
Definition: ntv2publicinterface.h:8605
AUTOCIRCULATE_STATUS::GetFrameCount
ULWord GetFrameCount(void) const
Definition: ntv2publicinterface.h:7320
AUTOCIRCULATE_TRANSFER_STATUS::acAudioTransferSize
ULWord acAudioTransferSize
Number of bytes captured into the audio buffer.
Definition: ntv2publicinterface.h:8080
ntv2publicinterface.h
Declares enums and structs used by all platform drivers and the SDK.
NTV2_TYPE_SETREGS
#define NTV2_TYPE_SETREGS
Identifies NTV2SetRegisters struct.
Definition: ntv2publicinterface.h:5531
NTV2_FG_1280x740
@ NTV2_FG_1280x740
1280x720, for 720p, NTV2_VANCMODE_TALL
Definition: ntv2enums.h:351
AUTOCIRCULATE_WITH_COLORCORRECT
#define AUTOCIRCULATE_WITH_COLORCORRECT
Use this to AutoCirculate with color correction.
Definition: ntv2publicinterface.h:5585
AUTOCIRCULATE_STATUS::IsFieldMode
bool IsFieldMode(void) const
Definition: ntv2publicinterface.h:7484
FRAME_STAMP::acFrameTime
LWord64 acFrameTime
(input/ingest/capture only) The absolute timestamp at the VBI when the frame started recording into d...
Definition: ntv2publicinterface.h:7890
AUTOCIRCULATE_TRANSFER::GetInputTimeCodes
bool GetInputTimeCodes(NTV2TimeCodeList &outValues) const
Intended for capture, answers with the timecodes captured in my acTransferStatus member's acFrameStam...
Definition: ntv2publicinterface.cpp:2977
NTV2_AUDIO_FORMAT_INVALID
@ NTV2_AUDIO_FORMAT_INVALID
Definition: ntv2enums.h:1942
NTV2Buffer::HostPageSize
static size_t HostPageSize(void)
Definition: ntv2publicinterface.cpp:2163
NTV2FrameSize::FGWidth
static ULWord FGWidth(const NTV2FrameGeometry fg)
Definition: ntv2publicinterface.cpp:1456
NTV2RegValueMapConstIter
NTV2RegisterValueMap::const_iterator NTV2RegValueMapConstIter
A const iterator that iterates over NTV2RegisterValueMap entries.
Definition: ntv2publicinterface.h:7549
NTV2DebugLogging
This is used to enable or disable AJADebug logging in the driver.
Definition: ntv2publicinterface.h:8598
NTV2_FG_2048x1556
@ NTV2_FG_2048x1556
2048x1556, for 2Kx1556psf film format, NTV2_VANCMODE_OFF
Definition: ntv2enums.h:353
NTV2_TYPE_AJABITSTREAM
#define NTV2_TYPE_AJABITSTREAM
Identifies NTV2Bitstream struct.
Definition: ntv2publicinterface.h:5535
NTV2EndianSwap64
#define NTV2EndianSwap64(__val__)
Definition: ntv2endian.h:25
AUTOCIRCULATE_STATUS::acFramesDropped
ULWord acFramesDropped
Total number of frames dropped since CNTV2Card::AutoCirculateStart called.
Definition: ntv2publicinterface.h:7286
AUTOCIRCULATE_DATA::Print
std::ostream & Print(std::ostream &oss) const
Definition: ntv2publicinterface.cpp:239
NTV2ChannelListConstIter
NTV2ChannelList::const_iterator NTV2ChannelListConstIter
A handy const iterator into an NTV2ChannelList.
Definition: ntv2publicinterface.h:3851
NTV2ColorCorrectionData::NTV2ColorCorrectionData
NTV2ColorCorrectionData()
Constructs a default NTV2ColorCorrectionData struct.
Definition: ntv2publicinterface.cpp:2744
FRAME_STAMP_STRUCT::frame
ULWord frame
The frame requested or -1 if not available.
Definition: ntv2publicinterface.h:4508
NTV2DIDSet
std::set< UByte > NTV2DIDSet
A set of distinct NTV2DID values.
Definition: ntv2publicinterface.h:76
NTV2_TRAILER_TAG
#define NTV2_TRAILER_TAG
Identifies the struct trailer.
Definition: ntv2publicinterface.h:5517
NTV2HostIsBigEndian
#define NTV2HostIsBigEndian
Definition: ntv2endian.h:58
NTV2_IS_VALID_FRAME_BUFFER_FORMAT
#define NTV2_IS_VALID_FRAME_BUFFER_FORMAT(__s__)
Definition: ntv2enums.h:254
AUTOCIRCULATE_DATA::RPCEncode
bool RPCEncode(NTV2_RPC_BLOB_TYPE &outBlob)
Definition: ntv2publicinterface.cpp:4478
FRAME_STAMP::acRequestedFrame
ULWord acRequestedFrame
On entry for NTV2_TYPE_ACFRAMESTAMP message, the requested frame. Upon exit, 0xFFFFFFFF means "not ...
Definition: ntv2publicinterface.h:7894
AUTOCIRCULATE_DATA::bVal7
BOOL_ bVal7
Definition: ntv2publicinterface.h:4445
NTV2Buffer::FindAll
ULWordSet & FindAll(ULWordSet &outOffsets, const NTV2Buffer &inValue) const
Definition: ntv2publicinterface.cpp:1969
operator<<
ostream & operator<<(ostream &inOutStr, const NTV2AudioChannelPairs &inSet)
Definition: ntv2publicinterface.cpp:34
kVRegMaskHDMOutRangeFull
@ kVRegMaskHDMOutRangeFull
Definition: ntv2virtualregisters.h:648
NTV2DoubleArrayConstIter
NTV2DoubleArray::const_iterator NTV2DoubleArrayConstIter
Handy const iterator to iterate over an NTV2DoubleArray.
Definition: ntv2publicinterface.h:72
xHEX0N
#define xHEX0N(__x__, __n__)
Definition: ntv2publicinterface.h:5646
NTV2AudioSystem
NTV2AudioSystem
Used to identify an Audio System on an NTV2 device. See Audio System Operation for more information.
Definition: ntv2enums.h:3865
NTV2DebugLogging::mHeader
NTV2_HEADER mHeader
The common structure header – ALWAYS FIRST!
Definition: ntv2publicinterface.h:8599
NTV2Buffer::GetU16s
bool GetU16s(UWordSequence &outU16s, const size_t inU16Offset=0, const size_t inMaxSize=64, const bool inByteSwap=false) const
Answers with my contents as a vector of unsigned 16-bit values.
Definition: ntv2publicinterface.cpp:641
NTV2Bitstream::NTV2Bitstream
NTV2Bitstream()
Constructs a default NTV2Bitstream struct.
Definition: ntv2publicinterface.cpp:3063
NTV2_AUDIO_RATE_INVALID
@ NTV2_AUDIO_RATE_INVALID
Definition: ntv2enums.h:1920
AUTOCIRCVIDPROCMODE_MIX
@ AUTOCIRCVIDPROCMODE_MIX
Definition: ntv2publicinterface.h:4253
NTV2_IS_VALID_AUDIO_SYSTEM
#define NTV2_IS_VALID_AUDIO_SYSTEM(__x__)
Definition: ntv2enums.h:3884
NTV2StreamBuffer
Definition: ntv2publicinterface.h:8921
NTV2StreamBuffer::mStatus
ULWord mStatus
Action status.
Definition: ntv2publicinterface.h:8925
NTV2Bitstream::Print
std::ostream & Print(std::ostream &inOutStream) const
Prints a human-readable representation of me to the given output stream.
Definition: ntv2publicinterface.cpp:3091
NTV2SDIInStatistics::operator[]
NTV2SDIInputStatus & operator[](const size_t inSDIInputIndex0)
Definition: ntv2publicinterface.cpp:2493
NTV2AudioChannelOctets
std::set< NTV2AudioChannelOctet > NTV2AudioChannelOctets
A set of distinct NTV2AudioChannelOctet values.
Definition: ntv2publicinterface.h:66
NTV2_INPUT_SOURCE_IS_ANALOG
#define NTV2_INPUT_SOURCE_IS_ANALOG(_inpSrc_)
Definition: ntv2enums.h:1273
NTV2RegisterReadsIter
NTV2RegWritesIter NTV2RegisterReadsIter
Definition: ntv2publicinterface.h:4074
ntv2nub::PUSHU16
void PUSHU16(const uint16_t inVal, std::vector< uint8_t > &inArr, const bool dontSwap=false)
Definition: ntv2nubtypes.h:31
NTV2Buffer::SetAndFill
bool SetAndFill(const void *pInUserPointer, const size_t inByteCount, const UByte inValue)
Sets (or resets) me from a client-supplied address and size.
Definition: ntv2publicinterface.cpp:1763
AJAMemory::AllocateAligned
static void * AllocateAligned(size_t size, size_t alignment)
Definition: memory.cpp:115
NTV2FrameRateToString
std::string NTV2FrameRateToString(const NTV2FrameRate inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:7232
ntv2registerexpert.h
Declares the CNTV2RegisterExpert class.
NTV2_FG_1920x1080
@ NTV2_FG_1920x1080
1920x1080, for 1080i and 1080p, NTV2_VANCMODE_OFF
Definition: ntv2enums.h:341
NTV2BankSelGetSetRegs::RPCEncode
bool RPCEncode(NTV2_RPC_BLOB_TYPE &outBlob)
Definition: ntv2publicinterface.cpp:3820
AUTOCIRCULATE_TRANSFER::acANCBuffer
NTV2Buffer acANCBuffer
The host ancillary data buffer. This field is owned by the client application, and thus is responsibl...
Definition: ntv2publicinterface.h:8187
NTV2FrameRateSet
std::set< NTV2FrameRate > NTV2FrameRateSet
A set of distinct NTV2FrameRate values. New in SDK 17.0.
Definition: ntv2publicinterface.h:8981
NTV2Crosspoint
NTV2Crosspoint
Logically, these are an NTV2Channel combined with an NTV2Mode.
Definition: ntv2enums.h:1686
NTV2IOKinds
ULWord NTV2IOKinds
Definition: ntv2enums.h:1296
AUTOCIRCULATE_TRANSFER_STATUS::acFramesProcessed
ULWord acFramesProcessed
Total number of frames successfully processed since AutoCirculateStart.
Definition: ntv2publicinterface.h:8077
NTV2GetRegisters::PatchRegister
bool PatchRegister(const ULWord inRegNum, const ULWord inValue)
Patches the given register value.
Definition: ntv2publicinterface.cpp:3220
NTV2GetRegisters::ResetUsing
bool ResetUsing(const NTV2RegNumSet &inRegisterNumbers)
Resets me, starting over, now using the given NTV2RegisterNumberSet.
Definition: ntv2publicinterface.cpp:3144
AUTOCIRCULATE_TRANSFER_STATUS::acAudioStartSample
ULWord acAudioStartSample
Starting audio sample (valid for capture only).
Definition: ntv2publicinterface.h:8081
AUTOCIRCULATE_TRANSFER::acPeerToPeerFlags
ULWord acPeerToPeerFlags
Definition: ntv2publicinterface.h:8243
memory.h
Declares the AJAMemory class.
NTV2PrintAudioSystemSet
ostream & NTV2PrintAudioSystemSet(const NTV2AudioSystemSet &inObj, const bool inCompact, std::ostream &inOutStream)
Streams a human-readable dump of the given NTV2AudioSystemSet into the specified output stream.
Definition: ntv2publicinterface.cpp:3534
kVRegShiftHDMOutAudioChannels
@ kVRegShiftHDMOutAudioChannels
Definition: ntv2virtualregisters.h:672
FRAME_STAMP_STRUCT::currentFieldCount
ULWord currentFieldCount
At Call Field0 or Field1 currently being OUTPUT (at the time of the IOCTL_NTV2_GET_FRAMESTAMP)
Definition: ntv2publicinterface.h:4570
NTV2_TYPE_AJASTREAMCHANNEL
#define NTV2_TYPE_AJASTREAMCHANNEL
Identifies NTV2StreamChannel struct.
Definition: ntv2publicinterface.h:5536
NTV2RegInfo::PrintCode
std::ostream & PrintCode(std::ostream &outputStream, const int inRadix=16, const NTV2DeviceID inDeviceID=DEVICE_ID_INVALID) const
Renders me to the given output stream as source code using a "WriteRegister" function call.
Definition: ntv2publicinterface.cpp:3408
NTV2_IS_TIMECODE_TASK
#define NTV2_IS_TIMECODE_TASK(_x_)
Definition: ntv2publicinterface.h:4752
NTV2SegmentedXferInfo::getSourceCode
std::string getSourceCode(const bool inInclDecl=true) const
Definition: ntv2publicinterface.cpp:1536
NTV2_AUTOCIRCULATE_STARTING_AT_TIME
@ NTV2_AUTOCIRCULATE_STARTING_AT_TIME
The AutoCirculate channel is starting, waiting for the start time specified in the call to CNTV2Card:...
Definition: ntv2publicinterface.h:4336
AUTOCIRCULATE_TRANSFER::SetBuffers
bool SetBuffers(ULWord *pInVideoBuffer, const ULWord inVideoByteCount, ULWord *pInAudioBuffer, const ULWord inAudioByteCount, ULWord *pInANCBuffer, const ULWord inANCByteCount, ULWord *pInANCF2Buffer=NULL, const ULWord inANCF2ByteCount=0)
Sets my buffers for use in a subsequent call to CNTV2Card::AutoCirculateTransfer.
Definition: ntv2publicinterface.cpp:2839
CNTV2RegisterExpert::GetDisplayValue
static std::string GetDisplayValue(const uint32_t inRegNum, const uint32_t inRegValue, const NTV2DeviceID inDeviceID=DEVICE_ID_NOTFOUND)
Definition: ntv2registerexpert.cpp:4668
NTV2FBOrientation
enum NTV2VideoFrameBufferOrientation NTV2FBOrientation
NTV2SDIInStatistics::Print
std::ostream & Print(std::ostream &inOutStream) const
Prints a human-readable representation of me to the given output stream.
Definition: ntv2publicinterface.cpp:2508
NTV2GetSupportedPixelFormats
bool NTV2GetSupportedPixelFormats(NTV2PixelFormats &outFormats)
Returns a set of all NTV2PixelFormat values supported (used) by any/all supported NTV2 devices.
Definition: ntv2publicinterface.cpp:1218
NTV2_IS_VALID_VIDEO_FORMAT
#define NTV2_IS_VALID_VIDEO_FORMAT(__f__)
Definition: ntv2enums.h:716
NTV2_OUTPUTDESTINATION_SDI5
@ NTV2_OUTPUTDESTINATION_SDI5
Definition: ntv2enums.h:1318
debug.h
Declares the AJADebug class.
FRAME_STAMP::acCurrentReps
ULWord acCurrentReps
Contains validCount (Playout: on repeated frames, number of reps remaining; Record: drops on frame)
Definition: ntv2publicinterface.h:7958
AUTOCIRCULATE_TASK_STRUCT::RPCEncode
bool RPCEncode(NTV2_RPC_BLOB_TYPE &outBlob)
Definition: ntv2publicinterface.cpp:4370
NTV2ColorCorrectionData::ccLookupTables
NTV2Buffer ccLookupTables
RGB lookup tables pre-formatted for AJA hardware as a contiguous block of NTV2_COLORCORRECTOR_TABLESI...
Definition: ntv2publicinterface.h:7227
ntv2nub::PUSHU8
void PUSHU8(const uint8_t inVal, std::vector< uint8_t > &inArr)
Definition: ntv2nubtypes.h:26
NTV2SegmentedXferInfo::containsElementAtOffset
bool containsElementAtOffset(const ULWord inElementOffset) const
Definition: ntv2publicinterface.cpp:1566
AUTOCIRCULATE_STATUS_STRUCT::bufferLevel
ULWord bufferLevel
Definition: ntv2publicinterface.h:4384
AUTOCIRCULATE_TRANSFER::AUTOCIRCULATE_TRANSFER
AUTOCIRCULATE_TRANSFER()
Constructs a default AUTOCIRCULATE_TRANSFER struct.
Definition: ntv2publicinterface.cpp:2780
AUTOCIRCULATE_TRANSFER::acRP188
NTV2_RP188 acRP188
Will be deprecated – use AUTOCIRCULATE_TRANSFER::SetOutputTimeCode instead.
Definition: ntv2publicinterface.h:8246
NTV2Buffer::SwapWith
bool SwapWith(NTV2Buffer &inBuffer)
Swaps my underlying buffer with another's.
Definition: ntv2publicinterface.cpp:1950
NTV2Buffer::Set
bool Set(const void *pInUserPointer, const size_t inByteCount)
Sets (or resets) me from a client-supplied address and size.
Definition: ntv2publicinterface.cpp:1753
NTV2_AUTOCIRCULATE_DISABLED
@ NTV2_AUTOCIRCULATE_DISABLED
The AutoCirculate channel is stopped.
Definition: ntv2publicinterface.h:4330
FRAME_STAMP_STRUCT::audioInStopAddress
ULWord audioInStopAddress
For record - end position (exclusive) in buffer of audio (includes base offset)
Definition: ntv2publicinterface.h:4520
Fixed_
int Fixed_
Definition: ajatypes.h:321
NTV2StreamBuffer::mFlags
ULWord mFlags
Action flags.
Definition: ntv2publicinterface.h:8924
AUTOCIRCULATE_STATUS::CopyTo
bool CopyTo(AUTOCIRCULATE_STATUS_STRUCT &outOldStruct)
Copies my data into the given AUTOCIRCULATE_STATUS_STRUCT.
Definition: ntv2publicinterface.cpp:2554
AUTOCIRCULATE_STATUS::IsOutput
bool IsOutput(void) const
Definition: ntv2publicinterface.h:7499
NTV2_OUTPUTDESTINATION_ANALOG1
@ NTV2_OUTPUTDESTINATION_ANALOG1
Definition: ntv2enums.h:1312
AJA_DebugStat_ACXferRPCEncode
@ AJA_DebugStat_ACXferRPCEncode
Definition: debugshare.h:248
NTV2MakeAudioSystemSet
NTV2AudioSystemSet NTV2MakeAudioSystemSet(const NTV2AudioSystem inFirstAudioSystem, const UWord inCount)
Definition: ntv2publicinterface.cpp:3555
NTV2GetRegisters::RPCEncode
bool RPCEncode(NTV2_RPC_BLOB_TYPE &outBlob)
Definition: ntv2publicinterface.cpp:3732
NTV2AudioSystemToString
std::string NTV2AudioSystemToString(const NTV2AudioSystem inValue, const bool inCompactDisplay=false)
Definition: ntv2utils.cpp:5810
AutoCircTaskType
AutoCircTaskType
These are the available AutoCirculate task types.
Definition: ntv2publicinterface.h:4733
GetTCIndexesForSDIInput
#define GetTCIndexesForSDIInput
Definition: ntv2utils.h:593
NTV2_TRAILER::fTrailerTag
ULWord fTrailerTag
A special FourCC to identify the tail end of an NTV2 structure.
Definition: ntv2publicinterface.h:7122
NTV2_FBF_LAST
@ NTV2_FBF_LAST
Definition: ntv2enums.h:246
NTV2OutputDestinationToString
std::string NTV2OutputDestinationToString(const NTV2OutputDestination inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:7286
NTV2_AUDIOSYSTEM_INVALID
@ NTV2_AUDIOSYSTEM_INVALID
Definition: ntv2enums.h:3877
NTV2HDMIBitDepthToString
std::string NTV2HDMIBitDepthToString(const NTV2HDMIBitDepth inValue, const bool inCompactDisplay=false)
Definition: ntv2utils.cpp:6697
NTV2_HEADER::NTV2_HEADER
NTV2_HEADER(const ULWord inStructureType, const ULWord inSizeInBytes)
Constructs a default NTV2_HEADER having the proper tag, version, and the given type and size.
Definition: ntv2publicinterface.cpp:307