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