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 if (inOutSet.find(*iter) == inOutSet.end())
1008 inOutSet.insert(*iter);
1016 NTV2VideoFormatSet::const_iterator iter (inFormats.begin ());
1018 inOStream << inFormats.size ()
1019 << (inFormats.size () == 1 ?
" video format: " :
" video format(s): ");
1021 while (iter != inFormats.end ())
1024 inOStream << (++iter == inFormats.end () ?
"" :
", ");
1036 inOStream << inFormats.size()
1037 << (inFormats.size() == 1 ?
" pixel format: " :
" pixel formats: ");
1039 while (iter != inFormats.end())
1042 inOStream << (++iter == inFormats.end() ?
"" :
", ");
1052 inOutSet.insert(*iter);
1062 inOStream << inStandards.size ()
1063 << (inStandards.size () == 1 ?
" standard: " :
" standards: ");
1065 while (iter != inStandards.end ())
1068 inOStream << (++iter == inStandards.end () ?
"" :
", ");
1078 inOutSet.insert(*iter);
1087 inOStream << inGeometries.size ()
1088 << (inGeometries.size () == 1 ?
" geometry: " :
" geometries: ");
1089 while (iter != inGeometries.end ())
1092 inOStream << (++iter == inGeometries.end () ?
"" :
", ");
1101 inOutSet.insert(*iter);
1110 inOStream << inSet.size()
1111 << (inSet.size() == 1 ?
" input: " :
" inputs: ");
1112 while (iter != inSet.end())
1115 inOStream << (++iter == inSet.end() ?
"" :
", ");
1124 inOutSet.insert (*iter);
1132 inOStream << inSet.size()
1133 << (inSet.size() == 1 ?
" output: " :
" outputs: ");
1134 while (iter != inSet.end())
1137 inOStream << (++iter == inSet.end() ?
"" :
", ");
1146 inOutSet.insert(*iter);
1159 if (outFormats.find(*fit) == outFormats.end())
1160 outFormats.insert(*fit);
1170 if (usedFormats.find(pf) == usedFormats.end())
1171 outFormats.insert(pf);
1177 outStandards.clear();
1184 if (outStandards.find(*sit) == outStandards.end())
1185 outStandards.insert(*sit);
1195 if (usedStandards.find(st) == usedStandards.end())
1196 outStandards.insert(st);
1215 outFormats.insert(vf);
1217 catch (
const std::bad_alloc &)
1225 NTV2_ASSERT ((isOkay && !outFormats.empty()) || (!isOkay && outFormats.empty()));
1240 outFormats.insert(pixelFormat);
1242 catch (
const std::bad_alloc &)
1249 NTV2_ASSERT ((isOkay && !outFormats.empty() ) || (!isOkay && outFormats.empty() ));
1258 outStandards.clear();
1265 outStandards.insert(
std);
1274 outGeometries.clear();
1288 outInputSources.clear();
1297 outInputSources.insert(src);
1307 outOutputDests.clear();
1310 for (
size_t ndx(0); ndx < 10; ndx++)
1317 outOutputDests.insert(dst);
1326 << (inSet.size() == 1 ?
" rate: " :
" rates: ");
1327 while (it != inSet.end())
1330 oss << (++it == inSet.end() ?
"" :
", ");
1338 if (inOutSet.find(*it) == inOutSet.end())
1339 inOutSet.insert(*it);
1352 outRates.insert(fr);
1360 return inRun.
Print(inOutStrm);
1367 static const char * sStateStrings [] = {
"Disabled",
"Initializing",
"Starting",
"Paused",
"Stopping",
"Running",
"StartingAtTime",
AJA_NULL};
1369 return string (sStateStrings [inState]);
1383 static const string sSegXferUnits[] = {
"",
" U8",
" U16",
"",
" U32",
"",
"",
"",
" U64",
""};
1394 return inStrm <<
"(invalid)";
1401 inStrm <<
DEC(getSegmentCount()) <<
" x " <<
DEC(getSegmentLength())
1403 if (getSourceOffset())
1404 inStrm <<
" srcOff=" <<
xHEX0N(getSourceOffset(),8);
1405 if (getSegmentCount() > 1)
1406 inStrm <<
" srcSpan=" <<
xHEX0N(getSourcePitch(),8) << (isSourceBottomUp()?
" VF":
"");
1407 if (getDestOffset())
1408 inStrm <<
" dstOff=" <<
xHEX0N(getDestOffset(),8);
1409 if (getSegmentCount() > 1)
1410 inStrm <<
" dstSpan=" <<
xHEX0N(getDestPitch(),8) << (isDestBottomUp()?
" VF":
"");
1411 inStrm <<
" totElm=" <<
DEC(getTotalElements()) <<
" totByt=" <<
xHEX0N(getTotalBytes(),8);
1418 static string var(
"segInfo");
1420 string units(
"\t// bytes");
1424 oss <<
"NTV2SegmentedXferInfo " << var <<
";" << endl;
1425 if (getElementLength() > 1)
1428 oss << var <<
".setElementLength(" << getElementLength() <<
");" << endl;
1430 oss << var <<
".setSegmentCount(" <<
DEC(getSegmentCount()) <<
");" << endl;
1431 oss << var <<
".setSegmentLength(" <<
DEC(getSegmentLength()) <<
");" << units << endl;
1432 if (getSourceOffset())
1433 oss << var <<
".setSourceOffset(" <<
DEC(getSourceOffset()) <<
");" << units << endl;
1434 oss << var <<
".setSourcePitch(" <<
DEC(getSourcePitch()) <<
");" << units << endl;
1435 if (isSourceBottomUp())
1436 oss << var <<
".setSourceDirection(false);" << endl;
1437 if (getDestOffset())
1438 oss << var <<
".setDestOffset(" <<
DEC(getDestOffset()) <<
");" << units << endl;
1440 oss << var <<
".setDestPitch(" <<
DEC(getDestPitch()) <<
");" << units << endl;
1441 if (isDestBottomUp())
1442 oss << var <<
".setDestDirection(false);" << endl;
1450 if (getSegmentCount() == 1)
1452 if (inElementOffset >= getSourceOffset())
1453 if (inElementOffset < getSourceOffset()+getSegmentLength())
1457 ULWord offset(getSourceOffset());
1458 for (
ULWord seg(0); seg < getSegmentCount(); seg++)
1460 if (inElementOffset < offset)
1462 if (inElementOffset < offset+getSegmentLength())
1464 offset += getSourcePitch();
1471 if (getElementLength() != inRHS.getElementLength())
1474 if (getSegmentCount() != inRHS.getSegmentCount())
1476 if (getSegmentLength() != inRHS.getSegmentLength())
1478 if (getSourceOffset() != inRHS.getSourceOffset())
1480 if (getSourcePitch() != inRHS.getSourcePitch())
1482 if (getDestOffset() != inRHS.getDestOffset())
1484 if (getDestPitch() != inRHS.getDestPitch())
1493 mElementsPerSegment = 0;
1494 mInitialSrcOffset = 0;
1495 mInitialDstOffset = 0;
1496 mSrcElementsPerRow = 0;
1497 mDstElementsPerRow = 0;
1504 std::swap(mSrcElementsPerRow, mDstElementsPerRow);
1505 std::swap(mInitialSrcOffset, mInitialDstOffset);
1506 const bool srcNormal(this->isSourceTopDown()), dstNormal(this->isDestTopDown());
1514 fByteCount (
ULWord(pInUserPointer ? inByteCount : 0)),
1516 #if defined (AJAMac)
1517 fKernelSpacePtr (0),
1528 : fUserSpacePtr (0),
1531 #if defined (AJAMac)
1532 fKernelSpacePtr (0),
1546 : fUserSpacePtr (0),
1549 #if defined (AJAMac)
1550 fKernelSpacePtr (0),
1569 fByteCount =
ULWord(inNewByteCount);
1598 const size_t loopCount(
GetByteCount() /
sizeof(uint64_t));
1601 for (
size_t ndx(0); ndx < loopCount; ndx++)
1610 const size_t loopCount(
GetByteCount() /
sizeof(uint32_t));
1613 for (
size_t ndx(0); ndx < loopCount; ndx++)
1622 const size_t loopCount(
GetByteCount() /
sizeof(uint16_t));
1625 for (
size_t ndx(0); ndx < loopCount; ndx++)
1635 fByteCount =
ULWord(pInUserPointer ? inByteCount : 0);
1637 return (pInUserPointer && inByteCount) || (!pInUserPointer && !inByteCount);
1643 return Set(pInUserPointer, inByteCount) &&
Fill(inValue);
1665 {pBuffer =
new UByte[inByteCount];}
1666 catch (
const std::bad_alloc &)
1668 if (pBuffer &&
Set(pBuffer, inByteCount))
1713 pBytes += inByteOffset;
1749 const ULWord inSrcByteOffset,
const ULWord inDstByteOffset,
const ULWord inByteCount)
1753 if (inSrcByteOffset + inByteCount > inBuffer.
GetByteCount())
1758 const UByte * pSrc (inBuffer);
1759 pSrc += inSrcByteOffset;
1761 UByte * pDst (*
this);
1762 pDst += inDstByteOffset;
1764 ::memcpy (pDst, pSrc, inByteCount);
1771 if (!inXferInfo.isValid() || inSrcBuffer.
IsNULL() ||
IsNULL())
1775 LWord srcOffset (
LWord(inXferInfo.getSourceOffset() * inXferInfo.getElementLength()));
1776 LWord dstOffset (
LWord(inXferInfo.getDestOffset() * inXferInfo.getElementLength()));
1777 LWord srcPitch (
LWord(inXferInfo.getSourcePitch() * inXferInfo.getElementLength()));
1778 LWord dstPitch (
LWord(inXferInfo.getDestPitch() * inXferInfo.getElementLength()));
1779 const LWord bytesPerSeg (inXferInfo.getSegmentLength() * inXferInfo.getElementLength());
1780 if (inXferInfo.isSourceBottomUp())
1781 srcPitch = 0 - srcPitch;
1782 if (inXferInfo.isDestBottomUp())
1783 dstPitch = 0 - dstPitch;
1784 for (
ULWord segNdx(0); segNdx < inXferInfo.getSegmentCount(); segNdx++)
1788 if (!pSrc)
return false;
1789 if (!pDst)
return false;
1794 ::memcpy (pDst, pSrc,
size_t(bytesPerSeg));
1795 srcOffset += srcPitch;
1796 dstOffset += dstPitch;
1806 const string newline(
"\n"), tab(
"\t");
1812 for (
size_t ndx(0); ndx < str.size(); ndx++)
1822 for (
size_t srcNdx(0), dstNdx(0); srcNdx < str.size(); srcNdx += 2)
1836 if (fFlags != inBuffer.fFlags)
1842 fUserSpacePtr = inBuffer.fUserSpacePtr;
1843 inBuffer.fUserSpacePtr = tmp;
1859 const uint8_t * pSrchData (inValue);
1860 const uint8_t * pMyData (*
this);
1864 if (!::memcmp(pMyData, pSrchData, srchByteCount))
1865 outOffsets.insert(offset);
1868 }
while (offset < maxOffset);
1880 if (inByteOffset >= totalBytes)
1883 totalBytes -= inByteOffset;
1885 ULWord byteCount(inByteCount);
1886 if (byteCount > totalBytes)
1887 byteCount = totalBytes;
1892 const UByte * pByte1 (*
this);
1893 const UByte * pByte2 (inBuffer);
1894 pByte1 += inByteOffset;
1895 pByte2 += inByteOffset;
1896 #if !defined(NTV2BUFFER_NO_MEMCMP)
1897 return ::memcmp (pByte1, pByte2, byteCount) == 0;
1898 #else // NTV2BUFFER_NO_MEMCMP
1899 ULWord offset(inByteOffset);
1902 if (*pByte1 != *pByte2)
1904 cerr <<
"## ERROR: IsContentEqual: miscompare at offset " <<
xHEX0N(offset,8)
1905 <<
" (" <<
DEC(offset) <<
"): " <<
xHEX0N(
UWord(*pByte1),2) <<
" != "
1907 <<
DEC(byteCount) <<
") bytes left to compare" << endl;
1915 #endif // NTV2BUFFER_NO_MEMCMP
1920 if (byteOffset == 0xFFFFFFFF)
1927 {byteOffset = 0xFFFFFFFF;
return true;}
1930 if (byteOffset >= totalBytesToCompare)
1932 totalBytesToCompare -= byteOffset;
1934 const UByte * pByte1 (*
this);
1935 const UByte * pByte2 (inBuffer);
1936 while (totalBytesToCompare)
1938 if (pByte1[byteOffset] != pByte2[byteOffset])
1940 totalBytesToCompare--;
1943 byteOffset = 0xFFFFFFFF;
1949 outByteOffsetFirst = outByteOffsetLast =
GetByteCount ();
1962 outByteOffsetFirst = 0;
1965 if (*pByte1 != *pByte2)
1969 outByteOffsetFirst++;
1971 if (outByteOffsetFirst == 0)
1976 if (*pByte1 == *pByte2)
1980 outByteOffsetFirst++;
1983 outByteOffsetFirst--;
1993 while (--outByteOffsetLast)
1995 if (*pByte1 != *pByte2)
2003 while (outByteOffsetLast)
2005 if (*pByte1 == *pByte2)
2009 outByteOffsetLast--;
2012 outByteOffsetLast++;
2013 if (outByteOffsetLast <= outByteOffsetFirst)
2014 cerr <<
"## WARNING: GetRingChangedByteRange: last " << outByteOffsetLast <<
" <= first " << outByteOffsetFirst <<
" in wrap condition" << endl;
2015 const ULWord tmp (outByteOffsetLast);
2016 outByteOffsetLast = outByteOffsetFirst;
2017 outByteOffsetFirst = tmp;
2018 if (outByteOffsetLast >= outByteOffsetFirst)
2019 cerr <<
"## WARNING: GetRingChangedByteRange: last " << outByteOffsetLast <<
" >= first " << outByteOffsetFirst <<
" in wrap condition" << endl;
2035 const bool result (inNewSize && (!(inNewSize & (inNewSize - 1))));
2043 #if defined(MSWindows) || defined(AJABareMetal)
2044 return AJA_PAGE_SIZE;
2046 return size_t(::getpagesize());
2054 acRequestedFrame (0),
2055 acAudioClockTimeStamp (0),
2056 acAudioExpectedAddress (0),
2057 acAudioInStartAddress (0),
2058 acAudioInStopAddress (0),
2059 acAudioOutStopAddress (0),
2060 acAudioOutStartAddress (0),
2061 acTotalBytesTransferred (0),
2066 acCurrentFrameTime (0),
2067 acAudioClockCurrentTime (0),
2068 acCurrentAudioExpectedAddress (0),
2069 acCurrentAudioStartAddress (0),
2070 acCurrentFieldCount (0),
2071 acCurrentLineCount (0),
2073 acCurrentUserCookie (0),
2082 : acHeader (inObj.acHeader),
2083 acFrameTime (inObj.acFrameTime),
2084 acRequestedFrame (inObj.acRequestedFrame),
2085 acAudioClockTimeStamp (inObj.acAudioClockTimeStamp),
2086 acAudioExpectedAddress (inObj.acAudioExpectedAddress),
2087 acAudioInStartAddress (inObj.acAudioInStartAddress),
2088 acAudioInStopAddress (inObj.acAudioInStopAddress),
2089 acAudioOutStopAddress (inObj.acAudioOutStopAddress),
2090 acAudioOutStartAddress (inObj.acAudioOutStartAddress),
2091 acTotalBytesTransferred (inObj.acTotalBytesTransferred),
2092 acStartSample (inObj.acStartSample),
2093 acCurrentTime (inObj.acCurrentTime),
2094 acCurrentFrame (inObj.acCurrentFrame),
2095 acCurrentFrameTime (inObj.acCurrentFrameTime),
2096 acAudioClockCurrentTime (inObj.acAudioClockCurrentTime),
2097 acCurrentAudioExpectedAddress (inObj.acCurrentAudioExpectedAddress),
2098 acCurrentAudioStartAddress (inObj.acCurrentAudioStartAddress),
2099 acCurrentFieldCount (inObj.acCurrentFieldCount),
2100 acCurrentLineCount (inObj.acCurrentLineCount),
2101 acCurrentReps (inObj.acCurrentReps),
2102 acCurrentUserCookie (inObj.acCurrentUserCookie),
2103 acFrame (inObj.acFrame),
2104 acRP188 (inObj.acRP188),
2105 acTrailer (inObj.acTrailer)
2128 for (
ULWord ndx (0); ndx < numRP188s; ndx++)
2129 outValues << pArray [ndx];
2148 outTimeCode = pArray [inTCIndex];
2156 outTimeCodes.clear();
2172 outTimeCodes[tcIndex] = tc;
2174 outTimeCodes[tcIndex] = tc;
2184 (
void)inSDIInputIndex0;
2192 if (!pArray || !numRP188s)
2197 if (
ULWord(inTCNdx) >= numRP188s)
2200 pArray[inTCNdx] = inTimecode;
2348 if (mInStatistics.
IsNULL())
2363 if (numElements != 8)
2365 if (inSDIInputIndex0 >= numElements)
2367 outStatus = pArray[inSDIInputIndex0];
2379 if (numElements != 8)
2381 if (inSDIInputIndex0 >= numElements)
2383 return pArray[inSDIInputIndex0];
2389 inOutStream << mHeader <<
", " << mInStatistics <<
", " << mTrailer;
return inOutStream;
2396 acTransferFrame (0),
2398 acFramesProcessed (0),
2399 acFramesDropped (0),
2401 acAudioTransferSize (0),
2402 acAudioStartSample (0),
2403 acAncTransferSize (0),
2404 acAncField2TransferSize (0)
2413 acCrosspoint (inCrosspoint),
2418 acRDTSCStartTime (0),
2419 acAudioClockStartTime (0),
2420 acRDTSCCurrentTime (0),
2421 acAudioClockCurrentTime (0),
2422 acFramesProcessed (0),
2423 acFramesDropped (0),
2530 if (inIndexNum == 0)
2547 case 13: oss << (
WithRP188() ?
"Yes" :
"No");
break;
2548 case 14: oss << (
WithLTC() ?
"Yes" :
"No");
break;
2552 case 18: oss << (
WithVidProc() ?
"Yes" :
"No");
break;
2555 case 21: oss << (
IsFieldMode() ?
"Yes" :
"No");
break;
2558 else if (inIndexNum < 22)
2568 << (inObj.
IsInput() ?
"Input " : (inObj.
IsOutput() ?
"Output" :
"*BAD* "))
2577 << setw(10) << (inObj.
WithRP188() ?
"+RP188" :
"-RP188")
2578 << setw(10) << (inObj.
WithLTC() ?
"+LTC" :
"-LTC")
2579 << setw(10) << (inObj.
WithFBFChange() ?
"+FBFchg" :
"-FBFchg")
2580 << setw(10) << (inObj.
WithFBOChange() ?
"+FBOchg" :
"-FBOchg")
2582 << setw(10) << (inObj.
WithVidProc() ?
"+VidProc" :
"-VidProc")
2583 << setw(10) << (inObj.
WithCustomAnc() ?
"+AncData" :
"-AncData")
2585 << setw(10) << (inObj.
IsFieldMode() ?
"+FldMode" :
"-FldMode");
2598 Set (inNumSegments, inNumActiveBytesPerRow, inHostBytesPerRow, inDeviceBytesPerRow);
2624 ccSaturationValue (0)
2661 acTransferStatus (),
2663 acInVideoDMAOffset (0),
2664 acInSegmentedDMAInfo (),
2665 acColorCorrection (),
2670 acPeerToPeerFlags (0),
2671 acFrameRepeatCount (1),
2672 acDesiredFrame (-1),
2684 ULWord * pInANCF2Buffer,
const ULWord inANCF2ByteCount)
2686 acVideoBuffer (pInVideoBuffer, inVideoByteCount),
2687 acAudioBuffer (pInAudioBuffer, inAudioByteCount),
2688 acANCBuffer (pInANCBuffer, inANCByteCount),
2689 acANCField2Buffer (pInANCF2Buffer, inANCF2ByteCount),
2691 acTransferStatus (),
2693 acInVideoDMAOffset (0),
2694 acInSegmentedDMAInfo (),
2695 acColorCorrection (),
2700 acPeerToPeerFlags (0),
2701 acFrameRepeatCount (1),
2702 acDesiredFrame (-1),
2718 ULWord * pInAudioBuffer,
const ULWord inAudioByteCount,
2720 ULWord * pInANCF2Buffer,
const ULWord inANCF2ByteCount)
2725 &&
SetAncBuffers (pInANCBuffer, inANCByteCount, pInANCF2Buffer, inANCF2ByteCount);
2766 for (
UWord ndx (0); ndx <
UWord(maxNumValues); ndx++)
2788 pArray[inTCIndex] = inTimeCode;
2802 for (
ULWord tcIndex(0); tcIndex < maxNumValues; tcIndex++)
2806 pArray[tcIndex] = inTimeCode;
2829 const ULWord inHostBytesPerRow,
const ULWord inDeviceBytesPerRow)
3004 mInNumRegisters (
ULWord (inRegisterNumbers.size ())),
3005 mOutNumRegisters (0)
3014 mInNumRegisters (
ULWord (inRegReads.size ())),
3015 mOutNumRegisters (0)
3025 mInNumRegisters =
ULWord(inRegisterNumbers.size());
3026 mOutNumRegisters = 0;
3027 bool result ( mInRegisters.
Allocate(mInNumRegisters *
sizeof(
ULWord))
3034 ULWord * pRegArray(mInRegisters);
3040 pRegArray[ndx++] = *iter;
3047 if (!mInNumRegisters)
3054 const ULWord * pRegNums(mInRegisters);
3055 for (
ULWord ndx(0); ndx < mInNumRegisters; ndx++)
3056 if (outRegNums.find(pRegNums[ndx]) == outRegNums.end())
3057 outRegNums.insert(pRegNums[ndx]);
3065 outGoodRegNums.clear();
3066 if (!mOutGoodRegisters)
3068 if (!mOutNumRegisters)
3070 if (mOutNumRegisters > mInNumRegisters)
3073 const ULWord * pRegArray (mOutGoodRegisters);
3074 for (
ULWord ndx(0); ndx < mOutNumRegisters; ndx++)
3075 outGoodRegNums.insert(pRegArray[ndx]);
3082 outBadRegNums.clear();
3088 if (reqRegNums == goodRegNums)
3092 std::set_difference (reqRegNums.begin(), reqRegNums.end(),
3093 goodRegNums.begin(), goodRegNums.end(),
3094 std::inserter(outBadRegNums, outBadRegNums.begin()));
3100 if (!mOutGoodRegisters)
3102 if (!mOutNumRegisters)
3104 if (mOutNumRegisters > mInNumRegisters)
3110 const ULWord * pRegArray (mOutGoodRegisters);
3111 ULWord * pValArray (mOutValues);
3112 for (
ULWord ndx(0); ndx < mOutNumRegisters; ndx++)
3113 if (pRegArray[ndx] == inRegNum)
3115 pValArray[ndx] = inValue;
3126 if (!mOutGoodRegisters)
3137 const ULWord * pRegArray (mOutGoodRegisters);
3138 const ULWord * pValArray (mOutValues);
3139 for (
ULWord ndx(0); ndx < mOutNumRegisters; ndx++)
3140 outValues [pRegArray[ndx]] = pValArray[ndx];
3151 if (outValues.empty())
3154 outValues.push_back(
NTV2RegInfo(it->first, it->second));
3159 uint32_t missingTally(0);
3163 if (mapIter == regValMap.end())
3165 it->registerValue = mapIter->second;
3167 return !missingTally;
3174 inOutStream << mHeader <<
", numRegs=" << mInNumRegisters <<
", inRegs=" << mInRegisters <<
", outNumGoodRegs=" << mOutNumRegisters
3175 <<
", outGoodRegs=" << mOutGoodRegisters <<
", outValues=" << mOutValues <<
", " << mTrailer;
3182 mInNumRegisters (
ULWord(inRegWrites.size())),
3206 pBadRegIndexes[ndx] = 0;
3208 pRegInfoArray[ndx++] = *it;
3219 outFailedRegWrites.clear();
3225 outRegWrites.clear();
3234 outRegWrites.push_back(pRegInfos[ndx]);
3247 if (pBadRegIndexes && maxNumBadRegIndexes && pRegInfoArray && maxNumRegInfos &&
mOutNumFailures)
3250 for (
UWord num(0); num < maxNumBadRegIndexes; num++)
3252 const UWord badRegIndex (pBadRegIndexes[num]);
3253 if (badRegIndex < maxNumRegInfos)
3255 const NTV2RegInfo & badRegInfo (pRegInfoArray[badRegIndex]);
3256 oss <<
"Failure " << num <<
": " << badRegInfo << endl;
3266 typedef std::pair <ULWord, ULWord> ULWordPair;
3267 typedef std::pair <ULWordPair, ULWordPair> ULWordPairs;
3290 const bool badName (regName.find(
' ') != string::npos);
3293 oss <<
"theDevice.WriteRegister (";
3330 for (NTV2ULWordVector::const_iterator it(inObj.begin()); it != inObj.end(); ++it)
3331 inOutStream <<
" " <<
HEX0N(*it,8);
3338 inOutStream << (inCompact ?
"Ch[" :
"[");
3342 inOutStream <<
DEC(*it+1);
3345 if (++it != inObj.end())
3346 inOutStream << (inCompact ?
"|" :
",");
3348 return inOutStream <<
"]";
3352 { ostringstream oss;
3359 inOutStream << (inCompact ?
"Ch{" :
"{");
3363 inOutStream <<
DEC(*it+1);
3366 if (++it != inObj.end())
3367 inOutStream << (inCompact ?
"|" :
",");
3369 return inOutStream <<
"}";
3373 { ostringstream oss;
3400 result.push_back(ch);
3408 result.push_back(*it);
3414 inOutStream << (inCompact ?
"AudSys{" :
"{");
3418 inOutStream <<
DEC(*it+1);
3421 if (++it != inObj.end())
3422 inOutStream << (inCompact ?
"|" :
",");
3424 return inOutStream <<
"}";
3428 { ostringstream oss;
3438 result.insert(audSys);
3446 if (result.find(it->registerNumber) == result.end())
3447 result.insert(it->registerNumber);
3454 if (iter->registerNumber == inRegNum)
3456 return inRegInfos.end();
3462 return inObj.
Print(inOutStream);
3468 inOutStream << inObj.size () <<
" regs:" << endl;
3470 inOutStream << *iter << endl;
3477 mIsWriting (inDoWrite),
3483 *pRegInfo = inBankSelect;
3486 *pRegInfo = inOutRegInfo;
3499 if (
ULWord(inIndex0) < maxNum)
3500 result = pRegInfos[inIndex0];
3512 if (
mInBankInfos) oss << *pBankRegInfo;
else oss <<
"-";
3513 oss <<
" regInfos=";
3514 if (
mInRegInfos) oss << *pRegInfo;
else oss <<
"-";
3522 mIsWriting (inDoWrite),
3523 mVirtualData (inVirtualData, inVirtualDataSize)
3541 #define AsU8Ref(_x_) reinterpret_cast<uint8_t&>(_x_)
3542 #define AsU16Ref(_x_) reinterpret_cast<uint16_t&>(_x_)
3543 #define AsU32Ref(_x_) reinterpret_cast<uint32_t&>(_x_)
3544 #define AsU64Ref(_x_) reinterpret_cast<uint64_t&>(_x_)
3550 PUSHU32(fHeaderVersion, outBlob);
3552 PUSHU32(fSizeInBytes, outBlob);
3553 PUSHU32(fPointerSize, outBlob);
3555 PUSHU32(fResultStatus, outBlob);
3561 POPU32(fHeaderTag, inBlob, inOutIndex);
3562 POPU32(fType, inBlob, inOutIndex);
3563 POPU32(fHeaderVersion, inBlob, inOutIndex);
3564 POPU32(fVersion, inBlob, inOutIndex);
3565 POPU32(fSizeInBytes, inBlob, inOutIndex);
3566 POPU32(fPointerSize, inBlob, inOutIndex);
3567 POPU32(fOperation, inBlob, inOutIndex);
3568 POPU32(fResultStatus, inBlob, inOutIndex);
3574 PUSHU32(fTrailerVersion, outBlob);
3575 PUSHU32(fTrailerTag, outBlob);
3581 POPU32(fTrailerVersion, inBlob, inOutIndex);
3582 POPU32(fTrailerTag, inBlob, inOutIndex);
3598 ULWord byteCount(0), flags(0);
3599 POPU32(byteCount, inBlob, inOutIndex);
3600 POPU32(flags, inBlob, inOutIndex);
3603 if ((inOutIndex + byteCount) > inBlob.size())
3605 for (
ULWord cnt(0); cnt < byteCount; cnt++)
3606 U8(
int(cnt)) = inBlob.at(inOutIndex++);
3612 const size_t totBytes (mHeader.GetSizeInBytes()
3613 + mInRegisters.GetByteCount() + mOutGoodRegisters.GetByteCount() + mOutValues.GetByteCount());
3614 if (outBlob.capacity() < totBytes)
3615 outBlob.reserve(totBytes);
3618 mInRegisters.ByteSwap32();
3619 mOutGoodRegisters.ByteSwap32();
3620 mOutValues.ByteSwap32();
3622 bool ok = mHeader.RPCEncode(outBlob);
3623 PUSHU32(mInNumRegisters, outBlob);
3624 ok &= mInRegisters.RPCEncode(outBlob);
3625 PUSHU32(mOutNumRegisters, outBlob);
3626 ok &= mOutGoodRegisters.RPCEncode(outBlob)
3627 && mOutValues.RPCEncode(outBlob)
3628 && mTrailer.RPCEncode(outBlob);
3631 mInRegisters.ByteSwap32();
3632 mOutGoodRegisters.ByteSwap32();
3633 mOutValues.ByteSwap32();
3640 bool ok = mHeader.RPCDecode(inBlob, inOutIndex);
3641 if (!ok)
return false;
3642 POPU32(mInNumRegisters, inBlob, inOutIndex);
3643 ok &= mInRegisters.RPCDecode(inBlob, inOutIndex);
3644 POPU32(mOutNumRegisters, inBlob, inOutIndex);
3645 ok &= mOutGoodRegisters.RPCDecode(inBlob, inOutIndex);
3646 ok &= mOutValues.RPCDecode(inBlob, inOutIndex);
3647 ok &= mTrailer.RPCDecode(inBlob, inOutIndex);
3650 mInRegisters.ByteSwap32();
3651 mOutGoodRegisters.ByteSwap32();
3652 mOutValues.ByteSwap32();
3659 const size_t totBytes (mHeader.GetSizeInBytes()
3660 + mInRegInfos.GetByteCount() + mOutBadRegIndexes.GetByteCount());
3661 if (outBlob.capacity() < totBytes)
3662 outBlob.reserve(totBytes);
3665 mInRegInfos.ByteSwap32();
3666 mOutBadRegIndexes.ByteSwap32();
3668 bool ok = mHeader.RPCEncode(outBlob);
3669 PUSHU32(mInNumRegisters, outBlob);
3670 ok &= mInRegInfos.RPCEncode(outBlob);
3671 PUSHU32(mOutNumFailures, outBlob);
3672 ok &= mOutBadRegIndexes.RPCEncode(outBlob)
3673 && mTrailer.RPCEncode(outBlob);
3676 mInRegInfos.ByteSwap32();
3677 mOutBadRegIndexes.ByteSwap16();
3684 bool ok = mHeader.RPCDecode(inBlob, inOutIndex);
3685 POPU32(mInNumRegisters, inBlob, inOutIndex);
3686 ok &= mInRegInfos.RPCDecode(inBlob, inOutIndex);
3687 POPU32(mOutNumFailures, inBlob, inOutIndex);
3688 ok &= mOutBadRegIndexes.RPCDecode(inBlob, inOutIndex);
3689 ok &= mTrailer.RPCDecode(inBlob, inOutIndex);
3692 mInRegInfos.ByteSwap32();
3693 mOutBadRegIndexes.ByteSwap16();
3700 const size_t totBytes (mHeader.GetSizeInBytes()
3701 + mInBankInfos.GetByteCount() + mInRegInfos.GetByteCount());
3702 if (outBlob.capacity() < totBytes)
3703 outBlob.reserve(totBytes);
3706 mInBankInfos.ByteSwap32();
3707 mInRegInfos.ByteSwap32();
3709 bool ok = mHeader.RPCEncode(outBlob);
3711 ok &= mInBankInfos.RPCEncode(outBlob);
3712 ok &= mInRegInfos.RPCEncode(outBlob)
3713 && mTrailer.RPCEncode(outBlob);
3716 mInBankInfos.ByteSwap32();
3717 mInRegInfos.ByteSwap32();
3724 bool ok = mHeader.RPCDecode(inBlob, inOutIndex);
3725 POPU32(mIsWriting, inBlob, inOutIndex);
3726 ok &= mInBankInfos.RPCDecode(inBlob, inOutIndex);
3727 ok &= mInRegInfos.RPCDecode(inBlob, inOutIndex);
3728 ok &= mTrailer.RPCDecode(inBlob, inOutIndex);
3731 mInBankInfos.ByteSwap32();
3732 mInRegInfos.ByteSwap32();
3739 const size_t totBytes (acHeader.GetSizeInBytes());
3740 if (outBlob.capacity() < totBytes)
3741 outBlob.reserve(totBytes);
3742 bool ok = acHeader.RPCEncode(outBlob);
3748 PUSHU64(acRDTSCStartTime, outBlob);
3749 PUSHU64(acAudioClockStartTime, outBlob);
3750 PUSHU64(acRDTSCCurrentTime, outBlob);
3751 PUSHU64(acAudioClockCurrentTime, outBlob);
3752 PUSHU32(acFramesProcessed, outBlob);
3753 PUSHU32(acFramesDropped, outBlob);
3754 PUSHU32(acBufferLevel, outBlob);
3755 PUSHU32(acOptionFlags, outBlob);
3757 ok &= acTrailer.RPCEncode(outBlob);
3762 { uint16_t v16(0); uint32_t v32(0);
3763 bool ok = acHeader.RPCDecode(inBlob, inOutIndex);
3764 POPU16(v16, inBlob, inOutIndex);
3766 POPU16(v16, inBlob, inOutIndex);
3768 POPU32(v32, inBlob, inOutIndex);
3769 acStartFrame =
LWord(v32);
3770 POPU32(v32, inBlob, inOutIndex);
3771 acEndFrame =
LWord(v32);
3772 POPU32(v32, inBlob, inOutIndex);
3773 acActiveFrame =
LWord(v32);
3774 POPU64(acRDTSCStartTime, inBlob, inOutIndex);
3775 POPU64(acAudioClockStartTime, inBlob, inOutIndex);
3776 POPU64(acRDTSCCurrentTime, inBlob, inOutIndex);
3777 POPU64(acAudioClockCurrentTime, inBlob, inOutIndex);
3778 POPU32(acFramesProcessed, inBlob, inOutIndex);
3779 POPU32(acFramesDropped, inBlob, inOutIndex);
3780 POPU32(acBufferLevel, inBlob, inOutIndex);
3781 POPU32(acOptionFlags, inBlob, inOutIndex);
3782 POPU16(v16, inBlob, inOutIndex);
3784 ok &= acTrailer.RPCDecode(inBlob, inOutIndex);
3790 const size_t totBytes (acHeader.GetSizeInBytes());
3791 if (outBlob.capacity() < totBytes)
3792 outBlob.reserve(totBytes);
3793 bool ok = acHeader.RPCEncode(outBlob);
3795 PUSHU32(acRequestedFrame, outBlob);
3796 PUSHU64(acAudioClockTimeStamp, outBlob);
3797 PUSHU32(acAudioExpectedAddress, outBlob);
3798 PUSHU32(acAudioInStartAddress, outBlob);
3799 PUSHU32(acAudioInStopAddress, outBlob);
3800 PUSHU32(acAudioOutStopAddress, outBlob);
3801 PUSHU32(acAudioOutStartAddress, outBlob);
3802 PUSHU32(acTotalBytesTransferred, outBlob);
3803 PUSHU32(acStartSample, outBlob);
3805 ok &= acTimeCodes.RPCEncode(outBlob);
3807 PUSHU32(acCurrentFrame, outBlob);
3809 PUSHU64(acAudioClockCurrentTime, outBlob);
3810 PUSHU32(acCurrentAudioExpectedAddress, outBlob);
3811 PUSHU32(acCurrentAudioStartAddress, outBlob);
3812 PUSHU32(acCurrentFieldCount, outBlob);
3813 PUSHU32(acCurrentLineCount, outBlob);
3814 PUSHU32(acCurrentReps, outBlob);
3815 PUSHU64(acCurrentUserCookie, outBlob);
3817 PUSHU32(acRP188.fDBB, outBlob);
3818 PUSHU32(acRP188.fLo, outBlob);
3819 PUSHU32(acRP188.fHi, outBlob);
3820 ok &= acTrailer.RPCEncode(outBlob);
3826 bool ok = acHeader.RPCDecode(inBlob, inOutIndex);
3827 POPU64(v64, inBlob, inOutIndex);
3829 POPU32(acRequestedFrame, inBlob, inOutIndex);
3830 POPU64(acAudioClockTimeStamp, inBlob, inOutIndex);
3831 POPU32(acAudioExpectedAddress, inBlob, inOutIndex);
3832 POPU32(acAudioInStartAddress, inBlob, inOutIndex);
3833 POPU32(acAudioInStopAddress, inBlob, inOutIndex);
3834 POPU32(acAudioOutStopAddress, inBlob, inOutIndex);
3835 POPU32(acAudioOutStartAddress, inBlob, inOutIndex);
3836 POPU32(acTotalBytesTransferred, inBlob, inOutIndex);
3837 POPU32(acStartSample, inBlob, inOutIndex);
3839 ok &= acTimeCodes.RPCDecode(inBlob, inOutIndex);
3840 POPU64(v64, inBlob, inOutIndex);
3842 POPU32(acCurrentFrame, inBlob, inOutIndex);
3843 POPU64(v64, inBlob, inOutIndex);
3844 acCurrentFrameTime =
LWord64(v64);
3845 POPU64(acAudioClockCurrentTime, inBlob, inOutIndex);
3846 POPU32(acCurrentAudioExpectedAddress, inBlob, inOutIndex);
3847 POPU32(acCurrentAudioStartAddress, inBlob, inOutIndex);
3848 POPU32(acCurrentFieldCount, inBlob, inOutIndex);
3849 POPU32(acCurrentLineCount, inBlob, inOutIndex);
3850 POPU32(acCurrentReps, inBlob, inOutIndex);
3851 POPU64(acCurrentUserCookie, inBlob, inOutIndex);
3852 POPU32(acFrame, inBlob, inOutIndex);
3853 POPU32(acRP188.fDBB, inBlob, inOutIndex);
3854 POPU32(acRP188.fLo, inBlob, inOutIndex);
3855 POPU32(acRP188.fHi, inBlob, inOutIndex);
3856 ok &= acTrailer.RPCDecode(inBlob, inOutIndex);
3862 const size_t totBytes (acHeader.GetSizeInBytes());
3863 if (outBlob.capacity() < totBytes)
3864 outBlob.reserve(totBytes);
3865 bool ok = acHeader.RPCEncode(outBlob);
3868 PUSHU32(acBufferLevel, outBlob);
3869 PUSHU32(acFramesProcessed, outBlob);
3870 PUSHU32(acFramesDropped, outBlob);
3871 ok &= acFrameStamp.RPCEncode(outBlob);
3872 PUSHU32(acAudioTransferSize, outBlob);
3873 PUSHU32(acAudioStartSample, outBlob);
3874 PUSHU32(acAncTransferSize, outBlob);
3875 PUSHU32(acAncField2TransferSize, outBlob);
3876 ok &= acTrailer.RPCEncode(outBlob);
3881 { uint16_t v16(0); uint32_t v32(0);
3882 bool ok = acHeader.RPCDecode(inBlob, inOutIndex);
3883 POPU16(v16, inBlob, inOutIndex);
3885 POPU32(v32, inBlob, inOutIndex);
3886 acTransferFrame =
LWord(v32);
3887 POPU32(acBufferLevel, inBlob, inOutIndex);
3888 POPU32(acFramesProcessed, inBlob, inOutIndex);
3889 POPU32(acFramesDropped, inBlob, inOutIndex);
3890 ok &= acFrameStamp.RPCDecode(inBlob, inOutIndex);
3891 POPU32(acAudioTransferSize, inBlob, inOutIndex);
3892 POPU32(acAudioStartSample, inBlob, inOutIndex);
3893 POPU32(acAncTransferSize, inBlob, inOutIndex);
3894 POPU32(acAncField2TransferSize, inBlob, inOutIndex);
3895 ok &= acTrailer.RPCDecode(inBlob, inOutIndex);
3901 PUSHU32(acNumSegments, outBlob);
3902 PUSHU32(acNumActiveBytesPerRow, outBlob);
3903 PUSHU32(acSegmentHostPitch, outBlob);
3904 PUSHU32(acSegmentDevicePitch, outBlob);
3910 POPU32(acNumSegments, inBlob, inOutIndex);
3911 POPU32(acNumActiveBytesPerRow, inBlob, inOutIndex);
3912 POPU32(acSegmentHostPitch, inBlob, inOutIndex);
3913 POPU32(acSegmentDevicePitch, inBlob, inOutIndex);
3920 PUSHU32(ccSaturationValue, outBlob);
3921 return ccLookupTables.RPCEncode(outBlob);
3926 POPU16(u16, inBlob, inOutIndex);
3928 POPU32(ccSaturationValue, inBlob, inOutIndex);
3929 return ccLookupTables.RPCDecode(inBlob, inOutIndex);
3935 PUSHU16(foregroundVideoCrosspoint, outBlob);
3936 PUSHU16(backgroundVideoCrosspoint, outBlob);
3937 PUSHU16(foregroundKeyCrosspoint, outBlob);
3938 PUSHU16(backgroundKeyCrosspoint, outBlob);
3945 { uint16_t v16(0); uint32_t v32(0);
3946 POPU16(v16, inBlob, inOutIndex);
3948 POPU16(v16, inBlob, inOutIndex);
3950 POPU16(v16, inBlob, inOutIndex);
3952 POPU16(v16, inBlob, inOutIndex);
3954 POPU16(v16, inBlob, inOutIndex);
3956 POPU32(v32, inBlob, inOutIndex);
3957 transitionCoefficient =
Fixed_(v32);
3958 POPU32(v32, inBlob, inOutIndex);
3959 transitionSoftness =
Fixed_(v32);
3973 POPU32(fDBB, inBlob, inOutIndex);
3974 POPU32(fLo, inBlob, inOutIndex);
3975 POPU32(fHi, inBlob, inOutIndex);
3982 const size_t totBytes (acHeader.GetSizeInBytes() + acVideoBuffer.GetByteCount() + acAudioBuffer.GetByteCount()
3983 + acANCBuffer.GetByteCount() + acANCField2Buffer.GetByteCount() + acOutputTimeCodes.GetByteCount()
3984 + acHDMIAuxData.GetByteCount() + 64);
3985 if (outBlob.capacity() < totBytes)
3986 outBlob.reserve(totBytes);
3987 bool ok = acHeader.RPCEncode(outBlob);
3988 ok &= acVideoBuffer.RPCEncode(outBlob);
3989 ok &= acAudioBuffer.RPCEncode(outBlob);
3990 ok &= acANCBuffer.RPCEncode(outBlob);
3991 ok &= acANCField2Buffer.RPCEncode(outBlob);
3992 ok &= acOutputTimeCodes.RPCEncode(outBlob);
3993 ok &= acTransferStatus.RPCEncode(outBlob);
3994 PUSHU64(acInUserCookie, outBlob);
3995 PUSHU32(acInVideoDMAOffset, outBlob);
3996 ok &= acInSegmentedDMAInfo.RPCEncode(outBlob);
3997 ok &= acColorCorrection.RPCEncode(outBlob);
3998 PUSHU16(acFrameBufferFormat, outBlob);
3999 PUSHU16(acFrameBufferOrientation, outBlob);
4000 ok &= acVidProcInfo.RPCEncode(outBlob);
4001 PUSHU16(acVideoQuarterSizeExpand, outBlob);
4002 ok &= acHDMIAuxData.RPCEncode(outBlob);
4003 PUSHU32(acPeerToPeerFlags, outBlob);
4004 PUSHU32(acFrameRepeatCount, outBlob);
4006 ok &= acRP188.RPCEncode(outBlob);
4007 PUSHU16(acCrosspoint, outBlob);
4008 ok &= acTrailer.RPCEncode(outBlob);
4014 { uint16_t v16(0); uint32_t v32(0);
4016 bool ok = acHeader.RPCDecode(inBlob, inOutIndex);
4017 ok &= acVideoBuffer.RPCDecode(inBlob, inOutIndex);
4018 ok &= acAudioBuffer.RPCDecode(inBlob, inOutIndex);
4019 ok &= acANCBuffer.RPCDecode(inBlob, inOutIndex);
4020 ok &= acANCField2Buffer.RPCDecode(inBlob, inOutIndex);
4021 ok &= acOutputTimeCodes.RPCDecode(inBlob, inOutIndex);
4022 ok &= acTransferStatus.RPCDecode(inBlob, inOutIndex);
4023 POPU64(acInUserCookie, inBlob, inOutIndex);
4024 POPU32(acInVideoDMAOffset, inBlob, inOutIndex);
4025 ok &= acInSegmentedDMAInfo.RPCDecode(inBlob, inOutIndex);
4026 ok &= acColorCorrection.RPCDecode(inBlob, inOutIndex);
4027 POPU16(v16, inBlob, inOutIndex);
4029 POPU16(v16, inBlob, inOutIndex);
4031 ok &= acVidProcInfo.RPCDecode(inBlob, inOutIndex);
4032 POPU16(v16, inBlob, inOutIndex);
4034 ok &= acHDMIAuxData.RPCDecode(inBlob, inOutIndex);
4035 POPU32(acPeerToPeerFlags, inBlob, inOutIndex);
4036 POPU32(acFrameRepeatCount, inBlob, inOutIndex);
4037 POPU32(v32, inBlob, inOutIndex);
4038 acDesiredFrame =
LWord(v32);
4039 ok &= acRP188.RPCDecode(inBlob, inOutIndex);
4040 POPU16(v16, inBlob, inOutIndex);
4042 ok &= acTrailer.RPCDecode(inBlob, inOutIndex);
4052 PUSHU32(videoBufferSize, outBlob);
4053 if (videoBuffer && videoBufferSize)
4054 { buff.
Set(videoBuffer, videoBufferSize);
4057 PUSHU32(videoDmaOffset, outBlob);
4059 PUSHU32(audioBufferSize, outBlob);
4060 if (audioBuffer && audioBufferSize)
4061 { buff.
Set(audioBuffer, audioBufferSize);
4064 PUSHU32(audioStartSample, outBlob);
4065 PUSHU32(audioNumChannels, outBlob);
4066 PUSHU32(frameRepeatCount, outBlob);
4067 rp188.RPCEncode(outBlob);
4070 PUSHU32(transferFlags, outBlob);
4071 PUSHU8(bDisableExtraAudioInfo, outBlob);
4075 vidProcInfo.RPCEncode(outBlob);
4076 PUSHU32(customAncInfo.Group1, outBlob);
4077 PUSHU32(customAncInfo.Group2, outBlob);
4078 PUSHU32(customAncInfo.Group3, outBlob);
4079 PUSHU32(customAncInfo.Group4, outBlob);
4080 PUSHU32(videoNumSegments, outBlob);
4081 PUSHU32(videoSegmentHostPitch, outBlob);
4082 PUSHU32(videoSegmentCardPitch, outBlob);
4089 POPU16(v16, inBlob, inOutIndex);
4093 POPU32(videoBufferSize, inBlob, inOutIndex);
4094 if (videoBufferSize && !videoBuffer)
4099 if ((inOutIndex + videoBufferSize) >= inBlob.size())
4101 UByte* pBuffer =
reinterpret_cast<UByte*
>(videoBuffer);
4102 for (
ULWord cnt(0); cnt < videoBufferSize; cnt++)
4103 pBuffer[cnt] = inBlob.at(inOutIndex++);
4105 POPU32(videoDmaOffset, inBlob, inOutIndex);
4108 POPU32(audioBufferSize, inBlob, inOutIndex);
4109 if (audioBufferSize && !audioBuffer)
4114 if ((inOutIndex + audioBufferSize) >= inBlob.size())
4116 UByte* pBuffer =
reinterpret_cast<UByte*
>(audioBuffer);
4117 for (
ULWord cnt(0); cnt < audioBufferSize; cnt++)
4118 pBuffer[cnt] = inBlob.at(inOutIndex++);
4120 POPU32(audioStartSample, inBlob, inOutIndex);
4121 POPU32(audioNumChannels, inBlob, inOutIndex);
4122 POPU32(frameRepeatCount, inBlob, inOutIndex);
4123 rp188.RPCDecode(inBlob, inOutIndex);
4124 POPU32(v32, inBlob, inOutIndex);
4125 desiredFrame =
LWord(v32);
4126 POPU32(hUser, inBlob, inOutIndex);
4127 POPU32(transferFlags, inBlob, inOutIndex);
4128 POPU8(
AsU8Ref(bDisableExtraAudioInfo), inBlob, inOutIndex);
4129 POPU16(v16, inBlob, inOutIndex);
4131 POPU16(v16, inBlob, inOutIndex);
4134 vidProcInfo.RPCDecode(inBlob, inOutIndex);
4135 POPU32(customAncInfo.Group1, inBlob, inOutIndex);
4136 POPU32(customAncInfo.Group2, inBlob, inOutIndex);
4137 POPU32(customAncInfo.Group3, inBlob, inOutIndex);
4138 POPU32(customAncInfo.Group4, inBlob, inOutIndex);
4139 POPU32(videoNumSegments, inBlob, inOutIndex);
4140 POPU32(videoSegmentHostPitch, inBlob, inOutIndex);
4141 POPU32(videoSegmentCardPitch, inBlob, inOutIndex);
4142 POPU16(v16, inBlob, inOutIndex);
4149 const size_t totBytes (mHeader.GetSizeInBytes());
4150 if (outBlob.capacity() < totBytes)
4151 outBlob.reserve(totBytes);
4152 bool ok = mHeader.RPCEncode(outBlob);
4153 ok &= mBuffer.RPCEncode(outBlob);
4156 for (
size_t ndx(0); ndx < 16; ndx++)
4157 PUSHU32(mRegisters[ndx], outBlob);
4158 for (
size_t ndx(0); ndx < 32; ndx++)
4159 PUSHU32(mReserved[ndx], outBlob);
4160 ok &= mTrailer.RPCEncode(outBlob);
4166 bool ok = mHeader.RPCDecode(inBlob, inOutIndex);
4167 ok &= mBuffer.RPCDecode(inBlob, inOutIndex);
4168 POPU32(mFlags, inBlob, inOutIndex);
4169 POPU32(mStatus, inBlob, inOutIndex);
4170 for (
size_t ndx(0); ndx < 16; ndx++)
4171 POPU32(mRegisters[ndx], inBlob, inOutIndex);
4172 for (
size_t ndx(0); ndx < 16; ndx++)
4173 POPU32(mReserved[ndx], inBlob, inOutIndex);
4174 ok &= mTrailer.RPCDecode(inBlob, inOutIndex);
4185 PUSHU64(rdtscStartTime, outBlob);
4186 PUSHU64(audioClockStartTime, outBlob);
4187 PUSHU64(rdtscCurrentTime, outBlob);
4188 PUSHU64(audioClockCurrentTime, outBlob);
4189 PUSHU32(framesProcessed, outBlob);
4190 PUSHU32(framesDropped, outBlob);
4191 PUSHU32(bufferLevel, outBlob);
4192 PUSHU8(bWithAudio, outBlob);
4193 PUSHU8(bWithRP188, outBlob);
4194 PUSHU8(bFbfChange, outBlob);
4195 PUSHU8(bFboChange, outBlob);
4196 PUSHU8(bWithColorCorrection, outBlob);
4197 PUSHU8(bWithVidProc, outBlob);
4198 PUSHU8(bWithCustomAncData, outBlob);
4203 { uint16_t v16(0); uint32_t v32(0);
4204 POPU16(v16, inBlob, inOutIndex);
4206 POPU16(v16, inBlob, inOutIndex);
4208 POPU32(v32, inBlob, inOutIndex);
4209 startFrame =
LWord(v32);
4210 POPU32(v32, inBlob, inOutIndex);
4211 endFrame =
LWord(v32);
4212 POPU32(v32, inBlob, inOutIndex);
4213 activeFrame =
LWord(v32);
4214 POPU64(rdtscStartTime, inBlob, inOutIndex);
4215 POPU64(audioClockStartTime, inBlob, inOutIndex);
4216 POPU64(rdtscCurrentTime, inBlob, inOutIndex);
4217 POPU64(audioClockCurrentTime, inBlob, inOutIndex);
4218 POPU32(framesProcessed, inBlob, inOutIndex);
4219 POPU32(framesDropped, inBlob, inOutIndex);
4220 POPU32(bufferLevel, inBlob, inOutIndex);
4225 POPU8(
AsU8Ref(bWithColorCorrection), inBlob, inOutIndex);
4227 POPU8(
AsU8Ref(bWithCustomAncData), inBlob, inOutIndex);
4241 POPU32(DBB, inBlob, inOutIndex);
4242 POPU32(Low, inBlob, inOutIndex);
4243 POPU32(High, inBlob, inOutIndex);
4250 PUSHU32(taskVersion, outBlob);
4255 if (taskArray && numTasks)
4256 for (
ULWord num(0); num < numTasks; num++)
4260 const ULWord * pULWords =
reinterpret_cast<const ULWord*
>(&task.
u);
4266 for (
ULWord word(0); word < numWords; word++)
4267 PUSHU32(pULWords[word], outBlob);
4274 POPU32(taskVersion, inBlob, inOutIndex);
4275 POPU32(taskSize, inBlob, inOutIndex);
4276 POPU32(numTasks, inBlob, inOutIndex);
4277 POPU32(maxTasks, inBlob, inOutIndex);
4278 POPU64(u64, inBlob, inOutIndex);
4280 if (taskArray && numTasks)
4281 for (
ULWord num(0); num < numTasks; num++)
4284 POPU32(u32, inBlob, inOutIndex);
4292 for (
ULWord word(0); word < numWords; word++)
4293 POPU32(pULWords[word], inBlob, inOutIndex);
4303 PUSHU64(audioClockTimeStamp, outBlob);
4304 PUSHU32(audioExpectedAddress, outBlob);
4305 PUSHU32(audioInStartAddress, outBlob);
4306 PUSHU32(audioInStopAddress, outBlob);
4307 PUSHU32(audioOutStopAddress, outBlob);
4308 PUSHU32(audioOutStartAddress, outBlob);
4310 PUSHU32(startSample, outBlob);
4312 PUSHU32(currentFrame, outBlob);
4313 currentRP188.RPCEncode(outBlob);
4315 PUSHU64(audioClockCurrentTime, outBlob);
4316 PUSHU32(currentAudioExpectedAddress, outBlob);
4317 PUSHU32(currentAudioStartAddress, outBlob);
4318 PUSHU32(currentFieldCount, outBlob);
4319 PUSHU32(currentLineCount, outBlob);
4320 PUSHU32(currentReps, outBlob);
4321 PUSHU32(currenthUser, outBlob);
4326 { uint16_t v16(0); uint64_t v64(0);
4327 POPU16(v16, inBlob, inOutIndex);
4329 POPU64(v64, inBlob, inOutIndex);
4331 POPU32(frame, inBlob, inOutIndex);
4332 POPU64(audioClockTimeStamp, inBlob, inOutIndex);
4333 POPU32(audioExpectedAddress, inBlob, inOutIndex);
4334 POPU32(audioInStartAddress, inBlob, inOutIndex);
4335 POPU32(audioInStopAddress, inBlob, inOutIndex);
4336 POPU32(audioOutStopAddress, inBlob, inOutIndex);
4337 POPU32(audioOutStartAddress, inBlob, inOutIndex);
4338 POPU32(bytesRead, inBlob, inOutIndex);
4339 POPU32(startSample, inBlob, inOutIndex);
4340 POPU64(v64, inBlob, inOutIndex);
4342 POPU32(currentFrame, inBlob, inOutIndex);
4343 currentRP188.RPCDecode(inBlob, inOutIndex);
4344 POPU64(v64, inBlob, inOutIndex);
4345 currentFrameTime =
LWord64(v64);
4346 POPU64(audioClockCurrentTime, inBlob, inOutIndex);
4347 POPU32(currentAudioExpectedAddress, inBlob, inOutIndex);
4348 POPU32(currentAudioStartAddress, inBlob, inOutIndex);
4349 POPU32(currentFieldCount, inBlob, inOutIndex);
4350 POPU32(currentLineCount, inBlob, inOutIndex);
4351 POPU32(currentReps, inBlob, inOutIndex);
4352 POPU32(currenthUser, inBlob, inOutIndex);
4391 #if defined(AJA_LINUX)
4392 #pragma GCC diagnostic push
4393 #pragma GCC diagnostic ignored "-Wstrict-aliasing"
4395 uint16_t v16(0); uint32_t v32(0);
4396 POPU16(v16, inBlob, inOutIndex);
4398 POPU16(v16, inBlob, inOutIndex);
4400 POPU32(v32, inBlob, inOutIndex); lVal1 =
LWord(v32);
4401 POPU32(v32, inBlob, inOutIndex); lVal2 =
LWord(v32);
4402 POPU32(v32, inBlob, inOutIndex); lVal3 =
LWord(v32);
4403 POPU32(v32, inBlob, inOutIndex); lVal4 =
LWord(v32);
4404 POPU32(v32, inBlob, inOutIndex); lVal5 =
LWord(v32);
4405 POPU32(v32, inBlob, inOutIndex); lVal6 =
LWord(v32);
4418 #if defined(AJA_LINUX)
4419 #pragma GCC diagnostic pop