23 #if !defined(MSWindows)
60 inOutStr << *iter << endl;
68 inOutStr <<
xHEX0N(uint16_t(*it),2);
69 if (++it != inDIDs.end())
77 inOutStream <<
DEC(inData.size()) <<
" UWords: ";
80 inOutStream <<
HEX0N(*iter,4);
81 if (++iter != inData.end())
89 inOutStream <<
DEC(inData.size()) <<
" ULWords: ";
92 inOutStream <<
HEX0N(*iter,8);
93 if (++iter != inData.end())
101 inOutStream <<
DEC(inData.size()) <<
" ULWord64s: ";
104 inOutStream <<
HEX0N(*iter,16);
105 if (++iter != inData.end())
123 mFrameRefClockCount = 0;
124 mGlobalClockCount = 0;
125 mFrameTRSError =
false;
134 inOutStream <<
"[CRCA=" <<
DEC(mCRCTallyA)
135 <<
" CRCB=" <<
DEC(mCRCTallyB)
136 <<
" unlk=" <<
xHEX0N(mUnlockTally,8)
137 <<
" frmRefClkCnt=" <<
xHEX0N(mFrameRefClockCount,16)
138 <<
" globalClkCnt=" <<
xHEX0N(mGlobalClockCount,16)
139 <<
" frmTRS=" <<
YesNo(mFrameTRSError)
140 <<
" locked=" <<
YesNo(mLocked)
141 <<
" VPIDA=" <<
YesNo(mVPIDValidA)
142 <<
" VPIDB=" <<
YesNo(mVPIDValidB)
184 inOutStream <<
"Enabled: " <<
YesNo(mEnabled);
187 <<
"Is 4:2:0: " <<
YesNo(mPixel420) << endl
208 transitionCoefficient (0),
209 transitionSoftness (0)
215 : eCommand (inCommand),
216 channelSpec (inCrosspoint),
241 fType (inStructureType),
244 fSizeInBytes (inStructSizeInBytes),
245 fPointerSize (sizeof(int*)),
254 return inObj.
Print (inOutStream);
262 inOutStream << NTV2_4CC_AS_STRING (fHeaderTag);
264 inOutStream <<
"BAD-" <<
HEX0N(fHeaderTag,8);
266 inOutStream << NTV2_4CC_AS_STRING (fType);
268 inOutStream <<
"|BAD-" <<
HEX0N(fType,8);
269 inOutStream <<
" v" << fHeaderVersion <<
" vers=" << fVersion <<
" sz=" << fSizeInBytes;
270 return inOutStream <<
"]";
275 const char * pU32 (
reinterpret_cast<const char *
>(&in4CC));
276 ostringstream result;
279 for (
size_t charPos(0); charPos < 4; charPos++)
281 #if AJATargetBigEndian
282 const char ch(pU32[charPos]);
283 #else // little-endian:
284 const char ch(pU32[3-charPos]);
286 if (ch < ' ' || ch > 126)
287 {result <<
'.'; badTally++;}
293 result <<
" (" <<
xHEX0N(in4CC,8) <<
")";
302 inOutStream << NTV2_4CC_AS_STRING(inObj.
fTrailerTag);
315 return inObj.
Print (inOutStream);
333 if (inDumpMaxBytes > 256)
334 inDumpMaxBytes = 256;
338 for (
UWord ndx(0); ndx < inDumpMaxBytes; ndx++)
339 oss <<
HEX0N(uint16_t(pBytes[ndx]),2);
351 oss <<
HEX0N(uint16_t(
U8(ndx++)),2);
352 if (inLineBreakInterval && ndx <
int(
GetByteCount()) && ((
size_t(ndx) % inLineBreakInterval) == 0))
356 return !outStr.empty();
361 const streamsize maxAddrWidth (
sizeof(
ULWord64) * 2);
364 oss <<
OCT0N(inOffset,maxAddrWidth) <<
": ";
365 else if (inRadix == 10)
366 oss <<
DEC0N(inOffset,maxAddrWidth) <<
": ";
368 oss <<
xHEX0N(inOffset,maxAddrWidth) <<
": ";
373 const size_t inStartOffset,
374 const size_t inByteCount,
375 const size_t inRadix,
376 const size_t inBytesPerGroup,
377 const size_t inGroupsPerRow,
378 const size_t inAddressRadix,
379 const bool inShowAscii,
380 const size_t inAddrOffset)
const
384 if (inRadix != 8 && inRadix != 10 && inRadix != 16 && inRadix != 2)
386 if (inAddressRadix != 0 && inAddressRadix != 8 && inAddressRadix != 10 && inAddressRadix != 16)
388 if (inBytesPerGroup == 0)
393 size_t bytesRemaining (inByteCount ? inByteCount :
GetByteCount());
394 size_t bytesInThisGroup (0);
395 size_t groupsInThisRow (0);
396 const unsigned maxByteWidth (inRadix == 8 ? 4 : (inRadix == 10 ? 3 : (inRadix == 2 ? 8 : 2)));
397 const UByte * pBuffer (
reinterpret_cast <const UByte *
> (pInStartAddress));
398 const size_t asciiBufferSize (inShowAscii && inGroupsPerRow ? (inBytesPerGroup * inGroupsPerRow + 1) *
sizeof (
UByte) : 0);
401 if (!pInStartAddress)
405 ::memset (pAsciiBuffer, 0, asciiBufferSize);
407 if (inGroupsPerRow && inAddressRadix)
409 while (bytesRemaining)
412 inOStream <<
BIN08(*pBuffer);
413 else if (inRadix == 8)
414 inOStream <<
oOCT(uint16_t(*pBuffer));
415 else if (inRadix == 10)
416 inOStream <<
DEC0N(uint16_t(*pBuffer),maxByteWidth);
417 else if (inRadix == 16)
418 inOStream <<
HEX0N(uint16_t(*pBuffer),2);
421 pAsciiBuffer[groupsInThisRow * inBytesPerGroup + bytesInThisGroup] = isprint(*pBuffer) ? *pBuffer :
'.';
426 if (bytesInThisGroup >= inBytesPerGroup)
429 if (inGroupsPerRow && groupsInThisRow >= inGroupsPerRow)
433 inOStream <<
" " << pAsciiBuffer;
434 ::memset (pAsciiBuffer, 0, asciiBufferSize);
437 if (inAddressRadix && bytesRemaining)
438 inOStream << print_address_offset (inAddressRadix, reinterpret_cast <ULWord64> (pBuffer) -
reinterpret_cast <ULWord64> (pInStartAddress) +
ULWord64 (inAddrOffset));
443 bytesInThisGroup = 0;
447 if (bytesInThisGroup && bytesInThisGroup < inBytesPerGroup && pAsciiBuffer)
450 inOStream <<
string ((inBytesPerGroup - bytesInThisGroup) * maxByteWidth + 1,
' ');
455 if (groupsInThisRow < inGroupsPerRow && pAsciiBuffer)
456 inOStream <<
string (((inGroupsPerRow - groupsInThisRow) * inBytesPerGroup * maxByteWidth + (inGroupsPerRow - groupsInThisRow)),
' ');
458 inOStream << pAsciiBuffer;
461 else if (bytesInThisGroup && bytesInThisGroup < inBytesPerGroup)
465 delete [] pAsciiBuffer;
472 const size_t inStartOffset,
473 const size_t inByteCount,
474 const size_t inRadix,
475 const size_t inBytesPerGroup,
476 const size_t inGroupsPerRow,
477 const size_t inAddressRadix,
478 const bool inShowAscii,
479 const size_t inAddrOffset)
const
482 Dump (oss, inStartOffset, inByteCount, inRadix, inBytesPerGroup, inGroupsPerRow, inAddressRadix, inShowAscii, inAddrOffset);
483 inOutputString = oss.str();
484 return inOutputString;
505 size_t maxSize (
size_t(
GetByteCount()) /
sizeof(uint64_t));
506 if (maxSize < inU64Offset)
508 maxSize -= inU64Offset;
510 const uint64_t * pU64 (
reinterpret_cast <const uint64_t *
> (
GetHostAddress(
ULWord(inU64Offset *
sizeof(uint64_t)))));
514 if (inMaxSize && inMaxSize < maxSize)
519 outUint64s.reserve(maxSize);
520 for (
size_t ndx(0); ndx < maxSize; ndx++)
522 const uint64_t u64 (*pU64++);
529 outUint64s.reserve(0);
542 size_t maxNumU32s (
size_t(
GetByteCount()) /
sizeof(uint32_t));
543 if (maxNumU32s < inU32Offset)
545 maxNumU32s -= inU32Offset;
547 const uint32_t * pU32 (
reinterpret_cast<const uint32_t*
>(
GetHostAddress(
ULWord(inU32Offset *
sizeof(uint32_t)))));
551 if (inMaxSize && inMaxSize < maxNumU32s)
552 maxNumU32s = inMaxSize;
556 outUint32s.reserve(maxNumU32s);
557 for (
size_t ndx(0); ndx < maxNumU32s; ndx++)
559 const uint32_t u32 (*pU32++);
566 outUint32s.reserve(0);
579 size_t maxSize (
size_t(
GetByteCount()) /
sizeof(uint16_t));
580 if (maxSize < inU16Offset)
582 maxSize -= inU16Offset;
584 const uint16_t * pU16 (
reinterpret_cast <const uint16_t *
> (
GetHostAddress(
ULWord(inU16Offset *
sizeof(uint16_t)))));
588 if (inMaxSize && inMaxSize < maxSize)
593 outUint16s.reserve(maxSize);
594 for (
size_t ndx(0); ndx < maxSize; ndx++)
596 const uint16_t u16 (*pU16++);
603 outUint16s.reserve(0);
617 if (maxSize < inU8Offset)
619 maxSize -= inU8Offset;
625 if (inMaxSize && inMaxSize < maxSize)
630 outUint8s.reserve(maxSize);
631 for (
size_t ndx(0); ndx < maxSize; ndx++)
632 outUint8s.push_back(*pU8++);
637 outUint8s.reserve(0);
645 const uint8_t * pU8 (
reinterpret_cast<const uint8_t*
> (
GetHostPointer()));
651 for (
size_t ndx(0); ndx < maxSize; ndx++)
652 outU8s.push_back(*pU8++);
669 if (maxSize < inU8Offset)
671 maxSize -= inU8Offset;
677 if (inMaxSize && inMaxSize < maxSize)
682 outString.reserve(maxSize);
683 for (
size_t ndx(0); ndx < maxSize; ndx++)
685 const char c = *pU8++;
695 outString.reserve(0);
710 uint64_t * pU64 (
reinterpret_cast<uint64_t*
>(
GetHostAddress(
ULWord(inU64Offset *
sizeof(uint64_t)))));
713 if (maxU64s > inU64Offset)
714 maxU64s -= inU64Offset;
715 if (maxU64s > inU64s.size())
716 maxU64s = inU64s.size();
717 if (inU64s.size() > maxU64s)
720 for (
unsigned ndx(0); ndx < maxU64s; ndx++)
738 uint32_t * pU32 (
reinterpret_cast<uint32_t*
>(
GetHostAddress(
ULWord(inU32Offset *
sizeof(uint32_t)))));
741 if (maxU32s > inU32Offset)
742 maxU32s -= inU32Offset;
743 if (maxU32s > inU32s.size())
744 maxU32s = inU32s.size();
745 if (inU32s.size() > maxU32s)
748 for (
unsigned ndx(0); ndx < maxU32s; ndx++)
766 uint16_t * pU16 (
reinterpret_cast<uint16_t*
>(
GetHostAddress(
ULWord(inU16Offset *
sizeof(uint16_t)))));
769 if (maxU16s > inU16Offset)
770 maxU16s -= inU16Offset;
771 if (maxU16s > inU16s.size())
772 maxU16s = inU16s.size();
773 if (inU16s.size() > maxU16s)
776 for (
unsigned ndx(0); ndx < maxU16s; ndx++)
797 if (maxU8s > inU8Offset)
798 maxU8s -= inU8Offset;
799 if (maxU8s > inU8s.size())
800 maxU8s = inU8s.size();
801 if (inU8s.size() > maxU8s)
804 ::memcpy(pU8, &inU8s[0], maxU8s);
806 for (
unsigned ndx(0); ndx < maxU8s; ndx++)
808 *pU8++ = inU8s.at(ndx);
822 return inOutStream <<
"{invalid}";
828 inOutList.push_back (inRP188);
835 inOutStream << inObj.size () <<
":[";
838 inOutStream << *iter;
839 if (++iter != inObj.end ())
842 return inOutStream <<
"]";
848 inOutStream << inObj.size () <<
":[";
852 if (++iter != inObj.end ())
855 return inOutStream <<
"]";
864 if (++iter != inObj.end ())
874 inOutSet.insert (*iter);
881 return inOutStream << inObj.
acHeader
902 <<
" acFrame=" << inObj.
acFrame
903 <<
" acRP188=" << inObj.
acRP188
914 inOutStream <<
"n/a";
925 while (str.find (
' ') != string::npos)
926 str.erase (str.find (
' '), 1);
971 inOutStream <<
"RegValues:" << inObj.size () <<
"[";
972 while (iter != inObj.end ())
975 const ULWord registerValue (iter->second);
977 if (++iter != inObj.end ())
980 return inOutStream <<
"]";
1007 NTV2VideoFormatSet::const_iterator iter (inFormats.begin ());
1009 inOStream << inFormats.size ()
1010 << (inFormats.size () == 1 ?
" video format: " :
" video format(s): ");
1012 while (iter != inFormats.end ())
1015 inOStream << (++iter == inFormats.end () ?
"" :
", ");
1027 inOStream << inFormats.size()
1028 << (inFormats.size() == 1 ?
" pixel format: " :
" pixel formats: ");
1030 while (iter != inFormats.end())
1033 inOStream << (++iter == inFormats.end() ?
"" :
", ");
1043 inOutSet.insert(*iter);
1053 inOStream << inStandards.size ()
1054 << (inStandards.size () == 1 ?
" standard: " :
" standards: ");
1056 while (iter != inStandards.end ())
1059 inOStream << (++iter == inStandards.end () ?
"" :
", ");
1069 inOutSet.insert(*iter);
1078 inOStream << inGeometries.size ()
1079 << (inGeometries.size () == 1 ?
" geometry: " :
" geometries: ");
1080 while (iter != inGeometries.end ())
1083 inOStream << (++iter == inGeometries.end () ?
"" :
", ");
1092 inOutSet.insert(*iter);
1101 inOStream << inSet.size()
1102 << (inSet.size() == 1 ?
" input: " :
" inputs: ");
1103 while (iter != inSet.end())
1106 inOStream << (++iter == inSet.end() ?
"" :
", ");
1115 inOutSet.insert (*iter);
1123 inOStream << inSet.size()
1124 << (inSet.size() == 1 ?
" output: " :
" outputs: ");
1125 while (iter != inSet.end())
1128 inOStream << (++iter == inSet.end() ?
"" :
", ");
1137 inOutSet.insert(*iter);
1150 if (outFormats.find(*fit) == outFormats.end())
1151 outFormats.insert(*fit);
1161 if (usedFormats.find(pf) == usedFormats.end())
1162 outFormats.insert(pf);
1168 outStandards.clear();
1175 if (outStandards.find(*sit) == outStandards.end())
1176 outStandards.insert(*sit);
1186 if (usedStandards.find(st) == usedStandards.end())
1187 outStandards.insert(st);
1206 outFormats.insert(vf);
1208 catch (
const std::bad_alloc &)
1216 NTV2_ASSERT ((isOkay && !outFormats.empty()) || (!isOkay && outFormats.empty()));
1231 outFormats.insert(pixelFormat);
1233 catch (
const std::bad_alloc &)
1240 NTV2_ASSERT ((isOkay && !outFormats.empty() ) || (!isOkay && outFormats.empty() ));
1249 outStandards.clear();
1256 outStandards.insert(
std);
1265 outGeometries.clear();
1279 outInputSources.clear();
1288 outInputSources.insert(src);
1298 outOutputDests.clear();
1301 for (
size_t ndx(0); ndx < 10; ndx++)
1308 outOutputDests.insert(dst);
1317 << (inSet.size() == 1 ?
" rate: " :
" rates: ");
1318 while (it != inSet.end())
1321 oss << (++it == inSet.end() ?
"" :
", ");
1329 if (inOutSet.find(*it) == inOutSet.end())
1330 inOutSet.insert(*it);
1343 outRates.insert(fr);
1351 return inRun.
Print(inOutStrm);
1358 static const char * sStateStrings [] = {
"Disabled",
"Initializing",
"Starting",
"Paused",
"Stopping",
"Running",
"StartingAtTime",
AJA_NULL};
1360 return string (sStateStrings [inState]);
1374 static const string sSegXferUnits[] = {
"",
" U8",
" U16",
"",
" U32",
"",
"",
"",
" U64",
""};
1379 return inStrm <<
"(invalid)";
1386 inStrm <<
DEC(getSegmentCount()) <<
" x " <<
DEC(getSegmentLength())
1388 if (getSourceOffset())
1389 inStrm <<
" srcOff=" <<
xHEX0N(getSourceOffset(),8);
1390 if (getSegmentCount() > 1)
1391 inStrm <<
" srcSpan=" <<
xHEX0N(getSourcePitch(),8) << (isSourceBottomUp()?
" VF":
"");
1392 if (getDestOffset())
1393 inStrm <<
" dstOff=" <<
xHEX0N(getDestOffset(),8);
1394 if (getSegmentCount() > 1)
1395 inStrm <<
" dstSpan=" <<
xHEX0N(getDestPitch(),8) << (isDestBottomUp()?
" VF":
"");
1396 inStrm <<
" totElm=" <<
DEC(getTotalElements()) <<
" totByt=" <<
xHEX0N(getTotalBytes(),8);
1403 static string var(
"segInfo");
1405 string units(
"\t// bytes");
1409 oss <<
"NTV2SegmentedXferInfo " << var <<
";" << endl;
1410 if (getElementLength() > 1)
1413 oss << var <<
".setElementLength(" << getElementLength() <<
");" << endl;
1415 oss << var <<
".setSegmentCount(" <<
DEC(getSegmentCount()) <<
");" << endl;
1416 oss << var <<
".setSegmentLength(" <<
DEC(getSegmentLength()) <<
");" << units << endl;
1417 if (getSourceOffset())
1418 oss << var <<
".setSourceOffset(" <<
DEC(getSourceOffset()) <<
");" << units << endl;
1419 oss << var <<
".setSourcePitch(" <<
DEC(getSourcePitch()) <<
");" << units << endl;
1420 if (isSourceBottomUp())
1421 oss << var <<
".setSourceDirection(false);" << endl;
1422 if (getDestOffset())
1423 oss << var <<
".setDestOffset(" <<
DEC(getDestOffset()) <<
");" << units << endl;
1425 oss << var <<
".setDestPitch(" <<
DEC(getDestPitch()) <<
");" << units << endl;
1426 if (isDestBottomUp())
1427 oss << var <<
".setDestDirection(false);" << endl;
1435 if (getSegmentCount() == 1)
1437 if (inElementOffset >= getSourceOffset())
1438 if (inElementOffset < getSourceOffset()+getSegmentLength())
1442 ULWord offset(getSourceOffset());
1443 for (
ULWord seg(0); seg < getSegmentCount(); seg++)
1445 if (inElementOffset < offset)
1447 if (inElementOffset < offset+getSegmentLength())
1449 offset += getSourcePitch();
1456 if (getElementLength() != inRHS.getElementLength())
1459 if (getSegmentCount() != inRHS.getSegmentCount())
1461 if (getSegmentLength() != inRHS.getSegmentLength())
1463 if (getSourceOffset() != inRHS.getSourceOffset())
1465 if (getSourcePitch() != inRHS.getSourcePitch())
1467 if (getDestOffset() != inRHS.getDestOffset())
1469 if (getDestPitch() != inRHS.getDestPitch())
1478 mElementsPerSegment = 0;
1479 mInitialSrcOffset = 0;
1480 mInitialDstOffset = 0;
1481 mSrcElementsPerRow = 0;
1482 mDstElementsPerRow = 0;
1489 std::swap(mSrcElementsPerRow, mDstElementsPerRow);
1490 std::swap(mInitialSrcOffset, mInitialDstOffset);
1497 fByteCount (
ULWord(pInUserPointer ? inByteCount : 0)),
1499 #if defined (AJAMac)
1500 fKernelSpacePtr (0),
1511 : fUserSpacePtr (0),
1514 #if defined (AJAMac)
1515 fKernelSpacePtr (0),
1529 : fUserSpacePtr (0),
1532 #if defined (AJAMac)
1533 fKernelSpacePtr (0),
1552 fByteCount =
ULWord(inNewByteCount);
1581 const size_t loopCount(
GetByteCount() /
sizeof(uint64_t));
1584 for (
size_t ndx(0); ndx < loopCount; ndx++)
1593 const size_t loopCount(
GetByteCount() /
sizeof(uint32_t));
1596 for (
size_t ndx(0); ndx < loopCount; ndx++)
1605 const size_t loopCount(
GetByteCount() /
sizeof(uint16_t));
1608 for (
size_t ndx(0); ndx < loopCount; ndx++)
1618 fByteCount =
ULWord(pInUserPointer ? inByteCount : 0);
1620 return (pInUserPointer && inByteCount) || (!pInUserPointer && !inByteCount);
1626 return Set(pInUserPointer, inByteCount) &&
Fill(inValue);
1648 {pBuffer =
new UByte[inByteCount];}
1649 catch (
const std::bad_alloc &)
1651 if (pBuffer &&
Set(pBuffer, inByteCount))
1696 pBytes += inByteOffset;
1732 const ULWord inSrcByteOffset,
const ULWord inDstByteOffset,
const ULWord inByteCount)
1736 if (inSrcByteOffset + inByteCount > inBuffer.
GetByteCount())
1741 const UByte * pSrc (inBuffer);
1742 pSrc += inSrcByteOffset;
1744 UByte * pDst (*
this);
1745 pDst += inDstByteOffset;
1747 ::memcpy (pDst, pSrc, inByteCount);
1754 if (!inXferInfo.isValid() || inSrcBuffer.
IsNULL() ||
IsNULL())
1758 ULWord srcOffset (inXferInfo.getSourceOffset() * inXferInfo.getElementLength());
1759 ULWord dstOffset (inXferInfo.getDestOffset() * inXferInfo.getElementLength());
1760 const ULWord srcPitch (inXferInfo.getSourcePitch() * inXferInfo.getElementLength());
1761 const ULWord dstPitch (inXferInfo.getDestPitch() * inXferInfo.getElementLength());
1762 const ULWord bytesPerSeg (inXferInfo.getSegmentLength() * inXferInfo.getElementLength());
1763 for (
ULWord segNdx(0); segNdx < inXferInfo.getSegmentCount(); segNdx++)
1767 if (!pSrc)
return false;
1768 if (!pDst)
return false;
1769 if (srcOffset + bytesPerSeg > inSrcBuffer.
GetByteCount())
1773 ::memcpy (pDst, pSrc, bytesPerSeg);
1774 srcOffset += srcPitch;
1775 dstOffset += dstPitch;
1785 const string newline(
"\n"), tab(
"\t");
1791 for (
size_t ndx(0); ndx < str.size(); ndx++)
1801 for (
size_t srcNdx(0), dstNdx(0); srcNdx < str.size(); srcNdx += 2)
1815 if (fFlags != inBuffer.fFlags)
1821 fUserSpacePtr = inBuffer.fUserSpacePtr;
1822 inBuffer.fUserSpacePtr = tmp;
1838 const uint8_t * pSrchData (inValue);
1839 const uint8_t * pMyData (*
this);
1843 if (!::memcmp(pMyData, pSrchData, srchByteCount))
1844 outOffsets.insert(offset);
1847 }
while (offset < maxOffset);
1859 if (inByteOffset >= totalBytes)
1862 totalBytes -= inByteOffset;
1864 ULWord byteCount(inByteCount);
1865 if (byteCount > totalBytes)
1866 byteCount = totalBytes;
1871 const UByte * pByte1 (*
this);
1872 const UByte * pByte2 (inBuffer);
1873 pByte1 += inByteOffset;
1874 pByte2 += inByteOffset;
1875 #if !defined(NTV2BUFFER_NO_MEMCMP)
1876 return ::memcmp (pByte1, pByte2, byteCount) == 0;
1877 #else // NTV2BUFFER_NO_MEMCMP
1878 ULWord offset(inByteOffset);
1881 if (*pByte1 != *pByte2)
1883 cerr <<
"## ERROR: IsContentEqual: miscompare at offset " <<
xHEX0N(offset,8)
1884 <<
" (" <<
DEC(offset) <<
"): " <<
xHEX0N(
UWord(*pByte1),2) <<
" != "
1886 <<
DEC(byteCount) <<
") bytes left to compare" << endl;
1894 #endif // NTV2BUFFER_NO_MEMCMP
1899 if (byteOffset == 0xFFFFFFFF)
1906 {byteOffset = 0xFFFFFFFF;
return true;}
1909 if (byteOffset >= totalBytesToCompare)
1911 totalBytesToCompare -= byteOffset;
1913 const UByte * pByte1 (*
this);
1914 const UByte * pByte2 (inBuffer);
1915 while (totalBytesToCompare)
1917 if (pByte1[byteOffset] != pByte2[byteOffset])
1919 totalBytesToCompare--;
1922 byteOffset = 0xFFFFFFFF;
1928 outByteOffsetFirst = outByteOffsetLast =
GetByteCount ();
1941 outByteOffsetFirst = 0;
1944 if (*pByte1 != *pByte2)
1948 outByteOffsetFirst++;
1950 if (outByteOffsetFirst == 0)
1955 if (*pByte1 == *pByte2)
1959 outByteOffsetFirst++;
1962 outByteOffsetFirst--;
1972 while (--outByteOffsetLast)
1974 if (*pByte1 != *pByte2)
1982 while (outByteOffsetLast)
1984 if (*pByte1 == *pByte2)
1988 outByteOffsetLast--;
1991 outByteOffsetLast++;
1992 if (outByteOffsetLast <= outByteOffsetFirst)
1993 cerr <<
"## WARNING: GetRingChangedByteRange: last " << outByteOffsetLast <<
" <= first " << outByteOffsetFirst <<
" in wrap condition" << endl;
1994 const ULWord tmp (outByteOffsetLast);
1995 outByteOffsetLast = outByteOffsetFirst;
1996 outByteOffsetFirst = tmp;
1997 if (outByteOffsetLast >= outByteOffsetFirst)
1998 cerr <<
"## WARNING: GetRingChangedByteRange: last " << outByteOffsetLast <<
" >= first " << outByteOffsetFirst <<
" in wrap condition" << endl;
2014 const bool result (inNewSize && (!(inNewSize & (inNewSize - 1))));
2022 #if defined(MSWindows) || defined(AJABareMetal)
2023 return AJA_PAGE_SIZE;
2025 return size_t(::getpagesize());
2033 acRequestedFrame (0),
2034 acAudioClockTimeStamp (0),
2035 acAudioExpectedAddress (0),
2036 acAudioInStartAddress (0),
2037 acAudioInStopAddress (0),
2038 acAudioOutStopAddress (0),
2039 acAudioOutStartAddress (0),
2040 acTotalBytesTransferred (0),
2045 acCurrentFrameTime (0),
2046 acAudioClockCurrentTime (0),
2047 acCurrentAudioExpectedAddress (0),
2048 acCurrentAudioStartAddress (0),
2049 acCurrentFieldCount (0),
2050 acCurrentLineCount (0),
2052 acCurrentUserCookie (0),
2061 : acHeader (inObj.acHeader),
2062 acFrameTime (inObj.acFrameTime),
2063 acRequestedFrame (inObj.acRequestedFrame),
2064 acAudioClockTimeStamp (inObj.acAudioClockTimeStamp),
2065 acAudioExpectedAddress (inObj.acAudioExpectedAddress),
2066 acAudioInStartAddress (inObj.acAudioInStartAddress),
2067 acAudioInStopAddress (inObj.acAudioInStopAddress),
2068 acAudioOutStopAddress (inObj.acAudioOutStopAddress),
2069 acAudioOutStartAddress (inObj.acAudioOutStartAddress),
2070 acTotalBytesTransferred (inObj.acTotalBytesTransferred),
2071 acStartSample (inObj.acStartSample),
2072 acCurrentTime (inObj.acCurrentTime),
2073 acCurrentFrame (inObj.acCurrentFrame),
2074 acCurrentFrameTime (inObj.acCurrentFrameTime),
2075 acAudioClockCurrentTime (inObj.acAudioClockCurrentTime),
2076 acCurrentAudioExpectedAddress (inObj.acCurrentAudioExpectedAddress),
2077 acCurrentAudioStartAddress (inObj.acCurrentAudioStartAddress),
2078 acCurrentFieldCount (inObj.acCurrentFieldCount),
2079 acCurrentLineCount (inObj.acCurrentLineCount),
2080 acCurrentReps (inObj.acCurrentReps),
2081 acCurrentUserCookie (inObj.acCurrentUserCookie),
2082 acFrame (inObj.acFrame),
2083 acRP188 (inObj.acRP188),
2084 acTrailer (inObj.acTrailer)
2107 for (
ULWord ndx (0); ndx < numRP188s; ndx++)
2108 outValues << pArray [ndx];
2127 outTimeCode = pArray [inTCIndex];
2135 outTimeCodes.clear();
2151 outTimeCodes[tcIndex] = tc;
2153 outTimeCodes[tcIndex] = tc;
2163 (
void)inSDIInputIndex0;
2171 if (!pArray || !numRP188s)
2176 if (
ULWord(inTCNdx) >= numRP188s)
2179 pArray[inTCNdx] = inTimecode;
2327 if (mInStatistics.
IsNULL())
2342 if (numElements != 8)
2344 if (inSDIInputIndex0 >= numElements)
2346 outStatus = pArray[inSDIInputIndex0];
2358 if (numElements != 8)
2360 if (inSDIInputIndex0 >= numElements)
2362 return pArray[inSDIInputIndex0];
2368 inOutStream << mHeader <<
", " << mInStatistics <<
", " << mTrailer;
return inOutStream;
2375 acTransferFrame (0),
2377 acFramesProcessed (0),
2378 acFramesDropped (0),
2380 acAudioTransferSize (0),
2381 acAudioStartSample (0),
2382 acAncTransferSize (0),
2383 acAncField2TransferSize (0)
2392 acCrosspoint (inCrosspoint),
2397 acRDTSCStartTime (0),
2398 acAudioClockStartTime (0),
2399 acRDTSCCurrentTime (0),
2400 acAudioClockCurrentTime (0),
2401 acFramesProcessed (0),
2402 acFramesDropped (0),
2509 if (inIndexNum == 0)
2526 case 13: oss << (
WithRP188() ?
"Yes" :
"No");
break;
2527 case 14: oss << (
WithLTC() ?
"Yes" :
"No");
break;
2531 case 18: oss << (
WithVidProc() ?
"Yes" :
"No");
break;
2534 case 21: oss << (
IsFieldMode() ?
"Yes" :
"No");
break;
2537 else if (inIndexNum < 22)
2547 << (inObj.
IsInput() ?
"Input " : (inObj.
IsOutput() ?
"Output" :
"*BAD* "))
2556 << setw(10) << (inObj.
WithRP188() ?
"+RP188" :
"-RP188")
2557 << setw(10) << (inObj.
WithLTC() ?
"+LTC" :
"-LTC")
2558 << setw(10) << (inObj.
WithFBFChange() ?
"+FBFchg" :
"-FBFchg")
2559 << setw(10) << (inObj.
WithFBOChange() ?
"+FBOchg" :
"-FBOchg")
2561 << setw(10) << (inObj.
WithVidProc() ?
"+VidProc" :
"-VidProc")
2562 << setw(10) << (inObj.
WithCustomAnc() ?
"+AncData" :
"-AncData")
2564 << setw(10) << (inObj.
IsFieldMode() ?
"+FldMode" :
"-FldMode");
2577 Set (inNumSegments, inNumActiveBytesPerRow, inHostBytesPerRow, inDeviceBytesPerRow);
2603 ccSaturationValue (0)
2640 acTransferStatus (),
2642 acInVideoDMAOffset (0),
2643 acInSegmentedDMAInfo (),
2644 acColorCorrection (),
2649 acPeerToPeerFlags (0),
2650 acFrameRepeatCount (1),
2651 acDesiredFrame (-1),
2663 ULWord * pInANCF2Buffer,
const ULWord inANCF2ByteCount)
2665 acVideoBuffer (pInVideoBuffer, inVideoByteCount),
2666 acAudioBuffer (pInAudioBuffer, inAudioByteCount),
2667 acANCBuffer (pInANCBuffer, inANCByteCount),
2668 acANCField2Buffer (pInANCF2Buffer, inANCF2ByteCount),
2670 acTransferStatus (),
2672 acInVideoDMAOffset (0),
2673 acInSegmentedDMAInfo (),
2674 acColorCorrection (),
2679 acPeerToPeerFlags (0),
2680 acFrameRepeatCount (1),
2681 acDesiredFrame (-1),
2697 ULWord * pInAudioBuffer,
const ULWord inAudioByteCount,
2699 ULWord * pInANCF2Buffer,
const ULWord inANCF2ByteCount)
2704 &&
SetAncBuffers (pInANCBuffer, inANCByteCount, pInANCF2Buffer, inANCF2ByteCount);
2745 for (
UWord ndx (0); ndx <
UWord(maxNumValues); ndx++)
2767 pArray[inTCIndex] = inTimeCode;
2781 for (
ULWord tcIndex(0); tcIndex < maxNumValues; tcIndex++)
2785 pArray[tcIndex] = inTimeCode;
2808 const ULWord inHostBytesPerRow,
const ULWord inDeviceBytesPerRow)
2983 mInNumRegisters (
ULWord (inRegisterNumbers.size ())),
2984 mOutNumRegisters (0)
2993 mInNumRegisters (
ULWord (inRegReads.size ())),
2994 mOutNumRegisters (0)
3004 mInNumRegisters =
ULWord(inRegisterNumbers.size());
3005 mOutNumRegisters = 0;
3006 bool result ( mInRegisters.
Allocate(mInNumRegisters *
sizeof(
ULWord))
3013 ULWord * pRegArray(mInRegisters);
3019 pRegArray[ndx++] = *iter;
3026 if (!mInNumRegisters)
3033 const ULWord * pRegNums(mInRegisters);
3034 for (
ULWord ndx(0); ndx < mInNumRegisters; ndx++)
3035 if (outRegNums.find(pRegNums[ndx]) == outRegNums.end())
3036 outRegNums.insert(pRegNums[ndx]);
3044 outGoodRegNums.clear();
3045 if (!mOutGoodRegisters)
3047 if (!mOutNumRegisters)
3049 if (mOutNumRegisters > mInNumRegisters)
3052 const ULWord * pRegArray (mOutGoodRegisters);
3053 for (
ULWord ndx(0); ndx < mOutNumRegisters; ndx++)
3054 outGoodRegNums.insert(pRegArray[ndx]);
3061 outBadRegNums.clear();
3067 if (reqRegNums == goodRegNums)
3071 std::set_difference (reqRegNums.begin(), reqRegNums.end(),
3072 goodRegNums.begin(), goodRegNums.end(),
3073 std::inserter(outBadRegNums, outBadRegNums.begin()));
3079 if (!mOutGoodRegisters)
3081 if (!mOutNumRegisters)
3083 if (mOutNumRegisters > mInNumRegisters)
3089 const ULWord * pRegArray (mOutGoodRegisters);
3090 ULWord * pValArray (mOutValues);
3091 for (
ULWord ndx(0); ndx < mOutNumRegisters; ndx++)
3092 if (pRegArray[ndx] == inRegNum)
3094 pValArray[ndx] = inValue;
3105 if (!mOutGoodRegisters)
3107 if (!mOutNumRegisters)
3109 if (mOutNumRegisters > mInNumRegisters)
3116 const ULWord * pRegArray (mOutGoodRegisters);
3117 const ULWord * pValArray (mOutValues);
3118 for (
ULWord ndx(0); ndx < mOutNumRegisters; ndx++)
3119 outValues [pRegArray[ndx]] = pValArray[ndx];
3130 if (outValues.empty())
3133 outValues.push_back(
NTV2RegInfo(it->first, it->second));
3138 uint32_t missingTally(0);
3142 if (mapIter == regValMap.end())
3144 it->registerValue = mapIter->second;
3146 return !missingTally;
3153 inOutStream << mHeader <<
", numRegs=" << mInNumRegisters <<
", inRegs=" << mInRegisters <<
", outNumGoodRegs=" << mOutNumRegisters
3154 <<
", outGoodRegs=" << mOutGoodRegisters <<
", outValues=" << mOutValues <<
", " << mTrailer;
3161 mInNumRegisters (
ULWord(inRegWrites.size())),
3185 pBadRegIndexes[ndx] = 0;
3187 pRegInfoArray[ndx++] = *it;
3198 outFailedRegWrites.clear();
3204 outRegWrites.clear();
3213 outRegWrites.push_back(pRegInfos[ndx]);
3226 if (pBadRegIndexes && maxNumBadRegIndexes && pRegInfoArray && maxNumRegInfos &&
mOutNumFailures)
3229 for (
UWord num(0); num < maxNumBadRegIndexes; num++)
3231 const UWord badRegIndex (pBadRegIndexes[num]);
3232 if (badRegIndex < maxNumRegInfos)
3234 const NTV2RegInfo & badRegInfo (pRegInfoArray[badRegIndex]);
3235 oss <<
"Failure " << num <<
": " << badRegInfo << endl;
3245 typedef std::pair <ULWord, ULWord> ULWordPair;
3246 typedef std::pair <ULWordPair, ULWordPair> ULWordPairs;
3269 const bool badName (regName.find(
' ') != string::npos);
3272 oss <<
"theDevice.WriteRegister (";
3309 for (NTV2ULWordVector::const_iterator it(inObj.begin()); it != inObj.end(); ++it)
3310 inOutStream <<
" " <<
HEX0N(*it,8);
3317 inOutStream << (inCompact ?
"Ch[" :
"[");
3321 inOutStream <<
DEC(*it+1);
3324 if (++it != inObj.end())
3325 inOutStream << (inCompact ?
"|" :
",");
3327 return inOutStream <<
"]";
3331 { ostringstream oss;
3338 inOutStream << (inCompact ?
"Ch{" :
"{");
3342 inOutStream <<
DEC(*it+1);
3345 if (++it != inObj.end())
3346 inOutStream << (inCompact ?
"|" :
",");
3348 return inOutStream <<
"}";
3352 { ostringstream oss;
3379 result.push_back(ch);
3387 result.push_back(*it);
3393 inOutStream << (inCompact ?
"AudSys{" :
"{");
3397 inOutStream <<
DEC(*it+1);
3400 if (++it != inObj.end())
3401 inOutStream << (inCompact ?
"|" :
",");
3403 return inOutStream <<
"}";
3407 { ostringstream oss;
3417 result.insert(audSys);
3425 if (result.find(it->registerNumber) == result.end())
3426 result.insert(it->registerNumber);
3433 if (iter->registerNumber == inRegNum)
3435 return inRegInfos.end();
3441 return inObj.
Print(inOutStream);
3447 inOutStream << inObj.size () <<
" regs:" << endl;
3449 inOutStream << *iter << endl;
3456 mIsWriting (inDoWrite),
3462 *pRegInfo = inBankSelect;
3465 *pRegInfo = inOutRegInfo;
3478 if (
ULWord(inIndex0) < maxNum)
3479 result = pRegInfos[inIndex0];
3491 if (
mInBankInfos) oss << *pBankRegInfo;
else oss <<
"-";
3492 oss <<
" regInfos=";
3493 if (
mInRegInfos) oss << *pRegInfo;
else oss <<
"-";
3501 mIsWriting (inDoWrite),
3502 mVirtualData (inVirtualData, inVirtualDataSize)
3520 #define AsU8Ref(_x_) reinterpret_cast<uint8_t&>(_x_)
3521 #define AsU16Ref(_x_) reinterpret_cast<uint16_t&>(_x_)
3522 #define AsU32Ref(_x_) reinterpret_cast<uint32_t&>(_x_)
3523 #define AsU64Ref(_x_) reinterpret_cast<uint64_t&>(_x_)
3529 PUSHU32(fHeaderVersion, outBlob);
3531 PUSHU32(fSizeInBytes, outBlob);
3532 PUSHU32(fPointerSize, outBlob);
3534 PUSHU32(fResultStatus, outBlob);
3540 POPU32(fHeaderTag, inBlob, inOutIndex);
3541 POPU32(fType, inBlob, inOutIndex);
3542 POPU32(fHeaderVersion, inBlob, inOutIndex);
3543 POPU32(fVersion, inBlob, inOutIndex);
3544 POPU32(fSizeInBytes, inBlob, inOutIndex);
3545 POPU32(fPointerSize, inBlob, inOutIndex);
3546 POPU32(fOperation, inBlob, inOutIndex);
3547 POPU32(fResultStatus, inBlob, inOutIndex);
3553 PUSHU32(fTrailerVersion, outBlob);
3554 PUSHU32(fTrailerTag, outBlob);
3560 POPU32(fTrailerVersion, inBlob, inOutIndex);
3561 POPU32(fTrailerTag, inBlob, inOutIndex);
3577 ULWord byteCount(0), flags(0);
3578 POPU32(byteCount, inBlob, inOutIndex);
3579 POPU32(flags, inBlob, inOutIndex);
3582 if ((inOutIndex + byteCount) > inBlob.size())
3584 for (
ULWord cnt(0); cnt < byteCount; cnt++)
3585 U8(
int(cnt)) = inBlob.at(inOutIndex++);
3591 const size_t totBytes (mHeader.GetSizeInBytes()
3592 + mInRegisters.GetByteCount() + mOutGoodRegisters.GetByteCount() + mOutValues.GetByteCount());
3593 if (outBlob.capacity() < totBytes)
3594 outBlob.reserve(totBytes);
3597 mInRegisters.ByteSwap32();
3598 mOutGoodRegisters.ByteSwap32();
3599 mOutValues.ByteSwap32();
3601 bool ok = mHeader.RPCEncode(outBlob);
3602 PUSHU32(mInNumRegisters, outBlob);
3603 ok &= mInRegisters.RPCEncode(outBlob);
3604 PUSHU32(mOutNumRegisters, outBlob);
3605 ok &= mOutGoodRegisters.RPCEncode(outBlob)
3606 && mOutValues.RPCEncode(outBlob)
3607 && mTrailer.RPCEncode(outBlob);
3610 mInRegisters.ByteSwap32();
3611 mOutGoodRegisters.ByteSwap32();
3612 mOutValues.ByteSwap32();
3619 bool ok = mHeader.RPCDecode(inBlob, inOutIndex);
3620 if (!ok)
return false;
3621 POPU32(mInNumRegisters, inBlob, inOutIndex);
3622 ok &= mInRegisters.RPCDecode(inBlob, inOutIndex);
3623 POPU32(mOutNumRegisters, inBlob, inOutIndex);
3624 ok &= mOutGoodRegisters.RPCDecode(inBlob, inOutIndex);
3625 ok &= mOutValues.RPCDecode(inBlob, inOutIndex);
3626 ok &= mTrailer.RPCDecode(inBlob, inOutIndex);
3629 mInRegisters.ByteSwap32();
3630 mOutGoodRegisters.ByteSwap32();
3631 mOutValues.ByteSwap32();
3638 const size_t totBytes (mHeader.GetSizeInBytes()
3639 + mInRegInfos.GetByteCount() + mOutBadRegIndexes.GetByteCount());
3640 if (outBlob.capacity() < totBytes)
3641 outBlob.reserve(totBytes);
3644 mInRegInfos.ByteSwap32();
3645 mOutBadRegIndexes.ByteSwap32();
3647 bool ok = mHeader.RPCEncode(outBlob);
3648 PUSHU32(mInNumRegisters, outBlob);
3649 ok &= mInRegInfos.RPCEncode(outBlob);
3650 PUSHU32(mOutNumFailures, outBlob);
3651 ok &= mOutBadRegIndexes.RPCEncode(outBlob)
3652 && mTrailer.RPCEncode(outBlob);
3655 mInRegInfos.ByteSwap32();
3656 mOutBadRegIndexes.ByteSwap16();
3663 bool ok = mHeader.RPCDecode(inBlob, inOutIndex);
3664 POPU32(mInNumRegisters, inBlob, inOutIndex);
3665 ok &= mInRegInfos.RPCDecode(inBlob, inOutIndex);
3666 POPU32(mOutNumFailures, inBlob, inOutIndex);
3667 ok &= mOutBadRegIndexes.RPCDecode(inBlob, inOutIndex);
3668 ok &= mTrailer.RPCDecode(inBlob, inOutIndex);
3671 mInRegInfos.ByteSwap32();
3672 mOutBadRegIndexes.ByteSwap16();
3679 const size_t totBytes (mHeader.GetSizeInBytes()
3680 + mInBankInfos.GetByteCount() + mInRegInfos.GetByteCount());
3681 if (outBlob.capacity() < totBytes)
3682 outBlob.reserve(totBytes);
3685 mInBankInfos.ByteSwap32();
3686 mInRegInfos.ByteSwap32();
3688 bool ok = mHeader.RPCEncode(outBlob);
3690 ok &= mInBankInfos.RPCEncode(outBlob);
3691 ok &= mInRegInfos.RPCEncode(outBlob)
3692 && mTrailer.RPCEncode(outBlob);
3695 mInBankInfos.ByteSwap32();
3696 mInRegInfos.ByteSwap32();
3703 bool ok = mHeader.RPCDecode(inBlob, inOutIndex);
3704 POPU32(mIsWriting, inBlob, inOutIndex);
3705 ok &= mInBankInfos.RPCDecode(inBlob, inOutIndex);
3706 ok &= mInRegInfos.RPCDecode(inBlob, inOutIndex);
3707 ok &= mTrailer.RPCDecode(inBlob, inOutIndex);
3710 mInBankInfos.ByteSwap32();
3711 mInRegInfos.ByteSwap32();
3718 const size_t totBytes (acHeader.GetSizeInBytes());
3719 if (outBlob.capacity() < totBytes)
3720 outBlob.reserve(totBytes);
3721 bool ok = acHeader.RPCEncode(outBlob);
3727 PUSHU64(acRDTSCStartTime, outBlob);
3728 PUSHU64(acAudioClockStartTime, outBlob);
3729 PUSHU64(acRDTSCCurrentTime, outBlob);
3730 PUSHU64(acAudioClockCurrentTime, outBlob);
3731 PUSHU32(acFramesProcessed, outBlob);
3732 PUSHU32(acFramesDropped, outBlob);
3733 PUSHU32(acBufferLevel, outBlob);
3734 PUSHU32(acOptionFlags, outBlob);
3736 ok &= acTrailer.RPCEncode(outBlob);
3741 { uint16_t v16(0); uint32_t v32(0);
3742 bool ok = acHeader.RPCDecode(inBlob, inOutIndex);
3743 POPU16(v16, inBlob, inOutIndex);
3745 POPU16(v16, inBlob, inOutIndex);
3747 POPU32(v32, inBlob, inOutIndex);
3748 acStartFrame =
LWord(v32);
3749 POPU32(v32, inBlob, inOutIndex);
3750 acEndFrame =
LWord(v32);
3751 POPU32(v32, inBlob, inOutIndex);
3752 acActiveFrame =
LWord(v32);
3753 POPU64(acRDTSCStartTime, inBlob, inOutIndex);
3754 POPU64(acAudioClockStartTime, inBlob, inOutIndex);
3755 POPU64(acRDTSCCurrentTime, inBlob, inOutIndex);
3756 POPU64(acAudioClockCurrentTime, inBlob, inOutIndex);
3757 POPU32(acFramesProcessed, inBlob, inOutIndex);
3758 POPU32(acFramesDropped, inBlob, inOutIndex);
3759 POPU32(acBufferLevel, inBlob, inOutIndex);
3760 POPU32(acOptionFlags, inBlob, inOutIndex);
3761 POPU16(v16, inBlob, inOutIndex);
3763 ok &= acTrailer.RPCDecode(inBlob, inOutIndex);
3769 const size_t totBytes (acHeader.GetSizeInBytes());
3770 if (outBlob.capacity() < totBytes)
3771 outBlob.reserve(totBytes);
3772 bool ok = acHeader.RPCEncode(outBlob);
3774 PUSHU32(acRequestedFrame, outBlob);
3775 PUSHU64(acAudioClockTimeStamp, outBlob);
3776 PUSHU32(acAudioExpectedAddress, outBlob);
3777 PUSHU32(acAudioInStartAddress, outBlob);
3778 PUSHU32(acAudioInStopAddress, outBlob);
3779 PUSHU32(acAudioOutStopAddress, outBlob);
3780 PUSHU32(acAudioOutStartAddress, outBlob);
3781 PUSHU32(acTotalBytesTransferred, outBlob);
3782 PUSHU32(acStartSample, outBlob);
3784 ok &= acTimeCodes.RPCEncode(outBlob);
3786 PUSHU32(acCurrentFrame, outBlob);
3788 PUSHU64(acAudioClockCurrentTime, outBlob);
3789 PUSHU32(acCurrentAudioExpectedAddress, outBlob);
3790 PUSHU32(acCurrentAudioStartAddress, outBlob);
3791 PUSHU32(acCurrentFieldCount, outBlob);
3792 PUSHU32(acCurrentLineCount, outBlob);
3793 PUSHU32(acCurrentReps, outBlob);
3794 PUSHU64(acCurrentUserCookie, outBlob);
3796 PUSHU32(acRP188.fDBB, outBlob);
3797 PUSHU32(acRP188.fLo, outBlob);
3798 PUSHU32(acRP188.fHi, outBlob);
3799 ok &= acTrailer.RPCEncode(outBlob);
3805 bool ok = acHeader.RPCDecode(inBlob, inOutIndex);
3806 POPU64(v64, inBlob, inOutIndex);
3808 POPU32(acRequestedFrame, inBlob, inOutIndex);
3809 POPU64(acAudioClockTimeStamp, inBlob, inOutIndex);
3810 POPU32(acAudioExpectedAddress, inBlob, inOutIndex);
3811 POPU32(acAudioInStartAddress, inBlob, inOutIndex);
3812 POPU32(acAudioInStopAddress, inBlob, inOutIndex);
3813 POPU32(acAudioOutStopAddress, inBlob, inOutIndex);
3814 POPU32(acAudioOutStartAddress, inBlob, inOutIndex);
3815 POPU32(acTotalBytesTransferred, inBlob, inOutIndex);
3816 POPU32(acStartSample, inBlob, inOutIndex);
3818 ok &= acTimeCodes.RPCDecode(inBlob, inOutIndex);
3819 POPU64(v64, inBlob, inOutIndex);
3821 POPU32(acCurrentFrame, inBlob, inOutIndex);
3822 POPU64(v64, inBlob, inOutIndex);
3823 acCurrentFrameTime =
LWord64(v64);
3824 POPU64(acAudioClockCurrentTime, inBlob, inOutIndex);
3825 POPU32(acCurrentAudioExpectedAddress, inBlob, inOutIndex);
3826 POPU32(acCurrentAudioStartAddress, inBlob, inOutIndex);
3827 POPU32(acCurrentFieldCount, inBlob, inOutIndex);
3828 POPU32(acCurrentLineCount, inBlob, inOutIndex);
3829 POPU32(acCurrentReps, inBlob, inOutIndex);
3830 POPU64(acCurrentUserCookie, inBlob, inOutIndex);
3831 POPU32(acFrame, inBlob, inOutIndex);
3832 POPU32(acRP188.fDBB, inBlob, inOutIndex);
3833 POPU32(acRP188.fLo, inBlob, inOutIndex);
3834 POPU32(acRP188.fHi, inBlob, inOutIndex);
3835 ok &= acTrailer.RPCDecode(inBlob, inOutIndex);
3841 const size_t totBytes (acHeader.GetSizeInBytes());
3842 if (outBlob.capacity() < totBytes)
3843 outBlob.reserve(totBytes);
3844 bool ok = acHeader.RPCEncode(outBlob);
3847 PUSHU32(acBufferLevel, outBlob);
3848 PUSHU32(acFramesProcessed, outBlob);
3849 PUSHU32(acFramesDropped, outBlob);
3850 ok &= acFrameStamp.RPCEncode(outBlob);
3851 PUSHU32(acAudioTransferSize, outBlob);
3852 PUSHU32(acAudioStartSample, outBlob);
3853 PUSHU32(acAncTransferSize, outBlob);
3854 PUSHU32(acAncField2TransferSize, outBlob);
3855 ok &= acTrailer.RPCEncode(outBlob);
3860 { uint16_t v16(0); uint32_t v32(0);
3861 bool ok = acHeader.RPCDecode(inBlob, inOutIndex);
3862 POPU16(v16, inBlob, inOutIndex);
3864 POPU32(v32, inBlob, inOutIndex);
3865 acTransferFrame =
LWord(v32);
3866 POPU32(acBufferLevel, inBlob, inOutIndex);
3867 POPU32(acFramesProcessed, inBlob, inOutIndex);
3868 POPU32(acFramesDropped, inBlob, inOutIndex);
3869 ok &= acFrameStamp.RPCDecode(inBlob, inOutIndex);
3870 POPU32(acAudioTransferSize, inBlob, inOutIndex);
3871 POPU32(acAudioStartSample, inBlob, inOutIndex);
3872 POPU32(acAncTransferSize, inBlob, inOutIndex);
3873 POPU32(acAncField2TransferSize, inBlob, inOutIndex);
3874 ok &= acTrailer.RPCDecode(inBlob, inOutIndex);
3880 PUSHU32(acNumSegments, outBlob);
3881 PUSHU32(acNumActiveBytesPerRow, outBlob);
3882 PUSHU32(acSegmentHostPitch, outBlob);
3883 PUSHU32(acSegmentDevicePitch, outBlob);
3889 POPU32(acNumSegments, inBlob, inOutIndex);
3890 POPU32(acNumActiveBytesPerRow, inBlob, inOutIndex);
3891 POPU32(acSegmentHostPitch, inBlob, inOutIndex);
3892 POPU32(acSegmentDevicePitch, inBlob, inOutIndex);
3899 PUSHU32(ccSaturationValue, outBlob);
3900 return ccLookupTables.RPCEncode(outBlob);
3905 POPU16(u16, inBlob, inOutIndex);
3907 POPU32(ccSaturationValue, inBlob, inOutIndex);
3908 return ccLookupTables.RPCDecode(inBlob, inOutIndex);
3914 PUSHU16(foregroundVideoCrosspoint, outBlob);
3915 PUSHU16(backgroundVideoCrosspoint, outBlob);
3916 PUSHU16(foregroundKeyCrosspoint, outBlob);
3917 PUSHU16(backgroundKeyCrosspoint, outBlob);
3924 { uint16_t v16(0); uint32_t v32(0);
3925 POPU16(v16, inBlob, inOutIndex);
3927 POPU16(v16, inBlob, inOutIndex);
3929 POPU16(v16, inBlob, inOutIndex);
3931 POPU16(v16, inBlob, inOutIndex);
3933 POPU16(v16, inBlob, inOutIndex);
3935 POPU32(v32, inBlob, inOutIndex);
3936 transitionCoefficient =
Fixed_(v32);
3937 POPU32(v32, inBlob, inOutIndex);
3938 transitionSoftness =
Fixed_(v32);
3952 POPU32(fDBB, inBlob, inOutIndex);
3953 POPU32(fLo, inBlob, inOutIndex);
3954 POPU32(fHi, inBlob, inOutIndex);
3961 const size_t totBytes (acHeader.GetSizeInBytes() + acVideoBuffer.GetByteCount() + acAudioBuffer.GetByteCount()
3962 + acANCBuffer.GetByteCount() + acANCField2Buffer.GetByteCount() + acOutputTimeCodes.GetByteCount()
3963 + acHDMIAuxData.GetByteCount() + 64);
3964 if (outBlob.capacity() < totBytes)
3965 outBlob.reserve(totBytes);
3966 bool ok = acHeader.RPCEncode(outBlob);
3967 ok &= acVideoBuffer.RPCEncode(outBlob);
3968 ok &= acAudioBuffer.RPCEncode(outBlob);
3969 ok &= acANCBuffer.RPCEncode(outBlob);
3970 ok &= acANCField2Buffer.RPCEncode(outBlob);
3971 ok &= acOutputTimeCodes.RPCEncode(outBlob);
3972 ok &= acTransferStatus.RPCEncode(outBlob);
3973 PUSHU64(acInUserCookie, outBlob);
3974 PUSHU32(acInVideoDMAOffset, outBlob);
3975 ok &= acInSegmentedDMAInfo.RPCEncode(outBlob);
3976 ok &= acColorCorrection.RPCEncode(outBlob);
3977 PUSHU16(acFrameBufferFormat, outBlob);
3978 PUSHU16(acFrameBufferOrientation, outBlob);
3979 ok &= acVidProcInfo.RPCEncode(outBlob);
3980 PUSHU16(acVideoQuarterSizeExpand, outBlob);
3981 ok &= acHDMIAuxData.RPCEncode(outBlob);
3982 PUSHU32(acPeerToPeerFlags, outBlob);
3983 PUSHU32(acFrameRepeatCount, outBlob);
3985 ok &= acRP188.RPCEncode(outBlob);
3986 PUSHU16(acCrosspoint, outBlob);
3987 ok &= acTrailer.RPCEncode(outBlob);
3993 { uint16_t v16(0); uint32_t v32(0);
3995 bool ok = acHeader.RPCDecode(inBlob, inOutIndex);
3996 ok &= acVideoBuffer.RPCDecode(inBlob, inOutIndex);
3997 ok &= acAudioBuffer.RPCDecode(inBlob, inOutIndex);
3998 ok &= acANCBuffer.RPCDecode(inBlob, inOutIndex);
3999 ok &= acANCField2Buffer.RPCDecode(inBlob, inOutIndex);
4000 ok &= acOutputTimeCodes.RPCDecode(inBlob, inOutIndex);
4001 ok &= acTransferStatus.RPCDecode(inBlob, inOutIndex);
4002 POPU64(acInUserCookie, inBlob, inOutIndex);
4003 POPU32(acInVideoDMAOffset, inBlob, inOutIndex);
4004 ok &= acInSegmentedDMAInfo.RPCDecode(inBlob, inOutIndex);
4005 ok &= acColorCorrection.RPCDecode(inBlob, inOutIndex);
4006 POPU16(v16, inBlob, inOutIndex);
4008 POPU16(v16, inBlob, inOutIndex);
4010 ok &= acVidProcInfo.RPCDecode(inBlob, inOutIndex);
4011 POPU16(v16, inBlob, inOutIndex);
4013 ok &= acHDMIAuxData.RPCDecode(inBlob, inOutIndex);
4014 POPU32(acPeerToPeerFlags, inBlob, inOutIndex);
4015 POPU32(acFrameRepeatCount, inBlob, inOutIndex);
4016 POPU32(v32, inBlob, inOutIndex);
4017 acDesiredFrame =
LWord(v32);
4018 ok &= acRP188.RPCDecode(inBlob, inOutIndex);
4019 POPU16(v16, inBlob, inOutIndex);
4021 ok &= acTrailer.RPCDecode(inBlob, inOutIndex);
4031 PUSHU32(videoBufferSize, outBlob);
4032 if (videoBuffer && videoBufferSize)
4033 { buff.
Set(videoBuffer, videoBufferSize);
4036 PUSHU32(videoDmaOffset, outBlob);
4038 PUSHU32(audioBufferSize, outBlob);
4039 if (audioBuffer && audioBufferSize)
4040 { buff.
Set(audioBuffer, audioBufferSize);
4043 PUSHU32(audioStartSample, outBlob);
4044 PUSHU32(audioNumChannels, outBlob);
4045 PUSHU32(frameRepeatCount, outBlob);
4046 rp188.RPCEncode(outBlob);
4049 PUSHU32(transferFlags, outBlob);
4050 PUSHU8(bDisableExtraAudioInfo, outBlob);
4054 vidProcInfo.RPCEncode(outBlob);
4055 PUSHU32(customAncInfo.Group1, outBlob);
4056 PUSHU32(customAncInfo.Group2, outBlob);
4057 PUSHU32(customAncInfo.Group3, outBlob);
4058 PUSHU32(customAncInfo.Group4, outBlob);
4059 PUSHU32(videoNumSegments, outBlob);
4060 PUSHU32(videoSegmentHostPitch, outBlob);
4061 PUSHU32(videoSegmentCardPitch, outBlob);
4068 POPU16(v16, inBlob, inOutIndex);
4072 POPU32(videoBufferSize, inBlob, inOutIndex);
4073 if (videoBufferSize && !videoBuffer)
4078 if ((inOutIndex + videoBufferSize) >= inBlob.size())
4080 UByte* pBuffer =
reinterpret_cast<UByte*
>(videoBuffer);
4081 for (
ULWord cnt(0); cnt < videoBufferSize; cnt++)
4082 pBuffer[cnt] = inBlob.at(inOutIndex++);
4084 POPU32(videoDmaOffset, inBlob, inOutIndex);
4087 POPU32(audioBufferSize, inBlob, inOutIndex);
4088 if (audioBufferSize && !audioBuffer)
4093 if ((inOutIndex + audioBufferSize) >= inBlob.size())
4095 UByte* pBuffer =
reinterpret_cast<UByte*
>(audioBuffer);
4096 for (
ULWord cnt(0); cnt < audioBufferSize; cnt++)
4097 pBuffer[cnt] = inBlob.at(inOutIndex++);
4099 POPU32(audioStartSample, inBlob, inOutIndex);
4100 POPU32(audioNumChannels, inBlob, inOutIndex);
4101 POPU32(frameRepeatCount, inBlob, inOutIndex);
4102 rp188.RPCDecode(inBlob, inOutIndex);
4103 POPU32(v32, inBlob, inOutIndex);
4104 desiredFrame =
LWord(v32);
4105 POPU32(hUser, inBlob, inOutIndex);
4106 POPU32(transferFlags, inBlob, inOutIndex);
4107 POPU8(
AsU8Ref(bDisableExtraAudioInfo), inBlob, inOutIndex);
4108 POPU16(v16, inBlob, inOutIndex);
4110 POPU16(v16, inBlob, inOutIndex);
4113 vidProcInfo.RPCDecode(inBlob, inOutIndex);
4114 POPU32(customAncInfo.Group1, inBlob, inOutIndex);
4115 POPU32(customAncInfo.Group2, inBlob, inOutIndex);
4116 POPU32(customAncInfo.Group3, inBlob, inOutIndex);
4117 POPU32(customAncInfo.Group4, inBlob, inOutIndex);
4118 POPU32(videoNumSegments, inBlob, inOutIndex);
4119 POPU32(videoSegmentHostPitch, inBlob, inOutIndex);
4120 POPU32(videoSegmentCardPitch, inBlob, inOutIndex);
4121 POPU16(v16, inBlob, inOutIndex);
4128 const size_t totBytes (mHeader.GetSizeInBytes());
4129 if (outBlob.capacity() < totBytes)
4130 outBlob.reserve(totBytes);
4131 bool ok = mHeader.RPCEncode(outBlob);
4132 ok &= mBuffer.RPCEncode(outBlob);
4135 for (
size_t ndx(0); ndx < 16; ndx++)
4136 PUSHU32(mRegisters[ndx], outBlob);
4137 for (
size_t ndx(0); ndx < 32; ndx++)
4138 PUSHU32(mReserved[ndx], outBlob);
4139 ok &= mTrailer.RPCEncode(outBlob);
4145 bool ok = mHeader.RPCDecode(inBlob, inOutIndex);
4146 ok &= mBuffer.RPCDecode(inBlob, inOutIndex);
4147 POPU32(mFlags, inBlob, inOutIndex);
4148 POPU32(mStatus, inBlob, inOutIndex);
4149 for (
size_t ndx(0); ndx < 16; ndx++)
4150 POPU32(mRegisters[ndx], inBlob, inOutIndex);
4151 for (
size_t ndx(0); ndx < 16; ndx++)
4152 POPU32(mReserved[ndx], inBlob, inOutIndex);
4153 ok &= mTrailer.RPCDecode(inBlob, inOutIndex);
4164 PUSHU64(rdtscStartTime, outBlob);
4165 PUSHU64(audioClockStartTime, outBlob);
4166 PUSHU64(rdtscCurrentTime, outBlob);
4167 PUSHU64(audioClockCurrentTime, outBlob);
4168 PUSHU32(framesProcessed, outBlob);
4169 PUSHU32(framesDropped, outBlob);
4170 PUSHU32(bufferLevel, outBlob);
4171 PUSHU8(bWithAudio, outBlob);
4172 PUSHU8(bWithRP188, outBlob);
4173 PUSHU8(bFbfChange, outBlob);
4174 PUSHU8(bFboChange, outBlob);
4175 PUSHU8(bWithColorCorrection, outBlob);
4176 PUSHU8(bWithVidProc, outBlob);
4177 PUSHU8(bWithCustomAncData, outBlob);
4182 { uint16_t v16(0); uint32_t v32(0);
4183 POPU16(v16, inBlob, inOutIndex);
4185 POPU16(v16, inBlob, inOutIndex);
4187 POPU32(v32, inBlob, inOutIndex);
4188 startFrame =
LWord(v32);
4189 POPU32(v32, inBlob, inOutIndex);
4190 endFrame =
LWord(v32);
4191 POPU32(v32, inBlob, inOutIndex);
4192 activeFrame =
LWord(v32);
4193 POPU64(rdtscStartTime, inBlob, inOutIndex);
4194 POPU64(audioClockStartTime, inBlob, inOutIndex);
4195 POPU64(rdtscCurrentTime, inBlob, inOutIndex);
4196 POPU64(audioClockCurrentTime, inBlob, inOutIndex);
4197 POPU32(framesProcessed, inBlob, inOutIndex);
4198 POPU32(framesDropped, inBlob, inOutIndex);
4199 POPU32(bufferLevel, inBlob, inOutIndex);
4204 POPU8(
AsU8Ref(bWithColorCorrection), inBlob, inOutIndex);
4206 POPU8(
AsU8Ref(bWithCustomAncData), inBlob, inOutIndex);
4220 POPU32(DBB, inBlob, inOutIndex);
4221 POPU32(Low, inBlob, inOutIndex);
4222 POPU32(High, inBlob, inOutIndex);
4229 PUSHU32(taskVersion, outBlob);
4234 if (taskArray && numTasks)
4235 for (
ULWord num(0); num < numTasks; num++)
4239 const ULWord * pULWords =
reinterpret_cast<const ULWord*
>(&task.
u);
4245 for (
ULWord word(0); word < numWords; word++)
4246 PUSHU32(pULWords[word], outBlob);
4253 POPU32(taskVersion, inBlob, inOutIndex);
4254 POPU32(taskSize, inBlob, inOutIndex);
4255 POPU32(numTasks, inBlob, inOutIndex);
4256 POPU32(maxTasks, inBlob, inOutIndex);
4257 POPU64(u64, inBlob, inOutIndex);
4259 if (taskArray && numTasks)
4260 for (
ULWord num(0); num < numTasks; num++)
4263 POPU32(u32, inBlob, inOutIndex);
4271 for (
ULWord word(0); word < numWords; word++)
4272 POPU32(pULWords[word], inBlob, inOutIndex);
4282 PUSHU64(audioClockTimeStamp, outBlob);
4283 PUSHU32(audioExpectedAddress, outBlob);
4284 PUSHU32(audioInStartAddress, outBlob);
4285 PUSHU32(audioInStopAddress, outBlob);
4286 PUSHU32(audioOutStopAddress, outBlob);
4287 PUSHU32(audioOutStartAddress, outBlob);
4289 PUSHU32(startSample, outBlob);
4291 PUSHU32(currentFrame, outBlob);
4292 currentRP188.RPCEncode(outBlob);
4294 PUSHU64(audioClockCurrentTime, outBlob);
4295 PUSHU32(currentAudioExpectedAddress, outBlob);
4296 PUSHU32(currentAudioStartAddress, outBlob);
4297 PUSHU32(currentFieldCount, outBlob);
4298 PUSHU32(currentLineCount, outBlob);
4299 PUSHU32(currentReps, outBlob);
4300 PUSHU32(currenthUser, outBlob);
4305 { uint16_t v16(0); uint64_t v64(0);
4306 POPU16(v16, inBlob, inOutIndex);
4308 POPU64(v64, inBlob, inOutIndex);
4310 POPU32(frame, inBlob, inOutIndex);
4311 POPU64(audioClockTimeStamp, inBlob, inOutIndex);
4312 POPU32(audioExpectedAddress, inBlob, inOutIndex);
4313 POPU32(audioInStartAddress, inBlob, inOutIndex);
4314 POPU32(audioInStopAddress, inBlob, inOutIndex);
4315 POPU32(audioOutStopAddress, inBlob, inOutIndex);
4316 POPU32(audioOutStartAddress, inBlob, inOutIndex);
4317 POPU32(bytesRead, inBlob, inOutIndex);
4318 POPU32(startSample, inBlob, inOutIndex);
4319 POPU64(v64, inBlob, inOutIndex);
4321 POPU32(currentFrame, inBlob, inOutIndex);
4322 currentRP188.RPCDecode(inBlob, inOutIndex);
4323 POPU64(v64, inBlob, inOutIndex);
4324 currentFrameTime =
LWord64(v64);
4325 POPU64(audioClockCurrentTime, inBlob, inOutIndex);
4326 POPU32(currentAudioExpectedAddress, inBlob, inOutIndex);
4327 POPU32(currentAudioStartAddress, inBlob, inOutIndex);
4328 POPU32(currentFieldCount, inBlob, inOutIndex);
4329 POPU32(currentLineCount, inBlob, inOutIndex);
4330 POPU32(currentReps, inBlob, inOutIndex);
4331 POPU32(currenthUser, inBlob, inOutIndex);
4370 #if defined(AJA_LINUX)
4371 #pragma GCC diagnostic push
4372 #pragma GCC diagnostic ignored "-Wstrict-aliasing"
4374 uint16_t v16(0); uint32_t v32(0);
4375 POPU16(v16, inBlob, inOutIndex);
4377 POPU16(v16, inBlob, inOutIndex);
4379 POPU32(v32, inBlob, inOutIndex); lVal1 =
LWord(v32);
4380 POPU32(v32, inBlob, inOutIndex); lVal2 =
LWord(v32);
4381 POPU32(v32, inBlob, inOutIndex); lVal3 =
LWord(v32);
4382 POPU32(v32, inBlob, inOutIndex); lVal4 =
LWord(v32);
4383 POPU32(v32, inBlob, inOutIndex); lVal5 =
LWord(v32);
4384 POPU32(v32, inBlob, inOutIndex); lVal6 =
LWord(v32);
4397 #if defined(AJA_LINUX)
4398 #pragma GCC diagnostic pop