24 #if !defined(MSWindows)
61 inOutStr << *iter << endl;
69 inOutStr <<
xHEX0N(uint16_t(*it),2);
70 if (++it != inDIDs.end())
78 inOutStream <<
DEC(inData.size()) <<
" UWords: ";
81 inOutStream <<
HEX0N(*iter,4);
82 if (++iter != inData.end())
90 inOutStream <<
DEC(inData.size()) <<
" ULWords: ";
93 inOutStream <<
HEX0N(*iter,8);
94 if (++iter != inData.end())
102 inOutStream <<
DEC(inData.size()) <<
" ULWord64s: ";
105 inOutStream <<
HEX0N(*iter,16);
106 if (++iter != inData.end())
124 mFrameRefClockCount = 0;
125 mGlobalClockCount = 0;
126 mFrameTRSError =
false;
135 inOutStream <<
"[CRCA=" <<
DEC(mCRCTallyA)
136 <<
" CRCB=" <<
DEC(mCRCTallyB)
137 <<
" unlk=" <<
xHEX0N(mUnlockTally,8)
138 <<
" frmRefClkCnt=" <<
xHEX0N(mFrameRefClockCount,16)
139 <<
" globalClkCnt=" <<
xHEX0N(mGlobalClockCount,16)
140 <<
" frmTRS=" <<
YesNo(mFrameTRSError)
141 <<
" locked=" <<
YesNo(mLocked)
142 <<
" VPIDA=" <<
YesNo(mVPIDValidA)
143 <<
" VPIDB=" <<
YesNo(mVPIDValidB)
185 inOutStream <<
"Enabled: " <<
YesNo(mEnabled);
188 <<
"Is 4:2:0: " <<
YesNo(mPixel420) << endl
209 transitionCoefficient (0),
210 transitionSoftness (0)
216 : eCommand (inCommand),
217 channelSpec (inCrosspoint),
241 static const string sCmds [] = {
"ACInit",
"ACStart",
"ACStop",
"ACPause",
"GetAC",
"ACFrmStmp",
242 "ACFlush",
"ACPreRoll",
"ACXfer",
"ACAbort",
"ACStartAt",
243 "ACXfer1",
"ACXfer2",
"ACFrmStmp2",
"ACTask",
"ACSetActFrm"};
244 if (
size_t(
eCommand) <
sizeof(sCmds))
254 if (
bVal2) oss <<
" +RP188";
255 if (
bVal3) oss <<
" +FBFChg";
256 if (
bVal4) oss <<
" +FBOChg";
257 if (
bVal5) oss <<
" +ColCorr";
258 if (
bVal6) oss <<
" +VidProc";
259 if (
bVal7) oss <<
" +Anc";
260 if (
bVal8) oss <<
" +LTC";
282 if (
bVal1) oss <<
" +resume";
283 if (
bVal1 &&
bVal2) oss <<
" +clearDropCount";
287 if (
bVal1) oss <<
" +clearDropCount";
309 fType (inStructureType),
312 fSizeInBytes (inStructSizeInBytes),
313 fPointerSize (sizeof(int*)),
322 return inObj.
Print (inOutStream);
330 inOutStream << NTV2_4CC_AS_STRING (fHeaderTag);
332 inOutStream <<
"BAD-" <<
HEX0N(fHeaderTag,8);
334 inOutStream << NTV2_4CC_AS_STRING (fType);
336 inOutStream <<
"|BAD-" <<
HEX0N(fType,8);
337 inOutStream <<
" v" << fHeaderVersion <<
" vers=" << fVersion <<
" sz=" << fSizeInBytes;
338 return inOutStream <<
"]";
343 const char * pU32 (
reinterpret_cast<const char *
>(&in4CC));
344 ostringstream result;
347 for (
size_t charPos(0); charPos < 4; charPos++)
349 #if AJATargetBigEndian
350 const char ch(pU32[charPos]);
351 #else // little-endian:
352 const char ch(pU32[3-charPos]);
354 if (ch < ' ' || ch > 126)
355 {result <<
'.'; badTally++;}
361 result <<
" (" <<
xHEX0N(in4CC,8) <<
")";
370 inOutStream << NTV2_4CC_AS_STRING(inObj.
fTrailerTag);
383 return inObj.
Print (inOutStream);
401 if (inDumpMaxBytes > 256)
402 inDumpMaxBytes = 256;
406 for (
UWord ndx(0); ndx < inDumpMaxBytes; ndx++)
407 oss <<
HEX0N(uint16_t(pBytes[ndx]),2);
419 oss <<
HEX0N(uint16_t(
U8(ndx++)),2);
420 if (inLineBreakInterval && ndx <
int(
GetByteCount()) && ((
size_t(ndx) % inLineBreakInterval) == 0))
424 return !outStr.empty();
429 const streamsize maxAddrWidth (
sizeof(
ULWord64) * 2);
432 oss <<
OCT0N(inOffset,maxAddrWidth) <<
": ";
433 else if (inRadix == 10)
434 oss <<
DEC0N(inOffset,maxAddrWidth) <<
": ";
436 oss <<
xHEX0N(inOffset,maxAddrWidth) <<
": ";
441 const size_t inStartOffset,
442 const size_t inByteCount,
443 const size_t inRadix,
444 const size_t inBytesPerGroup,
445 const size_t inGroupsPerRow,
446 const size_t inAddressRadix,
447 const bool inShowAscii,
448 const size_t inAddrOffset)
const
452 if (inRadix != 8 && inRadix != 10 && inRadix != 16 && inRadix != 2)
454 if (inAddressRadix != 0 && inAddressRadix != 8 && inAddressRadix != 10 && inAddressRadix != 16)
456 if (inBytesPerGroup == 0)
461 size_t bytesRemaining (inByteCount ? inByteCount :
GetByteCount());
462 size_t bytesInThisGroup (0);
463 size_t groupsInThisRow (0);
464 const unsigned maxByteWidth (inRadix == 8 ? 4 : (inRadix == 10 ? 3 : (inRadix == 2 ? 8 : 2)));
465 const UByte * pBuffer (
reinterpret_cast <const UByte *
> (pInStartAddress));
466 const size_t asciiBufferSize (inShowAscii && inGroupsPerRow ? (inBytesPerGroup * inGroupsPerRow + 1) *
sizeof (
UByte) : 0);
469 if (!pInStartAddress)
473 ::memset (pAsciiBuffer, 0, asciiBufferSize);
475 if (inGroupsPerRow && inAddressRadix)
477 while (bytesRemaining)
480 inOStream <<
BIN08(*pBuffer);
481 else if (inRadix == 8)
482 inOStream <<
oOCT(uint16_t(*pBuffer));
483 else if (inRadix == 10)
484 inOStream <<
DEC0N(uint16_t(*pBuffer),maxByteWidth);
485 else if (inRadix == 16)
486 inOStream <<
HEX0N(uint16_t(*pBuffer),2);
489 pAsciiBuffer[groupsInThisRow * inBytesPerGroup + bytesInThisGroup] = isprint(*pBuffer) ? *pBuffer :
'.';
494 if (bytesInThisGroup >= inBytesPerGroup)
497 if (inGroupsPerRow && groupsInThisRow >= inGroupsPerRow)
501 inOStream <<
" " << pAsciiBuffer;
502 ::memset (pAsciiBuffer, 0, asciiBufferSize);
505 if (inAddressRadix && bytesRemaining)
506 inOStream << print_address_offset (inAddressRadix, reinterpret_cast <ULWord64> (pBuffer) -
reinterpret_cast <ULWord64> (pInStartAddress) +
ULWord64 (inAddrOffset));
511 bytesInThisGroup = 0;
515 if (bytesInThisGroup && bytesInThisGroup < inBytesPerGroup && pAsciiBuffer)
518 inOStream <<
string ((inBytesPerGroup - bytesInThisGroup) * maxByteWidth + 1,
' ');
523 if (groupsInThisRow < inGroupsPerRow && pAsciiBuffer)
524 inOStream <<
string (((inGroupsPerRow - groupsInThisRow) * inBytesPerGroup * maxByteWidth + (inGroupsPerRow - groupsInThisRow)),
' ');
526 inOStream << pAsciiBuffer;
529 else if (bytesInThisGroup && bytesInThisGroup < inBytesPerGroup)
533 delete [] pAsciiBuffer;
540 const size_t inStartOffset,
541 const size_t inByteCount,
542 const size_t inRadix,
543 const size_t inBytesPerGroup,
544 const size_t inGroupsPerRow,
545 const size_t inAddressRadix,
546 const bool inShowAscii,
547 const size_t inAddrOffset)
const
550 Dump (oss, inStartOffset, inByteCount, inRadix, inBytesPerGroup, inGroupsPerRow, inAddressRadix, inShowAscii, inAddrOffset);
551 inOutputString = oss.str();
552 return inOutputString;
573 size_t maxSize (
size_t(
GetByteCount()) /
sizeof(uint64_t));
574 if (maxSize < inU64Offset)
576 maxSize -= inU64Offset;
578 const uint64_t * pU64 (
reinterpret_cast <const uint64_t *
> (
GetHostAddress(
ULWord(inU64Offset *
sizeof(uint64_t)))));
582 if (inMaxSize && inMaxSize < maxSize)
587 outUint64s.reserve(maxSize);
588 for (
size_t ndx(0); ndx < maxSize; ndx++)
590 const uint64_t u64 (*pU64++);
597 outUint64s.reserve(0);
610 size_t maxNumU32s (
size_t(
GetByteCount()) /
sizeof(uint32_t));
611 if (maxNumU32s < inU32Offset)
613 maxNumU32s -= inU32Offset;
615 const uint32_t * pU32 (
reinterpret_cast<const uint32_t*
>(
GetHostAddress(
ULWord(inU32Offset *
sizeof(uint32_t)))));
619 if (inMaxSize && inMaxSize < maxNumU32s)
620 maxNumU32s = inMaxSize;
624 outUint32s.reserve(maxNumU32s);
625 for (
size_t ndx(0); ndx < maxNumU32s; ndx++)
627 const uint32_t u32 (*pU32++);
634 outUint32s.reserve(0);
647 size_t maxSize (
size_t(
GetByteCount()) /
sizeof(uint16_t));
648 if (maxSize < inU16Offset)
650 maxSize -= inU16Offset;
652 const uint16_t * pU16 (
reinterpret_cast <const uint16_t *
> (
GetHostAddress(
ULWord(inU16Offset *
sizeof(uint16_t)))));
656 if (inMaxSize && inMaxSize < maxSize)
661 outUint16s.reserve(maxSize);
662 for (
size_t ndx(0); ndx < maxSize; ndx++)
664 const uint16_t u16 (*pU16++);
671 outUint16s.reserve(0);
685 if (maxSize < inU8Offset)
687 maxSize -= inU8Offset;
693 if (inMaxSize && inMaxSize < maxSize)
698 outUint8s.reserve(maxSize);
699 for (
size_t ndx(0); ndx < maxSize; ndx++)
700 outUint8s.push_back(*pU8++);
705 outUint8s.reserve(0);
713 const uint8_t * pU8 (
reinterpret_cast<const uint8_t*
> (
GetHostPointer()));
719 for (
size_t ndx(0); ndx < maxSize; ndx++)
720 outU8s.push_back(*pU8++);
737 if (maxSize < inU8Offset)
739 maxSize -= inU8Offset;
745 if (inMaxSize && inMaxSize < maxSize)
750 outString.reserve(maxSize);
751 for (
size_t ndx(0); ndx < maxSize; ndx++)
753 const char c = *pU8++;
763 outString.reserve(0);
778 uint64_t * pU64 (
reinterpret_cast<uint64_t*
>(
GetHostAddress(
ULWord(inU64Offset *
sizeof(uint64_t)))));
781 if (maxU64s > inU64Offset)
782 maxU64s -= inU64Offset;
783 if (maxU64s > inU64s.size())
784 maxU64s = inU64s.size();
785 if (inU64s.size() > maxU64s)
788 for (
unsigned ndx(0); ndx < maxU64s; ndx++)
806 uint32_t * pU32 (
reinterpret_cast<uint32_t*
>(
GetHostAddress(
ULWord(inU32Offset *
sizeof(uint32_t)))));
809 if (maxU32s > inU32Offset)
810 maxU32s -= inU32Offset;
811 if (maxU32s > inU32s.size())
812 maxU32s = inU32s.size();
813 if (inU32s.size() > maxU32s)
816 for (
unsigned ndx(0); ndx < maxU32s; ndx++)
834 uint16_t * pU16 (
reinterpret_cast<uint16_t*
>(
GetHostAddress(
ULWord(inU16Offset *
sizeof(uint16_t)))));
837 if (maxU16s > inU16Offset)
838 maxU16s -= inU16Offset;
839 if (maxU16s > inU16s.size())
840 maxU16s = inU16s.size();
841 if (inU16s.size() > maxU16s)
844 for (
unsigned ndx(0); ndx < maxU16s; ndx++)
865 if (maxU8s > inU8Offset)
866 maxU8s -= inU8Offset;
867 if (maxU8s > inU8s.size())
868 maxU8s = inU8s.size();
869 if (inU8s.size() > maxU8s)
872 ::memcpy(pU8, &inU8s[0], maxU8s);
874 for (
unsigned ndx(0); ndx < maxU8s; ndx++)
876 *pU8++ = inU8s.at(ndx);
890 return inOutStream <<
"{invalid}";
896 inOutList.push_back (inRP188);
903 inOutStream << inObj.size () <<
":[";
906 inOutStream << *iter;
907 if (++iter != inObj.end ())
910 return inOutStream <<
"]";
916 inOutStream << inObj.size () <<
":[";
920 if (++iter != inObj.end ())
923 return inOutStream <<
"]";
932 if (++iter != inObj.end ())
942 inOutSet.insert (*iter);
949 return inOutStream << inObj.
acHeader
970 <<
" acFrame=" << inObj.
acFrame
971 <<
" acRP188=" << inObj.
acRP188
982 inOutStream <<
"n/a";
993 while (str.find (
' ') != string::npos)
994 str.erase (str.find (
' '), 1);
1039 inOutStream <<
"RegValues:" << inObj.size () <<
"[";
1040 while (iter != inObj.end ())
1043 const ULWord registerValue (iter->second);
1045 if (++iter != inObj.end ())
1048 return inOutStream <<
"]";
1075 if (inOutSet.find(*iter) == inOutSet.end())
1076 inOutSet.insert(*iter);
1084 NTV2VideoFormatSet::const_iterator iter (inFormats.begin ());
1086 inOStream << inFormats.size ()
1087 << (inFormats.size () == 1 ?
" video format: " :
" video format(s): ");
1089 while (iter != inFormats.end ())
1092 inOStream << (++iter == inFormats.end () ?
"" :
", ");
1104 inOStream << inFormats.size()
1105 << (inFormats.size() == 1 ?
" pixel format: " :
" pixel formats: ");
1107 while (iter != inFormats.end())
1110 inOStream << (++iter == inFormats.end() ?
"" :
", ");
1120 inOutSet.insert(*iter);
1130 inOStream << inStandards.size ()
1131 << (inStandards.size () == 1 ?
" standard: " :
" standards: ");
1133 while (iter != inStandards.end ())
1136 inOStream << (++iter == inStandards.end () ?
"" :
", ");
1146 inOutSet.insert(*iter);
1155 inOStream << inGeometries.size ()
1156 << (inGeometries.size () == 1 ?
" geometry: " :
" geometries: ");
1157 while (iter != inGeometries.end ())
1160 inOStream << (++iter == inGeometries.end () ?
"" :
", ");
1169 inOutSet.insert(*iter);
1178 inOStream << inSet.size()
1179 << (inSet.size() == 1 ?
" input: " :
" inputs: ");
1180 while (iter != inSet.end())
1183 inOStream << (++iter == inSet.end() ?
"" :
", ");
1192 inOutSet.insert (*iter);
1200 inOStream << inSet.size()
1201 << (inSet.size() == 1 ?
" output: " :
" outputs: ");
1202 while (iter != inSet.end())
1205 inOStream << (++iter == inSet.end() ?
"" :
", ");
1214 inOutSet.insert(*iter);
1227 if (outFormats.find(*fit) == outFormats.end())
1228 outFormats.insert(*fit);
1238 if (usedFormats.find(pf) == usedFormats.end())
1239 outFormats.insert(pf);
1245 outStandards.clear();
1252 if (outStandards.find(*sit) == outStandards.end())
1253 outStandards.insert(*sit);
1263 if (usedStandards.find(st) == usedStandards.end())
1264 outStandards.insert(st);
1283 outFormats.insert(vf);
1285 catch (
const std::bad_alloc &)
1293 NTV2_ASSERT ((isOkay && !outFormats.empty()) || (!isOkay && outFormats.empty()));
1308 outFormats.insert(pixelFormat);
1310 catch (
const std::bad_alloc &)
1317 NTV2_ASSERT ((isOkay && !outFormats.empty() ) || (!isOkay && outFormats.empty() ));
1326 outStandards.clear();
1333 outStandards.insert(
std);
1342 outGeometries.clear();
1356 outInputSources.clear();
1365 outInputSources.insert(src);
1375 outOutputDests.clear();
1378 for (
size_t ndx(0); ndx < 10; ndx++)
1385 outOutputDests.insert(dst);
1394 << (inSet.size() == 1 ?
" rate: " :
" rates: ");
1395 while (it != inSet.end())
1398 oss << (++it == inSet.end() ?
"" :
", ");
1406 if (inOutSet.find(*it) == inOutSet.end())
1407 inOutSet.insert(*it);
1420 outRates.insert(fr);
1428 return inRun.
Print(inOutStrm);
1435 static const char * sStateStrings [] = {
"Disabled",
"Initializing",
"Starting",
"Paused",
"Stopping",
"Running",
"StartingAtTime",
AJA_NULL};
1437 return string (sStateStrings [inState]);
1479 return it != sFGWdths.end() ? it->second : 0;
1505 return it != sFGHghts.end() ? it->second : 0;
1509 static const string sSegXferUnits[] = {
"",
" U8",
" U16",
"",
" U32",
"",
"",
"",
" U64",
""};
1514 return inStrm <<
"(invalid)";
1521 inStrm <<
DEC(getSegmentCount()) <<
" x " <<
DEC(getSegmentLength())
1523 if (getSourceOffset())
1524 inStrm <<
" srcOff=" <<
xHEX0N(getSourceOffset(),8);
1525 if (getSegmentCount() > 1)
1526 inStrm <<
" srcSpan=" <<
xHEX0N(getSourcePitch(),8) << (isSourceBottomUp()?
" VF":
"");
1527 if (getDestOffset())
1528 inStrm <<
" dstOff=" <<
xHEX0N(getDestOffset(),8);
1529 if (getSegmentCount() > 1)
1530 inStrm <<
" dstSpan=" <<
xHEX0N(getDestPitch(),8) << (isDestBottomUp()?
" VF":
"");
1531 inStrm <<
" totElm=" <<
DEC(getTotalElements()) <<
" totByt=" <<
xHEX0N(getTotalBytes(),8);
1538 static string var(
"segInfo");
1540 string units(
"\t// bytes");
1544 oss <<
"NTV2SegmentedXferInfo " << var <<
";" << endl;
1545 if (getElementLength() > 1)
1548 oss << var <<
".setElementLength(" << getElementLength() <<
");" << endl;
1550 oss << var <<
".setSegmentCount(" <<
DEC(getSegmentCount()) <<
");" << endl;
1551 oss << var <<
".setSegmentLength(" <<
DEC(getSegmentLength()) <<
");" << units << endl;
1552 if (getSourceOffset())
1553 oss << var <<
".setSourceOffset(" <<
DEC(getSourceOffset()) <<
");" << units << endl;
1554 oss << var <<
".setSourcePitch(" <<
DEC(getSourcePitch()) <<
");" << units << endl;
1555 if (isSourceBottomUp())
1556 oss << var <<
".setSourceDirection(false);" << endl;
1557 if (getDestOffset())
1558 oss << var <<
".setDestOffset(" <<
DEC(getDestOffset()) <<
");" << units << endl;
1560 oss << var <<
".setDestPitch(" <<
DEC(getDestPitch()) <<
");" << units << endl;
1561 if (isDestBottomUp())
1562 oss << var <<
".setDestDirection(false);" << endl;
1570 if (getSegmentCount() == 1)
1572 if (inElementOffset >= getSourceOffset())
1573 if (inElementOffset < getSourceOffset()+getSegmentLength())
1577 ULWord offset(getSourceOffset());
1578 for (
ULWord seg(0); seg < getSegmentCount(); seg++)
1580 if (inElementOffset < offset)
1582 if (inElementOffset < offset+getSegmentLength())
1584 offset += getSourcePitch();
1591 if (getElementLength() != inRHS.getElementLength())
1594 if (getSegmentCount() != inRHS.getSegmentCount())
1596 if (getSegmentLength() != inRHS.getSegmentLength())
1598 if (getSourceOffset() != inRHS.getSourceOffset())
1600 if (getSourcePitch() != inRHS.getSourcePitch())
1602 if (getDestOffset() != inRHS.getDestOffset())
1604 if (getDestPitch() != inRHS.getDestPitch())
1613 mElementsPerSegment = 0;
1614 mInitialSrcOffset = 0;
1615 mInitialDstOffset = 0;
1616 mSrcElementsPerRow = 0;
1617 mDstElementsPerRow = 0;
1624 std::swap(mSrcElementsPerRow, mDstElementsPerRow);
1625 std::swap(mInitialSrcOffset, mInitialDstOffset);
1626 const bool srcNormal(this->isSourceTopDown()), dstNormal(this->isDestTopDown());
1634 fByteCount (
ULWord(pInUserPointer ? inByteCount : 0)),
1636 #if defined (AJAMac)
1637 fKernelSpacePtr (0),
1649 : fUserSpacePtr (0),
1652 #if defined (AJAMac)
1653 fKernelSpacePtr (0),
1667 : fUserSpacePtr (0),
1670 #if defined (AJAMac)
1671 fKernelSpacePtr (0),
1691 fByteCount =
ULWord(inNewByteCount);
1720 const size_t loopCount(
GetByteCount() /
sizeof(uint64_t));
1723 for (
size_t ndx(0); ndx < loopCount; ndx++)
1732 const size_t loopCount(
GetByteCount() /
sizeof(uint32_t));
1735 for (
size_t ndx(0); ndx < loopCount; ndx++)
1744 const size_t loopCount(
GetByteCount() /
sizeof(uint16_t));
1747 for (
size_t ndx(0); ndx < loopCount; ndx++)
1757 fByteCount =
ULWord(pInUserPointer ? inByteCount : 0);
1759 return (pInUserPointer && inByteCount) || (!pInUserPointer && !inByteCount);
1765 return Set(pInUserPointer, inByteCount) &&
Fill(inValue);
1787 {pBuffer =
new UByte[inByteCount];}
1788 catch (
const std::bad_alloc &)
1790 if (pBuffer &&
Set(pBuffer, inByteCount))
1835 pBytes += inByteOffset;
1871 const ULWord inSrcByteOffset,
const ULWord inDstByteOffset,
const ULWord inByteCount)
1875 if (inSrcByteOffset + inByteCount > inBuffer.
GetByteCount())
1880 const UByte * pSrc (inBuffer);
1881 pSrc += inSrcByteOffset;
1883 UByte * pDst (*
this);
1884 pDst += inDstByteOffset;
1886 ::memcpy (pDst, pSrc, inByteCount);
1893 if (!inXferInfo.isValid() || inSrcBuffer.
IsNULL() ||
IsNULL())
1897 LWord srcOffset (
LWord(inXferInfo.getSourceOffset() * inXferInfo.getElementLength()));
1898 LWord dstOffset (
LWord(inXferInfo.getDestOffset() * inXferInfo.getElementLength()));
1899 LWord srcPitch (
LWord(inXferInfo.getSourcePitch() * inXferInfo.getElementLength()));
1900 LWord dstPitch (
LWord(inXferInfo.getDestPitch() * inXferInfo.getElementLength()));
1901 const LWord bytesPerSeg (inXferInfo.getSegmentLength() * inXferInfo.getElementLength());
1902 if (inXferInfo.isSourceBottomUp())
1903 srcPitch = 0 - srcPitch;
1904 if (inXferInfo.isDestBottomUp())
1905 dstPitch = 0 - dstPitch;
1906 for (
ULWord segNdx(0); segNdx < inXferInfo.getSegmentCount(); segNdx++)
1910 if (!pSrc)
return false;
1911 if (!pDst)
return false;
1916 ::memcpy (pDst, pSrc,
size_t(bytesPerSeg));
1917 srcOffset += srcPitch;
1918 dstOffset += dstPitch;
1928 const string newline(
"\n"), tab(
"\t");
1934 for (
size_t ndx(0); ndx < str.size(); ndx++)
1944 for (
size_t srcNdx(0), dstNdx(0); srcNdx < str.size(); srcNdx += 2)
1958 if (fFlags != inBuffer.fFlags)
1964 fUserSpacePtr = inBuffer.fUserSpacePtr;
1965 inBuffer.fUserSpacePtr = tmp;
1981 const uint8_t * pSrchData (inValue);
1982 const uint8_t * pMyData (*
this);
1986 if (!::memcmp(pMyData, pSrchData, srchByteCount))
1987 outOffsets.insert(offset);
1990 }
while (offset < maxOffset);
2002 if (inByteOffset >= totalBytes)
2005 totalBytes -= inByteOffset;
2007 ULWord byteCount(inByteCount);
2008 if (byteCount > totalBytes)
2009 byteCount = totalBytes;
2014 const UByte * pByte1 (*
this);
2015 const UByte * pByte2 (inBuffer);
2016 pByte1 += inByteOffset;
2017 pByte2 += inByteOffset;
2018 #if !defined(NTV2BUFFER_NO_MEMCMP)
2019 return ::memcmp (pByte1, pByte2, byteCount) == 0;
2020 #else // NTV2BUFFER_NO_MEMCMP
2021 ULWord offset(inByteOffset);
2024 if (*pByte1 != *pByte2)
2026 cerr <<
"## ERROR: IsContentEqual: miscompare at offset " <<
xHEX0N(offset,8)
2027 <<
" (" <<
DEC(offset) <<
"): " <<
xHEX0N(
UWord(*pByte1),2) <<
" != "
2029 <<
DEC(byteCount) <<
") bytes left to compare" << endl;
2037 #endif // NTV2BUFFER_NO_MEMCMP
2042 if (byteOffset == 0xFFFFFFFF)
2049 {byteOffset = 0xFFFFFFFF;
return true;}
2052 if (byteOffset >= totalBytesToCompare)
2054 totalBytesToCompare -= byteOffset;
2056 const UByte * pByte1 (*
this);
2057 const UByte * pByte2 (inBuffer);
2058 while (totalBytesToCompare)
2060 if (pByte1[byteOffset] != pByte2[byteOffset])
2062 totalBytesToCompare--;
2065 byteOffset = 0xFFFFFFFF;
2071 outByteOffsetFirst = outByteOffsetLast =
GetByteCount ();
2084 outByteOffsetFirst = 0;
2087 if (*pByte1 != *pByte2)
2091 outByteOffsetFirst++;
2093 if (outByteOffsetFirst == 0)
2098 if (*pByte1 == *pByte2)
2102 outByteOffsetFirst++;
2105 outByteOffsetFirst--;
2115 while (--outByteOffsetLast)
2117 if (*pByte1 != *pByte2)
2125 while (outByteOffsetLast)
2127 if (*pByte1 == *pByte2)
2131 outByteOffsetLast--;
2134 outByteOffsetLast++;
2135 if (outByteOffsetLast <= outByteOffsetFirst)
2136 cerr <<
"## WARNING: GetRingChangedByteRange: last " << outByteOffsetLast <<
" <= first " << outByteOffsetFirst <<
" in wrap condition" << endl;
2137 const ULWord tmp (outByteOffsetLast);
2138 outByteOffsetLast = outByteOffsetFirst;
2139 outByteOffsetFirst = tmp;
2140 if (outByteOffsetLast >= outByteOffsetFirst)
2141 cerr <<
"## WARNING: GetRingChangedByteRange: last " << outByteOffsetLast <<
" >= first " << outByteOffsetFirst <<
" in wrap condition" << endl;
2157 const bool result (inNewSize && (!(inNewSize & (inNewSize - 1))));
2165 #if defined(MSWindows) || defined(AJABareMetal)
2166 return AJA_PAGE_SIZE;
2168 return size_t(::getpagesize());
2176 acRequestedFrame (0),
2177 acAudioClockTimeStamp (0),
2178 acAudioExpectedAddress (0),
2179 acAudioInStartAddress (0),
2180 acAudioInStopAddress (0),
2181 acAudioOutStopAddress (0),
2182 acAudioOutStartAddress (0),
2183 acTotalBytesTransferred (0),
2188 acCurrentFrameTime (0),
2189 acAudioClockCurrentTime (0),
2190 acCurrentAudioExpectedAddress (0),
2191 acCurrentAudioStartAddress (0),
2192 acCurrentFieldCount (0),
2193 acCurrentLineCount (0),
2195 acCurrentUserCookie (0),
2204 : acHeader (inObj.acHeader),
2205 acFrameTime (inObj.acFrameTime),
2206 acRequestedFrame (inObj.acRequestedFrame),
2207 acAudioClockTimeStamp (inObj.acAudioClockTimeStamp),
2208 acAudioExpectedAddress (inObj.acAudioExpectedAddress),
2209 acAudioInStartAddress (inObj.acAudioInStartAddress),
2210 acAudioInStopAddress (inObj.acAudioInStopAddress),
2211 acAudioOutStopAddress (inObj.acAudioOutStopAddress),
2212 acAudioOutStartAddress (inObj.acAudioOutStartAddress),
2213 acTotalBytesTransferred (inObj.acTotalBytesTransferred),
2214 acStartSample (inObj.acStartSample),
2215 acCurrentTime (inObj.acCurrentTime),
2216 acCurrentFrame (inObj.acCurrentFrame),
2217 acCurrentFrameTime (inObj.acCurrentFrameTime),
2218 acAudioClockCurrentTime (inObj.acAudioClockCurrentTime),
2219 acCurrentAudioExpectedAddress (inObj.acCurrentAudioExpectedAddress),
2220 acCurrentAudioStartAddress (inObj.acCurrentAudioStartAddress),
2221 acCurrentFieldCount (inObj.acCurrentFieldCount),
2222 acCurrentLineCount (inObj.acCurrentLineCount),
2223 acCurrentReps (inObj.acCurrentReps),
2224 acCurrentUserCookie (inObj.acCurrentUserCookie),
2225 acFrame (inObj.acFrame),
2226 acRP188 (inObj.acRP188),
2227 acTrailer (inObj.acTrailer)
2250 for (
ULWord ndx (0); ndx < numRP188s; ndx++)
2251 outValues << pArray [ndx];
2270 outTimeCode = pArray [inTCIndex];
2278 outTimeCodes.clear();
2294 outTimeCodes[tcIndex] = tc;
2296 outTimeCodes[tcIndex] = tc;
2306 (
void)inSDIInputIndex0;
2314 if (!pArray || !numRP188s)
2319 if (
ULWord(inTCNdx) >= numRP188s)
2322 pArray[inTCNdx] = inTimecode;
2470 if (mInStatistics.
IsNULL())
2485 if (numElements != 8)
2487 if (inSDIInputIndex0 >= numElements)
2489 outStatus = pArray[inSDIInputIndex0];
2501 if (numElements != 8)
2503 if (inSDIInputIndex0 >= numElements)
2505 return pArray[inSDIInputIndex0];
2511 inOutStream << mHeader <<
", " << mInStatistics <<
", " << mTrailer;
return inOutStream;
2518 acTransferFrame (0),
2520 acFramesProcessed (0),
2521 acFramesDropped (0),
2523 acAudioTransferSize (0),
2524 acAudioStartSample (0),
2525 acAncTransferSize (0),
2526 acAncField2TransferSize (0)
2535 acCrosspoint (inCrosspoint),
2540 acRDTSCStartTime (0),
2541 acAudioClockStartTime (0),
2542 acRDTSCCurrentTime (0),
2543 acAudioClockCurrentTime (0),
2544 acFramesProcessed (0),
2545 acFramesDropped (0),
2652 if (inIndexNum == 0)
2669 case 13: oss << (
WithRP188() ?
"Yes" :
"No");
break;
2670 case 14: oss << (
WithLTC() ?
"Yes" :
"No");
break;
2674 case 18: oss << (
WithVidProc() ?
"Yes" :
"No");
break;
2677 case 21: oss << (
IsFieldMode() ?
"Yes" :
"No");
break;
2680 else if (inIndexNum < 22)
2690 << (inObj.
IsInput() ?
"Input " : (inObj.
IsOutput() ?
"Output" :
"*BAD* "))
2699 << setw(10) << (inObj.
WithRP188() ?
"+RP188" :
"-RP188")
2700 << setw(10) << (inObj.
WithLTC() ?
"+LTC" :
"-LTC")
2701 << setw(10) << (inObj.
WithFBFChange() ?
"+FBFchg" :
"-FBFchg")
2702 << setw(10) << (inObj.
WithFBOChange() ?
"+FBOchg" :
"-FBOchg")
2704 << setw(10) << (inObj.
WithVidProc() ?
"+VidProc" :
"-VidProc")
2705 << setw(10) << (inObj.
WithCustomAnc() ?
"+AncData" :
"-AncData")
2707 << setw(10) << (inObj.
IsFieldMode() ?
"+FldMode" :
"-FldMode");
2720 Set (inNumSegments, inNumActiveBytesPerRow, inHostBytesPerRow, inDeviceBytesPerRow);
2746 ccSaturationValue (0)
2783 acTransferStatus (),
2785 acInVideoDMAOffset (0),
2786 acInSegmentedDMAInfo (),
2787 acColorCorrection (),
2792 acPeerToPeerFlags (0),
2793 acFrameRepeatCount (1),
2794 acDesiredFrame (-1),
2806 ULWord * pInANCF2Buffer,
const ULWord inANCF2ByteCount)
2808 acVideoBuffer (pInVideoBuffer, inVideoByteCount),
2809 acAudioBuffer (pInAudioBuffer, inAudioByteCount),
2810 acANCBuffer (pInANCBuffer, inANCByteCount),
2811 acANCField2Buffer (pInANCF2Buffer, inANCF2ByteCount),
2813 acTransferStatus (),
2815 acInVideoDMAOffset (0),
2816 acInSegmentedDMAInfo (),
2817 acColorCorrection (),
2822 acPeerToPeerFlags (0),
2823 acFrameRepeatCount (1),
2824 acDesiredFrame (-1),
2840 ULWord * pInAudioBuffer,
const ULWord inAudioByteCount,
2842 ULWord * pInANCF2Buffer,
const ULWord inANCF2ByteCount)
2847 &&
SetAncBuffers (pInANCBuffer, inANCByteCount, pInANCF2Buffer, inANCF2ByteCount);
2888 for (
UWord ndx (0); ndx <
UWord(maxNumValues); ndx++)
2910 pArray[inTCIndex] = inTimeCode;
2924 for (
ULWord tcIndex(0); tcIndex < maxNumValues; tcIndex++)
2928 pArray[tcIndex] = inTimeCode;
2951 const ULWord inHostBytesPerRow,
const ULWord inDeviceBytesPerRow)
3126 mInNumRegisters (
ULWord (inRegisterNumbers.size ())),
3127 mOutNumRegisters (0)
3136 mInNumRegisters (
ULWord (inRegReads.size ())),
3137 mOutNumRegisters (0)
3147 mInNumRegisters =
ULWord(inRegisterNumbers.size());
3148 mOutNumRegisters = 0;
3149 bool result ( mInRegisters.
Allocate(mInNumRegisters *
sizeof(
ULWord))
3156 ULWord * pRegArray(mInRegisters);
3162 pRegArray[ndx++] = *iter;
3169 if (!mInNumRegisters)
3176 const ULWord * pRegNums(mInRegisters);
3177 for (
ULWord ndx(0); ndx < mInNumRegisters; ndx++)
3178 if (outRegNums.find(pRegNums[ndx]) == outRegNums.end())
3179 outRegNums.insert(pRegNums[ndx]);
3187 outGoodRegNums.clear();
3188 if (!mOutGoodRegisters)
3190 if (!mOutNumRegisters)
3192 if (mOutNumRegisters > mInNumRegisters)
3195 const ULWord * pRegArray (mOutGoodRegisters);
3196 for (
ULWord ndx(0); ndx < mOutNumRegisters; ndx++)
3197 outGoodRegNums.insert(pRegArray[ndx]);
3204 outBadRegNums.clear();
3210 if (reqRegNums == goodRegNums)
3214 std::set_difference (reqRegNums.begin(), reqRegNums.end(),
3215 goodRegNums.begin(), goodRegNums.end(),
3216 std::inserter(outBadRegNums, outBadRegNums.begin()));
3222 if (!mOutGoodRegisters)
3224 if (!mOutNumRegisters)
3226 if (mOutNumRegisters > mInNumRegisters)
3232 const ULWord * pRegArray (mOutGoodRegisters);
3233 ULWord * pValArray (mOutValues);
3234 for (
ULWord ndx(0); ndx < mOutNumRegisters; ndx++)
3235 if (pRegArray[ndx] == inRegNum)
3237 pValArray[ndx] = inValue;
3248 if (!mOutGoodRegisters)
3250 if (!mOutNumRegisters)
3252 if (mOutNumRegisters > mInNumRegisters)
3259 const ULWord * pRegArray (mOutGoodRegisters);
3260 const ULWord * pValArray (mOutValues);
3261 for (
ULWord ndx(0); ndx < mOutNumRegisters; ndx++)
3263 outValues [pRegArray[ndx]] = pValArray[ndx];
3264 #if 0 // Fake KONAIP25G from C4412G (see also CNTV2XXXXDriverInterface::ReadRegister):
3268 outValues [pRegArray[ndx]] = 0x0A03FAD9;
3281 if (outValues.empty())
3286 #if 0 // Fake KONAIP25G from C4412G (see also CNTV2XXXXDriverInterface::ReadRegister):
3292 outValues.push_back(regInfo);
3298 uint32_t missingTally(0);
3302 if (mapIter == regValMap.end())
3304 it->registerValue = mapIter->second;
3305 #if 0 // Fake KONAIP25G from C4412G (see also CNTV2XXXXDriverInterface::ReadRegister):
3309 it->registerValue = 0x0A03FAD9;
3312 return !missingTally;
3319 inOutStream << mHeader <<
", numRegs=" << mInNumRegisters <<
", inRegs=" << mInRegisters <<
", outNumGoodRegs=" << mOutNumRegisters
3320 <<
", outGoodRegs=" << mOutGoodRegisters <<
", outValues=" << mOutValues <<
", " << mTrailer;
3327 mInNumRegisters (
ULWord(inRegWrites.size())),
3351 pBadRegIndexes[ndx] = 0;
3353 pRegInfoArray[ndx++] = *it;
3364 outFailedRegWrites.clear();
3370 outRegWrites.clear();
3379 outRegWrites.push_back(pRegInfos[ndx]);
3392 if (pBadRegIndexes && maxNumBadRegIndexes && pRegInfoArray && maxNumRegInfos &&
mOutNumFailures)
3395 for (
UWord num(0); num < maxNumBadRegIndexes; num++)
3397 const UWord badRegIndex (pBadRegIndexes[num]);
3398 if (badRegIndex < maxNumRegInfos)
3400 const NTV2RegInfo & badRegInfo (pRegInfoArray[badRegIndex]);
3401 oss <<
"Failure " << num <<
": " << badRegInfo << endl;
3411 typedef std::pair <ULWord, ULWord> ULWordPair;
3412 typedef std::pair <ULWordPair, ULWordPair> ULWordPairs;
3435 const bool badName (regName.find(
' ') != string::npos);
3438 oss <<
"theDevice.WriteRegister (";
3475 for (NTV2ULWordVector::const_iterator it(inObj.begin()); it != inObj.end(); ++it)
3476 inOutStream <<
" " <<
HEX0N(*it,8);
3483 inOutStream << (inCompact ?
"Ch[" :
"[");
3487 inOutStream <<
DEC(*it+1);
3490 if (++it != inObj.end())
3491 inOutStream << (inCompact ?
"|" :
",");
3493 return inOutStream <<
"]";
3497 { ostringstream oss;
3504 inOutStream << (inCompact ?
"Ch{" :
"{");
3508 inOutStream <<
DEC(*it+1);
3511 if (++it != inObj.end())
3512 inOutStream << (inCompact ?
"|" :
",");
3514 return inOutStream <<
"}";
3518 { ostringstream oss;
3545 result.push_back(ch);
3553 result.push_back(*it);
3559 inOutStream << (inCompact ?
"AudSys{" :
"{");
3563 inOutStream <<
DEC(*it+1);
3566 if (++it != inObj.end())
3567 inOutStream << (inCompact ?
"|" :
",");
3569 return inOutStream <<
"}";
3573 { ostringstream oss;
3583 result.insert(audSys);
3591 if (result.find(it->registerNumber) == result.end())
3592 result.insert(it->registerNumber);
3599 if (iter->registerNumber == inRegNum)
3601 return inRegInfos.end();
3607 return inObj.
Print(inOutStream);
3613 inOutStream << inObj.size () <<
" regs:" << endl;
3615 inOutStream << *iter << endl;
3622 mIsWriting (inDoWrite),
3628 *pRegInfo = inBankSelect;
3631 *pRegInfo = inOutRegInfo;
3644 if (
ULWord(inIndex0) < maxNum)
3645 result = pRegInfos[inIndex0];
3657 if (
mInBankInfos) oss << *pBankRegInfo;
else oss <<
"-";
3658 oss <<
" regInfos=";
3659 if (
mInRegInfos) oss << *pRegInfo;
else oss <<
"-";
3667 mIsWriting (inDoWrite),
3668 mVirtualData (inVirtualData, inVirtualDataSize)
3686 #define AsU8Ref(_x_) reinterpret_cast<uint8_t&>(_x_)
3687 #define AsU16Ref(_x_) reinterpret_cast<uint16_t&>(_x_)
3688 #define AsU32Ref(_x_) reinterpret_cast<uint32_t&>(_x_)
3689 #define AsU64Ref(_x_) reinterpret_cast<uint64_t&>(_x_)
3695 PUSHU32(fHeaderVersion, outBlob);
3697 PUSHU32(fSizeInBytes, outBlob);
3698 PUSHU32(fPointerSize, outBlob);
3700 PUSHU32(fResultStatus, outBlob);
3706 POPU32(fHeaderTag, inBlob, inOutIndex);
3707 POPU32(fType, inBlob, inOutIndex);
3708 POPU32(fHeaderVersion, inBlob, inOutIndex);
3709 POPU32(fVersion, inBlob, inOutIndex);
3710 POPU32(fSizeInBytes, inBlob, inOutIndex);
3711 POPU32(fPointerSize, inBlob, inOutIndex);
3712 POPU32(fOperation, inBlob, inOutIndex);
3713 POPU32(fResultStatus, inBlob, inOutIndex);
3719 PUSHU32(fTrailerVersion, outBlob);
3720 PUSHU32(fTrailerTag, outBlob);
3726 POPU32(fTrailerVersion, inBlob, inOutIndex);
3727 POPU32(fTrailerTag, inBlob, inOutIndex);
3743 ULWord byteCount(0), flags(0);
3744 POPU32(byteCount, inBlob, inOutIndex);
3745 POPU32(flags, inBlob, inOutIndex);
3748 if ((inOutIndex + byteCount) > inBlob.size())
3750 for (
ULWord cnt(0); cnt < byteCount; cnt++)
3751 U8(
int(cnt)) = inBlob.at(inOutIndex++);
3757 const size_t totBytes (mHeader.GetSizeInBytes()
3758 + mInRegisters.GetByteCount() + mOutGoodRegisters.GetByteCount() + mOutValues.GetByteCount());
3759 if (outBlob.capacity() < totBytes)
3760 outBlob.reserve(totBytes);
3763 mInRegisters.ByteSwap32();
3764 mOutGoodRegisters.ByteSwap32();
3765 mOutValues.ByteSwap32();
3767 bool ok = mHeader.RPCEncode(outBlob);
3768 PUSHU32(mInNumRegisters, outBlob);
3769 ok &= mInRegisters.RPCEncode(outBlob);
3770 PUSHU32(mOutNumRegisters, outBlob);
3771 ok &= mOutGoodRegisters.RPCEncode(outBlob)
3772 && mOutValues.RPCEncode(outBlob)
3773 && mTrailer.RPCEncode(outBlob);
3776 mInRegisters.ByteSwap32();
3777 mOutGoodRegisters.ByteSwap32();
3778 mOutValues.ByteSwap32();
3785 bool ok = mHeader.RPCDecode(inBlob, inOutIndex);
3786 if (!ok)
return false;
3787 POPU32(mInNumRegisters, inBlob, inOutIndex);
3788 ok &= mInRegisters.RPCDecode(inBlob, inOutIndex);
3789 POPU32(mOutNumRegisters, inBlob, inOutIndex);
3790 ok &= mOutGoodRegisters.RPCDecode(inBlob, inOutIndex);
3791 ok &= mOutValues.RPCDecode(inBlob, inOutIndex);
3792 ok &= mTrailer.RPCDecode(inBlob, inOutIndex);
3795 mInRegisters.ByteSwap32();
3796 mOutGoodRegisters.ByteSwap32();
3797 mOutValues.ByteSwap32();
3804 const size_t totBytes (mHeader.GetSizeInBytes()
3805 + mInRegInfos.GetByteCount() + mOutBadRegIndexes.GetByteCount());
3806 if (outBlob.capacity() < totBytes)
3807 outBlob.reserve(totBytes);
3810 mInRegInfos.ByteSwap32();
3811 mOutBadRegIndexes.ByteSwap32();
3813 bool ok = mHeader.RPCEncode(outBlob);
3814 PUSHU32(mInNumRegisters, outBlob);
3815 ok &= mInRegInfos.RPCEncode(outBlob);
3816 PUSHU32(mOutNumFailures, outBlob);
3817 ok &= mOutBadRegIndexes.RPCEncode(outBlob)
3818 && mTrailer.RPCEncode(outBlob);
3821 mInRegInfos.ByteSwap32();
3822 mOutBadRegIndexes.ByteSwap16();
3829 bool ok = mHeader.RPCDecode(inBlob, inOutIndex);
3830 POPU32(mInNumRegisters, inBlob, inOutIndex);
3831 ok &= mInRegInfos.RPCDecode(inBlob, inOutIndex);
3832 POPU32(mOutNumFailures, inBlob, inOutIndex);
3833 ok &= mOutBadRegIndexes.RPCDecode(inBlob, inOutIndex);
3834 ok &= mTrailer.RPCDecode(inBlob, inOutIndex);
3837 mInRegInfos.ByteSwap32();
3838 mOutBadRegIndexes.ByteSwap16();
3845 const size_t totBytes (mHeader.GetSizeInBytes()
3846 + mInBankInfos.GetByteCount() + mInRegInfos.GetByteCount());
3847 if (outBlob.capacity() < totBytes)
3848 outBlob.reserve(totBytes);
3851 mInBankInfos.ByteSwap32();
3852 mInRegInfos.ByteSwap32();
3854 bool ok = mHeader.RPCEncode(outBlob);
3856 ok &= mInBankInfos.RPCEncode(outBlob);
3857 ok &= mInRegInfos.RPCEncode(outBlob)
3858 && mTrailer.RPCEncode(outBlob);
3861 mInBankInfos.ByteSwap32();
3862 mInRegInfos.ByteSwap32();
3869 bool ok = mHeader.RPCDecode(inBlob, inOutIndex);
3870 POPU32(mIsWriting, inBlob, inOutIndex);
3871 ok &= mInBankInfos.RPCDecode(inBlob, inOutIndex);
3872 ok &= mInRegInfos.RPCDecode(inBlob, inOutIndex);
3873 ok &= mTrailer.RPCDecode(inBlob, inOutIndex);
3876 mInBankInfos.ByteSwap32();
3877 mInRegInfos.ByteSwap32();
3884 const size_t totBytes (acHeader.GetSizeInBytes());
3885 if (outBlob.capacity() < totBytes)
3886 outBlob.reserve(totBytes);
3887 bool ok = acHeader.RPCEncode(outBlob);
3893 PUSHU64(acRDTSCStartTime, outBlob);
3894 PUSHU64(acAudioClockStartTime, outBlob);
3895 PUSHU64(acRDTSCCurrentTime, outBlob);
3896 PUSHU64(acAudioClockCurrentTime, outBlob);
3897 PUSHU32(acFramesProcessed, outBlob);
3898 PUSHU32(acFramesDropped, outBlob);
3899 PUSHU32(acBufferLevel, outBlob);
3900 PUSHU32(acOptionFlags, outBlob);
3902 ok &= acTrailer.RPCEncode(outBlob);
3907 { uint16_t v16(0); uint32_t v32(0);
3908 bool ok = acHeader.RPCDecode(inBlob, inOutIndex);
3909 POPU16(v16, inBlob, inOutIndex);
3911 POPU16(v16, inBlob, inOutIndex);
3913 POPU32(v32, inBlob, inOutIndex);
3914 acStartFrame =
LWord(v32);
3915 POPU32(v32, inBlob, inOutIndex);
3916 acEndFrame =
LWord(v32);
3917 POPU32(v32, inBlob, inOutIndex);
3918 acActiveFrame =
LWord(v32);
3919 POPU64(acRDTSCStartTime, inBlob, inOutIndex);
3920 POPU64(acAudioClockStartTime, inBlob, inOutIndex);
3921 POPU64(acRDTSCCurrentTime, inBlob, inOutIndex);
3922 POPU64(acAudioClockCurrentTime, inBlob, inOutIndex);
3923 POPU32(acFramesProcessed, inBlob, inOutIndex);
3924 POPU32(acFramesDropped, inBlob, inOutIndex);
3925 POPU32(acBufferLevel, inBlob, inOutIndex);
3926 POPU32(acOptionFlags, inBlob, inOutIndex);
3927 POPU16(v16, inBlob, inOutIndex);
3929 ok &= acTrailer.RPCDecode(inBlob, inOutIndex);
3935 const size_t totBytes (acHeader.GetSizeInBytes());
3936 if (outBlob.capacity() < totBytes)
3937 outBlob.reserve(totBytes);
3938 bool ok = acHeader.RPCEncode(outBlob);
3940 PUSHU32(acRequestedFrame, outBlob);
3941 PUSHU64(acAudioClockTimeStamp, outBlob);
3942 PUSHU32(acAudioExpectedAddress, outBlob);
3943 PUSHU32(acAudioInStartAddress, outBlob);
3944 PUSHU32(acAudioInStopAddress, outBlob);
3945 PUSHU32(acAudioOutStopAddress, outBlob);
3946 PUSHU32(acAudioOutStartAddress, outBlob);
3947 PUSHU32(acTotalBytesTransferred, outBlob);
3948 PUSHU32(acStartSample, outBlob);
3950 ok &= acTimeCodes.RPCEncode(outBlob);
3952 PUSHU32(acCurrentFrame, outBlob);
3954 PUSHU64(acAudioClockCurrentTime, outBlob);
3955 PUSHU32(acCurrentAudioExpectedAddress, outBlob);
3956 PUSHU32(acCurrentAudioStartAddress, outBlob);
3957 PUSHU32(acCurrentFieldCount, outBlob);
3958 PUSHU32(acCurrentLineCount, outBlob);
3959 PUSHU32(acCurrentReps, outBlob);
3960 PUSHU64(acCurrentUserCookie, outBlob);
3962 PUSHU32(acRP188.fDBB, outBlob);
3963 PUSHU32(acRP188.fLo, outBlob);
3964 PUSHU32(acRP188.fHi, outBlob);
3965 ok &= acTrailer.RPCEncode(outBlob);
3971 bool ok = acHeader.RPCDecode(inBlob, inOutIndex);
3972 POPU64(v64, inBlob, inOutIndex);
3974 POPU32(acRequestedFrame, inBlob, inOutIndex);
3975 POPU64(acAudioClockTimeStamp, inBlob, inOutIndex);
3976 POPU32(acAudioExpectedAddress, inBlob, inOutIndex);
3977 POPU32(acAudioInStartAddress, inBlob, inOutIndex);
3978 POPU32(acAudioInStopAddress, inBlob, inOutIndex);
3979 POPU32(acAudioOutStopAddress, inBlob, inOutIndex);
3980 POPU32(acAudioOutStartAddress, inBlob, inOutIndex);
3981 POPU32(acTotalBytesTransferred, inBlob, inOutIndex);
3982 POPU32(acStartSample, inBlob, inOutIndex);
3984 ok &= acTimeCodes.RPCDecode(inBlob, inOutIndex);
3985 POPU64(v64, inBlob, inOutIndex);
3987 POPU32(acCurrentFrame, inBlob, inOutIndex);
3988 POPU64(v64, inBlob, inOutIndex);
3989 acCurrentFrameTime =
LWord64(v64);
3990 POPU64(acAudioClockCurrentTime, inBlob, inOutIndex);
3991 POPU32(acCurrentAudioExpectedAddress, inBlob, inOutIndex);
3992 POPU32(acCurrentAudioStartAddress, inBlob, inOutIndex);
3993 POPU32(acCurrentFieldCount, inBlob, inOutIndex);
3994 POPU32(acCurrentLineCount, inBlob, inOutIndex);
3995 POPU32(acCurrentReps, inBlob, inOutIndex);
3996 POPU64(acCurrentUserCookie, inBlob, inOutIndex);
3997 POPU32(acFrame, inBlob, inOutIndex);
3998 POPU32(acRP188.fDBB, inBlob, inOutIndex);
3999 POPU32(acRP188.fLo, inBlob, inOutIndex);
4000 POPU32(acRP188.fHi, inBlob, inOutIndex);
4001 ok &= acTrailer.RPCDecode(inBlob, inOutIndex);
4007 const size_t totBytes (acHeader.GetSizeInBytes());
4008 if (outBlob.capacity() < totBytes)
4009 outBlob.reserve(totBytes);
4010 bool ok = acHeader.RPCEncode(outBlob);
4013 PUSHU32(acBufferLevel, outBlob);
4014 PUSHU32(acFramesProcessed, outBlob);
4015 PUSHU32(acFramesDropped, outBlob);
4016 ok &= acFrameStamp.RPCEncode(outBlob);
4017 PUSHU32(acAudioTransferSize, outBlob);
4018 PUSHU32(acAudioStartSample, outBlob);
4019 PUSHU32(acAncTransferSize, outBlob);
4020 PUSHU32(acAncField2TransferSize, outBlob);
4021 ok &= acTrailer.RPCEncode(outBlob);
4026 { uint16_t v16(0); uint32_t v32(0);
4027 bool ok = acHeader.RPCDecode(inBlob, inOutIndex);
4028 POPU16(v16, inBlob, inOutIndex);
4030 POPU32(v32, inBlob, inOutIndex);
4031 acTransferFrame =
LWord(v32);
4032 POPU32(acBufferLevel, inBlob, inOutIndex);
4033 POPU32(acFramesProcessed, inBlob, inOutIndex);
4034 POPU32(acFramesDropped, inBlob, inOutIndex);
4035 ok &= acFrameStamp.RPCDecode(inBlob, inOutIndex);
4036 POPU32(acAudioTransferSize, inBlob, inOutIndex);
4037 POPU32(acAudioStartSample, inBlob, inOutIndex);
4038 POPU32(acAncTransferSize, inBlob, inOutIndex);
4039 POPU32(acAncField2TransferSize, inBlob, inOutIndex);
4040 ok &= acTrailer.RPCDecode(inBlob, inOutIndex);
4046 PUSHU32(acNumSegments, outBlob);
4047 PUSHU32(acNumActiveBytesPerRow, outBlob);
4048 PUSHU32(acSegmentHostPitch, outBlob);
4049 PUSHU32(acSegmentDevicePitch, outBlob);
4055 POPU32(acNumSegments, inBlob, inOutIndex);
4056 POPU32(acNumActiveBytesPerRow, inBlob, inOutIndex);
4057 POPU32(acSegmentHostPitch, inBlob, inOutIndex);
4058 POPU32(acSegmentDevicePitch, inBlob, inOutIndex);
4065 PUSHU32(ccSaturationValue, outBlob);
4066 return ccLookupTables.RPCEncode(outBlob);
4071 POPU16(u16, inBlob, inOutIndex);
4073 POPU32(ccSaturationValue, inBlob, inOutIndex);
4074 return ccLookupTables.RPCDecode(inBlob, inOutIndex);
4080 PUSHU16(foregroundVideoCrosspoint, outBlob);
4081 PUSHU16(backgroundVideoCrosspoint, outBlob);
4082 PUSHU16(foregroundKeyCrosspoint, outBlob);
4083 PUSHU16(backgroundKeyCrosspoint, outBlob);
4090 { uint16_t v16(0); uint32_t v32(0);
4091 POPU16(v16, inBlob, inOutIndex);
4093 POPU16(v16, inBlob, inOutIndex);
4095 POPU16(v16, inBlob, inOutIndex);
4097 POPU16(v16, inBlob, inOutIndex);
4099 POPU16(v16, inBlob, inOutIndex);
4101 POPU32(v32, inBlob, inOutIndex);
4102 transitionCoefficient =
Fixed_(v32);
4103 POPU32(v32, inBlob, inOutIndex);
4104 transitionSoftness =
Fixed_(v32);
4118 POPU32(fDBB, inBlob, inOutIndex);
4119 POPU32(fLo, inBlob, inOutIndex);
4120 POPU32(fHi, inBlob, inOutIndex);
4127 const size_t totBytes (acHeader.GetSizeInBytes() + acVideoBuffer.GetByteCount() + acAudioBuffer.GetByteCount()
4128 + acANCBuffer.GetByteCount() + acANCField2Buffer.GetByteCount() + acOutputTimeCodes.GetByteCount()
4129 + acHDMIAuxData.GetByteCount() + 64);
4130 if (outBlob.capacity() < totBytes)
4131 outBlob.reserve(totBytes);
4132 bool ok = acHeader.RPCEncode(outBlob);
4133 ok &= acVideoBuffer.RPCEncode(outBlob);
4134 ok &= acAudioBuffer.RPCEncode(outBlob);
4135 ok &= acANCBuffer.RPCEncode(outBlob);
4136 ok &= acANCField2Buffer.RPCEncode(outBlob);
4137 ok &= acOutputTimeCodes.RPCEncode(outBlob);
4138 ok &= acTransferStatus.RPCEncode(outBlob);
4139 PUSHU64(acInUserCookie, outBlob);
4140 PUSHU32(acInVideoDMAOffset, outBlob);
4141 ok &= acInSegmentedDMAInfo.RPCEncode(outBlob);
4142 ok &= acColorCorrection.RPCEncode(outBlob);
4143 PUSHU16(acFrameBufferFormat, outBlob);
4144 PUSHU16(acFrameBufferOrientation, outBlob);
4145 ok &= acVidProcInfo.RPCEncode(outBlob);
4146 PUSHU16(acVideoQuarterSizeExpand, outBlob);
4147 ok &= acHDMIAuxData.RPCEncode(outBlob);
4148 PUSHU32(acPeerToPeerFlags, outBlob);
4149 PUSHU32(acFrameRepeatCount, outBlob);
4151 ok &= acRP188.RPCEncode(outBlob);
4152 PUSHU16(acCrosspoint, outBlob);
4153 ok &= acTrailer.RPCEncode(outBlob);
4159 { uint16_t v16(0); uint32_t v32(0);
4161 bool ok = acHeader.RPCDecode(inBlob, inOutIndex);
4162 ok &= acVideoBuffer.RPCDecode(inBlob, inOutIndex);
4163 ok &= acAudioBuffer.RPCDecode(inBlob, inOutIndex);
4164 ok &= acANCBuffer.RPCDecode(inBlob, inOutIndex);
4165 ok &= acANCField2Buffer.RPCDecode(inBlob, inOutIndex);
4166 ok &= acOutputTimeCodes.RPCDecode(inBlob, inOutIndex);
4167 ok &= acTransferStatus.RPCDecode(inBlob, inOutIndex);
4168 POPU64(acInUserCookie, inBlob, inOutIndex);
4169 POPU32(acInVideoDMAOffset, inBlob, inOutIndex);
4170 ok &= acInSegmentedDMAInfo.RPCDecode(inBlob, inOutIndex);
4171 ok &= acColorCorrection.RPCDecode(inBlob, inOutIndex);
4172 POPU16(v16, inBlob, inOutIndex);
4174 POPU16(v16, inBlob, inOutIndex);
4176 ok &= acVidProcInfo.RPCDecode(inBlob, inOutIndex);
4177 POPU16(v16, inBlob, inOutIndex);
4179 ok &= acHDMIAuxData.RPCDecode(inBlob, inOutIndex);
4180 POPU32(acPeerToPeerFlags, inBlob, inOutIndex);
4181 POPU32(acFrameRepeatCount, inBlob, inOutIndex);
4182 POPU32(v32, inBlob, inOutIndex);
4183 acDesiredFrame =
LWord(v32);
4184 ok &= acRP188.RPCDecode(inBlob, inOutIndex);
4185 POPU16(v16, inBlob, inOutIndex);
4187 ok &= acTrailer.RPCDecode(inBlob, inOutIndex);
4197 PUSHU32(videoBufferSize, outBlob);
4198 if (videoBuffer && videoBufferSize)
4199 { buff.
Set(videoBuffer, videoBufferSize);
4202 PUSHU32(videoDmaOffset, outBlob);
4204 PUSHU32(audioBufferSize, outBlob);
4205 if (audioBuffer && audioBufferSize)
4206 { buff.
Set(audioBuffer, audioBufferSize);
4209 PUSHU32(audioStartSample, outBlob);
4210 PUSHU32(audioNumChannels, outBlob);
4211 PUSHU32(frameRepeatCount, outBlob);
4212 rp188.RPCEncode(outBlob);
4215 PUSHU32(transferFlags, outBlob);
4216 PUSHU8(bDisableExtraAudioInfo, outBlob);
4220 vidProcInfo.RPCEncode(outBlob);
4221 PUSHU32(customAncInfo.Group1, outBlob);
4222 PUSHU32(customAncInfo.Group2, outBlob);
4223 PUSHU32(customAncInfo.Group3, outBlob);
4224 PUSHU32(customAncInfo.Group4, outBlob);
4225 PUSHU32(videoNumSegments, outBlob);
4226 PUSHU32(videoSegmentHostPitch, outBlob);
4227 PUSHU32(videoSegmentCardPitch, outBlob);
4234 POPU16(v16, inBlob, inOutIndex);
4238 POPU32(videoBufferSize, inBlob, inOutIndex);
4239 if (videoBufferSize && !videoBuffer)
4244 if ((inOutIndex + videoBufferSize) >= inBlob.size())
4246 UByte* pBuffer =
reinterpret_cast<UByte*
>(videoBuffer);
4247 for (
ULWord cnt(0); cnt < videoBufferSize; cnt++)
4248 pBuffer[cnt] = inBlob.at(inOutIndex++);
4250 POPU32(videoDmaOffset, inBlob, inOutIndex);
4253 POPU32(audioBufferSize, inBlob, inOutIndex);
4254 if (audioBufferSize && !audioBuffer)
4259 if ((inOutIndex + audioBufferSize) >= inBlob.size())
4261 UByte* pBuffer =
reinterpret_cast<UByte*
>(audioBuffer);
4262 for (
ULWord cnt(0); cnt < audioBufferSize; cnt++)
4263 pBuffer[cnt] = inBlob.at(inOutIndex++);
4265 POPU32(audioStartSample, inBlob, inOutIndex);
4266 POPU32(audioNumChannels, inBlob, inOutIndex);
4267 POPU32(frameRepeatCount, inBlob, inOutIndex);
4268 rp188.RPCDecode(inBlob, inOutIndex);
4269 POPU32(v32, inBlob, inOutIndex);
4270 desiredFrame =
LWord(v32);
4271 POPU32(hUser, inBlob, inOutIndex);
4272 POPU32(transferFlags, inBlob, inOutIndex);
4273 POPU8(
AsU8Ref(bDisableExtraAudioInfo), inBlob, inOutIndex);
4274 POPU16(v16, inBlob, inOutIndex);
4276 POPU16(v16, inBlob, inOutIndex);
4279 vidProcInfo.RPCDecode(inBlob, inOutIndex);
4280 POPU32(customAncInfo.Group1, inBlob, inOutIndex);
4281 POPU32(customAncInfo.Group2, inBlob, inOutIndex);
4282 POPU32(customAncInfo.Group3, inBlob, inOutIndex);
4283 POPU32(customAncInfo.Group4, inBlob, inOutIndex);
4284 POPU32(videoNumSegments, inBlob, inOutIndex);
4285 POPU32(videoSegmentHostPitch, inBlob, inOutIndex);
4286 POPU32(videoSegmentCardPitch, inBlob, inOutIndex);
4287 POPU16(v16, inBlob, inOutIndex);
4294 const size_t totBytes (mHeader.GetSizeInBytes());
4295 if (outBlob.capacity() < totBytes)
4296 outBlob.reserve(totBytes);
4297 bool ok = mHeader.RPCEncode(outBlob);
4298 ok &= mBuffer.RPCEncode(outBlob);
4301 for (
size_t ndx(0); ndx < 16; ndx++)
4302 PUSHU32(mRegisters[ndx], outBlob);
4303 for (
size_t ndx(0); ndx < 32; ndx++)
4304 PUSHU32(mReserved[ndx], outBlob);
4305 ok &= mTrailer.RPCEncode(outBlob);
4311 bool ok = mHeader.RPCDecode(inBlob, inOutIndex);
4312 ok &= mBuffer.RPCDecode(inBlob, inOutIndex);
4313 POPU32(mFlags, inBlob, inOutIndex);
4314 POPU32(mStatus, inBlob, inOutIndex);
4315 for (
size_t ndx(0); ndx < 16; ndx++)
4316 POPU32(mRegisters[ndx], inBlob, inOutIndex);
4317 for (
size_t ndx(0); ndx < 16; ndx++)
4318 POPU32(mReserved[ndx], inBlob, inOutIndex);
4319 ok &= mTrailer.RPCDecode(inBlob, inOutIndex);
4330 PUSHU64(rdtscStartTime, outBlob);
4331 PUSHU64(audioClockStartTime, outBlob);
4332 PUSHU64(rdtscCurrentTime, outBlob);
4333 PUSHU64(audioClockCurrentTime, outBlob);
4334 PUSHU32(framesProcessed, outBlob);
4335 PUSHU32(framesDropped, outBlob);
4336 PUSHU32(bufferLevel, outBlob);
4337 PUSHU8(bWithAudio, outBlob);
4338 PUSHU8(bWithRP188, outBlob);
4339 PUSHU8(bFbfChange, outBlob);
4340 PUSHU8(bFboChange, outBlob);
4341 PUSHU8(bWithColorCorrection, outBlob);
4342 PUSHU8(bWithVidProc, outBlob);
4343 PUSHU8(bWithCustomAncData, outBlob);
4348 { uint16_t v16(0); uint32_t v32(0);
4349 POPU16(v16, inBlob, inOutIndex);
4351 POPU16(v16, inBlob, inOutIndex);
4353 POPU32(v32, inBlob, inOutIndex);
4354 startFrame =
LWord(v32);
4355 POPU32(v32, inBlob, inOutIndex);
4356 endFrame =
LWord(v32);
4357 POPU32(v32, inBlob, inOutIndex);
4358 activeFrame =
LWord(v32);
4359 POPU64(rdtscStartTime, inBlob, inOutIndex);
4360 POPU64(audioClockStartTime, inBlob, inOutIndex);
4361 POPU64(rdtscCurrentTime, inBlob, inOutIndex);
4362 POPU64(audioClockCurrentTime, inBlob, inOutIndex);
4363 POPU32(framesProcessed, inBlob, inOutIndex);
4364 POPU32(framesDropped, inBlob, inOutIndex);
4365 POPU32(bufferLevel, inBlob, inOutIndex);
4370 POPU8(
AsU8Ref(bWithColorCorrection), inBlob, inOutIndex);
4372 POPU8(
AsU8Ref(bWithCustomAncData), inBlob, inOutIndex);
4386 POPU32(DBB, inBlob, inOutIndex);
4387 POPU32(Low, inBlob, inOutIndex);
4388 POPU32(High, inBlob, inOutIndex);
4395 PUSHU32(taskVersion, outBlob);
4400 if (taskArray && numTasks)
4401 for (
ULWord num(0); num < numTasks; num++)
4405 const ULWord * pULWords =
reinterpret_cast<const ULWord*
>(&task.
u);
4411 for (
ULWord word(0); word < numWords; word++)
4412 PUSHU32(pULWords[word], outBlob);
4419 POPU32(taskVersion, inBlob, inOutIndex);
4420 POPU32(taskSize, inBlob, inOutIndex);
4421 POPU32(numTasks, inBlob, inOutIndex);
4422 POPU32(maxTasks, inBlob, inOutIndex);
4423 POPU64(u64, inBlob, inOutIndex);
4425 if (taskArray && numTasks)
4426 for (
ULWord num(0); num < numTasks; num++)
4429 POPU32(u32, inBlob, inOutIndex);
4437 for (
ULWord word(0); word < numWords; word++)
4438 POPU32(pULWords[word], inBlob, inOutIndex);
4448 PUSHU64(audioClockTimeStamp, outBlob);
4449 PUSHU32(audioExpectedAddress, outBlob);
4450 PUSHU32(audioInStartAddress, outBlob);
4451 PUSHU32(audioInStopAddress, outBlob);
4452 PUSHU32(audioOutStopAddress, outBlob);
4453 PUSHU32(audioOutStartAddress, outBlob);
4455 PUSHU32(startSample, outBlob);
4457 PUSHU32(currentFrame, outBlob);
4458 currentRP188.RPCEncode(outBlob);
4460 PUSHU64(audioClockCurrentTime, outBlob);
4461 PUSHU32(currentAudioExpectedAddress, outBlob);
4462 PUSHU32(currentAudioStartAddress, outBlob);
4463 PUSHU32(currentFieldCount, outBlob);
4464 PUSHU32(currentLineCount, outBlob);
4465 PUSHU32(currentReps, outBlob);
4466 PUSHU32(currenthUser, outBlob);
4471 { uint16_t v16(0); uint64_t v64(0);
4472 POPU16(v16, inBlob, inOutIndex);
4474 POPU64(v64, inBlob, inOutIndex);
4476 POPU32(frame, inBlob, inOutIndex);
4477 POPU64(audioClockTimeStamp, inBlob, inOutIndex);
4478 POPU32(audioExpectedAddress, inBlob, inOutIndex);
4479 POPU32(audioInStartAddress, inBlob, inOutIndex);
4480 POPU32(audioInStopAddress, inBlob, inOutIndex);
4481 POPU32(audioOutStopAddress, inBlob, inOutIndex);
4482 POPU32(audioOutStartAddress, inBlob, inOutIndex);
4483 POPU32(bytesRead, inBlob, inOutIndex);
4484 POPU32(startSample, inBlob, inOutIndex);
4485 POPU64(v64, inBlob, inOutIndex);
4487 POPU32(currentFrame, inBlob, inOutIndex);
4488 currentRP188.RPCDecode(inBlob, inOutIndex);
4489 POPU64(v64, inBlob, inOutIndex);
4490 currentFrameTime =
LWord64(v64);
4491 POPU64(audioClockCurrentTime, inBlob, inOutIndex);
4492 POPU32(currentAudioExpectedAddress, inBlob, inOutIndex);
4493 POPU32(currentAudioStartAddress, inBlob, inOutIndex);
4494 POPU32(currentFieldCount, inBlob, inOutIndex);
4495 POPU32(currentLineCount, inBlob, inOutIndex);
4496 POPU32(currentReps, inBlob, inOutIndex);
4497 POPU32(currenthUser, inBlob, inOutIndex);
4536 #if defined(AJA_LINUX)
4537 #pragma GCC diagnostic push
4538 #pragma GCC diagnostic ignored "-Wstrict-aliasing"
4540 uint16_t v16(0); uint32_t v32(0);
4541 POPU16(v16, inBlob, inOutIndex);
4543 POPU16(v16, inBlob, inOutIndex);
4545 POPU32(v32, inBlob, inOutIndex); lVal1 =
LWord(v32);
4546 POPU32(v32, inBlob, inOutIndex); lVal2 =
LWord(v32);
4547 POPU32(v32, inBlob, inOutIndex); lVal3 =
LWord(v32);
4548 POPU32(v32, inBlob, inOutIndex); lVal4 =
LWord(v32);
4549 POPU32(v32, inBlob, inOutIndex); lVal5 =
LWord(v32);
4550 POPU32(v32, inBlob, inOutIndex); lVal6 =
LWord(v32);
4563 #if defined(AJA_LINUX)
4564 #pragma GCC diagnostic pop