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),
1641 fKernelSpacePtr (0),
1649 : fUserSpacePtr (0),
1652 #if defined (AJAMac)
1653 fKernelSpacePtr (0),
1657 fKernelSpacePtr (0),
1667 : fUserSpacePtr (0),
1670 #if defined (AJAMac)
1671 fKernelSpacePtr (0),
1675 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)
3259 const ULWord * pRegArray (mOutGoodRegisters);
3260 const ULWord * pValArray (mOutValues);
3261 for (
ULWord ndx(0); ndx < mOutNumRegisters; ndx++)
3262 outValues [pRegArray[ndx]] = pValArray[ndx];
3273 if (outValues.empty())
3276 outValues.push_back(
NTV2RegInfo(it->first, it->second));
3281 uint32_t missingTally(0);
3285 if (mapIter == regValMap.end())
3287 it->registerValue = mapIter->second;
3289 return !missingTally;
3296 inOutStream << mHeader <<
", numRegs=" << mInNumRegisters <<
", inRegs=" << mInRegisters <<
", outNumGoodRegs=" << mOutNumRegisters
3297 <<
", outGoodRegs=" << mOutGoodRegisters <<
", outValues=" << mOutValues <<
", " << mTrailer;
3304 mInNumRegisters (
ULWord(inRegWrites.size())),
3328 pBadRegIndexes[ndx] = 0;
3330 pRegInfoArray[ndx++] = *it;
3341 outFailedRegWrites.clear();
3347 outRegWrites.clear();
3356 outRegWrites.push_back(pRegInfos[ndx]);
3369 if (pBadRegIndexes && maxNumBadRegIndexes && pRegInfoArray && maxNumRegInfos &&
mOutNumFailures)
3372 for (
UWord num(0); num < maxNumBadRegIndexes; num++)
3374 const UWord badRegIndex (pBadRegIndexes[num]);
3375 if (badRegIndex < maxNumRegInfos)
3377 const NTV2RegInfo & badRegInfo (pRegInfoArray[badRegIndex]);
3378 oss <<
"Failure " << num <<
": " << badRegInfo << endl;
3388 typedef std::pair <ULWord, ULWord> ULWordPair;
3389 typedef std::pair <ULWordPair, ULWordPair> ULWordPairs;
3412 const bool badName (regName.find(
' ') != string::npos);
3415 oss <<
"theDevice.WriteRegister (";
3452 for (NTV2ULWordVector::const_iterator it(inObj.begin()); it != inObj.end(); ++it)
3453 inOutStream <<
" " <<
HEX0N(*it,8);
3460 inOutStream << (inCompact ?
"Ch[" :
"[");
3464 inOutStream <<
DEC(*it+1);
3467 if (++it != inObj.end())
3468 inOutStream << (inCompact ?
"|" :
",");
3470 return inOutStream <<
"]";
3474 { ostringstream oss;
3481 inOutStream << (inCompact ?
"Ch{" :
"{");
3485 inOutStream <<
DEC(*it+1);
3488 if (++it != inObj.end())
3489 inOutStream << (inCompact ?
"|" :
",");
3491 return inOutStream <<
"}";
3495 { ostringstream oss;
3522 result.push_back(ch);
3530 result.push_back(*it);
3536 inOutStream << (inCompact ?
"AudSys{" :
"{");
3540 inOutStream <<
DEC(*it+1);
3543 if (++it != inObj.end())
3544 inOutStream << (inCompact ?
"|" :
",");
3546 return inOutStream <<
"}";
3550 { ostringstream oss;
3560 result.insert(audSys);
3568 if (result.find(it->registerNumber) == result.end())
3569 result.insert(it->registerNumber);
3576 if (iter->registerNumber == inRegNum)
3578 return inRegInfos.end();
3584 return inObj.
Print(inOutStream);
3590 inOutStream << inObj.size () <<
" regs:" << endl;
3592 inOutStream << *iter << endl;
3599 mIsWriting (inDoWrite),
3605 *pRegInfo = inBankSelect;
3608 *pRegInfo = inOutRegInfo;
3621 if (
ULWord(inIndex0) < maxNum)
3622 result = pRegInfos[inIndex0];
3634 if (
mInBankInfos) oss << *pBankRegInfo;
else oss <<
"-";
3635 oss <<
" regInfos=";
3636 if (
mInRegInfos) oss << *pRegInfo;
else oss <<
"-";
3644 mIsWriting (inDoWrite),
3645 mVirtualData (inVirtualData, inVirtualDataSize)
3663 #define AsU8Ref(_x_) reinterpret_cast<uint8_t&>(_x_)
3664 #define AsU16Ref(_x_) reinterpret_cast<uint16_t&>(_x_)
3665 #define AsU32Ref(_x_) reinterpret_cast<uint32_t&>(_x_)
3666 #define AsU64Ref(_x_) reinterpret_cast<uint64_t&>(_x_)
3672 PUSHU32(fHeaderVersion, outBlob);
3674 PUSHU32(fSizeInBytes, outBlob);
3675 PUSHU32(fPointerSize, outBlob);
3677 PUSHU32(fResultStatus, outBlob);
3683 POPU32(fHeaderTag, inBlob, inOutIndex);
3684 POPU32(fType, inBlob, inOutIndex);
3685 POPU32(fHeaderVersion, inBlob, inOutIndex);
3686 POPU32(fVersion, inBlob, inOutIndex);
3687 POPU32(fSizeInBytes, inBlob, inOutIndex);
3688 POPU32(fPointerSize, inBlob, inOutIndex);
3689 POPU32(fOperation, inBlob, inOutIndex);
3690 POPU32(fResultStatus, inBlob, inOutIndex);
3696 PUSHU32(fTrailerVersion, outBlob);
3697 PUSHU32(fTrailerTag, outBlob);
3703 POPU32(fTrailerVersion, inBlob, inOutIndex);
3704 POPU32(fTrailerTag, inBlob, inOutIndex);
3720 ULWord byteCount(0), flags(0);
3721 POPU32(byteCount, inBlob, inOutIndex);
3722 POPU32(flags, inBlob, inOutIndex);
3725 if ((inOutIndex + byteCount) > inBlob.size())
3727 for (
ULWord cnt(0); cnt < byteCount; cnt++)
3728 U8(
int(cnt)) = inBlob.at(inOutIndex++);
3734 const size_t totBytes (mHeader.GetSizeInBytes()
3735 + mInRegisters.GetByteCount() + mOutGoodRegisters.GetByteCount() + mOutValues.GetByteCount());
3736 if (outBlob.capacity() < totBytes)
3737 outBlob.reserve(totBytes);
3740 mInRegisters.ByteSwap32();
3741 mOutGoodRegisters.ByteSwap32();
3742 mOutValues.ByteSwap32();
3744 bool ok = mHeader.RPCEncode(outBlob);
3745 PUSHU32(mInNumRegisters, outBlob);
3746 ok &= mInRegisters.RPCEncode(outBlob);
3747 PUSHU32(mOutNumRegisters, outBlob);
3748 ok &= mOutGoodRegisters.RPCEncode(outBlob)
3749 && mOutValues.RPCEncode(outBlob)
3750 && mTrailer.RPCEncode(outBlob);
3753 mInRegisters.ByteSwap32();
3754 mOutGoodRegisters.ByteSwap32();
3755 mOutValues.ByteSwap32();
3762 bool ok = mHeader.RPCDecode(inBlob, inOutIndex);
3763 if (!ok)
return false;
3764 POPU32(mInNumRegisters, inBlob, inOutIndex);
3765 ok &= mInRegisters.RPCDecode(inBlob, inOutIndex);
3766 POPU32(mOutNumRegisters, inBlob, inOutIndex);
3767 ok &= mOutGoodRegisters.RPCDecode(inBlob, inOutIndex);
3768 ok &= mOutValues.RPCDecode(inBlob, inOutIndex);
3769 ok &= mTrailer.RPCDecode(inBlob, inOutIndex);
3772 mInRegisters.ByteSwap32();
3773 mOutGoodRegisters.ByteSwap32();
3774 mOutValues.ByteSwap32();
3781 const size_t totBytes (mHeader.GetSizeInBytes()
3782 + mInRegInfos.GetByteCount() + mOutBadRegIndexes.GetByteCount());
3783 if (outBlob.capacity() < totBytes)
3784 outBlob.reserve(totBytes);
3787 mInRegInfos.ByteSwap32();
3788 mOutBadRegIndexes.ByteSwap32();
3790 bool ok = mHeader.RPCEncode(outBlob);
3791 PUSHU32(mInNumRegisters, outBlob);
3792 ok &= mInRegInfos.RPCEncode(outBlob);
3793 PUSHU32(mOutNumFailures, outBlob);
3794 ok &= mOutBadRegIndexes.RPCEncode(outBlob)
3795 && mTrailer.RPCEncode(outBlob);
3798 mInRegInfos.ByteSwap32();
3799 mOutBadRegIndexes.ByteSwap16();
3806 bool ok = mHeader.RPCDecode(inBlob, inOutIndex);
3807 POPU32(mInNumRegisters, inBlob, inOutIndex);
3808 ok &= mInRegInfos.RPCDecode(inBlob, inOutIndex);
3809 POPU32(mOutNumFailures, inBlob, inOutIndex);
3810 ok &= mOutBadRegIndexes.RPCDecode(inBlob, inOutIndex);
3811 ok &= mTrailer.RPCDecode(inBlob, inOutIndex);
3814 mInRegInfos.ByteSwap32();
3815 mOutBadRegIndexes.ByteSwap16();
3822 const size_t totBytes (mHeader.GetSizeInBytes()
3823 + mInBankInfos.GetByteCount() + mInRegInfos.GetByteCount());
3824 if (outBlob.capacity() < totBytes)
3825 outBlob.reserve(totBytes);
3828 mInBankInfos.ByteSwap32();
3829 mInRegInfos.ByteSwap32();
3831 bool ok = mHeader.RPCEncode(outBlob);
3833 ok &= mInBankInfos.RPCEncode(outBlob);
3834 ok &= mInRegInfos.RPCEncode(outBlob)
3835 && mTrailer.RPCEncode(outBlob);
3838 mInBankInfos.ByteSwap32();
3839 mInRegInfos.ByteSwap32();
3846 bool ok = mHeader.RPCDecode(inBlob, inOutIndex);
3847 POPU32(mIsWriting, inBlob, inOutIndex);
3848 ok &= mInBankInfos.RPCDecode(inBlob, inOutIndex);
3849 ok &= mInRegInfos.RPCDecode(inBlob, inOutIndex);
3850 ok &= mTrailer.RPCDecode(inBlob, inOutIndex);
3853 mInBankInfos.ByteSwap32();
3854 mInRegInfos.ByteSwap32();
3861 const size_t totBytes (acHeader.GetSizeInBytes());
3862 if (outBlob.capacity() < totBytes)
3863 outBlob.reserve(totBytes);
3864 bool ok = acHeader.RPCEncode(outBlob);
3870 PUSHU64(acRDTSCStartTime, outBlob);
3871 PUSHU64(acAudioClockStartTime, outBlob);
3872 PUSHU64(acRDTSCCurrentTime, outBlob);
3873 PUSHU64(acAudioClockCurrentTime, outBlob);
3874 PUSHU32(acFramesProcessed, outBlob);
3875 PUSHU32(acFramesDropped, outBlob);
3876 PUSHU32(acBufferLevel, outBlob);
3877 PUSHU32(acOptionFlags, outBlob);
3879 ok &= acTrailer.RPCEncode(outBlob);
3884 { uint16_t v16(0); uint32_t v32(0);
3885 bool ok = acHeader.RPCDecode(inBlob, inOutIndex);
3886 POPU16(v16, inBlob, inOutIndex);
3888 POPU16(v16, inBlob, inOutIndex);
3890 POPU32(v32, inBlob, inOutIndex);
3891 acStartFrame =
LWord(v32);
3892 POPU32(v32, inBlob, inOutIndex);
3893 acEndFrame =
LWord(v32);
3894 POPU32(v32, inBlob, inOutIndex);
3895 acActiveFrame =
LWord(v32);
3896 POPU64(acRDTSCStartTime, inBlob, inOutIndex);
3897 POPU64(acAudioClockStartTime, inBlob, inOutIndex);
3898 POPU64(acRDTSCCurrentTime, inBlob, inOutIndex);
3899 POPU64(acAudioClockCurrentTime, inBlob, inOutIndex);
3900 POPU32(acFramesProcessed, inBlob, inOutIndex);
3901 POPU32(acFramesDropped, inBlob, inOutIndex);
3902 POPU32(acBufferLevel, inBlob, inOutIndex);
3903 POPU32(acOptionFlags, inBlob, inOutIndex);
3904 POPU16(v16, inBlob, inOutIndex);
3906 ok &= acTrailer.RPCDecode(inBlob, inOutIndex);
3912 const size_t totBytes (acHeader.GetSizeInBytes());
3913 if (outBlob.capacity() < totBytes)
3914 outBlob.reserve(totBytes);
3915 bool ok = acHeader.RPCEncode(outBlob);
3917 PUSHU32(acRequestedFrame, outBlob);
3918 PUSHU64(acAudioClockTimeStamp, outBlob);
3919 PUSHU32(acAudioExpectedAddress, outBlob);
3920 PUSHU32(acAudioInStartAddress, outBlob);
3921 PUSHU32(acAudioInStopAddress, outBlob);
3922 PUSHU32(acAudioOutStopAddress, outBlob);
3923 PUSHU32(acAudioOutStartAddress, outBlob);
3924 PUSHU32(acTotalBytesTransferred, outBlob);
3925 PUSHU32(acStartSample, outBlob);
3927 ok &= acTimeCodes.RPCEncode(outBlob);
3929 PUSHU32(acCurrentFrame, outBlob);
3931 PUSHU64(acAudioClockCurrentTime, outBlob);
3932 PUSHU32(acCurrentAudioExpectedAddress, outBlob);
3933 PUSHU32(acCurrentAudioStartAddress, outBlob);
3934 PUSHU32(acCurrentFieldCount, outBlob);
3935 PUSHU32(acCurrentLineCount, outBlob);
3936 PUSHU32(acCurrentReps, outBlob);
3937 PUSHU64(acCurrentUserCookie, outBlob);
3939 PUSHU32(acRP188.fDBB, outBlob);
3940 PUSHU32(acRP188.fLo, outBlob);
3941 PUSHU32(acRP188.fHi, outBlob);
3942 ok &= acTrailer.RPCEncode(outBlob);
3948 bool ok = acHeader.RPCDecode(inBlob, inOutIndex);
3949 POPU64(v64, inBlob, inOutIndex);
3951 POPU32(acRequestedFrame, inBlob, inOutIndex);
3952 POPU64(acAudioClockTimeStamp, inBlob, inOutIndex);
3953 POPU32(acAudioExpectedAddress, inBlob, inOutIndex);
3954 POPU32(acAudioInStartAddress, inBlob, inOutIndex);
3955 POPU32(acAudioInStopAddress, inBlob, inOutIndex);
3956 POPU32(acAudioOutStopAddress, inBlob, inOutIndex);
3957 POPU32(acAudioOutStartAddress, inBlob, inOutIndex);
3958 POPU32(acTotalBytesTransferred, inBlob, inOutIndex);
3959 POPU32(acStartSample, inBlob, inOutIndex);
3961 ok &= acTimeCodes.RPCDecode(inBlob, inOutIndex);
3962 POPU64(v64, inBlob, inOutIndex);
3964 POPU32(acCurrentFrame, inBlob, inOutIndex);
3965 POPU64(v64, inBlob, inOutIndex);
3966 acCurrentFrameTime =
LWord64(v64);
3967 POPU64(acAudioClockCurrentTime, inBlob, inOutIndex);
3968 POPU32(acCurrentAudioExpectedAddress, inBlob, inOutIndex);
3969 POPU32(acCurrentAudioStartAddress, inBlob, inOutIndex);
3970 POPU32(acCurrentFieldCount, inBlob, inOutIndex);
3971 POPU32(acCurrentLineCount, inBlob, inOutIndex);
3972 POPU32(acCurrentReps, inBlob, inOutIndex);
3973 POPU64(acCurrentUserCookie, inBlob, inOutIndex);
3974 POPU32(acFrame, inBlob, inOutIndex);
3975 POPU32(acRP188.fDBB, inBlob, inOutIndex);
3976 POPU32(acRP188.fLo, inBlob, inOutIndex);
3977 POPU32(acRP188.fHi, inBlob, inOutIndex);
3978 ok &= acTrailer.RPCDecode(inBlob, inOutIndex);
3984 const size_t totBytes (acHeader.GetSizeInBytes());
3985 if (outBlob.capacity() < totBytes)
3986 outBlob.reserve(totBytes);
3987 bool ok = acHeader.RPCEncode(outBlob);
3990 PUSHU32(acBufferLevel, outBlob);
3991 PUSHU32(acFramesProcessed, outBlob);
3992 PUSHU32(acFramesDropped, outBlob);
3993 ok &= acFrameStamp.RPCEncode(outBlob);
3994 PUSHU32(acAudioTransferSize, outBlob);
3995 PUSHU32(acAudioStartSample, outBlob);
3996 PUSHU32(acAncTransferSize, outBlob);
3997 PUSHU32(acAncField2TransferSize, outBlob);
3998 ok &= acTrailer.RPCEncode(outBlob);
4003 { uint16_t v16(0); uint32_t v32(0);
4004 bool ok = acHeader.RPCDecode(inBlob, inOutIndex);
4005 POPU16(v16, inBlob, inOutIndex);
4007 POPU32(v32, inBlob, inOutIndex);
4008 acTransferFrame =
LWord(v32);
4009 POPU32(acBufferLevel, inBlob, inOutIndex);
4010 POPU32(acFramesProcessed, inBlob, inOutIndex);
4011 POPU32(acFramesDropped, inBlob, inOutIndex);
4012 ok &= acFrameStamp.RPCDecode(inBlob, inOutIndex);
4013 POPU32(acAudioTransferSize, inBlob, inOutIndex);
4014 POPU32(acAudioStartSample, inBlob, inOutIndex);
4015 POPU32(acAncTransferSize, inBlob, inOutIndex);
4016 POPU32(acAncField2TransferSize, inBlob, inOutIndex);
4017 ok &= acTrailer.RPCDecode(inBlob, inOutIndex);
4023 PUSHU32(acNumSegments, outBlob);
4024 PUSHU32(acNumActiveBytesPerRow, outBlob);
4025 PUSHU32(acSegmentHostPitch, outBlob);
4026 PUSHU32(acSegmentDevicePitch, outBlob);
4032 POPU32(acNumSegments, inBlob, inOutIndex);
4033 POPU32(acNumActiveBytesPerRow, inBlob, inOutIndex);
4034 POPU32(acSegmentHostPitch, inBlob, inOutIndex);
4035 POPU32(acSegmentDevicePitch, inBlob, inOutIndex);
4042 PUSHU32(ccSaturationValue, outBlob);
4043 return ccLookupTables.RPCEncode(outBlob);
4048 POPU16(u16, inBlob, inOutIndex);
4050 POPU32(ccSaturationValue, inBlob, inOutIndex);
4051 return ccLookupTables.RPCDecode(inBlob, inOutIndex);
4057 PUSHU16(foregroundVideoCrosspoint, outBlob);
4058 PUSHU16(backgroundVideoCrosspoint, outBlob);
4059 PUSHU16(foregroundKeyCrosspoint, outBlob);
4060 PUSHU16(backgroundKeyCrosspoint, outBlob);
4067 { uint16_t v16(0); uint32_t v32(0);
4068 POPU16(v16, inBlob, inOutIndex);
4070 POPU16(v16, inBlob, inOutIndex);
4072 POPU16(v16, inBlob, inOutIndex);
4074 POPU16(v16, inBlob, inOutIndex);
4076 POPU16(v16, inBlob, inOutIndex);
4078 POPU32(v32, inBlob, inOutIndex);
4079 transitionCoefficient =
Fixed_(v32);
4080 POPU32(v32, inBlob, inOutIndex);
4081 transitionSoftness =
Fixed_(v32);
4095 POPU32(fDBB, inBlob, inOutIndex);
4096 POPU32(fLo, inBlob, inOutIndex);
4097 POPU32(fHi, inBlob, inOutIndex);
4104 const size_t totBytes (acHeader.GetSizeInBytes() + acVideoBuffer.GetByteCount() + acAudioBuffer.GetByteCount()
4105 + acANCBuffer.GetByteCount() + acANCField2Buffer.GetByteCount() + acOutputTimeCodes.GetByteCount()
4106 + acHDMIAuxData.GetByteCount() + 64);
4107 if (outBlob.capacity() < totBytes)
4108 outBlob.reserve(totBytes);
4109 bool ok = acHeader.RPCEncode(outBlob);
4110 ok &= acVideoBuffer.RPCEncode(outBlob);
4111 ok &= acAudioBuffer.RPCEncode(outBlob);
4112 ok &= acANCBuffer.RPCEncode(outBlob);
4113 ok &= acANCField2Buffer.RPCEncode(outBlob);
4114 ok &= acOutputTimeCodes.RPCEncode(outBlob);
4115 ok &= acTransferStatus.RPCEncode(outBlob);
4116 PUSHU64(acInUserCookie, outBlob);
4117 PUSHU32(acInVideoDMAOffset, outBlob);
4118 ok &= acInSegmentedDMAInfo.RPCEncode(outBlob);
4119 ok &= acColorCorrection.RPCEncode(outBlob);
4120 PUSHU16(acFrameBufferFormat, outBlob);
4121 PUSHU16(acFrameBufferOrientation, outBlob);
4122 ok &= acVidProcInfo.RPCEncode(outBlob);
4123 PUSHU16(acVideoQuarterSizeExpand, outBlob);
4124 ok &= acHDMIAuxData.RPCEncode(outBlob);
4125 PUSHU32(acPeerToPeerFlags, outBlob);
4126 PUSHU32(acFrameRepeatCount, outBlob);
4128 ok &= acRP188.RPCEncode(outBlob);
4129 PUSHU16(acCrosspoint, outBlob);
4130 ok &= acTrailer.RPCEncode(outBlob);
4136 { uint16_t v16(0); uint32_t v32(0);
4138 bool ok = acHeader.RPCDecode(inBlob, inOutIndex);
4139 ok &= acVideoBuffer.RPCDecode(inBlob, inOutIndex);
4140 ok &= acAudioBuffer.RPCDecode(inBlob, inOutIndex);
4141 ok &= acANCBuffer.RPCDecode(inBlob, inOutIndex);
4142 ok &= acANCField2Buffer.RPCDecode(inBlob, inOutIndex);
4143 ok &= acOutputTimeCodes.RPCDecode(inBlob, inOutIndex);
4144 ok &= acTransferStatus.RPCDecode(inBlob, inOutIndex);
4145 POPU64(acInUserCookie, inBlob, inOutIndex);
4146 POPU32(acInVideoDMAOffset, inBlob, inOutIndex);
4147 ok &= acInSegmentedDMAInfo.RPCDecode(inBlob, inOutIndex);
4148 ok &= acColorCorrection.RPCDecode(inBlob, inOutIndex);
4149 POPU16(v16, inBlob, inOutIndex);
4151 POPU16(v16, inBlob, inOutIndex);
4153 ok &= acVidProcInfo.RPCDecode(inBlob, inOutIndex);
4154 POPU16(v16, inBlob, inOutIndex);
4156 ok &= acHDMIAuxData.RPCDecode(inBlob, inOutIndex);
4157 POPU32(acPeerToPeerFlags, inBlob, inOutIndex);
4158 POPU32(acFrameRepeatCount, inBlob, inOutIndex);
4159 POPU32(v32, inBlob, inOutIndex);
4160 acDesiredFrame =
LWord(v32);
4161 ok &= acRP188.RPCDecode(inBlob, inOutIndex);
4162 POPU16(v16, inBlob, inOutIndex);
4164 ok &= acTrailer.RPCDecode(inBlob, inOutIndex);
4174 PUSHU32(videoBufferSize, outBlob);
4175 if (videoBuffer && videoBufferSize)
4176 { buff.
Set(videoBuffer, videoBufferSize);
4179 PUSHU32(videoDmaOffset, outBlob);
4181 PUSHU32(audioBufferSize, outBlob);
4182 if (audioBuffer && audioBufferSize)
4183 { buff.
Set(audioBuffer, audioBufferSize);
4186 PUSHU32(audioStartSample, outBlob);
4187 PUSHU32(audioNumChannels, outBlob);
4188 PUSHU32(frameRepeatCount, outBlob);
4189 rp188.RPCEncode(outBlob);
4192 PUSHU32(transferFlags, outBlob);
4193 PUSHU8(bDisableExtraAudioInfo, outBlob);
4197 vidProcInfo.RPCEncode(outBlob);
4198 PUSHU32(customAncInfo.Group1, outBlob);
4199 PUSHU32(customAncInfo.Group2, outBlob);
4200 PUSHU32(customAncInfo.Group3, outBlob);
4201 PUSHU32(customAncInfo.Group4, outBlob);
4202 PUSHU32(videoNumSegments, outBlob);
4203 PUSHU32(videoSegmentHostPitch, outBlob);
4204 PUSHU32(videoSegmentCardPitch, outBlob);
4211 POPU16(v16, inBlob, inOutIndex);
4215 POPU32(videoBufferSize, inBlob, inOutIndex);
4216 if (videoBufferSize && !videoBuffer)
4221 if ((inOutIndex + videoBufferSize) >= inBlob.size())
4223 UByte* pBuffer =
reinterpret_cast<UByte*
>(videoBuffer);
4224 for (
ULWord cnt(0); cnt < videoBufferSize; cnt++)
4225 pBuffer[cnt] = inBlob.at(inOutIndex++);
4227 POPU32(videoDmaOffset, inBlob, inOutIndex);
4230 POPU32(audioBufferSize, inBlob, inOutIndex);
4231 if (audioBufferSize && !audioBuffer)
4236 if ((inOutIndex + audioBufferSize) >= inBlob.size())
4238 UByte* pBuffer =
reinterpret_cast<UByte*
>(audioBuffer);
4239 for (
ULWord cnt(0); cnt < audioBufferSize; cnt++)
4240 pBuffer[cnt] = inBlob.at(inOutIndex++);
4242 POPU32(audioStartSample, inBlob, inOutIndex);
4243 POPU32(audioNumChannels, inBlob, inOutIndex);
4244 POPU32(frameRepeatCount, inBlob, inOutIndex);
4245 rp188.RPCDecode(inBlob, inOutIndex);
4246 POPU32(v32, inBlob, inOutIndex);
4247 desiredFrame =
LWord(v32);
4248 POPU32(hUser, inBlob, inOutIndex);
4249 POPU32(transferFlags, inBlob, inOutIndex);
4250 POPU8(
AsU8Ref(bDisableExtraAudioInfo), inBlob, inOutIndex);
4251 POPU16(v16, inBlob, inOutIndex);
4253 POPU16(v16, inBlob, inOutIndex);
4256 vidProcInfo.RPCDecode(inBlob, inOutIndex);
4257 POPU32(customAncInfo.Group1, inBlob, inOutIndex);
4258 POPU32(customAncInfo.Group2, inBlob, inOutIndex);
4259 POPU32(customAncInfo.Group3, inBlob, inOutIndex);
4260 POPU32(customAncInfo.Group4, inBlob, inOutIndex);
4261 POPU32(videoNumSegments, inBlob, inOutIndex);
4262 POPU32(videoSegmentHostPitch, inBlob, inOutIndex);
4263 POPU32(videoSegmentCardPitch, inBlob, inOutIndex);
4264 POPU16(v16, inBlob, inOutIndex);
4271 const size_t totBytes (mHeader.GetSizeInBytes());
4272 if (outBlob.capacity() < totBytes)
4273 outBlob.reserve(totBytes);
4274 bool ok = mHeader.RPCEncode(outBlob);
4275 ok &= mBuffer.RPCEncode(outBlob);
4278 for (
size_t ndx(0); ndx < 16; ndx++)
4279 PUSHU32(mRegisters[ndx], outBlob);
4280 for (
size_t ndx(0); ndx < 32; ndx++)
4281 PUSHU32(mReserved[ndx], outBlob);
4282 ok &= mTrailer.RPCEncode(outBlob);
4288 bool ok = mHeader.RPCDecode(inBlob, inOutIndex);
4289 ok &= mBuffer.RPCDecode(inBlob, inOutIndex);
4290 POPU32(mFlags, inBlob, inOutIndex);
4291 POPU32(mStatus, inBlob, inOutIndex);
4292 for (
size_t ndx(0); ndx < 16; ndx++)
4293 POPU32(mRegisters[ndx], inBlob, inOutIndex);
4294 for (
size_t ndx(0); ndx < 16; ndx++)
4295 POPU32(mReserved[ndx], inBlob, inOutIndex);
4296 ok &= mTrailer.RPCDecode(inBlob, inOutIndex);
4307 PUSHU64(rdtscStartTime, outBlob);
4308 PUSHU64(audioClockStartTime, outBlob);
4309 PUSHU64(rdtscCurrentTime, outBlob);
4310 PUSHU64(audioClockCurrentTime, outBlob);
4311 PUSHU32(framesProcessed, outBlob);
4312 PUSHU32(framesDropped, outBlob);
4313 PUSHU32(bufferLevel, outBlob);
4314 PUSHU8(bWithAudio, outBlob);
4315 PUSHU8(bWithRP188, outBlob);
4316 PUSHU8(bFbfChange, outBlob);
4317 PUSHU8(bFboChange, outBlob);
4318 PUSHU8(bWithColorCorrection, outBlob);
4319 PUSHU8(bWithVidProc, outBlob);
4320 PUSHU8(bWithCustomAncData, outBlob);
4325 { uint16_t v16(0); uint32_t v32(0);
4326 POPU16(v16, inBlob, inOutIndex);
4328 POPU16(v16, inBlob, inOutIndex);
4330 POPU32(v32, inBlob, inOutIndex);
4331 startFrame =
LWord(v32);
4332 POPU32(v32, inBlob, inOutIndex);
4333 endFrame =
LWord(v32);
4334 POPU32(v32, inBlob, inOutIndex);
4335 activeFrame =
LWord(v32);
4336 POPU64(rdtscStartTime, inBlob, inOutIndex);
4337 POPU64(audioClockStartTime, inBlob, inOutIndex);
4338 POPU64(rdtscCurrentTime, inBlob, inOutIndex);
4339 POPU64(audioClockCurrentTime, inBlob, inOutIndex);
4340 POPU32(framesProcessed, inBlob, inOutIndex);
4341 POPU32(framesDropped, inBlob, inOutIndex);
4342 POPU32(bufferLevel, inBlob, inOutIndex);
4347 POPU8(
AsU8Ref(bWithColorCorrection), inBlob, inOutIndex);
4349 POPU8(
AsU8Ref(bWithCustomAncData), inBlob, inOutIndex);
4363 POPU32(DBB, inBlob, inOutIndex);
4364 POPU32(Low, inBlob, inOutIndex);
4365 POPU32(High, inBlob, inOutIndex);
4372 PUSHU32(taskVersion, outBlob);
4377 if (taskArray && numTasks)
4378 for (
ULWord num(0); num < numTasks; num++)
4382 const ULWord * pULWords =
reinterpret_cast<const ULWord*
>(&task.
u);
4388 for (
ULWord word(0); word < numWords; word++)
4389 PUSHU32(pULWords[word], outBlob);
4396 POPU32(taskVersion, inBlob, inOutIndex);
4397 POPU32(taskSize, inBlob, inOutIndex);
4398 POPU32(numTasks, inBlob, inOutIndex);
4399 POPU32(maxTasks, inBlob, inOutIndex);
4400 POPU64(u64, inBlob, inOutIndex);
4402 if (taskArray && numTasks)
4403 for (
ULWord num(0); num < numTasks; num++)
4406 POPU32(u32, inBlob, inOutIndex);
4414 for (
ULWord word(0); word < numWords; word++)
4415 POPU32(pULWords[word], inBlob, inOutIndex);
4425 PUSHU64(audioClockTimeStamp, outBlob);
4426 PUSHU32(audioExpectedAddress, outBlob);
4427 PUSHU32(audioInStartAddress, outBlob);
4428 PUSHU32(audioInStopAddress, outBlob);
4429 PUSHU32(audioOutStopAddress, outBlob);
4430 PUSHU32(audioOutStartAddress, outBlob);
4432 PUSHU32(startSample, outBlob);
4434 PUSHU32(currentFrame, outBlob);
4435 currentRP188.RPCEncode(outBlob);
4437 PUSHU64(audioClockCurrentTime, outBlob);
4438 PUSHU32(currentAudioExpectedAddress, outBlob);
4439 PUSHU32(currentAudioStartAddress, outBlob);
4440 PUSHU32(currentFieldCount, outBlob);
4441 PUSHU32(currentLineCount, outBlob);
4442 PUSHU32(currentReps, outBlob);
4443 PUSHU32(currenthUser, outBlob);
4448 { uint16_t v16(0); uint64_t v64(0);
4449 POPU16(v16, inBlob, inOutIndex);
4451 POPU64(v64, inBlob, inOutIndex);
4453 POPU32(frame, inBlob, inOutIndex);
4454 POPU64(audioClockTimeStamp, inBlob, inOutIndex);
4455 POPU32(audioExpectedAddress, inBlob, inOutIndex);
4456 POPU32(audioInStartAddress, inBlob, inOutIndex);
4457 POPU32(audioInStopAddress, inBlob, inOutIndex);
4458 POPU32(audioOutStopAddress, inBlob, inOutIndex);
4459 POPU32(audioOutStartAddress, inBlob, inOutIndex);
4460 POPU32(bytesRead, inBlob, inOutIndex);
4461 POPU32(startSample, inBlob, inOutIndex);
4462 POPU64(v64, inBlob, inOutIndex);
4464 POPU32(currentFrame, inBlob, inOutIndex);
4465 currentRP188.RPCDecode(inBlob, inOutIndex);
4466 POPU64(v64, inBlob, inOutIndex);
4467 currentFrameTime =
LWord64(v64);
4468 POPU64(audioClockCurrentTime, inBlob, inOutIndex);
4469 POPU32(currentAudioExpectedAddress, inBlob, inOutIndex);
4470 POPU32(currentAudioStartAddress, inBlob, inOutIndex);
4471 POPU32(currentFieldCount, inBlob, inOutIndex);
4472 POPU32(currentLineCount, inBlob, inOutIndex);
4473 POPU32(currentReps, inBlob, inOutIndex);
4474 POPU32(currenthUser, inBlob, inOutIndex);
4513 #if defined(AJA_LINUX)
4514 #pragma GCC diagnostic push
4515 #pragma GCC diagnostic ignored "-Wstrict-aliasing"
4517 uint16_t v16(0); uint32_t v32(0);
4518 POPU16(v16, inBlob, inOutIndex);
4520 POPU16(v16, inBlob, inOutIndex);
4522 POPU32(v32, inBlob, inOutIndex); lVal1 =
LWord(v32);
4523 POPU32(v32, inBlob, inOutIndex); lVal2 =
LWord(v32);
4524 POPU32(v32, inBlob, inOutIndex); lVal3 =
LWord(v32);
4525 POPU32(v32, inBlob, inOutIndex); lVal4 =
LWord(v32);
4526 POPU32(v32, inBlob, inOutIndex); lVal5 =
LWord(v32);
4527 POPU32(v32, inBlob, inOutIndex); lVal6 =
LWord(v32);
4540 #if defined(AJA_LINUX)
4541 #pragma GCC diagnostic pop