12 #if defined(AJA_LINUX)
20 #define LOGMYERROR(__x__) AJA_sREPORT(AJA_DebugUnit_AJAAncData, AJA_DebugSeverity_Error, AJAFUNC << ": " << __x__)
21 #define LOGMYWARN(__x__) AJA_sREPORT(AJA_DebugUnit_AJAAncData, AJA_DebugSeverity_Warning, AJAFUNC << ": " << __x__)
22 #define LOGMYNOTE(__x__) AJA_sREPORT(AJA_DebugUnit_AJAAncData, AJA_DebugSeverity_Notice, AJAFUNC << ": " << __x__)
23 #define LOGMYINFO(__x__) AJA_sREPORT(AJA_DebugUnit_AJAAncData, AJA_DebugSeverity_Info, AJAFUNC << ": " << __x__)
24 #define LOGMYDEBUG(__x__) AJA_sREPORT(AJA_DebugUnit_AJAAncData, AJA_DebugSeverity_Debug, AJAFUNC << ": " << __x__)
26 #define RCV2110ERR(__x__) AJA_sREPORT(AJA_DebugUnit_Anc2110Rcv, AJA_DebugSeverity_Error, AJAFUNC << ": " << __x__)
27 #define RCV2110WARN(__x__) AJA_sREPORT(AJA_DebugUnit_Anc2110Rcv, AJA_DebugSeverity_Warning, AJAFUNC << ": " << __x__)
28 #define RCV2110NOTE(__x__) AJA_sREPORT(AJA_DebugUnit_Anc2110Rcv, AJA_DebugSeverity_Notice, AJAFUNC << ": " << __x__)
29 #define RCV2110INFO(__x__) AJA_sREPORT(AJA_DebugUnit_Anc2110Rcv, AJA_DebugSeverity_Info, AJAFUNC << ": " << __x__)
30 #define RCV2110DBG(__x__) AJA_sREPORT(AJA_DebugUnit_Anc2110Rcv, AJA_DebugSeverity_Debug, AJAFUNC << ": " << __x__)
32 #define XMT2110ERR(__x__) AJA_sREPORT(AJA_DebugUnit_Anc2110Xmit, AJA_DebugSeverity_Error, AJAFUNC << ": " << __x__)
33 #define XMT2110WARN(__x__) AJA_sREPORT(AJA_DebugUnit_Anc2110Xmit, AJA_DebugSeverity_Warning, AJAFUNC << ": " << __x__)
34 #define XMT2110NOTE(__x__) AJA_sREPORT(AJA_DebugUnit_Anc2110Xmit, AJA_DebugSeverity_Notice, AJAFUNC << ": " << __x__)
35 #define XMT2110INFO(__x__) AJA_sREPORT(AJA_DebugUnit_Anc2110Xmit, AJA_DebugSeverity_Info, AJAFUNC << ": " << __x__)
36 #define XMT2110DBG(__x__) AJA_sREPORT(AJA_DebugUnit_Anc2110Xmit, AJA_DebugSeverity_Debug, AJAFUNC << ": " << __x__)
37 #if defined(AJA_WINDOWS)
38 const size_t sENDL(2);
40 const size_t sENDL(1);
44 #if 0 // DetailedDebugging
45 #define RCV2110DDBG(__x__) RCV2110DBG(__x__)
46 #define XMT2110DDBG(__x__) XMT2110DBG(__x__)
48 #define RCV2110DDBG(__x__)
49 #define XMT2110DDBG(__x__)
52 #if defined(AJAHostIsBigEndian)
54 #define AJA_ENDIAN_16NtoH(__val__) (__val__)
55 #define AJA_ENDIAN_16HtoN(__val__) (__val__)
56 #define AJA_ENDIAN_32NtoH(__val__) (__val__)
57 #define AJA_ENDIAN_32HtoN(__val__) (__val__)
58 #define AJA_ENDIAN_64NtoH(__val__) (__val__)
59 #define AJA_ENDIAN_64HtoN(__val__) (__val__)
62 #define AJA_ENDIAN_16NtoH(__val__) AJA_ENDIAN_SWAP16(__val__)
63 #define AJA_ENDIAN_16HtoN(__val__) AJA_ENDIAN_SWAP16(__val__)
64 #define AJA_ENDIAN_32NtoH(__val__) AJA_ENDIAN_SWAP32(__val__)
65 #define AJA_ENDIAN_32HtoN(__val__) AJA_ENDIAN_SWAP32(__val__)
66 #define AJA_ENDIAN_64NtoH(__val__) AJA_ENDIAN_SWAP64(__val__)
67 #define AJA_ENDIAN_64HtoN(__val__) AJA_ENDIAN_SWAP64(__val__)
80 #endif // defined(_DEBUG)
89 #endif // defined(_DEBUG)
98 #endif // defined(_DEBUG)
108 #endif // defined(_DEBUG)
119 #endif // defined(_DEBUG)
133 m_rcvDataValid =
false;
165 m_payload.reserve(numBytes);
166 for (uint32_t ndx(0); ndx < numBytes; ndx++)
167 m_payload.push_back(0);
170 catch(
const bad_alloc &)
203 m_checksum = inChecksum;
205 if (inChecksum != Calculate8BitChecksum())
214 return uint16_t(GetLocationDataStream());
216 return uint16_t(GetLocationVideoLink());
228 sum += uint8_t(m_payload.size());
229 if (!m_payload.empty())
230 for (ByteVector::size_type ndx(0); ndx < m_payload.size(); ndx++)
231 sum += m_payload[ndx];
232 NTV2_ASSERT(sum == uint8_t(Calculate9BitChecksum()));
240 uint16_t sum (AddEvenParity(m_DID));
241 sum += AddEvenParity(m_SID);
242 sum += AddEvenParity(
UByte(GetDC()));
243 if (!m_payload.empty())
244 for (ByteVector::size_type ndx(0); ndx < m_payload.size(); ndx++)
245 sum += AddEvenParity(m_payload[ndx]);
247 const bool b8 ((sum & 0x100) != 0);
249 return (sum & 0x1FF) | (b9 ? 0x200 : 0x000);
258 AJAStatus status (SetLocationVideoLink(loc.GetDataLink()));
260 status = SetLocationDataStream(loc.GetDataStream());
262 status = SetLocationDataChannel(loc.GetDataChannel());
266 status = SetLocationLineNumber(loc.GetLineNumber());
278 m_location.SetDataLink(inLinkValue);
290 m_location.SetDataStream(inStream);
302 m_location.SetDataChannel(inChannel);
312 m_location.SetLineNumber(inLineNum);
322 m_location.SetHorizontalOffset(inOffset);
333 m_coding = inCodingType;
344 if (pInData ==
NULL || inNumBytes == 0)
348 AJAStatus status (AllocDataMemory(inNumBytes));
353 ::memcpy (&m_payload[0], pInData, inNumBytes);
365 const uint32_t payloadByteCount (uint32_t(pInData[5] & 0x00FF));
366 if ((inNumWords - 7) > payloadByteCount)
370 const AJAStatus status (AllocDataMemory(payloadByteCount));
375 for (uint32_t numWord (0); numWord < payloadByteCount; numWord++)
376 m_payload[numWord] =
UByte(pInData[6+numWord] & 0x00FF);
379 SetDataLocation(inLocInfo);
380 SetChecksum(
UByte(pInData[6+payloadByteCount] & 0x00FF));
381 SetDID(
UByte(pInData[3] & 0x00FF));
382 SetSID(
UByte(pInData[4] & 0x00FF));
394 if (pInData ==
NULL || inNumBytes == 0)
399 for (uint32_t ndx(0); ndx < inNumBytes; ndx++)
400 m_payload.push_back(pInData[ndx]);
402 catch(
const bad_alloc &)
419 const uint32_t numBytes (uint32_t(inAnc.GetPayloadByteCount()));
420 for (uint32_t ndx(0); ndx < numBytes; ndx++)
421 m_payload.push_back(pInData[ndx]);
423 catch(
const bad_alloc &)
437 if (pOutData ==
NULL)
443 ::memcpy (pOutData, GetPayloadData(), inNumBytes);
451 const UWordSequence::size_type origSize (outUDWs.size());
454 const uint16_t UDW (inAddParity ? AddEvenParity(*iter) : *iter);
457 outUDWs.push_back(UDW);
465 outUDWs.resize(origSize);
473 return m_payload[inIndex0];
481 if (inIndex0 >= GetDC())
484 m_payload[inIndex0] = inDataByte;
492 m_rcvDataValid =
false;
501 const size_t inMaxBytes,
503 uint32_t & outPacketByteCount)
537 const uint32_t maxBytes(uint32_t(inMaxBytes+0));
540 outPacketByteCount = 0;
548 outPacketByteCount = maxBytes;
554 if (pInData[0] != 0xFF)
557 outPacketByteCount = 0;
558 LOGMYDEBUG(
"No data: First GUMP byte is " <<
xHEX0N(uint16_t(pInData[0]),2) <<
", expected 0xFF");
567 if (totalBytes > maxBytes)
569 outPacketByteCount = maxBytes;
570 LOGMYERROR(
"AJA_STATUS_RANGE: Reported packet size " << totalBytes <<
" [bytes] extends past end of buffer " << inMaxBytes <<
" by " << (totalBytes-inMaxBytes) <<
" byte(s)");
578 m_checksum = pInData[totalBytes-1];
581 m_location = inLocationInfo;
583 if ((pInData[1] & 0x80) != 0)
589 m_location.SetLineNumber(uint16_t((pInData[1] & 0x0F) << 7) + uint16_t(pInData[2] & 0x7F));
595 const uint32_t payloadSize (pInData[5]);
598 status = AllocDataMemory(payloadSize);
600 for (uint32_t ndx(0); ndx < payloadSize; ndx++)
601 m_payload[ndx] = pInData[ndx+6];
604 outPacketByteCount = totalBytes;
605 LOGMYDEBUG(
"Set from GUMP buffer OK: " << AsString(32));
613 uint32_t pktByteCount(0);
616 return InitWithReceivedData (&inData[0], uint32_t(inData.size()), inLocationInfo, pktByteCount);
637 LOGMYWARN(
"Illegal packet size " <<
DEC(GetDC()) <<
", exceeds 255 -- returning truncated value (255): " << AsString(32));
647 const uint32_t numPackets ((GetDC() + 254) / 255);
648 const uint32_t lastPacketDC (GetDC() % 255);
667 AJAStatus status (GeneratePayloadData());
672 uint32_t myPacketSize(0), maxBytes(uint32_t(inMaxBytes+0));
673 GetRawPacketSize(myPacketSize);
675 if (myPacketSize == 0)
677 LOGMYERROR(
"AJA_STATUS_FAIL: nothing to do -- raw packet size is zero: " << AsString(32));
680 if (myPacketSize > maxBytes)
682 LOGMYERROR(
"AJA_STATUS_FAIL: " << maxBytes <<
"-byte client buffer too small to hold " << myPacketSize <<
" byte(s): " << AsString(32));
685 if (!IsDigital() && !
IsRaw())
687 LOGMYERROR(
"AJA_STATUS_FAIL: invalid packet coding (neither Raw nor Digital): " << AsString(32));
693 pData[0] = GetGUMPHeaderByte1();
694 pData[1] = GetGUMPHeaderByte2();
695 pData[2] = GetGUMPHeaderByte3();
699 uint8_t payloadSize = uint8_t((GetDC() > 255) ? 255 : GetDC());
700 pData[5] = payloadSize;
703 status = GetPayloadData(&pData[6], payloadSize);
707 pData[6+payloadSize] = Calculate8BitChecksum();
710 outPacketSize = myPacketSize;
717 const uint32_t numPackets ((GetDC() + 254) / 255);
722 const uint8_t * payloadPtr = GetPayloadData();
723 uint32_t remainingPayloadData = GetDC();
725 for (uint32_t ndx(0); ndx < numPackets; ndx++)
727 pData[0] = GetGUMPHeaderByte1();
728 pData[1] = GetGUMPHeaderByte2();
729 pData[2] = GetGUMPHeaderByte3();
733 uint8_t payloadSize = uint8_t((remainingPayloadData > 255) ? 255 : remainingPayloadData);
734 pData[5] = payloadSize;
737 ::memcpy(&pData[6], payloadPtr, payloadSize);
741 pData[6+payloadSize] = m_checksum;
744 payloadPtr += payloadSize;
747 remainingPayloadData -= payloadSize;
753 outPacketSize = myPacketSize;
755 LOGMYDEBUG(outPacketSize <<
" byte(s) generated: " << AsString(32));
763 uint8_t result (0x80);
768 if (m_location.IsLumaChannel())
771 if (m_location.IsHanc())
775 result |= (m_location.GetLineNumber() >> 7) & 0x0F;
783 AJAStatus status (GeneratePayloadData());
784 const UWordSequence::size_type origSize (outRawComponents.size());
790 const uint8_t dataCount ((GetDC() > 255) ? 255 : uint8_t(GetDC()));
791 outRawComponents.push_back(0x000);
792 outRawComponents.push_back(0x3FF);
793 outRawComponents.push_back(0x3FF);
794 outRawComponents.push_back(AddEvenParity(GetDID()));
795 outRawComponents.push_back(AddEvenParity(GetSID()));
796 outRawComponents.push_back(AddEvenParity(dataCount));
800 outRawComponents.resize(origSize);
807 status = GetPayloadData(outRawComponents, IsDigital() );
811 outRawComponents.push_back(Calculate9BitChecksum());
814 LOGMYDEBUG((origSize ?
"Appended " :
"Generated ") << (outRawComponents.size() - origSize) <<
" UWords from " << AsString(32) << endl <<
UWordSequence(outRawComponents));
822 static const size_t gIndexes[] = { 0,1,2,3, 3,4,5,6, 6,7,8,9, 9,10,11,12, 12,13,14,15 };
823 static const unsigned gShifts[] = { 22,12,2,8, 24,14,4,6, 26,16,6,4, 28,18,8,2, 30,20,10,0 };
824 static const uint32_t
gMasks[] = { 0xFFC00000, 0x003FF000, 0x00000FFC, 0x00000003,
825 0xFF000000, 0x00FFC000, 0x00003FF0, 0x0000000F,
826 0xFC000000, 0x03FF0000, 0x0000FFC0, 0x0000003F,
827 0xF0000000, 0x0FFC0000, 0x0003FF00, 0x000000FF,
828 0xC0000000, 0x3FF00000, 0x000FFC00, 0x000003FF };
833 AJAStatus status (GeneratePayloadData());
834 const ULWordSequence::size_type origSize (outData.size());
844 const uint16_t did (AddEvenParity(GetDID()));
845 const uint16_t sid (AddEvenParity(GetSID()));
846 const uint16_t dc (AddEvenParity(uint8_t(GetDC())));
847 const uint16_t cs (Calculate9BitChecksum());
850 UDW16s.reserve(GetDC()+4);
851 UDW16s.push_back(did);
852 UDW16s.push_back(sid);
853 UDW16s.push_back(dc);
856 status = GetPayloadData(UDW16s,
true);
858 {
XMT2110ERR(
"GetPayloadData failed: " << AsString(32));
return status;}
859 UDW16s.push_back(cs);
867 const uint32_t pktHdrWord (pktHdr.
GetULWord());
868 outData.push_back(pktHdrWord);
872 const size_t numUDWs (UDW16s.size());
877 for (
unsigned loopNdx(0); loopNdx <
sizeof(
gIndexes) /
sizeof(
size_t); loopNdx++)
879 const bool is4th ((loopNdx & 3) == 3);
880 const size_t ndx (UDWndx +
gIndexes[loopNdx]);
881 const bool isPastEnd (ndx >= numUDWs);
882 const uint32_t UDW (isPastEnd ? 0 : uint32_t(UDW16s[ndx]));
883 const unsigned shift (
gShifts[loopNdx]);
884 const uint32_t mask (
gMasks[loopNdx]);
888 u32 |= (UDW >> shift) & mask;
897 u32 |= (UDW << shift) & mask;
900 }
while (UDWndx < numUDWs);
932 oss << (origSize ?
"Appended " :
"Generated ") << (outData.size() - origSize) <<
" U32s:";
933 for (
size_t ndx(origSize); ndx < outData.size(); ndx++)
935 oss <<
" BigEndian from " << AsString(32);
939 XMT2110DBG((origSize ?
"Appended " :
"Generated ")
940 << (outData.size() - origSize) <<
" 32-bit words from " << AsString(32));
948 const size_t numU32s (inU32s.size());
952 if (inOutU32Ndx >= numU32s)
960 RCV2110DDBG(
"u32=" <<
xHEX0N(
ENDIAN_32NtoH(inU32s.at(inOutU32Ndx)),8) <<
" inU32s[" <<
DEC(inOutU32Ndx) <<
" of " <<
DEC(numU32s) <<
"] AncPktHdr: " << ancPktHeader <<
" -- AncDataLoc: " << dataLoc);
962 if (++inOutU32Ndx >= numU32s)
967 result = SetLocationVideoLink(dataLoc.GetDataLink());
968 if (
AJA_FAILURE(result)) {
RCV2110ERR(
"SetLocationVideoLink failed, dataLoc: " << dataLoc);
return result;}
970 result = SetLocationDataStream(dataLoc.GetDataStream());
971 if (
AJA_FAILURE(result)) {
RCV2110ERR(
"SetLocationDataStream failed, dataLoc: " << dataLoc);
return result;}
973 result = SetLocationDataChannel(dataLoc.GetDataChannel());
974 if (
AJA_FAILURE(result)) {
RCV2110ERR(
"SetLocationDataChannel failed, dataLoc: " << dataLoc);
return result;}
977 if (
AJA_FAILURE(result)) {
RCV2110ERR(
"SetLocationHorizOffset failed, dataLoc: " << dataLoc);
return result;}
979 result = SetLocationLineNumber(dataLoc.GetLineNumber());
980 if (
AJA_FAILURE(result)) {
RCV2110ERR(
"SetLocationLineNumber failed, dataLoc: " << dataLoc);
return result;}
984 bool gotChecksum (
false);
985 size_t dataCount (0);
987 const size_t startU32Ndx (inOutU32Ndx);
992 for (
unsigned loopNdx(0); loopNdx < 20 && !gotChecksum; loopNdx++)
994 const bool is4th ((loopNdx & 3) == 3);
995 const bool is1st ((loopNdx & 3) == 0);
996 const unsigned shift (
gShifts[loopNdx]);
997 const uint32_t mask (
gMasks[loopNdx]);
1000 u16 = uint16_t((u32 & mask) << shift);
1003 if (++inOutU32Ndx >= numU32s)
1005 u16s.push_back(u16);
1010 <<
" from " <<
DEC(loopNdx) <<
"(" <<
xHEX0N(inU32s.at(inOutU32Ndx-1),8) <<
" & " <<
xHEX0N(mask,8) <<
") << " <<
DEC(shift));
1018 u16 |= uint16_t((u32 & mask) >> shift);
1022 u16 = uint16_t((u32 & mask) >> shift);
1025 u16s.push_back(u16);
1028 case 1: SetDID(uint8_t(u16));
break;
1029 case 2: SetSID(uint8_t(u16));
break;
1030 case 3: dataCount = size_t(u16 & 0x0FF);
break;
1031 default:
if (u16s.size() == (dataCount + 4))
1032 {gotChecksum =
true;
RCV2110DDBG(
"Got checksum, DC=" <<
xHEX0N(dataCount,2) <<
" CS=" <<
xHEX0N(u16s.back(),3));}
1038 }
while (inOutU32Ndx < numU32s);
1040 if (u16s.size() < 4)
1041 { ostringstream oss;
1042 if (u16s.size() < 1) oss <<
" NoDID";
1044 if (u16s.size() < 2) oss <<
" NoSID";
1046 if (u16s.size() < 3) oss <<
" NoDC";
1047 else oss <<
" DC=" <<
DEC(dataCount);
1048 RCV2110ERR(
"Incomplete/bad packet:" << oss.str() <<
" NoCS" <<
" -- only unpacked " << u16s);
1051 RCV2110DBG(
"Consumed " <<
DEC(inOutU32Ndx - startU32Ndx + 1) <<
" ULWord(s), " << (gotChecksum?
"":
"NoCS, ") <<
"DC=" <<
DEC(dataCount) <<
", unpacked " << u16s);
1052 if (inOutU32Ndx < numU32s)
1056 if (dataCount > (u16s.size()-3))
1058 RCV2110ERR(
"Incomplete/bad packet: " <<
DEC(u16s.size()) <<
" U16s, but missing " <<
DEC(dataCount - (u16s.size()-3))
1059 <<
" byte(s), expected DC=" <<
DEC(dataCount) <<
" -- DID=" <<
xHEX0N(
UWord(GetDID()),2) <<
" SID=" <<
xHEX0N(
UWord(GetSID()),2));
1064 for (
size_t ndx(0); ndx < dataCount; ndx++)
1065 m_payload.push_back(uint8_t(u16s.at(ndx+3)));
1067 result = SetChecksum(uint8_t(u16s.at(u16s.size()-1)),
true );
1070 if (inIgnoreChecksum)
1073 {
RCV2110ERR(
"SetChecksum=" <<
xHEX0N(u16s.at(u16s.size()-1),3) <<
" failed, calculated=" <<
xHEX0N(Calculate9BitChecksum(),3));
return result;}
1134 static const string gAncDataLinkToStr [] = {
"A",
"B",
"?"};
1135 static const string gDAncDataLinkToStr [] = {
"AJAAncDataLink_A",
"AJAAncDataLink_B",
"AJAAncDataLink_Unknown"};
1137 return IS_VALID_AJAAncDataLink(inValue) ? (inCompact ? gAncDataLinkToStr[inValue] : gDAncDataLinkToStr[inValue]) : gAncDataLinkToStr[2];
1143 static const string gAncDataStreamToStr [] = {
"DS1",
"DS2",
"DS3",
"DS4",
"?"};
1144 static const string gDAncDataStreamToStr [] = {
"AJAAncDataStream_1",
"AJAAncDataStream_2",
1145 "AJAAncDataStream_3",
"AJAAncDataStream_4",
"AJAAncDataStream_Unknown"};
1153 static const string gAncDataChannelToStr [] = {
"C",
"Y",
"?"};
1154 static const string gDAncDataChannelToStr [] = {
"AJAAncDataChannel_C",
"AJAAncDataChannel_Y",
"AJAAncDataChannel_Unknown"};
1162 static const string gAncDataSpaceToStr [] = {
"VANC",
"HANC",
"????"};
1163 static const string gDAncDataSpaceToStr [] = {
"AJAAncDataSpace_VANC",
"AJAAncDataSpace_HANC",
"AJAAncDataSpace_Unknown"};
1181 oss <<
"L" <<
DEC(inValue);
1200 oss <<
"+" <<
DEC(inValue);
1218 if (GetDataLink() != inRHS.GetDataLink())
1220 if (GetDataStream() != inRHS.GetDataStream())
1222 if (GetDataChannel() != inRHS.GetDataChannel())
1226 if (GetLineNumber() != inRHS.GetLineNumber())
1237 if (GetDataLink() != inRHS.GetDataLink())
1239 if (GetDataStream() != inRHS.GetDataStream())
1241 if (GetDataChannel() != inRHS.GetDataChannel())
1245 if (GetLineNumber() != inRHS.GetLineNumber())
1246 oss <<
", " <<
"Line " <<
DEC(GetLineNumber()) <<
" != " <<
DEC(inRHS.GetLineNumber());
1251 if (oss.str().length() > 2)
1252 return oss.str().substr(2, oss.str().length() - 2);
1260 inValue.
Print(oss, inCompact);
1266 return inValue.
Print(inOutStream,
true);
1272 static const string gAncDataCodingToStr [] = {
"Dig",
"Ana",
"???"};
1273 static const string gDAncDataCodingToStr [] = {
"AJAAncDataCoding_Digital",
"AJAAncDataCoding_Raw",
"AJAAncDataCoding_Unknown"};
1281 static const string gAncBufFmtToStr [] = {
"UNK",
"FBVANC",
"SDI",
"RTP",
""};
1282 static const string gDAncBufFmtToStr [] = {
"AJAAncBufferFormat_Unknown",
"AJAAncBufferFormat_FBVANC",
1283 "AJAAncBufferFormat_SDI",
"AJAAncBufferFormat_RTP",
""};
1291 static const string gAncDataTypeToStr [] = {
"Unknown",
"SMPTE 2016-3 AFD",
"SMPTE 12-M RP188",
"SMPTE 12-M VITC",
1292 "SMPTE 334 CEA708",
"SMPTE 334 CEA608",
"CEA608 Line21",
"SMPTE 352 VPID",
1293 "SMPTE 2051 2 Frame Marker",
"524D Frame Status",
"5251 Frame Status",
1294 "HDR SDR",
"HDR10",
"HDR HLG",
"?"};
1296 static const string gDAncDataTypeToStr [] = {
"AJAAncDataType_Unknown",
"AJAAncDataType_Smpte2016_3",
"AJAAncDataType_Timecode_ATC",
1297 "AJAAncDataType_Timecode_VITC",
"AJAAncDataType_Cea708",
"AJAAncDataType_Cea608_Vanc",
1298 "AJAAncDataType_Cea608_Line21",
"AJAAncDataType_Smpte352",
"AJAAncDataType_Smpte2051",
1299 "AJAAncDataType_FrameStatusInfo524D",
"AJAAncDataType_FrameStatusInfo5251",
1300 "AJAAncDataType_HDR_SDR",
"AJAAncDataType_HDR_HDR10",
"AJAAncDataType_HDR_HLG",
"?"};
1308 oss <<
"Type:\t\t" << IDAsString() << endl;
1309 oss <<
"DID:\t\t" <<
xHEX0N(uint32_t(GetDID()),2) << endl
1310 <<
"SID:\t\t" <<
xHEX0N(uint32_t(GetSID()),2) << endl;
1311 oss <<
"DC:\t\t" <<
DEC(GetDC()) << endl;
1312 oss <<
"CS:\t\t" <<
xHEX0N(uint32_t(m_checksum),2) << endl
1313 <<
"Loc:\t\t" << GetDataLocation() << endl;
1315 <<
"Frame:\t\t" <<
xHEX0N(GetFrameID(),8) << endl
1317 <<
"Valid:\t\t" << (GotValidReceiveData() ?
"Yes" :
"No");
1319 {oss << endl; DumpPayload(oss);}
1327 oss <<
"Analog/Raw Line " <<
DEC(GetDataLocation().GetLineNumber()) <<
" Packet";
1329 oss << DIDSIDToString(GetDID(), GetSID());
1338 <<
"|" << GetDIDSIDPair() <<
"|CS" <<
HEX0N(uint16_t(GetChecksum()),2);
1339 oss <<
"|DC=" <<
DEC(GetDC());
1341 oss <<
"|FRx" <<
HEX0N(GetFrameID(),8);
1345 if (!typeStr.empty())
1346 oss <<
"|" << typeStr;
1348 if (inMaxBytes && GetDC())
1350 uint16_t bytesToDump = uint16_t(GetDC());
1352 if (inMaxBytes < bytesToDump)
1353 bytesToDump = inMaxBytes;
1354 for (uint16_t ndx(0); ndx < bytesToDump; ndx++)
1355 oss <<
HEX0N(uint16_t(m_payload[ndx]),2);
1356 if (bytesToDump < uint16_t(GetDC()))
1365 inOutStream <<
"x" <<
HEX0N(uint16_t(inData.first), 2) <<
"x" <<
HEX0N(uint16_t(inData.second), 2);
1373 inOutStream <<
"(NULL payload)" << endl;
1376 const int32_t kBytesPerLine (32);
1377 uint32_t count (GetDC());
1378 const uint8_t * pData (GetPayloadData());
1382 const uint32_t numBytes ((count >= kBytesPerLine) ? kBytesPerLine : count);
1383 inOutStream << ((count == GetDC()) ?
"Payload: " :
" ");
1384 for (uint8_t num(0); num < numBytes; num++)
1386 inOutStream <<
" " <<
HEX0N(uint32_t(pData[num]),2);
1390 inOutStream << endl;
1401 if (GetDID() != inRHS.GetDID())
1403 if (GetSID() != inRHS.GetSID())
1405 if (GetDC() != inRHS.GetDC())
1408 if (!inIgnoreChecksum)
1409 if (GetChecksum() != inRHS.GetChecksum())
1411 if (!inIgnoreLocation)
1412 if (
AJA_FAILURE(GetDataLocation().Compare(inRHS.GetDataLocation())))
1415 if (GetDataCoding() != inRHS.GetDataCoding())
1429 if (GetDID() != inRHS.GetDID())
1430 oss << endl <<
"DID mismatch: " <<
xHEX0N(uint16_t(GetDID()),2) <<
" != " <<
xHEX0N(uint16_t(inRHS.GetDID()),2);
1431 if (GetSID() != inRHS.GetSID())
1432 oss << endl <<
"SID mismatch: " <<
xHEX0N(uint16_t(GetSID()),2) <<
" != " <<
xHEX0N(uint16_t(inRHS.GetSID()),2);
1433 if (GetDC() != inRHS.GetDC())
1434 oss << endl <<
"DC mismatch: " <<
xHEX0N(GetDC(),4) <<
" != " <<
xHEX0N(inRHS.GetDC(),4);
1436 if (!inIgnoreChecksum)
1437 if (GetChecksum() != inRHS.GetChecksum())
1438 oss << endl <<
"CS mismatch: " <<
xHEX0N(uint16_t(GetChecksum()),2) <<
" != " <<
xHEX0N(uint16_t(inRHS.GetChecksum()),2);
1439 if (!inIgnoreLocation)
1440 {
const string info(GetDataLocation().CompareWithInfo(inRHS.GetDataLocation()));
1442 oss << endl <<
"Location mismatch: " << info;
1445 if (GetDataCoding() != inRHS.GetDataCoding())
1450 const uint8_t *pLHS(GetPayloadData()), *pRHS(inRHS.
GetPayloadData());
1452 for (
size_t ndx(0); ndx < GetPayloadByteCount(); ndx++)
1453 if (pLHS[ndx] != pRHS[ndx])
1454 diffNdxs.push_back(
ULWord(ndx));
1455 if (!diffNdxs.empty())
1456 oss << endl <<
DEC(diffNdxs.size()) <<
" of " <<
DEC(GetDC()) <<
" (" <<
fDEC(100.0*
double(diffNdxs.size())/double(GetDC()), 5, 2)
1457 <<
"%) mismatched payload bytes, starting at offset " <<
DEC(diffNdxs.at(0));
1460 if (oss.str().length() >
sENDL)
1461 return oss.str().substr(
sENDL, oss.str().length() -
sENDL);
1469 m_DID = inRHS.
m_DID;
1470 m_SID = inRHS.
m_SID;
1494 static const uint16_t gEvenParityTable[256] =
1496 0x200,0x101,0x102,0x203,0x104,0x205,0x206,0x107,
1497 0x108,0x209,0x20A,0x10B,0x20C,0x10D,0x10E,0x20F,
1498 0x110,0x211,0x212,0x113,0x214,0x115,0x116,0x217,
1499 0x218,0x119,0x11A,0x21B,0x11C,0x21D,0x21E,0x11F,
1500 0x120,0x221,0x222,0x123,0x224,0x125,0x126,0x227,
1501 0x228,0x129,0x12A,0x22B,0x12C,0x22D,0x22E,0x12F,
1502 0x230,0x131,0x132,0x233,0x134,0x235,0x236,0x137,
1503 0x138,0x239,0x23A,0x13B,0x23C,0x13D,0x13E,0x23F,
1504 0x140,0x241,0x242,0x143,0x244,0x145,0x146,0x247,
1505 0x248,0x149,0x14A,0x24B,0x14C,0x24D,0x24E,0x14F,
1506 0x250,0x151,0x152,0x253,0x154,0x255,0x256,0x157,
1507 0x158,0x259,0x25A,0x15B,0x25C,0x15D,0x15E,0x25F,
1508 0x260,0x161,0x162,0x263,0x164,0x265,0x266,0x167,
1509 0x168,0x269,0x26A,0x16B,0x26C,0x16D,0x16E,0x26F,
1510 0x170,0x271,0x272,0x173,0x274,0x175,0x176,0x277,
1511 0x278,0x179,0x17A,0x27B,0x17C,0x27D,0x27E,0x17F,
1512 0x180,0x281,0x282,0x183,0x284,0x185,0x186,0x287,
1513 0x288,0x189,0x18A,0x28B,0x18C,0x28D,0x28E,0x18F,
1514 0x290,0x191,0x192,0x293,0x194,0x295,0x296,0x197,
1515 0x198,0x299,0x29A,0x19B,0x29C,0x19D,0x19E,0x29F,
1516 0x2A0,0x1A1,0x1A2,0x2A3,0x1A4,0x2A5,0x2A6,0x1A7,
1517 0x1A8,0x2A9,0x2AA,0x1AB,0x2AC,0x1AD,0x1AE,0x2AF,
1518 0x1B0,0x2B1,0x2B2,0x1B3,0x2B4,0x1B5,0x1B6,0x2B7,
1519 0x2B8,0x1B9,0x1BA,0x2BB,0x1BC,0x2BD,0x2BE,0x1BF,
1520 0x2C0,0x1C1,0x1C2,0x2C3,0x1C4,0x2C5,0x2C6,0x1C7,
1521 0x1C8,0x2C9,0x2CA,0x1CB,0x2CC,0x1CD,0x1CE,0x2CF,
1522 0x1D0,0x2D1,0x2D2,0x1D3,0x2D4,0x1D5,0x1D6,0x2D7,
1523 0x2D8,0x1D9,0x1DA,0x2DB,0x1DC,0x2DD,0x2DE,0x1DF,
1524 0x1E0,0x2E1,0x2E2,0x1E3,0x2E4,0x1E5,0x1E6,0x2E7,
1525 0x2E8,0x1E9,0x1EA,0x2EB,0x1EC,0x2ED,0x2EE,0x1EF,
1526 0x2F0,0x1F1,0x1F2,0x2F3,0x1F4,0x2F5,0x2F6,0x1F7,
1527 0x1F8,0x2F9,0x2FA,0x1FB,0x2FC,0x1FD,0x1FE,0x2FF
1529 return gEvenParityTable[inDataByte];
1547 const uint16_t inStartIndex,
1548 const uint16_t inTotalCount,
1549 const uint16_t inIncrement = 2)
1553 if (inIncrement == 0 || inIncrement > 2)
1557 for (ndx = 3; ndx < inTotalCount - 1; ndx++)
1559 const UWord wordValue (inYUV16Line[inStartIndex + ndx * inIncrement]);
1562 LOGMYERROR (
"Parity error at word " << ndx <<
": got " <<
xHEX0N(wordValue,2)
1569 const UWord checksum (inYUV16Line [inStartIndex + (inTotalCount - 1) * inIncrement]);
1570 const bool b8 ((checksum &
BIT(8)) != 0);
1571 const bool b9 ((checksum &
BIT(9)) != 0);
1574 LOGMYERROR (
"Checksum word error: got " <<
xHEX0N(checksum,2) <<
", expected " <<
xHEX0N(checksum ^ 0x200, 2));
1580 for (ndx = 3; ndx < inTotalCount - 1; ndx++)
1581 sum += inYUV16Line [inStartIndex + ndx * inIncrement] & 0x1FF;
1583 if ((sum & 0x1FF) != (checksum & 0x1FF))
1585 LOGMYERROR (
"Checksum math error: got " <<
xHEX0N(checksum & 0x1FF, 2) <<
", expected " <<
xHEX0N(sum & 0x1FF, 2));
1599 const UWord wordCountMax (
UWord(inYUV16Line.size ()));
1607 outRawPackets.clear();
1608 outWordOffsets.clear();
1611 {
LOGMYERROR(
"Bad search select value " <<
DEC(inChanSelect));
return false;}
1612 if (wordCountMax < 12)
1613 {
LOGMYERROR(
"UWordSequence size " <<
DEC(wordCountMax) <<
" too small");
return false;}
1615 for (
UWord wordNum = searchOffset; wordNum < (wordCountMax - 12); wordNum += searchIncr)
1617 const UWord ancHdr0 (inYUV16Line.at (wordNum + (0 * searchIncr)));
1618 const UWord ancHdr1 (inYUV16Line.at (wordNum + (1 * searchIncr)));
1619 const UWord ancHdr2 (inYUV16Line.at (wordNum + (2 * searchIncr)));
1620 const UWord ancHdr3 (inYUV16Line.at (wordNum + (3 * searchIncr)));
1621 const UWord ancHdr4 (inYUV16Line.at (wordNum + (4 * searchIncr)));
1622 const UWord ancHdr5 (inYUV16Line.at (wordNum + (5 * searchIncr)));
1623 if (ancHdr0 == 0x000 && ancHdr1 == 0x3ff && ancHdr2 == 0x3ff)
1626 UWord dataCount (ancHdr5 & 0xFF);
1627 UWord totalCount (6 + dataCount + 1);
1629 if (totalCount > wordCountMax)
1631 totalCount = wordCountMax;
1632 LOGMYERROR (
"packet totalCount " << totalCount <<
" exceeds max " << wordCountMax);
1637 if (
ULWord (wordNum + totalCount) >= wordCountMax)
1639 LOGMYDEBUG (
"past end of line: " << wordNum <<
" + " << totalCount <<
" >= " << wordCountMax);
1647 for (
unsigned i = 0; i < totalCount; i++)
1648 packet.push_back (inYUV16Line.at (wordNum + (i * searchIncr)));
1649 outRawPackets.push_back (packet);
1650 outWordOffsets.push_back (wordNum);
1653 <<
": DID=" <<
xHEX0N(ancHdr3,4)
1654 <<
" SDID=" <<
xHEX0N(ancHdr4,4)
1655 <<
" word=" << wordNum
1656 <<
" DC=" << ancHdr5
1657 <<
" pix=" << (wordNum / searchIncr));
1668 const uint32_t inNumPixels)
1670 const UByte * pInYUV8Buffer (
reinterpret_cast <const UByte *
> (pInYUV8Line));
1671 const ULWord maxOutElements (inNumPixels * 2);
1673 outU16YUVLine.clear ();
1674 outU16YUVLine.reserve (maxOutElements);
1675 while (outU16YUVLine.size() <
size_t(maxOutElements))
1676 outU16YUVLine.push_back(0);
1679 {
LOGMYERROR(
"NULL/empty YUV8 buffer");
return false;}
1680 if (inNumPixels < 12)
1681 {
LOGMYERROR(
"width in pixels " <<
DEC(inNumPixels) <<
" too small (< 12)");
return false;}
1682 if (inNumPixels % 4)
1683 {
LOGMYERROR(
"width in pixels " <<
DEC(inNumPixels) <<
" not multiple of 4");
return false;}
1687 for (
ULWord comp = 0; comp < 2; comp++)
1689 bool bNoMoreAnc (
false);
1699 while (pixNum < inNumPixels)
1704 const ULWord index (2 * pixNum + comp);
1707 if (index <
ULWord(outU16YUVLine.size()))
1708 outU16YUVLine [index] = dataValue;
1710 outU16YUVLine.push_back (dataValue);
1717 if ((pixNum + 7) < inNumPixels)
1719 if ( pInYUV8Buffer [2*(pixNum+0) + comp] == 0x00
1720 && pInYUV8Buffer [2*(pixNum+1) + comp] == 0xFF
1721 && pInYUV8Buffer [2*(pixNum+2) + comp] == 0xFF)
1724 outU16YUVLine [2*pixNum++ + comp] = 0x000;
1725 outU16YUVLine [2*pixNum++ + comp] = 0x3ff;
1726 outU16YUVLine [2*pixNum++ + comp] = 0x3ff;
1728 ancCount = pInYUV8Buffer[2*(pixNum+2) + comp] + 3 + 1;
1737 else if (ancCount == 1)
1740 outU16YUVLine [2*pixNum + comp] = checksum & 0x1ff;
1741 outU16YUVLine [2*pixNum + comp] |= (~checksum & 0x100) << 1;
1749 const UByte ancByte (pInYUV8Buffer [2*pixNum + comp]);
1750 const UWord ancWord (AddEvenParity (ancByte));
1752 outU16YUVLine [2*pixNum + comp] = ancWord;
1754 checksum += (ancWord & 0x1ff);
1773 outConstructed = outDestructed = 0;
1815 case 0x00:
return "SMPTE-291 Control Packet";
1816 case 0x08:
if (inSID == 0x08)
return "SMPTE-291 Control Packet";
1818 case 0x40:
switch (inSID)
1820 case 0x01:
return "RP-305 SDTI Header Data";
1821 case 0x02:
return "RP-348 HD-SDTI Header Data";
1822 case 0x04:
return "SMPTE-427 Link Encryp Key Msg 1";
1823 case 0x05:
return "SMPTE-427 Link Encryp Key Msg 2";
1824 case 0x06:
return "SMPTE-427 Link Encryp MetaD";
1827 case 0x41:
switch (inSID)
1829 case 0x01:
return "SMPTE-352M Payload ID";
1830 case 0x05:
return "SMPTE-2016-3 ADF/Bar Data";
1831 case 0x06:
return "SMPTE-2016-4 Pan & Scan Data";
1832 case 0x07:
return "SMPTE-2010 ANSI/SCTE 104 Msgs";
1833 case 0x08:
return "SMPTE-2031 DVB/SCTE VBI Data";
1836 case 0x43:
switch (inSID)
1838 case 0x01:
return "BT.1685 Inter-Station Ctrl Data";
1839 case 0x02:
return "RDD08/OP-47 Teletext Subtitling";
1840 case 0x03:
return "RDD08/OP-47 VANC Multipacket";
1841 case 0x04:
return "ARIB TR-B29 AV Sig Error Mon MetaD";
1842 case 0x05:
return "RDD18 Camera Params";
1845 case 0x44:
if (inSID == 0x04 || inSID == 0x14)
return "RP-214 KLV Encoded MetaD & Essence";
1846 else if (inSID == 0x44)
return "RP-223 UMID & Prog ID Label Data";
1848 case 0x45:
if (inSID > 0 && inSID < 0x0A)
return "RP-2020 Compr/Dolby Aud MetaD";
1851 case 0x50:
if (inSID == 0x01)
return "RDD08 WSS Data";
1852 else if (inSID == 0x51)
return "CineLink-2 Link Encryp MetaD";
1854 case 0x51:
if (inSID == 0x01)
return "RP-215 Film Transfer Info";
1855 else if (inSID == 0x02)
return "RDD-18 Cam Param MetaD Set Acq";
1857 case 0x5F:
if (inSID == 0xDF)
return "ARIB STD-B37 HD Captions";
1858 else if (inSID == 0xDE)
return "ARIB STD-B37 SD Captions";
1859 else if (inSID == 0xDD)
return "ARIB STD-B37 Analog Captions";
1860 else if (inSID == 0xDC)
return "ARIB STD-B37 Mobile Captions";
1861 else if ((inSID & 0xF0) == 0xD0)
return "ARIB STD-B37 ??? Captions";
1862 return "ARIB STD-B37 ???";
1863 case 0x60:
if (inSID == 0x60)
return "SMPTE-12M ATC Timecode";
1865 case 0x61:
if (inSID == 0x01)
return "SMPTE-334 HD CEA-708 CC";
1866 else if (inSID == 0x02)
return "SMPTE-334 SD CEA-608 CC";
1868 case 0x62:
if (inSID == 0x01)
return "RP-207 DTV Program Desc";
1869 else if (inSID == 0x02)
return "SMPTE-334 Data Broadcast";
1870 else if (inSID == 0x03)
return "RP-208 VBI Data";
1872 case 0x64:
if (inSID == 0x64)
return "RP-196 LTC in HANC (Obs)";
1873 else if (inSID == 0x7F)
return "RP-196 VITC in HANC (Obs)";
1875 case 0x80:
return "SMPTE-291 Ctrl Pkt 'Marked for Deletion'";
1876 case 0x84:
return "SMPTE-291 Ctrl Pkt 'End Marker'";
1877 case 0x88:
return "SMPTE-291 Ctrl Pkt 'Start Marker'";
1878 case 0xA0:
return "SMPTE-299M 3G HD Aud Ctrl 8";
1879 case 0xA1:
return "SMPTE-299M 3G HD Aud Ctrl 7";
1880 case 0xA2:
return "SMPTE-299M 3G HD Aud Ctrl 6";
1881 case 0xA3:
return "SMPTE-299M 3G HD Aud Ctrl 5";
1882 case 0xA4:
return "SMPTE-299M 3G HD Aud Data 8";
1883 case 0xA5:
return "SMPTE-299M 3G HD Aud Data 7";
1884 case 0xA6:
return "SMPTE-299M 3G HD Aud Data 6";
1885 case 0xA7:
return "SMPTE-299M 3G HD Aud Data 5";
1887 case 0xD2:
return "AJA QA F1 Test Packet";
1888 case 0xD3:
return "AJA QA F2 Test Packet";
1889 case 0xE0:
return "SMPTE-299M HD Aud Ctrl 4";
1890 case 0xE1:
return "SMPTE-299M HD Aud Ctrl 3";
1891 case 0xE2:
return "SMPTE-299M HD Aud Ctrl 2";
1892 case 0xE3:
return "SMPTE-299M HD Aud Ctrl 1";
1893 case 0xE4:
return "SMPTE-299M HD Aud Data 4";
1894 case 0xE5:
return "SMPTE-299M HD Aud Data 3";
1895 case 0xE6:
return "SMPTE-299M HD Aud Data 2";
1896 case 0xE7:
return "SMPTE-299M HD Aud Data 1";
1897 case 0xEC:
return "SMPTE-272M SD Aud Ctrl 4";
1898 case 0xED:
return "SMPTE-272M SD Aud Ctrl 3";
1899 case 0xEE:
return "SMPTE-272M SD Aud Ctrl 2";
1900 case 0xEF:
return "SMPTE-272M SD Aud Ctrl 1";
1901 case 0xF0:
return "SMPTE-315 Camera Position";
1902 case 0xF4:
return "RP-165 Error Detect/Checkwords";
1903 case 0xF8:
return "SMPTE-272M SD Aud Ext Data 4";
1904 case 0xF9:
return "SMPTE-272M SD Aud Data 4";
1905 case 0xFA:
return "SMPTE-272M SD Aud Ext Data 3";
1906 case 0xFB:
return "SMPTE-272M SD Aud Data 3";
1907 case 0xFC:
return "SMPTE-272M SD Aud Ext Data 2";
1908 case 0xFD:
return "SMPTE-272M SD Aud Data 2";
1909 case 0xFE:
return "SMPTE-272M SD Aud Ext Data 1";
1910 case 0xFF:
return "SMPTE-272M SD Aud Data 1";
1938 mSequenceNumber (0),
1953 uint32_t u32(uint32_t(mVBits << 30));
1954 u32 |= uint32_t(mPBit ? 1 : 0) << 29;
1955 u32 |= uint32_t(mPBit ? 1 : 0) << 29;
1956 u32 |= uint32_t(mXBit ? 1 : 0) << 28;
1957 u32 |= uint32_t(mCCBits & 0x0000000F) << 24;
1958 u32 |= uint32_t(IsEndOfFieldOrFrame() ? 1 : 0) << 23;
1959 u32 |= uint32_t(GetPayloadType() & 0x0000007F) << 16;
1960 u32 |= uint32_t(GetSequenceNumber() & 0x0000FFFF);
1975 const uint32_t u32 ((GetSequenceNumber() & 0xFFFF0000) | (GetPayloadLength()));
1982 uint32_t u32(uint32_t(GetAncPacketCount() & 0x000000FF) << 24);
1983 u32 |= uint32_t(GetFieldSignal() & 0x00000003) << 22;
2000 case 0: mVBits = uint8_t(u32 >> 30);
2001 mPBit = (u32 & 0x20000000) ?
true :
false;
2002 mXBit = (u32 & 0x10000000) ?
true :
false;
2003 mCCBits = uint8_t((u32 & 0x0F000000) >> 24);
2004 mMarkerBit = (u32 & 0x00800000) ?
true :
false;
2005 mPayloadType = uint8_t((u32 & 0x007F0000) >> 16);
2006 mSequenceNumber = (mSequenceNumber & 0xFFFF0000) | (u32 & 0x0000FFFF);
2009 case 1: mTimeStamp = u32;
2012 case 2: mSyncSourceID = u32;
2015 case 3: mSequenceNumber = (u32 & 0xFFFF0000) | (mSequenceNumber & 0x0000FFFF);
2016 mPayloadLength = uint16_t(u32 & 0x0000FFFF);
2019 case 4: mAncCount = uint8_t((u32 & 0xFF000000) >> 24);
2020 mFieldSignal = uint8_t((u32 & 0x00C00000) >> 22);
2023 default:
return false;
2032 while (outVector.size() < 5)
2033 outVector.push_back(0);
2034 for (
unsigned ndx(0); ndx < 5; ndx++)
2041 const ULWord startingByteOffset (inU32Offset *
sizeof(uint32_t));
2044 uint32_t * pU32s (
reinterpret_cast<uint32_t*
>(outBuffer.
GetHostAddress(startingByteOffset)));
2045 for (
unsigned ndx(0); ndx < 5; ndx++)
2053 if (inVector.size() < 5)
2055 for (
unsigned ndx(0); ndx < 5; ndx++)
2065 const uint32_t * pU32s (
reinterpret_cast <const uint32_t *
> (inBuffer.
GetHostPointer()));
2066 for (
unsigned ndx(0); ndx < 5; ndx++)
2074 static const string sStrs[] = {
"p/noF",
"BAD",
"i/F1",
"i/F2" };
2075 return sStrs[inFBits & 0x03];
2080 return mVBits == inRHS.mVBits
2081 && mPBit == inRHS.mPBit
2082 && mXBit == inRHS.mXBit
2083 && mCCBits == inRHS.mCCBits
2084 && mMarkerBit == inRHS.mMarkerBit
2085 && mPayloadType == inRHS.mPayloadType
2086 && mSequenceNumber == inRHS.mSequenceNumber
2087 && mTimeStamp == inRHS.mTimeStamp
2088 && mSyncSourceID == inRHS.mSyncSourceID
2089 && mPayloadLength == inRHS.mPayloadLength
2090 && mAncCount == inRHS.mAncCount
2091 && mFieldSignal == inRHS.mFieldSignal;
2097 inOutStream <<
xHEX0N(word0,8)
2099 <<
": V=" <<
DEC(uint16_t(mVBits))
2100 <<
" P=" << mPBit <<
" X=" << mXBit <<
" CC=" <<
DEC(uint16_t(mCCBits))
2101 <<
" M=" << (IsEndOfFieldOrFrame()?
"EOF":
"0") <<
" PT=" <<
xHEX0N(uint16_t(GetPayloadType()),2)
2102 <<
" Seq#=" <<
xHEX0N(GetSequenceNumber(),8) <<
" TS=" <<
xHEX0N(GetTimeStamp(),8)
2103 <<
" SSRC=" <<
xHEX0N(GetSyncSourceID(),8) <<
" PayLen=" <<
DEC(GetPayloadLength())
2105 << (
IsValid() ?
"" :
" (invalid)");
2111 return !(mVBits || mPBit || mXBit || mCCBits || mMarkerBit || mPayloadType || mSequenceNumber || mTimeStamp || mSyncSourceID || mPayloadLength || mAncCount || mFieldSignal);
2116 return mVBits == 0x02
2118 && IsValidFieldSignal();
2154 u32 |= (uint32_t(GetLineNumber()) & 0x000007FF) << 20;
2155 u32 |= (IsCBitSet() ? 0x80000000 : 0x00000000);
2156 u32 |= (uint32_t(GetHorizOffset()) & 0x00000FFF) << 8;
2157 u32 |= IsSBitSet() ? 0x00000080 : 0x00000000;
2159 u32 |= uint32_t(GetStreamNumber() & 0x7F);
2170 if (u32 & 0x80000000)
2191 if (inIndex0 >= inVector.size())
2232 mStreamNum = uint8_t(lnk);
2234 mStreamNum = uint8_t(ds);
2238 mLineNum = inLoc.GetLineNumber();
2246 inOutStream <<
xHEX0N(
GetULWord(),8) <<
": C=" << (IsCBitSet() ?
"1" :
"0")
2247 <<
" Line=" <<
DEC(GetLineNumber()) <<
" HOff=" <<
DEC(GetHorizOffset())
2248 <<
" S=" << (IsSBitSet() ?
"1" :
"0") <<
" Strm=" <<
DEC(uint16_t(GetStreamNumber()));