23 #if !defined(MSWindows)
33 inOutStream <<
DEC(inData.size()) <<
" UWords: ";
36 inOutStream <<
HEX0N(*iter,4);
37 if (++iter != inData.end())
45 inOutStream <<
DEC(inData.size()) <<
" ULWords: ";
48 inOutStream <<
HEX0N(*iter,8);
49 if (++iter != inData.end())
57 inOutStream <<
DEC(inData.size()) <<
" ULWord64s: ";
60 inOutStream <<
HEX0N(*iter,16);
61 if (++iter != inData.end())
79 mFrameRefClockCount = 0;
80 mGlobalClockCount = 0;
81 mFrameTRSError =
false;
90 inOutStream <<
"[CRCA=" <<
DEC(mCRCTallyA)
91 <<
" CRCB=" <<
DEC(mCRCTallyB)
92 <<
" unlk=" <<
xHEX0N(mUnlockTally,8)
93 <<
" frmRefClkCnt=" <<
xHEX0N(mFrameRefClockCount,16)
94 <<
" globalClkCnt=" <<
xHEX0N(mGlobalClockCount,16)
95 <<
" frmTRS=" <<
YesNo(mFrameTRSError)
96 <<
" locked=" <<
YesNo(mLocked)
97 <<
" VPIDA=" <<
YesNo(mVPIDValidA)
98 <<
" VPIDB=" <<
YesNo(mVPIDValidB)
140 inOutStream <<
"Enabled: " <<
YesNo(mEnabled);
143 <<
"Is 4:2:0: " <<
YesNo(mPixel420) << endl
164 transitionCoefficient (0),
165 transitionSoftness (0)
171 : eCommand (inCommand),
172 channelSpec (inCrosspoint),
197 fType (inStructureType),
200 fSizeInBytes (inStructSizeInBytes),
201 fPointerSize (sizeof(int*)),
210 return inObj.
Print (inOutStream);
218 inOutStream << NTV2_4CC_AS_STRING (fHeaderTag);
220 inOutStream <<
"BAD-" <<
HEX0N(fHeaderTag,8);
222 inOutStream << NTV2_4CC_AS_STRING (fType);
224 inOutStream <<
"|BAD-" <<
HEX0N(fType,8);
225 inOutStream <<
" v" << fHeaderVersion <<
" vers=" << fVersion <<
" sz=" << fSizeInBytes;
226 return inOutStream <<
"]";
231 const char * pU32 (
reinterpret_cast<const char *
>(&in4CC));
232 ostringstream result;
235 for (
size_t charPos(0); charPos < 4; charPos++)
237 #if AJATargetBigEndian
238 const char ch(pU32[charPos]);
239 #else // little-endian:
240 const char ch(pU32[3-charPos]);
242 if (ch < ' ' || ch > 126)
243 {result <<
'.'; badTally++;}
249 result <<
" (" <<
xHEX0N(in4CC,8) <<
")";
258 inOutStream << NTV2_4CC_AS_STRING(inObj.
fTrailerTag);
271 return inObj.
Print (inOutStream);
289 if (inDumpMaxBytes > 256)
290 inDumpMaxBytes = 256;
294 for (
UWord ndx(0); ndx < inDumpMaxBytes; ndx++)
295 oss <<
HEX0N(uint16_t(pBytes[ndx]),2);
302 const streamsize maxAddrWidth (
sizeof(
ULWord64) * 2);
305 oss <<
OCT0N(inOffset,maxAddrWidth) <<
": ";
306 else if (inRadix == 10)
307 oss <<
DEC0N(inOffset,maxAddrWidth) <<
": ";
309 oss <<
xHEX0N(inOffset,maxAddrWidth) <<
": ";
314 const size_t inStartOffset,
315 const size_t inByteCount,
316 const size_t inRadix,
317 const size_t inBytesPerGroup,
318 const size_t inGroupsPerRow,
319 const size_t inAddressRadix,
320 const bool inShowAscii,
321 const size_t inAddrOffset)
const
325 if (inRadix != 8 && inRadix != 10 && inRadix != 16 && inRadix != 2)
327 if (inAddressRadix != 0 && inAddressRadix != 8 && inAddressRadix != 10 && inAddressRadix != 16)
329 if (inBytesPerGroup == 0)
334 size_t bytesRemaining (inByteCount ? inByteCount :
GetByteCount());
335 size_t bytesInThisGroup (0);
336 size_t groupsInThisRow (0);
337 const unsigned maxByteWidth (inRadix == 8 ? 4 : (inRadix == 10 ? 3 : (inRadix == 2 ? 8 : 2)));
338 const UByte * pBuffer (
reinterpret_cast <const UByte *
> (pInStartAddress));
339 const size_t asciiBufferSize (inShowAscii && inGroupsPerRow ? (inBytesPerGroup * inGroupsPerRow + 1) *
sizeof (
UByte) : 0);
342 if (!pInStartAddress)
346 ::memset (pAsciiBuffer, 0, asciiBufferSize);
348 if (inGroupsPerRow && inAddressRadix)
350 while (bytesRemaining)
353 inOStream <<
BIN08(*pBuffer);
354 else if (inRadix == 8)
355 inOStream <<
oOCT(uint16_t(*pBuffer));
356 else if (inRadix == 10)
357 inOStream <<
DEC0N(uint16_t(*pBuffer),maxByteWidth);
358 else if (inRadix == 16)
359 inOStream <<
HEX0N(uint16_t(*pBuffer),2);
362 pAsciiBuffer[groupsInThisRow * inBytesPerGroup + bytesInThisGroup] = isprint(*pBuffer) ? *pBuffer :
'.';
367 if (bytesInThisGroup >= inBytesPerGroup)
370 if (inGroupsPerRow && groupsInThisRow >= inGroupsPerRow)
374 inOStream <<
" " << pAsciiBuffer;
375 ::memset (pAsciiBuffer, 0, asciiBufferSize);
378 if (inAddressRadix && bytesRemaining)
379 inOStream << print_address_offset (inAddressRadix, reinterpret_cast <ULWord64> (pBuffer) -
reinterpret_cast <ULWord64> (pInStartAddress) +
ULWord64 (inAddrOffset));
384 bytesInThisGroup = 0;
388 if (bytesInThisGroup && bytesInThisGroup < inBytesPerGroup && pAsciiBuffer)
391 inOStream << string ((inBytesPerGroup - bytesInThisGroup) * maxByteWidth + 1,
' ');
396 if (groupsInThisRow < inGroupsPerRow && pAsciiBuffer)
397 inOStream << string (((inGroupsPerRow - groupsInThisRow) * inBytesPerGroup * maxByteWidth + (inGroupsPerRow - groupsInThisRow)),
' ');
399 inOStream << pAsciiBuffer;
402 else if (bytesInThisGroup && bytesInThisGroup < inBytesPerGroup)
406 delete [] pAsciiBuffer;
413 const size_t inStartOffset,
414 const size_t inByteCount,
415 const size_t inRadix,
416 const size_t inBytesPerGroup,
417 const size_t inGroupsPerRow,
418 const size_t inAddressRadix,
419 const bool inShowAscii,
420 const size_t inAddrOffset)
const
423 Dump (oss, inStartOffset, inByteCount, inRadix, inBytesPerGroup, inGroupsPerRow, inAddressRadix, inShowAscii, inAddrOffset);
424 inOutputString = oss.str();
425 return inOutputString;
446 size_t maxSize (
size_t(
GetByteCount()) /
sizeof(uint64_t));
447 if (maxSize < inU64Offset)
449 maxSize -= inU64Offset;
451 const uint64_t * pU64 (
reinterpret_cast <const uint64_t *
> (
GetHostAddress(
ULWord(inU64Offset *
sizeof(uint64_t)))));
455 if (inMaxSize && inMaxSize < maxSize)
460 outUint64s.reserve(maxSize);
461 for (
size_t ndx(0); ndx < maxSize; ndx++)
463 const uint64_t u64 (*pU64++);
470 outUint64s.reserve(0);
483 size_t maxNumU32s (
size_t(
GetByteCount()) /
sizeof(uint32_t));
484 if (maxNumU32s < inU32Offset)
486 maxNumU32s -= inU32Offset;
488 const uint32_t * pU32 (
reinterpret_cast<const uint32_t*
>(
GetHostAddress(
ULWord(inU32Offset *
sizeof(uint32_t)))));
492 if (inMaxSize && inMaxSize < maxNumU32s)
493 maxNumU32s = inMaxSize;
497 outUint32s.reserve(maxNumU32s);
498 for (
size_t ndx(0); ndx < maxNumU32s; ndx++)
500 const uint32_t u32 (*pU32++);
507 outUint32s.reserve(0);
520 size_t maxSize (
size_t(
GetByteCount()) /
sizeof(uint16_t));
521 if (maxSize < inU16Offset)
523 maxSize -= inU16Offset;
525 const uint16_t * pU16 (
reinterpret_cast <const uint16_t *
> (
GetHostAddress(
ULWord(inU16Offset *
sizeof(uint16_t)))));
529 if (inMaxSize && inMaxSize < maxSize)
534 outUint16s.reserve(maxSize);
535 for (
size_t ndx(0); ndx < maxSize; ndx++)
537 const uint16_t u16 (*pU16++);
544 outUint16s.reserve(0);
558 if (maxSize < inU8Offset)
560 maxSize -= inU8Offset;
566 if (inMaxSize && inMaxSize < maxSize)
571 outUint8s.reserve(maxSize);
572 for (
size_t ndx(0); ndx < maxSize; ndx++)
573 outUint8s.push_back(*pU8++);
578 outUint8s.reserve(0);
586 const uint8_t * pU8 (
reinterpret_cast<const uint8_t*
> (
GetHostPointer()));
592 for (
size_t ndx(0); ndx < maxSize; ndx++)
593 outU8s.push_back(*pU8++);
610 if (maxSize < inU8Offset)
612 maxSize -= inU8Offset;
618 if (inMaxSize && inMaxSize < maxSize)
623 outString.reserve(maxSize);
624 for (
size_t ndx(0); ndx < maxSize; ndx++)
625 outString +=
char(*pU8++);
630 outString.reserve(0);
645 uint64_t * pU64 (
reinterpret_cast<uint64_t*
>(
GetHostAddress(
ULWord(inU64Offset *
sizeof(uint64_t)))));
648 if (maxU64s > inU64Offset)
649 maxU64s -= inU64Offset;
650 if (maxU64s > inU64s.size())
651 maxU64s = inU64s.size();
652 if (inU64s.size() > maxU64s)
655 for (
unsigned ndx(0); ndx < maxU64s; ndx++)
673 uint32_t * pU32 (
reinterpret_cast<uint32_t*
>(
GetHostAddress(
ULWord(inU32Offset *
sizeof(uint32_t)))));
676 if (maxU32s > inU32Offset)
677 maxU32s -= inU32Offset;
678 if (maxU32s > inU32s.size())
679 maxU32s = inU32s.size();
680 if (inU32s.size() > maxU32s)
683 for (
unsigned ndx(0); ndx < maxU32s; ndx++)
701 uint16_t * pU16 (
reinterpret_cast<uint16_t*
>(
GetHostAddress(
ULWord(inU16Offset *
sizeof(uint16_t)))));
704 if (maxU16s > inU16Offset)
705 maxU16s -= inU16Offset;
706 if (maxU16s > inU16s.size())
707 maxU16s = inU16s.size();
708 if (inU16s.size() > maxU16s)
711 for (
unsigned ndx(0); ndx < maxU16s; ndx++)
732 if (maxU8s > inU8Offset)
733 maxU8s -= inU8Offset;
734 if (maxU8s > inU8s.size())
735 maxU8s = inU8s.size();
736 if (inU8s.size() > maxU8s)
739 ::memcpy(pU8, &inU8s[0], maxU8s);
741 for (
unsigned ndx(0); ndx < maxU8s; ndx++)
743 *pU8++ = inU8s.at(ndx);
757 return inOutStream <<
"{invalid}";
763 inOutList.push_back (inRP188);
770 inOutStream << inObj.size () <<
":[";
773 inOutStream << *iter;
774 if (++iter != inObj.end ())
777 return inOutStream <<
"]";
783 inOutStream << inObj.size () <<
":[";
787 if (++iter != inObj.end ())
790 return inOutStream <<
"]";
799 if (++iter != inObj.end ())
809 inOutSet.insert (*iter);
816 return inOutStream << inObj.
acHeader
837 <<
" acFrame=" << inObj.
acFrame
838 <<
" acRP188=" << inObj.
acRP188
849 inOutStream <<
"n/a";
860 while (str.find (
' ') != string::npos)
861 str.erase (str.find (
' '), 1);
906 inOutStream <<
"RegValues:" << inObj.size () <<
"[";
907 while (iter != inObj.end ())
910 const ULWord registerValue (iter->second);
912 if (++iter != inObj.end ())
915 return inOutStream <<
"]";
942 NTV2VideoFormatSet::const_iterator iter (inFormats.begin ());
944 inOStream << inFormats.size ()
945 << (inFormats.size () == 1 ?
" video format: " :
" video format(s): ");
947 while (iter != inFormats.end ())
950 inOStream << (++iter == inFormats.end () ?
"" :
", ");
962 inOStream << inFormats.size()
963 << (inFormats.size() == 1 ?
" pixel format: " :
" pixel formats: ");
965 while (iter != inFormats.end())
968 inOStream << (++iter == inFormats.end() ?
"" :
", ");
978 inOutSet.insert(*iter);
988 inOStream << inStandards.size ()
989 << (inStandards.size () == 1 ?
" standard: " :
" standards: ");
991 while (iter != inStandards.end ())
994 inOStream << (++iter == inStandards.end () ?
"" :
", ");
1004 inOutSet.insert(*iter);
1013 inOStream << inGeometries.size ()
1014 << (inGeometries.size () == 1 ?
" geometry: " :
" geometries: ");
1015 while (iter != inGeometries.end ())
1018 inOStream << (++iter == inGeometries.end () ?
"" :
", ");
1027 inOutSet.insert(*iter);
1036 inOStream << inSet.size()
1037 << (inSet.size() == 1 ?
" input: " :
" inputs: ");
1038 while (iter != inSet.end())
1041 inOStream << (++iter == inSet.end() ?
"" :
", ");
1050 inOutSet.insert (*iter);
1058 inOStream << inSet.size()
1059 << (inSet.size() == 1 ?
" output: " :
" outputs: ");
1060 while (iter != inSet.end())
1063 inOStream << (++iter == inSet.end() ?
"" :
", ");
1072 inOutSet.insert(*iter);
1085 if (outFormats.find(*fit) == outFormats.end())
1086 outFormats.insert(*fit);
1096 if (usedFormats.find(pf) == usedFormats.end())
1097 outFormats.insert(pf);
1103 outStandards.clear();
1110 if (outStandards.find(*sit) == outStandards.end())
1111 outStandards.insert(*sit);
1121 if (usedStandards.find(st) == usedStandards.end())
1122 outStandards.insert(st);
1141 outFormats.insert(vf);
1143 catch (
const std::bad_alloc &)
1151 NTV2_ASSERT ((isOkay && !outFormats.empty()) || (!isOkay && outFormats.empty()));
1166 outFormats.insert(pixelFormat);
1168 catch (
const std::bad_alloc &)
1175 NTV2_ASSERT ((isOkay && !outFormats.empty() ) || (!isOkay && outFormats.empty() ));
1184 outStandards.clear();
1191 outStandards.insert(std);
1200 outGeometries.clear();
1214 outInputSources.clear();
1223 outInputSources.insert(src);
1233 outOutputDests.clear();
1236 for (
size_t ndx(0); ndx < 10; ndx++)
1243 outOutputDests.insert(dst);
1252 << (inSet.size() == 1 ?
" rate: " :
" rates: ");
1253 while (it != inSet.end())
1256 oss << (++it == inSet.end() ?
"" :
", ");
1264 if (inOutSet.find(*it) == inOutSet.end())
1265 inOutSet.insert(*it);
1278 outRates.insert(fr);
1286 return inRun.
Print(inOutStrm);
1293 static const char * sStateStrings [] = {
"Disabled",
"Initializing",
"Starting",
"Paused",
"Stopping",
"Running",
"StartingAtTime",
AJA_NULL};
1295 return string (sStateStrings [inState]);
1309 static const string sSegXferUnits[] = {
"",
" U8",
" U16",
"",
" U32",
"",
"",
"",
" U64",
""};
1314 return inStrm <<
"(invalid)";
1321 inStrm <<
DEC(getSegmentCount()) <<
" x " <<
DEC(getSegmentLength())
1323 if (getSourceOffset())
1324 inStrm <<
" srcOff=" <<
xHEX0N(getSourceOffset(),8);
1325 if (getSegmentCount() > 1)
1326 inStrm <<
" srcSpan=" <<
xHEX0N(getSourcePitch(),8) << (isSourceBottomUp()?
" VF":
"");
1327 if (getDestOffset())
1328 inStrm <<
" dstOff=" <<
xHEX0N(getDestOffset(),8);
1329 if (getSegmentCount() > 1)
1330 inStrm <<
" dstSpan=" <<
xHEX0N(getDestPitch(),8) << (isDestBottomUp()?
" VF":
"");
1331 inStrm <<
" totElm=" <<
DEC(getTotalElements()) <<
" totByt=" <<
xHEX0N(getTotalBytes(),8);
1338 static string var(
"segInfo");
1340 string units(
"\t// bytes");
1344 oss <<
"NTV2SegmentedXferInfo " << var <<
";" << endl;
1345 if (getElementLength() > 1)
1348 oss << var <<
".setElementLength(" << getElementLength() <<
");" << endl;
1350 oss << var <<
".setSegmentCount(" <<
DEC(getSegmentCount()) <<
");" << endl;
1351 oss << var <<
".setSegmentLength(" <<
DEC(getSegmentLength()) <<
");" << units << endl;
1352 if (getSourceOffset())
1353 oss << var <<
".setSourceOffset(" <<
DEC(getSourceOffset()) <<
");" << units << endl;
1354 oss << var <<
".setSourcePitch(" <<
DEC(getSourcePitch()) <<
");" << units << endl;
1355 if (isSourceBottomUp())
1356 oss << var <<
".setSourceDirection(false);" << endl;
1357 if (getDestOffset())
1358 oss << var <<
".setDestOffset(" <<
DEC(getDestOffset()) <<
");" << units << endl;
1360 oss << var <<
".setDestPitch(" <<
DEC(getDestPitch()) <<
");" << units << endl;
1361 if (isDestBottomUp())
1362 oss << var <<
".setDestDirection(false);" << endl;
1370 if (getSegmentCount() == 1)
1372 if (inElementOffset >= getSourceOffset())
1373 if (inElementOffset < getSourceOffset()+getSegmentLength())
1377 ULWord offset(getSourceOffset());
1378 for (
ULWord seg(0); seg < getSegmentCount(); seg++)
1380 if (inElementOffset < offset)
1382 if (inElementOffset < offset+getSegmentLength())
1384 offset += getSourcePitch();
1391 if (getElementLength() != inRHS.getElementLength())
1394 if (getSegmentCount() != inRHS.getSegmentCount())
1396 if (getSegmentLength() != inRHS.getSegmentLength())
1398 if (getSourceOffset() != inRHS.getSourceOffset())
1400 if (getSourcePitch() != inRHS.getSourcePitch())
1402 if (getDestOffset() != inRHS.getDestOffset())
1404 if (getDestPitch() != inRHS.getDestPitch())
1413 mElementsPerSegment = 0;
1414 mInitialSrcOffset = 0;
1415 mInitialDstOffset = 0;
1416 mSrcElementsPerRow = 0;
1417 mDstElementsPerRow = 0;
1424 std::swap(mSrcElementsPerRow, mDstElementsPerRow);
1425 std::swap(mInitialSrcOffset, mInitialDstOffset);
1432 fByteCount (
ULWord(pInUserPointer ? inByteCount : 0)),
1434 #if defined (AJAMac)
1435 fKernelSpacePtr (0),
1446 : fUserSpacePtr (0),
1449 #if defined (AJAMac)
1450 fKernelSpacePtr (0),
1464 : fUserSpacePtr (0),
1467 #if defined (AJAMac)
1468 fKernelSpacePtr (0),
1505 const size_t loopCount(
GetByteCount() /
sizeof(uint64_t));
1508 for (
size_t ndx(0); ndx < loopCount; ndx++)
1517 const size_t loopCount(
GetByteCount() /
sizeof(uint32_t));
1520 for (
size_t ndx(0); ndx < loopCount; ndx++)
1529 const size_t loopCount(
GetByteCount() /
sizeof(uint16_t));
1532 for (
size_t ndx(0); ndx < loopCount; ndx++)
1542 fByteCount =
ULWord(pInUserPointer ? inByteCount : 0);
1544 return (pInUserPointer && inByteCount) || (!pInUserPointer && !inByteCount);
1550 return Set(pInUserPointer, inByteCount) &&
Fill(inValue);
1572 {pBuffer =
new UByte[inByteCount];}
1573 catch (
const std::bad_alloc &)
1575 if (pBuffer &&
Set(pBuffer, inByteCount))
1620 pBytes += inByteOffset;
1656 const ULWord inSrcByteOffset,
const ULWord inDstByteOffset,
const ULWord inByteCount)
1660 if (inSrcByteOffset + inByteCount > inBuffer.
GetByteCount())
1665 const UByte * pSrc (inBuffer);
1666 pSrc += inSrcByteOffset;
1668 UByte * pDst (*
this);
1669 pDst += inDstByteOffset;
1671 ::memcpy (pDst, pSrc, inByteCount);
1678 if (!inXferInfo.isValid() || inSrcBuffer.
IsNULL() ||
IsNULL())
1682 ULWord srcOffset (inXferInfo.getSourceOffset() * inXferInfo.getElementLength());
1683 ULWord dstOffset (inXferInfo.getDestOffset() * inXferInfo.getElementLength());
1684 const ULWord srcPitch (inXferInfo.getSourcePitch() * inXferInfo.getElementLength());
1685 const ULWord dstPitch (inXferInfo.getDestPitch() * inXferInfo.getElementLength());
1686 const ULWord bytesPerSeg (inXferInfo.getSegmentLength() * inXferInfo.getElementLength());
1687 for (
ULWord segNdx(0); segNdx < inXferInfo.getSegmentCount(); segNdx++)
1691 if (!pSrc)
return false;
1692 if (!pDst)
return false;
1693 if (srcOffset + bytesPerSeg > inSrcBuffer.
GetByteCount())
1697 ::memcpy (pDst, pSrc, bytesPerSeg);
1698 srcOffset += srcPitch;
1699 dstOffset += dstPitch;
1713 if (fFlags != inBuffer.fFlags)
1719 fUserSpacePtr = inBuffer.fUserSpacePtr;
1720 inBuffer.fUserSpacePtr = tmp;
1736 const uint8_t * pSrchData (inValue);
1737 const uint8_t * pMyData (*
this);
1741 if (!::memcmp(pMyData, pSrchData, srchByteCount))
1742 outOffsets.insert(offset);
1745 }
while (offset < maxOffset);
1757 if (inByteOffset >= totalBytes)
1760 totalBytes -= inByteOffset;
1762 ULWord byteCount(inByteCount);
1763 if (byteCount > totalBytes)
1764 byteCount = totalBytes;
1769 const UByte * pByte1 (*
this);
1770 const UByte * pByte2 (inBuffer);
1771 pByte1 += inByteOffset;
1772 pByte2 += inByteOffset;
1773 #if !defined(NTV2BUFFER_NO_MEMCMP)
1774 return ::memcmp (pByte1, pByte2, byteCount) == 0;
1775 #else // NTV2BUFFER_NO_MEMCMP
1776 ULWord offset(inByteOffset);
1779 if (*pByte1 != *pByte2)
1781 cerr <<
"## ERROR: IsContentEqual: miscompare at offset " <<
xHEX0N(offset,8)
1782 <<
" (" <<
DEC(offset) <<
"): " <<
xHEX0N(
UWord(*pByte1),2) <<
" != "
1784 <<
DEC(byteCount) <<
") bytes left to compare" << endl;
1792 #endif // NTV2BUFFER_NO_MEMCMP
1797 if (byteOffset == 0xFFFFFFFF)
1804 {byteOffset = 0xFFFFFFFF;
return true;}
1807 if (byteOffset >= totalBytesToCompare)
1809 totalBytesToCompare -= byteOffset;
1811 const UByte * pByte1 (*
this);
1812 const UByte * pByte2 (inBuffer);
1813 while (totalBytesToCompare)
1815 if (pByte1[byteOffset] != pByte2[byteOffset])
1817 totalBytesToCompare--;
1820 byteOffset = 0xFFFFFFFF;
1826 outByteOffsetFirst = outByteOffsetLast =
GetByteCount ();
1839 outByteOffsetFirst = 0;
1842 if (*pByte1 != *pByte2)
1846 outByteOffsetFirst++;
1848 if (outByteOffsetFirst == 0)
1853 if (*pByte1 == *pByte2)
1857 outByteOffsetFirst++;
1860 outByteOffsetFirst--;
1870 while (--outByteOffsetLast)
1872 if (*pByte1 != *pByte2)
1880 while (outByteOffsetLast)
1882 if (*pByte1 == *pByte2)
1886 outByteOffsetLast--;
1889 outByteOffsetLast++;
1890 if (outByteOffsetLast <= outByteOffsetFirst)
1891 cerr <<
"## WARNING: GetRingChangedByteRange: last " << outByteOffsetLast <<
" <= first " << outByteOffsetFirst <<
" in wrap condition" << endl;
1892 const ULWord tmp (outByteOffsetLast);
1893 outByteOffsetLast = outByteOffsetFirst;
1894 outByteOffsetFirst = tmp;
1895 if (outByteOffsetLast >= outByteOffsetFirst)
1896 cerr <<
"## WARNING: GetRingChangedByteRange: last " << outByteOffsetLast <<
" >= first " << outByteOffsetFirst <<
" in wrap condition" << endl;
1912 const bool result (inNewSize && (!(inNewSize & (inNewSize - 1))));
1920 #if defined(MSWindows) || defined(AJABareMetal)
1921 return AJA_PAGE_SIZE;
1923 return size_t(::getpagesize());
1931 acRequestedFrame (0),
1932 acAudioClockTimeStamp (0),
1933 acAudioExpectedAddress (0),
1934 acAudioInStartAddress (0),
1935 acAudioInStopAddress (0),
1936 acAudioOutStopAddress (0),
1937 acAudioOutStartAddress (0),
1938 acTotalBytesTransferred (0),
1943 acCurrentFrameTime (0),
1944 acAudioClockCurrentTime (0),
1945 acCurrentAudioExpectedAddress (0),
1946 acCurrentAudioStartAddress (0),
1947 acCurrentFieldCount (0),
1948 acCurrentLineCount (0),
1950 acCurrentUserCookie (0),
1959 : acHeader (inObj.acHeader),
1960 acFrameTime (inObj.acFrameTime),
1961 acRequestedFrame (inObj.acRequestedFrame),
1962 acAudioClockTimeStamp (inObj.acAudioClockTimeStamp),
1963 acAudioExpectedAddress (inObj.acAudioExpectedAddress),
1964 acAudioInStartAddress (inObj.acAudioInStartAddress),
1965 acAudioInStopAddress (inObj.acAudioInStopAddress),
1966 acAudioOutStopAddress (inObj.acAudioOutStopAddress),
1967 acAudioOutStartAddress (inObj.acAudioOutStartAddress),
1968 acTotalBytesTransferred (inObj.acTotalBytesTransferred),
1969 acStartSample (inObj.acStartSample),
1970 acCurrentTime (inObj.acCurrentTime),
1971 acCurrentFrame (inObj.acCurrentFrame),
1972 acCurrentFrameTime (inObj.acCurrentFrameTime),
1973 acAudioClockCurrentTime (inObj.acAudioClockCurrentTime),
1974 acCurrentAudioExpectedAddress (inObj.acCurrentAudioExpectedAddress),
1975 acCurrentAudioStartAddress (inObj.acCurrentAudioStartAddress),
1976 acCurrentFieldCount (inObj.acCurrentFieldCount),
1977 acCurrentLineCount (inObj.acCurrentLineCount),
1978 acCurrentReps (inObj.acCurrentReps),
1979 acCurrentUserCookie (inObj.acCurrentUserCookie),
1980 acFrame (inObj.acFrame),
1981 acRP188 (inObj.acRP188),
1982 acTrailer (inObj.acTrailer)
2005 for (
ULWord ndx (0); ndx < numRP188s; ndx++)
2006 outValues << pArray [ndx];
2025 outTimeCode = pArray [inTCIndex];
2033 outTimeCodes.clear();
2049 outTimeCodes[tcIndex] = tc;
2051 outTimeCodes[tcIndex] = tc;
2061 (void)inSDIInputIndex0;
2069 if (!pArray || !numRP188s)
2074 if (
ULWord(inTCNdx) >= numRP188s)
2077 pArray[inTCNdx] = inTimecode;
2225 if (mInStatistics.
IsNULL())
2240 if (numElements != 8)
2242 if (inSDIInputIndex0 >= numElements)
2244 outStatus = pArray[inSDIInputIndex0];
2256 if (numElements != 8)
2258 if (inSDIInputIndex0 >= numElements)
2260 return pArray[inSDIInputIndex0];
2266 inOutStream << mHeader <<
", " << mInStatistics <<
", " << mTrailer;
return inOutStream;
2273 acTransferFrame (0),
2275 acFramesProcessed (0),
2276 acFramesDropped (0),
2278 acAudioTransferSize (0),
2279 acAudioStartSample (0),
2280 acAncTransferSize (0),
2281 acAncField2TransferSize (0)
2290 acCrosspoint (inCrosspoint),
2295 acRDTSCStartTime (0),
2296 acAudioClockStartTime (0),
2297 acRDTSCCurrentTime (0),
2298 acAudioClockCurrentTime (0),
2299 acFramesProcessed (0),
2300 acFramesDropped (0),
2407 if (inIndexNum == 0)
2424 case 13: oss << (
WithRP188() ?
"Yes" :
"No");
break;
2425 case 14: oss << (
WithLTC() ?
"Yes" :
"No");
break;
2429 case 18: oss << (
WithVidProc() ?
"Yes" :
"No");
break;
2432 case 21: oss << (
IsFieldMode() ?
"Yes" :
"No");
break;
2435 else if (inIndexNum < 22)
2445 << (inObj.
IsInput() ?
"Input " : (inObj.
IsOutput() ?
"Output" :
"*BAD* "))
2454 << setw(10) << (inObj.
WithRP188() ?
"+RP188" :
"-RP188")
2455 << setw(10) << (inObj.
WithLTC() ?
"+LTC" :
"-LTC")
2456 << setw(10) << (inObj.
WithFBFChange() ?
"+FBFchg" :
"-FBFchg")
2457 << setw(10) << (inObj.
WithFBOChange() ?
"+FBOchg" :
"-FBOchg")
2459 << setw(10) << (inObj.
WithVidProc() ?
"+VidProc" :
"-VidProc")
2460 << setw(10) << (inObj.
WithCustomAnc() ?
"+AncData" :
"-AncData")
2462 << setw(10) << (inObj.
IsFieldMode() ?
"+FldMode" :
"-FldMode");
2475 Set (inNumSegments, inNumActiveBytesPerRow, inHostBytesPerRow, inDeviceBytesPerRow);
2501 ccSaturationValue (0)
2538 acTransferStatus (),
2540 acInVideoDMAOffset (0),
2541 acInSegmentedDMAInfo (),
2542 acColorCorrection (),
2547 acPeerToPeerFlags (0),
2548 acFrameRepeatCount (1),
2549 acDesiredFrame (-1),
2561 ULWord * pInANCF2Buffer,
const ULWord inANCF2ByteCount)
2563 acVideoBuffer (pInVideoBuffer, inVideoByteCount),
2564 acAudioBuffer (pInAudioBuffer, inAudioByteCount),
2565 acANCBuffer (pInANCBuffer, inANCByteCount),
2566 acANCField2Buffer (pInANCF2Buffer, inANCF2ByteCount),
2568 acTransferStatus (),
2570 acInVideoDMAOffset (0),
2571 acInSegmentedDMAInfo (),
2572 acColorCorrection (),
2577 acPeerToPeerFlags (0),
2578 acFrameRepeatCount (1),
2579 acDesiredFrame (-1),
2595 ULWord * pInAudioBuffer,
const ULWord inAudioByteCount,
2597 ULWord * pInANCF2Buffer,
const ULWord inANCF2ByteCount)
2602 &&
SetAncBuffers (pInANCBuffer, inANCByteCount, pInANCF2Buffer, inANCF2ByteCount);
2643 for (
UWord ndx (0); ndx <
UWord(maxNumValues); ndx++)
2665 pArray[inTCIndex] = inTimeCode;
2679 for (
ULWord tcIndex(0); tcIndex < maxNumValues; tcIndex++)
2683 pArray[tcIndex] = inTimeCode;
2706 const ULWord inHostBytesPerRow,
const ULWord inDeviceBytesPerRow)
2920 mInNumRegisters (
ULWord (inRegisterNumbers.size ())),
2921 mOutNumRegisters (0)
2930 mInNumRegisters (
ULWord (inRegReads.size ())),
2931 mOutNumRegisters (0)
2941 mInNumRegisters =
ULWord(inRegisterNumbers.size());
2942 mOutNumRegisters = 0;
2943 bool result ( mInRegisters.
Allocate(mInNumRegisters *
sizeof(
ULWord))
2950 ULWord * pRegArray(mInRegisters);
2956 pRegArray[ndx++] = *iter;
2963 if (!mInNumRegisters)
2970 const ULWord * pRegNums(mInRegisters);
2971 for (
ULWord ndx(0); ndx < mInNumRegisters; ndx++)
2972 if (outRegNums.find(pRegNums[ndx]) == outRegNums.end())
2973 outRegNums.insert(pRegNums[ndx]);
2981 outGoodRegNums.clear();
2982 if (!mOutGoodRegisters)
2984 if (!mOutNumRegisters)
2986 if (mOutNumRegisters > mInNumRegisters)
2989 const ULWord * pRegArray (mOutGoodRegisters);
2990 for (
ULWord ndx(0); ndx < mOutNumRegisters; ndx++)
2991 outGoodRegNums.insert(pRegArray[ndx]);
2998 outBadRegNums.clear();
3004 if (reqRegNums == goodRegNums)
3008 std::set_difference (reqRegNums.begin(), reqRegNums.end(),
3009 goodRegNums.begin(), goodRegNums.end(),
3010 std::inserter(outBadRegNums, outBadRegNums.begin()));
3016 if (!mOutGoodRegisters)
3018 if (!mOutNumRegisters)
3020 if (mOutNumRegisters > mInNumRegisters)
3026 const ULWord * pRegArray (mOutGoodRegisters);
3027 ULWord * pValArray (mOutValues);
3028 for (
ULWord ndx(0); ndx < mOutNumRegisters; ndx++)
3029 if (pRegArray[ndx] == inRegNum)
3031 pValArray[ndx] = inValue;
3042 if (!mOutGoodRegisters)
3044 if (!mOutNumRegisters)
3046 if (mOutNumRegisters > mInNumRegisters)
3053 const ULWord * pRegArray (mOutGoodRegisters);
3054 const ULWord * pValArray (mOutValues);
3055 for (
ULWord ndx(0); ndx < mOutNumRegisters; ndx++)
3056 outValues [pRegArray[ndx]] = pValArray[ndx];
3067 if (outValues.empty())
3070 outValues.push_back(
NTV2RegInfo(it->first, it->second));
3075 uint32_t missingTally(0);
3079 if (mapIter == regValMap.end())
3081 it->registerValue = mapIter->second;
3083 return !missingTally;
3090 inOutStream << mHeader <<
", numRegs=" << mInNumRegisters <<
", inRegs=" << mInRegisters <<
", outNumGoodRegs=" << mOutNumRegisters
3091 <<
", outGoodRegs=" << mOutGoodRegisters <<
", outValues=" << mOutValues <<
", " << mTrailer;
3098 mInNumRegisters (
ULWord(inRegWrites.size())),
3122 pBadRegIndexes[ndx] = 0;
3124 pRegInfoArray[ndx++] = *it;
3135 outFailedRegWrites.clear();
3141 outRegWrites.clear();
3150 outRegWrites.push_back(pRegInfos[ndx]);
3163 if (pBadRegIndexes && maxNumBadRegIndexes && pRegInfoArray && maxNumRegInfos &&
mOutNumFailures)
3166 for (
UWord num(0); num < maxNumBadRegIndexes; num++)
3168 const UWord badRegIndex (pBadRegIndexes[num]);
3169 if (badRegIndex < maxNumRegInfos)
3171 const NTV2RegInfo & badRegInfo (pRegInfoArray[badRegIndex]);
3172 oss <<
"Failure " << num <<
": " << badRegInfo << endl;
3182 typedef std::pair <ULWord, ULWord> ULWordPair;
3183 typedef std::pair <ULWordPair, ULWordPair> ULWordPairs;
3206 const bool badName (regName.find(
' ') != string::npos);
3209 oss <<
"theDevice.WriteRegister (";
3246 for (NTV2ULWordVector::const_iterator it(inObj.begin()); it != inObj.end(); ++it)
3247 inOutStream <<
" " <<
HEX0N(*it,8);
3254 inOutStream << (inCompact ?
"Ch[" :
"[");
3258 inOutStream <<
DEC(*it+1);
3261 if (++it != inObj.end())
3262 inOutStream << (inCompact ?
"|" :
",");
3264 return inOutStream <<
"]";
3268 { ostringstream oss;
3275 inOutStream << (inCompact ?
"Ch{" :
"{");
3279 inOutStream <<
DEC(*it+1);
3282 if (++it != inObj.end())
3283 inOutStream << (inCompact ?
"|" :
",");
3285 return inOutStream <<
"}";
3289 { ostringstream oss;
3316 result.push_back(ch);
3324 result.push_back(*it);
3330 inOutStream << (inCompact ?
"AudSys{" :
"{");
3334 inOutStream <<
DEC(*it+1);
3337 if (++it != inObj.end())
3338 inOutStream << (inCompact ?
"|" :
",");
3340 return inOutStream <<
"}";
3344 { ostringstream oss;
3354 result.insert(audSys);
3362 if (result.find(it->registerNumber) == result.end())
3363 result.insert(it->registerNumber);
3370 if (iter->registerNumber == inRegNum)
3372 return inRegInfos.end();
3378 return inObj.
Print(inOutStream);
3384 inOutStream << inObj.size () <<
" regs:" << endl;
3386 inOutStream << *iter << endl;
3393 mIsWriting (inDoWrite),
3399 *pRegInfo = inBankSelect;
3402 *pRegInfo = inOutRegInfo;
3415 if (
ULWord(inIndex0) < maxNum)
3416 result = pRegInfos[inIndex0];
3428 if (
mInBankInfos) oss << *pBankRegInfo;
else oss <<
"-";
3429 oss <<
" regInfos=";
3430 if (
mInRegInfos) oss << *pRegInfo;
else oss <<
"-";
3438 mIsWriting (inDoWrite),
3439 mVirtualData (inVirtualData, inVirtualDataSize)
3457 #define AsU8Ref(_x_) reinterpret_cast<uint8_t&>(_x_)
3458 #define AsU16Ref(_x_) reinterpret_cast<uint16_t&>(_x_)
3459 #define AsU32Ref(_x_) reinterpret_cast<uint32_t&>(_x_)
3460 #define AsU64Ref(_x_) reinterpret_cast<uint64_t&>(_x_)
3466 PUSHU32(fHeaderVersion, outBlob);
3468 PUSHU32(fSizeInBytes, outBlob);
3469 PUSHU32(fPointerSize, outBlob);
3471 PUSHU32(fResultStatus, outBlob);
3477 POPU32(fHeaderTag, inBlob, inOutIndex);
3478 POPU32(fType, inBlob, inOutIndex);
3479 POPU32(fHeaderVersion, inBlob, inOutIndex);
3480 POPU32(fVersion, inBlob, inOutIndex);
3481 POPU32(fSizeInBytes, inBlob, inOutIndex);
3482 POPU32(fPointerSize, inBlob, inOutIndex);
3483 POPU32(fOperation, inBlob, inOutIndex);
3484 POPU32(fResultStatus, inBlob, inOutIndex);
3490 PUSHU32(fTrailerVersion, outBlob);
3491 PUSHU32(fTrailerTag, outBlob);
3497 POPU32(fTrailerVersion, inBlob, inOutIndex);
3498 POPU32(fTrailerTag, inBlob, inOutIndex);
3514 ULWord byteCount(0), flags(0);
3515 POPU32(byteCount, inBlob, inOutIndex);
3516 POPU32(flags, inBlob, inOutIndex);
3519 if ((inOutIndex + byteCount) > inBlob.size())
3521 for (
ULWord cnt(0); cnt < byteCount; cnt++)
3522 U8(
int(cnt)) = inBlob.at(inOutIndex++);
3528 const size_t totBytes (mHeader.GetSizeInBytes()
3529 + mInRegisters.GetByteCount() + mOutGoodRegisters.GetByteCount() + mOutValues.GetByteCount());
3530 if (outBlob.capacity() < totBytes)
3531 outBlob.reserve(totBytes);
3534 mInRegisters.ByteSwap32();
3535 mOutGoodRegisters.ByteSwap32();
3536 mOutValues.ByteSwap32();
3538 bool ok = mHeader.RPCEncode(outBlob);
3539 PUSHU32(mInNumRegisters, outBlob);
3540 ok &= mInRegisters.RPCEncode(outBlob);
3541 PUSHU32(mOutNumRegisters, outBlob);
3542 ok &= mOutGoodRegisters.RPCEncode(outBlob)
3543 && mOutValues.RPCEncode(outBlob)
3544 && mTrailer.RPCEncode(outBlob);
3547 mInRegisters.ByteSwap32();
3548 mOutGoodRegisters.ByteSwap32();
3549 mOutValues.ByteSwap32();
3556 bool ok = mHeader.RPCDecode(inBlob, inOutIndex);
3557 if (!ok)
return false;
3558 POPU32(mInNumRegisters, inBlob, inOutIndex);
3559 ok &= mInRegisters.RPCDecode(inBlob, inOutIndex);
3560 POPU32(mOutNumRegisters, inBlob, inOutIndex);
3561 ok &= mOutGoodRegisters.RPCDecode(inBlob, inOutIndex);
3562 ok &= mOutValues.RPCDecode(inBlob, inOutIndex);
3563 ok &= mTrailer.RPCDecode(inBlob, inOutIndex);
3566 mInRegisters.ByteSwap32();
3567 mOutGoodRegisters.ByteSwap32();
3568 mOutValues.ByteSwap32();
3575 const size_t totBytes (mHeader.GetSizeInBytes()
3576 + mInRegInfos.GetByteCount() + mOutBadRegIndexes.GetByteCount());
3577 if (outBlob.capacity() < totBytes)
3578 outBlob.reserve(totBytes);
3581 mInRegInfos.ByteSwap32();
3582 mOutBadRegIndexes.ByteSwap32();
3584 bool ok = mHeader.RPCEncode(outBlob);
3585 PUSHU32(mInNumRegisters, outBlob);
3586 ok &= mInRegInfos.RPCEncode(outBlob);
3587 PUSHU32(mOutNumFailures, outBlob);
3588 ok &= mOutBadRegIndexes.RPCEncode(outBlob)
3589 && mTrailer.RPCEncode(outBlob);
3592 mInRegInfos.ByteSwap32();
3593 mOutBadRegIndexes.ByteSwap16();
3600 bool ok = mHeader.RPCDecode(inBlob, inOutIndex);
3601 POPU32(mInNumRegisters, inBlob, inOutIndex);
3602 ok &= mInRegInfos.RPCDecode(inBlob, inOutIndex);
3603 POPU32(mOutNumFailures, inBlob, inOutIndex);
3604 ok &= mOutBadRegIndexes.RPCDecode(inBlob, inOutIndex);
3605 ok &= mTrailer.RPCDecode(inBlob, inOutIndex);
3608 mInRegInfos.ByteSwap32();
3609 mOutBadRegIndexes.ByteSwap16();
3616 const size_t totBytes (mHeader.GetSizeInBytes()
3617 + mInBankInfos.GetByteCount() + mInRegInfos.GetByteCount());
3618 if (outBlob.capacity() < totBytes)
3619 outBlob.reserve(totBytes);
3622 mInBankInfos.ByteSwap32();
3623 mInRegInfos.ByteSwap32();
3625 bool ok = mHeader.RPCEncode(outBlob);
3627 ok &= mInBankInfos.RPCEncode(outBlob);
3628 ok &= mInRegInfos.RPCEncode(outBlob)
3629 && mTrailer.RPCEncode(outBlob);
3632 mInBankInfos.ByteSwap32();
3633 mInRegInfos.ByteSwap32();
3640 bool ok = mHeader.RPCDecode(inBlob, inOutIndex);
3641 POPU32(mIsWriting, inBlob, inOutIndex);
3642 ok &= mInBankInfos.RPCDecode(inBlob, inOutIndex);
3643 ok &= mInRegInfos.RPCDecode(inBlob, inOutIndex);
3644 ok &= mTrailer.RPCDecode(inBlob, inOutIndex);
3647 mInBankInfos.ByteSwap32();
3648 mInRegInfos.ByteSwap32();
3655 const size_t totBytes (acHeader.GetSizeInBytes());
3656 if (outBlob.capacity() < totBytes)
3657 outBlob.reserve(totBytes);
3658 bool ok = acHeader.RPCEncode(outBlob);
3664 PUSHU64(acRDTSCStartTime, outBlob);
3665 PUSHU64(acAudioClockStartTime, outBlob);
3666 PUSHU64(acRDTSCCurrentTime, outBlob);
3667 PUSHU64(acAudioClockCurrentTime, outBlob);
3668 PUSHU32(acFramesProcessed, outBlob);
3669 PUSHU32(acFramesDropped, outBlob);
3670 PUSHU32(acBufferLevel, outBlob);
3671 PUSHU32(acOptionFlags, outBlob);
3673 ok &= acTrailer.RPCEncode(outBlob);
3678 { uint16_t v16(0); uint32_t v32(0);
3679 bool ok = acHeader.RPCDecode(inBlob, inOutIndex);
3680 POPU16(v16, inBlob, inOutIndex);
3682 POPU16(v16, inBlob, inOutIndex);
3684 POPU32(v32, inBlob, inOutIndex);
3685 acStartFrame =
LWord(v32);
3686 POPU32(v32, inBlob, inOutIndex);
3687 acEndFrame =
LWord(v32);
3688 POPU32(v32, inBlob, inOutIndex);
3689 acActiveFrame =
LWord(v32);
3690 POPU64(acRDTSCStartTime, inBlob, inOutIndex);
3691 POPU64(acAudioClockStartTime, inBlob, inOutIndex);
3692 POPU64(acRDTSCCurrentTime, inBlob, inOutIndex);
3693 POPU64(acAudioClockCurrentTime, inBlob, inOutIndex);
3694 POPU32(acFramesProcessed, inBlob, inOutIndex);
3695 POPU32(acFramesDropped, inBlob, inOutIndex);
3696 POPU32(acBufferLevel, inBlob, inOutIndex);
3697 POPU32(acOptionFlags, inBlob, inOutIndex);
3698 POPU16(v16, inBlob, inOutIndex);
3700 ok &= acTrailer.RPCDecode(inBlob, inOutIndex);
3706 const size_t totBytes (acHeader.GetSizeInBytes());
3707 if (outBlob.capacity() < totBytes)
3708 outBlob.reserve(totBytes);
3709 bool ok = acHeader.RPCEncode(outBlob);
3711 PUSHU32(acRequestedFrame, outBlob);
3712 PUSHU64(acAudioClockTimeStamp, outBlob);
3713 PUSHU32(acAudioExpectedAddress, outBlob);
3714 PUSHU32(acAudioInStartAddress, outBlob);
3715 PUSHU32(acAudioInStopAddress, outBlob);
3716 PUSHU32(acAudioOutStopAddress, outBlob);
3717 PUSHU32(acAudioOutStartAddress, outBlob);
3718 PUSHU32(acTotalBytesTransferred, outBlob);
3719 PUSHU32(acStartSample, outBlob);
3721 ok &= acTimeCodes.RPCEncode(outBlob);
3723 PUSHU32(acCurrentFrame, outBlob);
3725 PUSHU64(acAudioClockCurrentTime, outBlob);
3726 PUSHU32(acCurrentAudioExpectedAddress, outBlob);
3727 PUSHU32(acCurrentAudioStartAddress, outBlob);
3728 PUSHU32(acCurrentFieldCount, outBlob);
3729 PUSHU32(acCurrentLineCount, outBlob);
3730 PUSHU32(acCurrentReps, outBlob);
3731 PUSHU64(acCurrentUserCookie, outBlob);
3733 PUSHU32(acRP188.fDBB, outBlob);
3734 PUSHU32(acRP188.fLo, outBlob);
3735 PUSHU32(acRP188.fHi, outBlob);
3736 ok &= acTrailer.RPCEncode(outBlob);
3742 bool ok = acHeader.RPCDecode(inBlob, inOutIndex);
3743 POPU64(v64, inBlob, inOutIndex);
3745 POPU32(acRequestedFrame, inBlob, inOutIndex);
3746 POPU64(acAudioClockTimeStamp, inBlob, inOutIndex);
3747 POPU32(acAudioExpectedAddress, inBlob, inOutIndex);
3748 POPU32(acAudioInStartAddress, inBlob, inOutIndex);
3749 POPU32(acAudioInStopAddress, inBlob, inOutIndex);
3750 POPU32(acAudioOutStopAddress, inBlob, inOutIndex);
3751 POPU32(acAudioOutStartAddress, inBlob, inOutIndex);
3752 POPU32(acTotalBytesTransferred, inBlob, inOutIndex);
3753 POPU32(acStartSample, inBlob, inOutIndex);
3755 ok &= acTimeCodes.RPCDecode(inBlob, inOutIndex);
3756 POPU64(v64, inBlob, inOutIndex);
3758 POPU32(acCurrentFrame, inBlob, inOutIndex);
3759 POPU64(v64, inBlob, inOutIndex);
3760 acCurrentFrameTime =
LWord64(v64);
3761 POPU64(acAudioClockCurrentTime, inBlob, inOutIndex);
3762 POPU32(acCurrentAudioExpectedAddress, inBlob, inOutIndex);
3763 POPU32(acCurrentAudioStartAddress, inBlob, inOutIndex);
3764 POPU32(acCurrentFieldCount, inBlob, inOutIndex);
3765 POPU32(acCurrentLineCount, inBlob, inOutIndex);
3766 POPU32(acCurrentReps, inBlob, inOutIndex);
3767 POPU64(acCurrentUserCookie, inBlob, inOutIndex);
3768 POPU32(acFrame, inBlob, inOutIndex);
3769 POPU32(acRP188.fDBB, inBlob, inOutIndex);
3770 POPU32(acRP188.fLo, inBlob, inOutIndex);
3771 POPU32(acRP188.fHi, inBlob, inOutIndex);
3772 ok &= acTrailer.RPCDecode(inBlob, inOutIndex);
3778 const size_t totBytes (acHeader.GetSizeInBytes());
3779 if (outBlob.capacity() < totBytes)
3780 outBlob.reserve(totBytes);
3781 bool ok = acHeader.RPCEncode(outBlob);
3784 PUSHU32(acBufferLevel, outBlob);
3785 PUSHU32(acFramesProcessed, outBlob);
3786 PUSHU32(acFramesDropped, outBlob);
3787 ok &= acFrameStamp.RPCEncode(outBlob);
3788 PUSHU32(acAudioTransferSize, outBlob);
3789 PUSHU32(acAudioStartSample, outBlob);
3790 PUSHU32(acAncTransferSize, outBlob);
3791 PUSHU32(acAncField2TransferSize, outBlob);
3792 ok &= acTrailer.RPCEncode(outBlob);
3797 { uint16_t v16(0); uint32_t v32(0);
3798 bool ok = acHeader.RPCDecode(inBlob, inOutIndex);
3799 POPU16(v16, inBlob, inOutIndex);
3801 POPU32(v32, inBlob, inOutIndex);
3802 acTransferFrame =
LWord(v32);
3803 POPU32(acBufferLevel, inBlob, inOutIndex);
3804 POPU32(acFramesProcessed, inBlob, inOutIndex);
3805 POPU32(acFramesDropped, inBlob, inOutIndex);
3806 ok &= acFrameStamp.RPCDecode(inBlob, inOutIndex);
3807 POPU32(acAudioTransferSize, inBlob, inOutIndex);
3808 POPU32(acAudioStartSample, inBlob, inOutIndex);
3809 POPU32(acAncTransferSize, inBlob, inOutIndex);
3810 POPU32(acAncField2TransferSize, inBlob, inOutIndex);
3811 ok &= acTrailer.RPCDecode(inBlob, inOutIndex);
3817 PUSHU32(acNumSegments, outBlob);
3818 PUSHU32(acNumActiveBytesPerRow, outBlob);
3819 PUSHU32(acSegmentHostPitch, outBlob);
3820 PUSHU32(acSegmentDevicePitch, outBlob);
3826 POPU32(acNumSegments, inBlob, inOutIndex);
3827 POPU32(acNumActiveBytesPerRow, inBlob, inOutIndex);
3828 POPU32(acSegmentHostPitch, inBlob, inOutIndex);
3829 POPU32(acSegmentDevicePitch, inBlob, inOutIndex);
3836 PUSHU32(ccSaturationValue, outBlob);
3837 return ccLookupTables.RPCEncode(outBlob);
3842 POPU16(u16, inBlob, inOutIndex);
3844 POPU32(ccSaturationValue, inBlob, inOutIndex);
3845 return ccLookupTables.RPCDecode(inBlob, inOutIndex);
3851 PUSHU16(foregroundVideoCrosspoint, outBlob);
3852 PUSHU16(backgroundVideoCrosspoint, outBlob);
3853 PUSHU16(foregroundKeyCrosspoint, outBlob);
3854 PUSHU16(backgroundKeyCrosspoint, outBlob);
3861 { uint16_t v16(0); uint32_t v32(0);
3862 POPU16(v16, inBlob, inOutIndex);
3864 POPU16(v16, inBlob, inOutIndex);
3866 POPU16(v16, inBlob, inOutIndex);
3868 POPU16(v16, inBlob, inOutIndex);
3870 POPU16(v16, inBlob, inOutIndex);
3872 POPU32(v32, inBlob, inOutIndex);
3873 transitionCoefficient =
Fixed_(v32);
3874 POPU32(v32, inBlob, inOutIndex);
3875 transitionSoftness =
Fixed_(v32);
3889 POPU32(fDBB, inBlob, inOutIndex);
3890 POPU32(fLo, inBlob, inOutIndex);
3891 POPU32(fHi, inBlob, inOutIndex);
3898 const size_t totBytes (acHeader.GetSizeInBytes() + acVideoBuffer.GetByteCount() + acAudioBuffer.GetByteCount()
3899 + acANCBuffer.GetByteCount() + acANCField2Buffer.GetByteCount() + acOutputTimeCodes.GetByteCount()
3900 + acHDMIAuxData.GetByteCount() + 64);
3901 if (outBlob.capacity() < totBytes)
3902 outBlob.reserve(totBytes);
3903 bool ok = acHeader.RPCEncode(outBlob);
3904 ok &= acVideoBuffer.RPCEncode(outBlob);
3905 ok &= acAudioBuffer.RPCEncode(outBlob);
3906 ok &= acANCBuffer.RPCEncode(outBlob);
3907 ok &= acANCField2Buffer.RPCEncode(outBlob);
3908 ok &= acOutputTimeCodes.RPCEncode(outBlob);
3909 ok &= acTransferStatus.RPCEncode(outBlob);
3910 PUSHU64(acInUserCookie, outBlob);
3911 PUSHU32(acInVideoDMAOffset, outBlob);
3912 ok &= acInSegmentedDMAInfo.RPCEncode(outBlob);
3913 ok &= acColorCorrection.RPCEncode(outBlob);
3914 PUSHU16(acFrameBufferFormat, outBlob);
3915 PUSHU16(acFrameBufferOrientation, outBlob);
3916 ok &= acVidProcInfo.RPCEncode(outBlob);
3917 PUSHU16(acVideoQuarterSizeExpand, outBlob);
3918 ok &= acHDMIAuxData.RPCEncode(outBlob);
3919 PUSHU32(acPeerToPeerFlags, outBlob);
3920 PUSHU32(acFrameRepeatCount, outBlob);
3922 ok &= acRP188.RPCEncode(outBlob);
3923 PUSHU16(acCrosspoint, outBlob);
3924 ok &= acTrailer.RPCEncode(outBlob);
3930 { uint16_t v16(0); uint32_t v32(0);
3932 bool ok = acHeader.RPCDecode(inBlob, inOutIndex);
3933 ok &= acVideoBuffer.RPCDecode(inBlob, inOutIndex);
3934 ok &= acAudioBuffer.RPCDecode(inBlob, inOutIndex);
3935 ok &= acANCBuffer.RPCDecode(inBlob, inOutIndex);
3936 ok &= acANCField2Buffer.RPCDecode(inBlob, inOutIndex);
3937 ok &= acOutputTimeCodes.RPCDecode(inBlob, inOutIndex);
3938 ok &= acTransferStatus.RPCDecode(inBlob, inOutIndex);
3939 POPU64(acInUserCookie, inBlob, inOutIndex);
3940 POPU32(acInVideoDMAOffset, inBlob, inOutIndex);
3941 ok &= acInSegmentedDMAInfo.RPCDecode(inBlob, inOutIndex);
3942 ok &= acColorCorrection.RPCDecode(inBlob, inOutIndex);
3943 POPU16(v16, inBlob, inOutIndex);
3945 POPU16(v16, inBlob, inOutIndex);
3947 ok &= acVidProcInfo.RPCDecode(inBlob, inOutIndex);
3948 POPU16(v16, inBlob, inOutIndex);
3950 ok &= acHDMIAuxData.RPCDecode(inBlob, inOutIndex);
3951 POPU32(acPeerToPeerFlags, inBlob, inOutIndex);
3952 POPU32(acFrameRepeatCount, inBlob, inOutIndex);
3953 POPU32(v32, inBlob, inOutIndex);
3954 acDesiredFrame =
LWord(v32);
3955 ok &= acRP188.RPCDecode(inBlob, inOutIndex);
3956 POPU16(v16, inBlob, inOutIndex);
3958 ok &= acTrailer.RPCDecode(inBlob, inOutIndex);
3968 PUSHU32(videoBufferSize, outBlob);
3969 if (videoBuffer && videoBufferSize)
3970 { buff.
Set(videoBuffer, videoBufferSize);
3973 PUSHU32(videoDmaOffset, outBlob);
3975 PUSHU32(audioBufferSize, outBlob);
3976 if (audioBuffer && audioBufferSize)
3977 { buff.
Set(audioBuffer, audioBufferSize);
3980 PUSHU32(audioStartSample, outBlob);
3981 PUSHU32(audioNumChannels, outBlob);
3982 PUSHU32(frameRepeatCount, outBlob);
3983 rp188.RPCEncode(outBlob);
3986 PUSHU32(transferFlags, outBlob);
3987 PUSHU8(bDisableExtraAudioInfo, outBlob);
3991 vidProcInfo.RPCEncode(outBlob);
3992 PUSHU32(customAncInfo.Group1, outBlob);
3993 PUSHU32(customAncInfo.Group2, outBlob);
3994 PUSHU32(customAncInfo.Group3, outBlob);
3995 PUSHU32(customAncInfo.Group4, outBlob);
3996 PUSHU32(videoNumSegments, outBlob);
3997 PUSHU32(videoSegmentHostPitch, outBlob);
3998 PUSHU32(videoSegmentCardPitch, outBlob);
4005 POPU16(v16, inBlob, inOutIndex);
4009 POPU32(videoBufferSize, inBlob, inOutIndex);
4010 if (videoBufferSize && !videoBuffer)
4015 if ((inOutIndex + videoBufferSize) >= inBlob.size())
4017 UByte* pBuffer =
reinterpret_cast<UByte*
>(videoBuffer);
4018 for (
ULWord cnt(0); cnt < videoBufferSize; cnt++)
4019 pBuffer[cnt] = inBlob.at(inOutIndex++);
4021 POPU32(videoDmaOffset, inBlob, inOutIndex);
4024 POPU32(audioBufferSize, inBlob, inOutIndex);
4025 if (audioBufferSize && !audioBuffer)
4030 if ((inOutIndex + audioBufferSize) >= inBlob.size())
4032 UByte* pBuffer =
reinterpret_cast<UByte*
>(audioBuffer);
4033 for (
ULWord cnt(0); cnt < audioBufferSize; cnt++)
4034 pBuffer[cnt] = inBlob.at(inOutIndex++);
4036 POPU32(audioStartSample, inBlob, inOutIndex);
4037 POPU32(audioNumChannels, inBlob, inOutIndex);
4038 POPU32(frameRepeatCount, inBlob, inOutIndex);
4039 rp188.RPCDecode(inBlob, inOutIndex);
4040 POPU32(v32, inBlob, inOutIndex);
4041 desiredFrame =
LWord(v32);
4042 POPU32(hUser, inBlob, inOutIndex);
4043 POPU32(transferFlags, inBlob, inOutIndex);
4044 POPU8(
AsU8Ref(bDisableExtraAudioInfo), inBlob, inOutIndex);
4045 POPU16(v16, inBlob, inOutIndex);
4047 POPU16(v16, inBlob, inOutIndex);
4050 vidProcInfo.RPCDecode(inBlob, inOutIndex);
4051 POPU32(customAncInfo.Group1, inBlob, inOutIndex);
4052 POPU32(customAncInfo.Group2, inBlob, inOutIndex);
4053 POPU32(customAncInfo.Group3, inBlob, inOutIndex);
4054 POPU32(customAncInfo.Group4, inBlob, inOutIndex);
4055 POPU32(videoNumSegments, inBlob, inOutIndex);
4056 POPU32(videoSegmentHostPitch, inBlob, inOutIndex);
4057 POPU32(videoSegmentCardPitch, inBlob, inOutIndex);
4058 POPU16(v16, inBlob, inOutIndex);
4065 const size_t totBytes (mHeader.GetSizeInBytes());
4066 if (outBlob.capacity() < totBytes)
4067 outBlob.reserve(totBytes);
4068 bool ok = mHeader.RPCEncode(outBlob);
4069 ok &= mBuffer.RPCEncode(outBlob);
4072 for (
size_t ndx(0); ndx < 16; ndx++)
4073 PUSHU32(mRegisters[ndx], outBlob);
4074 for (
size_t ndx(0); ndx < 32; ndx++)
4075 PUSHU32(mReserved[ndx], outBlob);
4076 ok &= mTrailer.RPCEncode(outBlob);
4082 bool ok = mHeader.RPCDecode(inBlob, inOutIndex);
4083 ok &= mBuffer.RPCDecode(inBlob, inOutIndex);
4084 POPU32(mFlags, inBlob, inOutIndex);
4085 POPU32(mStatus, inBlob, inOutIndex);
4086 for (
size_t ndx(0); ndx < 16; ndx++)
4087 POPU32(mRegisters[ndx], inBlob, inOutIndex);
4088 for (
size_t ndx(0); ndx < 16; ndx++)
4089 POPU32(mReserved[ndx], inBlob, inOutIndex);
4090 ok &= mTrailer.RPCDecode(inBlob, inOutIndex);
4101 PUSHU64(rdtscStartTime, outBlob);
4102 PUSHU64(audioClockStartTime, outBlob);
4103 PUSHU64(rdtscCurrentTime, outBlob);
4104 PUSHU64(audioClockCurrentTime, outBlob);
4105 PUSHU32(framesProcessed, outBlob);
4106 PUSHU32(framesDropped, outBlob);
4107 PUSHU32(bufferLevel, outBlob);
4108 PUSHU8(bWithAudio, outBlob);
4109 PUSHU8(bWithRP188, outBlob);
4110 PUSHU8(bFbfChange, outBlob);
4111 PUSHU8(bFboChange, outBlob);
4112 PUSHU8(bWithColorCorrection, outBlob);
4113 PUSHU8(bWithVidProc, outBlob);
4114 PUSHU8(bWithCustomAncData, outBlob);
4119 { uint16_t v16(0); uint32_t v32(0);
4120 POPU16(v16, inBlob, inOutIndex);
4122 POPU16(v16, inBlob, inOutIndex);
4124 POPU32(v32, inBlob, inOutIndex);
4125 startFrame =
LWord(v32);
4126 POPU32(v32, inBlob, inOutIndex);
4127 endFrame =
LWord(v32);
4128 POPU32(v32, inBlob, inOutIndex);
4129 activeFrame =
LWord(v32);
4130 POPU64(rdtscStartTime, inBlob, inOutIndex);
4131 POPU64(audioClockStartTime, inBlob, inOutIndex);
4132 POPU64(rdtscCurrentTime, inBlob, inOutIndex);
4133 POPU64(audioClockCurrentTime, inBlob, inOutIndex);
4134 POPU32(framesProcessed, inBlob, inOutIndex);
4135 POPU32(framesDropped, inBlob, inOutIndex);
4136 POPU32(bufferLevel, inBlob, inOutIndex);
4141 POPU8(
AsU8Ref(bWithColorCorrection), inBlob, inOutIndex);
4143 POPU8(
AsU8Ref(bWithCustomAncData), inBlob, inOutIndex);
4157 POPU32(DBB, inBlob, inOutIndex);
4158 POPU32(Low, inBlob, inOutIndex);
4159 POPU32(High, inBlob, inOutIndex);
4166 PUSHU32(taskVersion, outBlob);
4171 if (taskArray && numTasks)
4172 for (
ULWord num(0); num < numTasks; num++)
4176 const ULWord * pULWords =
reinterpret_cast<const ULWord*
>(&task.
u);
4182 for (
ULWord word(0); word < numWords; word++)
4183 PUSHU32(pULWords[word], outBlob);
4190 POPU32(taskVersion, inBlob, inOutIndex);
4191 POPU32(taskSize, inBlob, inOutIndex);
4192 POPU32(numTasks, inBlob, inOutIndex);
4193 POPU32(maxTasks, inBlob, inOutIndex);
4194 POPU64(u64, inBlob, inOutIndex);
4196 if (taskArray && numTasks)
4197 for (
ULWord num(0); num < numTasks; num++)
4200 POPU32(u32, inBlob, inOutIndex);
4208 for (
ULWord word(0); word < numWords; word++)
4209 POPU32(pULWords[word], inBlob, inOutIndex);
4219 PUSHU64(audioClockTimeStamp, outBlob);
4220 PUSHU32(audioExpectedAddress, outBlob);
4221 PUSHU32(audioInStartAddress, outBlob);
4222 PUSHU32(audioInStopAddress, outBlob);
4223 PUSHU32(audioOutStopAddress, outBlob);
4224 PUSHU32(audioOutStartAddress, outBlob);
4226 PUSHU32(startSample, outBlob);
4228 PUSHU32(currentFrame, outBlob);
4229 currentRP188.RPCEncode(outBlob);
4231 PUSHU64(audioClockCurrentTime, outBlob);
4232 PUSHU32(currentAudioExpectedAddress, outBlob);
4233 PUSHU32(currentAudioStartAddress, outBlob);
4234 PUSHU32(currentFieldCount, outBlob);
4235 PUSHU32(currentLineCount, outBlob);
4236 PUSHU32(currentReps, outBlob);
4237 PUSHU32(currenthUser, outBlob);
4242 { uint16_t v16(0); uint64_t v64(0);
4243 POPU16(v16, inBlob, inOutIndex);
4245 POPU64(v64, inBlob, inOutIndex);
4247 POPU32(frame, inBlob, inOutIndex);
4248 POPU64(audioClockTimeStamp, inBlob, inOutIndex);
4249 POPU32(audioExpectedAddress, inBlob, inOutIndex);
4250 POPU32(audioInStartAddress, inBlob, inOutIndex);
4251 POPU32(audioInStopAddress, inBlob, inOutIndex);
4252 POPU32(audioOutStopAddress, inBlob, inOutIndex);
4253 POPU32(audioOutStartAddress, inBlob, inOutIndex);
4254 POPU32(bytesRead, inBlob, inOutIndex);
4255 POPU32(startSample, inBlob, inOutIndex);
4256 POPU64(v64, inBlob, inOutIndex);
4258 POPU32(currentFrame, inBlob, inOutIndex);
4259 currentRP188.RPCDecode(inBlob, inOutIndex);
4260 POPU64(v64, inBlob, inOutIndex);
4261 currentFrameTime =
LWord64(v64);
4262 POPU64(audioClockCurrentTime, inBlob, inOutIndex);
4263 POPU32(currentAudioExpectedAddress, inBlob, inOutIndex);
4264 POPU32(currentAudioStartAddress, inBlob, inOutIndex);
4265 POPU32(currentFieldCount, inBlob, inOutIndex);
4266 POPU32(currentLineCount, inBlob, inOutIndex);
4267 POPU32(currentReps, inBlob, inOutIndex);
4268 POPU32(currenthUser, inBlob, inOutIndex);
4306 { uint16_t v16(0); uint32_t v32(0);
4307 POPU16(v16, inBlob, inOutIndex);
4309 POPU16(v16, inBlob, inOutIndex);
4311 POPU32(v32, inBlob, inOutIndex); lVal1 =
LWord(v32);
4312 POPU32(v32, inBlob, inOutIndex); lVal2 =
LWord(v32);
4313 POPU32(v32, inBlob, inOutIndex); lVal3 =
LWord(v32);
4314 POPU32(v32, inBlob, inOutIndex); lVal4 =
LWord(v32);
4315 POPU32(v32, inBlob, inOutIndex); lVal5 =
LWord(v32);
4316 POPU32(v32, inBlob, inOutIndex); lVal6 =
LWord(v32);