13 #if defined(AJA_LINUX)
21 #define LOGGING_ANCDATA AJADebug::IsActive(AJA_DebugUnit_AJAAncData)
22 #define LOGGING_ANC2110RX AJADebug::IsActive(AJA_DebugUnit_Anc2110Rcv)
23 #define LOGGING_ANC2110TX AJADebug::IsActive(AJA_DebugUnit_Anc2110Xmit)
25 #define LOGMYERROR(__x__) {if (LOGGING_ANCDATA) AJA_sERROR (AJA_DebugUnit_AJAAncData, AJAFUNC << ": " << __x__);}
26 #define LOGMYWARN(__x__) {if (LOGGING_ANCDATA) AJA_sWARNING(AJA_DebugUnit_AJAAncData, AJAFUNC << ": " << __x__);}
27 #define LOGMYNOTE(__x__) {if (LOGGING_ANCDATA) AJA_sNOTICE (AJA_DebugUnit_AJAAncData, AJAFUNC << ": " << __x__);}
28 #define LOGMYINFO(__x__) {if (LOGGING_ANCDATA) AJA_sINFO (AJA_DebugUnit_AJAAncData, AJAFUNC << ": " << __x__);}
29 #define LOGMYDEBUG(__x__) {if (LOGGING_ANCDATA) AJA_sDEBUG (AJA_DebugUnit_AJAAncData, AJAFUNC << ": " << __x__);}
31 #define RCV2110ERR(__x__) {if (LOGGING_ANC2110RX) AJA_sERROR (AJA_DebugUnit_Anc2110Rcv, AJAFUNC << ": " << __x__);}
32 #define RCV2110WARN(__x__) {if (LOGGING_ANC2110RX) AJA_sWARNING(AJA_DebugUnit_Anc2110Rcv, AJAFUNC << ": " << __x__);}
33 #define RCV2110NOTE(__x__) {if (LOGGING_ANC2110RX) AJA_sNOTICE (AJA_DebugUnit_Anc2110Rcv, AJAFUNC << ": " << __x__);}
34 #define RCV2110INFO(__x__) {if (LOGGING_ANC2110RX) AJA_sINFO (AJA_DebugUnit_Anc2110Rcv, AJAFUNC << ": " << __x__);}
35 #define RCV2110DBG(__x__) {if (LOGGING_ANC2110RX) AJA_sDEBUG (AJA_DebugUnit_Anc2110Rcv, AJAFUNC << ": " << __x__);}
37 #define XMT2110ERR(__x__) {if (LOGGING_ANC2110TX) AJA_sERROR (AJA_DebugUnit_Anc2110Xmit, AJAFUNC << ": " << __x__);}
38 #define XMT2110WARN(__x__) {if (LOGGING_ANC2110TX) AJA_sWARNING(AJA_DebugUnit_Anc2110Xmit, AJAFUNC << ": " << __x__);}
39 #define XMT2110NOTE(__x__) {if (LOGGING_ANC2110TX) AJA_sNOTICE (AJA_DebugUnit_Anc2110Xmit, AJAFUNC << ": " << __x__);}
40 #define XMT2110INFO(__x__) {if (LOGGING_ANC2110TX) AJA_sINFO (AJA_DebugUnit_Anc2110Xmit, AJAFUNC << ": " << __x__);}
41 #define XMT2110DBG(__x__) {if (LOGGING_ANC2110TX) AJA_sDEBUG (AJA_DebugUnit_Anc2110Xmit, AJAFUNC << ": " << __x__);}
43 #if defined(AJA_WINDOWS)
44 const size_t sENDL(2);
46 const size_t sENDL(1);
50 #if 0 // DetailedDebugging
51 #define RCV2110DDBG(__x__) RCV2110DBG(__x__)
52 #define XMT2110DDBG(__x__) XMT2110DBG(__x__)
54 #define RCV2110DDBG(__x__)
55 #define XMT2110DDBG(__x__)
58 #if defined(AJAHostIsBigEndian)
60 #define AJA_ENDIAN_16NtoH(__val__) (__val__)
61 #define AJA_ENDIAN_16HtoN(__val__) (__val__)
62 #define AJA_ENDIAN_32NtoH(__val__) (__val__)
63 #define AJA_ENDIAN_32HtoN(__val__) (__val__)
64 #define AJA_ENDIAN_64NtoH(__val__) (__val__)
65 #define AJA_ENDIAN_64HtoN(__val__) (__val__)
68 #define AJA_ENDIAN_16NtoH(__val__) AJA_ENDIAN_SWAP16(__val__)
69 #define AJA_ENDIAN_16HtoN(__val__) AJA_ENDIAN_SWAP16(__val__)
70 #define AJA_ENDIAN_32NtoH(__val__) AJA_ENDIAN_SWAP32(__val__)
71 #define AJA_ENDIAN_32HtoN(__val__) AJA_ENDIAN_SWAP32(__val__)
72 #define AJA_ENDIAN_64NtoH(__val__) AJA_ENDIAN_SWAP64(__val__)
73 #define AJA_ENDIAN_64HtoN(__val__) AJA_ENDIAN_SWAP64(__val__)
87 #endif // defined(_DEBUG)
96 #endif // defined(_DEBUG)
105 #endif // defined(_DEBUG)
115 #endif // defined(_DEBUG)
126 #endif // defined(_DEBUG)
140 m_rcvDataValid =
false;
177 m_payload.reserve(numBytes);
178 for (uint32_t ndx(0); ndx < numBytes; ndx++)
179 m_payload.push_back(0);
182 catch(
const bad_alloc &)
215 m_checksum = inChecksum;
217 if (inChecksum != Calculate8BitChecksum())
226 return uint16_t(GetLocationDataStream());
228 return uint16_t(GetLocationVideoLink());
240 sum += uint8_t(m_payload.size());
241 if (!m_payload.empty())
242 for (ByteVector::size_type ndx(0); ndx < m_payload.size(); ndx++)
243 sum += m_payload[ndx];
244 NTV2_ASSERT(sum == uint8_t(Calculate9BitChecksum()));
252 uint16_t sum (AddEvenParity(m_DID));
253 sum += AddEvenParity(m_SID);
254 sum += AddEvenParity(
UByte(GetDC()));
255 if (!m_payload.empty())
256 for (ByteVector::size_type ndx(0); ndx < m_payload.size(); ndx++)
257 sum += AddEvenParity(m_payload[ndx]);
259 const bool b8 ((sum & 0x100) != 0);
261 return (sum & 0x1FF) | (b9 ? 0x200 : 0x000);
270 AJAStatus status (SetLocationVideoLink(loc.GetDataLink()));
272 status = SetLocationDataStream(loc.GetDataStream());
274 status = SetLocationDataChannel(loc.GetDataChannel());
278 status = SetLocationLineNumber(loc.GetLineNumber());
290 m_location.SetDataLink(inLinkValue);
302 m_location.SetDataStream(inStream);
314 m_location.SetDataChannel(inChannel);
324 m_location.SetLineNumber(inLineNum);
334 m_location.SetHorizontalOffset(inOffset);
345 m_coding = inCodingType;
356 if (pInData ==
NULL || inNumBytes == 0)
360 AJAStatus status (AllocDataMemory(inNumBytes));
365 ::memcpy (&m_payload[0], pInData, inNumBytes);
377 const uint32_t payloadByteCount (uint32_t(pInData[5] & 0x00FF));
378 if ((inNumWords - 7) > payloadByteCount)
382 const AJAStatus status (AllocDataMemory(payloadByteCount));
387 for (uint32_t numWord (0); numWord < payloadByteCount; numWord++)
388 m_payload[numWord] =
UByte(pInData[6+numWord] & 0x00FF);
391 SetDataLocation(inLocInfo);
392 SetChecksum(
UByte(pInData[6+payloadByteCount] & 0x00FF));
393 SetDID(
UByte(pInData[3] & 0x00FF));
394 SetSID(
UByte(pInData[4] & 0x00FF));
406 if (pInData ==
NULL || inNumBytes == 0)
411 for (uint32_t ndx(0); ndx < inNumBytes; ndx++)
412 m_payload.push_back(pInData[ndx]);
414 catch(
const bad_alloc &)
431 const uint32_t numBytes (uint32_t(inAnc.GetPayloadByteCount()));
432 for (uint32_t ndx(0); ndx < numBytes; ndx++)
433 m_payload.push_back(pInData[ndx]);
435 catch(
const bad_alloc &)
449 if (pOutData ==
NULL)
455 ::memcpy (pOutData, GetPayloadData(), inNumBytes);
463 const UWordSequence::size_type origSize (outUDWs.size());
466 const uint16_t UDW (inAddParity ? AddEvenParity(*iter) : *iter);
469 outUDWs.push_back(UDW);
477 outUDWs.resize(origSize);
485 return m_payload[inIndex0];
493 if (inIndex0 >= GetDC())
496 m_payload[inIndex0] = inDataByte;
504 m_rcvDataValid =
false;
513 const size_t inMaxBytes,
515 uint32_t & outPacketByteCount)
549 const uint32_t maxBytes(uint32_t(inMaxBytes+0));
552 outPacketByteCount = 0;
560 outPacketByteCount = maxBytes;
566 if (pInData[0] != 0xFF)
569 outPacketByteCount = 0;
570 LOGMYDEBUG(
"No data: First GUMP byte is " <<
xHEX0N(uint16_t(pInData[0]),2) <<
", expected 0xFF");
579 if (totalBytes > maxBytes)
581 outPacketByteCount = maxBytes;
582 LOGMYERROR(
"AJA_STATUS_RANGE: Reported packet size " << totalBytes <<
" [bytes] extends past end of buffer " << inMaxBytes <<
" by " << (totalBytes-inMaxBytes) <<
" byte(s)");
590 m_checksum = pInData[totalBytes-1];
593 m_location = inLocationInfo;
595 if ((pInData[1] & 0x80) != 0)
601 m_location.SetLineNumber(uint16_t((pInData[1] & 0x0F) << 7) + uint16_t(pInData[2] & 0x7F));
607 const uint32_t payloadSize (pInData[5]);
610 status = AllocDataMemory(payloadSize);
612 for (uint32_t ndx(0); ndx < payloadSize; ndx++)
613 m_payload[ndx] = pInData[ndx+6];
616 outPacketByteCount = totalBytes;
617 LOGMYDEBUG(
"Set from GUMP buffer OK: " << AsString(32));
625 const size_t inMaxBytes,
626 uint32_t & outPacketByteCount)
651 outPacketByteCount = 0;
658 if (!AuxPacketTypeIsValid(pInData[0]))
661 outPacketByteCount = 0;
662 LOGMYDEBUG(
"No data: First Aux byte " <<
xHEX0N(uint16_t(pInData[0]),2) <<
" is not a recognized type");
666 const uint32_t maxBytes(uint32_t(inMaxBytes+0));
670 outPacketByteCount = maxBytes;
680 m_auxType = pInData[0];
681 m_auxHB1 = pInData[1];
682 m_auxHB2 = pInData[2];
686 uint32_t payloadSize(28);
687 int payloadOffset(3);
688 if (m_auxType & 0x80)
690 m_checksum = pInData[3];
691 payloadSize = m_auxHB2 & 0x0000001F;
701 status = AllocDataMemory(payloadSize);
703 for (uint32_t ndx(0); ndx < payloadSize; ndx++)
704 m_payload[ndx] = pInData[ndx+payloadOffset];
707 outPacketByteCount = totalBytes;
708 LOGMYDEBUG(
"Set from HDMI buffer OK: " << AsString(32));
715 uint32_t pktByteCount(0);
718 return InitWithReceivedData (&inData[0], uint32_t(inData.size()), inLocationInfo, pktByteCount);
739 LOGMYWARN(
"Illegal packet size " <<
DEC(GetDC()) <<
", exceeds 255 -- returning truncated value (255): " << AsString(32));
749 const uint32_t numPackets ((GetDC() + 254) / 255);
750 const uint32_t lastPacketDC (GetDC() % 255);
769 AJAStatus status (GeneratePayloadData());
774 uint32_t myPacketSize(0), maxBytes(uint32_t(inMaxBytes+0));
775 GetRawPacketSize(myPacketSize);
777 if (myPacketSize == 0)
779 LOGMYERROR(
"AJA_STATUS_FAIL: nothing to do -- raw packet size is zero: " << AsString(32));
782 if (myPacketSize > maxBytes)
784 LOGMYERROR(
"AJA_STATUS_FAIL: " << maxBytes <<
"-byte client buffer too small to hold " << myPacketSize <<
" byte(s): " << AsString(32));
787 if (!IsDigital() && !
IsRaw())
789 LOGMYERROR(
"AJA_STATUS_FAIL: invalid packet coding (neither Raw nor Digital): " << AsString(32));
795 pData[0] = GetGUMPHeaderByte1();
796 pData[1] = GetGUMPHeaderByte2();
797 pData[2] = GetGUMPHeaderByte3();
801 uint8_t payloadSize = uint8_t((GetDC() > 255) ? 255 : GetDC());
802 pData[5] = payloadSize;
805 status = GetPayloadData(&pData[6], payloadSize);
809 pData[6+payloadSize] = Calculate8BitChecksum();
812 outPacketSize = myPacketSize;
819 const uint32_t numPackets ((GetDC() + 254) / 255);
824 const uint8_t * payloadPtr = GetPayloadData();
825 uint32_t remainingPayloadData = GetDC();
827 for (uint32_t ndx(0); ndx < numPackets; ndx++)
829 pData[0] = GetGUMPHeaderByte1();
830 pData[1] = GetGUMPHeaderByte2();
831 pData[2] = GetGUMPHeaderByte3();
835 uint8_t payloadSize = uint8_t((remainingPayloadData > 255) ? 255 : remainingPayloadData);
836 pData[5] = payloadSize;
839 ::memcpy(&pData[6], payloadPtr, payloadSize);
843 pData[6+payloadSize] = m_checksum;
846 payloadPtr += payloadSize;
849 remainingPayloadData -= payloadSize;
855 outPacketSize = myPacketSize;
857 LOGMYDEBUG(outPacketSize <<
" byte(s) generated: " << AsString(32));
865 uint8_t result (0x80);
870 if (m_location.IsLumaChannel())
873 if (m_location.IsHanc())
877 result |= (m_location.GetLineNumber() >> 7) & 0x0F;
885 AJAStatus status (GeneratePayloadData());
886 const UWordSequence::size_type origSize (outRawComponents.size());
892 const uint8_t dataCount ((GetDC() > 255) ? 255 : uint8_t(GetDC()));
893 outRawComponents.push_back(0x000);
894 outRawComponents.push_back(0x3FF);
895 outRawComponents.push_back(0x3FF);
896 outRawComponents.push_back(AddEvenParity(GetDID()));
897 outRawComponents.push_back(AddEvenParity(GetSID()));
898 outRawComponents.push_back(AddEvenParity(dataCount));
902 outRawComponents.resize(origSize);
909 status = GetPayloadData(outRawComponents, IsDigital() );
913 outRawComponents.push_back(Calculate9BitChecksum());
916 {
LOGMYDEBUG((origSize ?
"Appended " :
"Generated ") << (outRawComponents.size() - origSize) <<
" UWords from " << AsString(32) << endl <<
UWordSequence(outRawComponents));}
924 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 };
925 static const unsigned gShifts[] = { 22,12,2,8, 24,14,4,6, 26,16,6,4, 28,18,8,2, 30,20,10,0 };
926 static const uint32_t
gMasks[] = { 0xFFC00000, 0x003FF000, 0x00000FFC, 0x00000003,
927 0xFF000000, 0x00FFC000, 0x00003FF0, 0x0000000F,
928 0xFC000000, 0x03FF0000, 0x0000FFC0, 0x0000003F,
929 0xF0000000, 0x0FFC0000, 0x0003FF00, 0x000000FF,
930 0xC0000000, 0x3FF00000, 0x000FFC00, 0x000003FF };
935 AJAStatus status (GeneratePayloadData());
936 const ULWordSequence::size_type origSize (outData.size());
946 const uint16_t did (AddEvenParity(GetDID()));
947 const uint16_t sid (AddEvenParity(GetSID()));
948 const uint16_t dc (AddEvenParity(uint8_t(GetDC())));
949 const uint16_t cs (Calculate9BitChecksum());
952 UDW16s.reserve(GetDC()+4);
953 UDW16s.push_back(did);
954 UDW16s.push_back(sid);
955 UDW16s.push_back(dc);
958 status = GetPayloadData(UDW16s,
true);
960 {
XMT2110ERR(
"GetPayloadData failed: " << AsString(32));
return status;}
961 UDW16s.push_back(cs);
969 const uint32_t pktHdrWord (pktHdr.
GetULWord());
970 outData.push_back(pktHdrWord);
974 const size_t numUDWs (UDW16s.size());
979 for (
unsigned loopNdx(0); loopNdx <
sizeof(
gIndexes) /
sizeof(
size_t); loopNdx++)
981 const bool is4th ((loopNdx & 3) == 3);
982 const size_t ndx (UDWndx +
gIndexes[loopNdx]);
983 const bool isPastEnd (ndx >= numUDWs);
984 const uint32_t UDW (isPastEnd ? 0 : uint32_t(UDW16s[ndx]));
985 const unsigned shift (
gShifts[loopNdx]);
986 const uint32_t mask (
gMasks[loopNdx]);
990 u32 |= (UDW >> shift) & mask;
999 u32 |= (UDW << shift) & mask;
1002 }
while (UDWndx < numUDWs);
1034 oss << (origSize ?
"Appended " :
"Generated ") << (outData.size() - origSize) <<
" U32s:";
1035 for (
size_t ndx(origSize); ndx < outData.size(); ndx++)
1037 oss <<
" BigEndian from " << AsString(32);
1041 XMT2110DBG((origSize ?
"Appended " :
"Generated ")
1042 << (outData.size() - origSize) <<
" 32-bit words from " << AsString(32));
1050 const size_t numU32s (inU32s.size());
1054 if (inOutU32Ndx >= numU32s)
1062 RCV2110DDBG(
"u32=" <<
xHEX0N(
ENDIAN_32NtoH(inU32s.at(inOutU32Ndx)),8) <<
" inU32s[" <<
DEC(inOutU32Ndx) <<
" of " <<
DEC(numU32s) <<
"] AncPktHdr: " << ancPktHeader <<
" -- AncDataLoc: " << dataLoc);
1064 if (++inOutU32Ndx >= numU32s)
1069 result = SetLocationVideoLink(dataLoc.GetDataLink());
1070 if (
AJA_FAILURE(result)) {
RCV2110ERR(
"SetLocationVideoLink failed, dataLoc: " << dataLoc);
return result;}
1072 result = SetLocationDataStream(dataLoc.GetDataStream());
1073 if (
AJA_FAILURE(result)) {
RCV2110ERR(
"SetLocationDataStream failed, dataLoc: " << dataLoc);
return result;}
1075 result = SetLocationDataChannel(dataLoc.GetDataChannel());
1076 if (
AJA_FAILURE(result)) {
RCV2110ERR(
"SetLocationDataChannel failed, dataLoc: " << dataLoc);
return result;}
1079 if (
AJA_FAILURE(result)) {
RCV2110ERR(
"SetLocationHorizOffset failed, dataLoc: " << dataLoc);
return result;}
1081 result = SetLocationLineNumber(dataLoc.GetLineNumber());
1082 if (
AJA_FAILURE(result)) {
RCV2110ERR(
"SetLocationLineNumber failed, dataLoc: " << dataLoc);
return result;}
1086 bool gotChecksum (
false);
1087 size_t dataCount (0);
1089 const size_t startU32Ndx (inOutU32Ndx);
1094 for (
unsigned loopNdx(0); loopNdx < 20 && !gotChecksum; loopNdx++)
1096 const bool is4th ((loopNdx & 3) == 3);
1097 const bool is1st ((loopNdx & 3) == 0);
1098 const unsigned shift (
gShifts[loopNdx]);
1099 const uint32_t mask (
gMasks[loopNdx]);
1102 u16 = uint16_t((u32 & mask) << shift);
1105 if (++inOutU32Ndx >= numU32s)
1107 u16s.push_back(u16);
1112 <<
" from " <<
DEC(loopNdx) <<
"(" <<
xHEX0N(inU32s.at(inOutU32Ndx-1),8) <<
" & " <<
xHEX0N(mask,8) <<
") << " <<
DEC(shift));
1120 u16 |= uint16_t((u32 & mask) >> shift);
1124 u16 = uint16_t((u32 & mask) >> shift);
1127 u16s.push_back(u16);
1130 case 1: SetDID(uint8_t(u16));
break;
1131 case 2: SetSID(uint8_t(u16));
break;
1132 case 3: dataCount = size_t(u16 & 0x0FF);
break;
1133 default:
if (u16s.size() == (dataCount + 4))
1134 {gotChecksum =
true;
RCV2110DDBG(
"Got checksum, DC=" <<
xHEX0N(dataCount,2) <<
" CS=" <<
xHEX0N(u16s.back(),3));}
1140 }
while (inOutU32Ndx < numU32s);
1142 if (u16s.size() < 4)
1143 { ostringstream oss;
1144 if (u16s.size() < 1) oss <<
" NoDID";
1146 if (u16s.size() < 2) oss <<
" NoSID";
1148 if (u16s.size() < 3) oss <<
" NoDC";
1149 else oss <<
" DC=" <<
DEC(dataCount);
1150 RCV2110ERR(
"Incomplete/bad packet:" << oss.str() <<
" NoCS" <<
" -- only unpacked " << u16s);
1153 RCV2110DBG(
"Consumed " <<
DEC(inOutU32Ndx - startU32Ndx + 1) <<
" ULWord(s), " << (gotChecksum?
"":
"NoCS, ") <<
"DC=" <<
DEC(dataCount) <<
", unpacked " << u16s);
1154 if (inOutU32Ndx < numU32s)
1158 if (dataCount > (u16s.size()-3))
1160 RCV2110ERR(
"Incomplete/bad packet: " <<
DEC(u16s.size()) <<
" U16s, but missing " <<
DEC(dataCount - (u16s.size()-3))
1161 <<
" byte(s), expected DC=" <<
DEC(dataCount) <<
" -- DID=" <<
xHEX0N(
UWord(GetDID()),2) <<
" SID=" <<
xHEX0N(
UWord(GetSID()),2));
1166 for (
size_t ndx(0); ndx < dataCount; ndx++)
1167 m_payload.push_back(uint8_t(u16s.at(ndx+3)));
1169 result = SetChecksum(uint8_t(u16s.at(u16s.size()-1)),
true );
1172 if (inIgnoreChecksum)
1175 {
RCV2110ERR(
"SetChecksum=" <<
xHEX0N(u16s.at(u16s.size()-1),3) <<
" failed, calculated=" <<
xHEX0N(Calculate9BitChecksum(),3));
return result;}
1236 static const string gAncDataLinkToStr [] = {
"A",
"B",
"?"};
1237 static const string gDAncDataLinkToStr [] = {
"AJAAncDataLink_A",
"AJAAncDataLink_B",
"AJAAncDataLink_Unknown"};
1239 return IS_VALID_AJAAncDataLink(inValue) ? (inCompact ? gAncDataLinkToStr[inValue] : gDAncDataLinkToStr[inValue]) : gAncDataLinkToStr[2];
1245 static const string gAncDataStreamToStr [] = {
"DS1",
"DS2",
"DS3",
"DS4",
"?"};
1246 static const string gDAncDataStreamToStr [] = {
"AJAAncDataStream_1",
"AJAAncDataStream_2",
1247 "AJAAncDataStream_3",
"AJAAncDataStream_4",
"AJAAncDataStream_Unknown"};
1255 static const string gAncDataChannelToStr [] = {
"C",
"Y",
"?"};
1256 static const string gDAncDataChannelToStr [] = {
"AJAAncDataChannel_C",
"AJAAncDataChannel_Y",
"AJAAncDataChannel_Unknown"};
1264 static const string gAncDataSpaceToStr [] = {
"VANC",
"HANC",
"????"};
1265 static const string gDAncDataSpaceToStr [] = {
"AJAAncDataSpace_VANC",
"AJAAncDataSpace_HANC",
"AJAAncDataSpace_Unknown"};
1283 oss <<
"L" <<
DEC(inValue);
1302 oss <<
"+" <<
DEC(inValue);
1320 if (GetDataLink() != inRHS.GetDataLink())
1322 if (GetDataStream() != inRHS.GetDataStream())
1324 if (GetDataChannel() != inRHS.GetDataChannel())
1328 if (GetLineNumber() != inRHS.GetLineNumber())
1339 if (GetDataLink() != inRHS.GetDataLink())
1341 if (GetDataStream() != inRHS.GetDataStream())
1343 if (GetDataChannel() != inRHS.GetDataChannel())
1347 if (GetLineNumber() != inRHS.GetLineNumber())
1348 oss <<
", " <<
"Line " <<
DEC(GetLineNumber()) <<
" != " <<
DEC(inRHS.GetLineNumber());
1353 if (oss.str().length() > 2)
1354 return oss.str().substr(2, oss.str().length() - 2);
1362 inValue.
Print(oss, inCompact);
1368 return inValue.
Print(inOutStream,
true);
1374 static const string gAncDataCodingToStr [] = {
"Dig",
"Ana",
"???"};
1375 static const string gDAncDataCodingToStr [] = {
"AJAAncDataCoding_Digital",
"AJAAncDataCoding_Raw",
"AJAAncDataCoding_Unknown"};
1383 static const string gAncBufFmtToStr [] = {
"UNK",
"FBVANC",
"SDI",
"RTP",
"HDMI",
""};
1384 static const string gDAncBufFmtToStr [] = {
"AJAAncBufferFormat_Unknown",
"AJAAncBufferFormat_FBVANC",
1385 "AJAAncBufferFormat_SDI",
"AJAAncBufferFormat_RTP",
"AJAAncBufferFormat_HDMI",
""};
1393 static const string gAncDataTypeToStr [] = {
"Unknown",
"SMPTE 2016-3 AFD",
"SMPTE 12-M RP188",
"SMPTE 12-M VITC",
1394 "SMPTE 334 CEA708",
"SMPTE 334 CEA608",
"CEA608 Line21",
"SMPTE 352 VPID",
1395 "SMPTE 2051 2 Frame Marker",
"524D Frame Status",
"5251 Frame Status",
1396 "HDR SDR",
"HDR10",
"HDR HLG",
"HDMI Aux",
"?"};
1398 static const string gDAncDataTypeToStr [] = {
"AJAAncDataType_Unknown",
"AJAAncDataType_Smpte2016_3",
"AJAAncDataType_Timecode_ATC",
1399 "AJAAncDataType_Timecode_VITC",
"AJAAncDataType_Cea708",
"AJAAncDataType_Cea608_Vanc",
1400 "AJAAncDataType_Cea608_Line21",
"AJAAncDataType_Smpte352",
"AJAAncDataType_Smpte2051",
1401 "AJAAncDataType_FrameStatusInfo524D",
"AJAAncDataType_FrameStatusInfo5251",
1402 "AJAAncDataType_HDR_SDR",
"AJAAncDataType_HDR_HDR10",
"AJAAncDataType_HDR_HLG",
1403 "AJAAncDataType_HDMI_Aux",
"?"};
1411 oss <<
"Type:\t\t" << IDAsString() << endl;
1413 oss <<
"DID:\t\t" <<
xHEX0N(uint32_t(GetDID()),2) << endl
1414 <<
"SID:\t\t" <<
xHEX0N(uint32_t(GetSID()),2) << endl;
1415 oss <<
"DC:\t\t" <<
DEC(GetDC()) << endl;
1417 oss <<
"CS:\t\t" <<
xHEX0N(uint32_t(m_checksum),2) << endl
1418 <<
"Loc:\t\t" << GetDataLocation() << endl;
1420 <<
"Frame:\t\t" <<
xHEX0N(GetFrameID(),8) << endl
1422 <<
"Valid:\t\t" << (GotValidReceiveData() ?
"Yes" :
"No");
1424 {oss << endl; DumpPayload(oss);}
1432 oss <<
"Analog/Raw Line " <<
DEC(GetDataLocation().GetLineNumber()) <<
" Packet";
1434 oss << AuxPacketTypeToString(GetAuxType());
1436 oss << DIDSIDToString(GetDID(), GetSID());
1445 oss <<
"|" <<
xHEX0N(uint16_t(GetAuxType()),2)
1446 <<
HEX0N(uint16_t(GetAuxHB1()),2)
1447 <<
HEX0N(uint16_t(GetAuxHB2()),2);
1450 <<
"|" << GetDIDSIDPair() <<
"|CS" <<
HEX0N(uint16_t(GetChecksum()),2);
1451 oss <<
"|DC=" <<
DEC(GetDC());
1453 oss <<
"|FRx" <<
HEX0N(GetFrameID(),8);
1456 const string typeStr (IsHDMI() ? AuxPacketTypeToString(GetAuxType())
1457 : DIDSIDToString(GetDID(), GetSID()));
1458 if (!typeStr.empty())
1459 oss <<
"|" << typeStr;
1461 if (inMaxBytes && GetDC())
1463 uint16_t bytesToDump = uint16_t(GetDC());
1465 if (inMaxBytes < bytesToDump)
1466 bytesToDump = inMaxBytes;
1467 for (uint16_t ndx(0); ndx < bytesToDump; ndx++)
1468 oss <<
HEX0N(uint16_t(m_payload[ndx]),2);
1469 if (bytesToDump < uint16_t(GetDC()))
1477 inOutStream <<
"x" <<
HEX0N(uint16_t(inData.first), 2) <<
"x" <<
HEX0N(uint16_t(inData.second), 2);
1484 inOutStream <<
"(NULL payload)" << endl;
1487 const int32_t kBytesPerLine (32);
1488 uint32_t count (GetDC());
1489 const uint8_t * pData (GetPayloadData());
1493 const uint32_t numBytes ((count >= kBytesPerLine) ? kBytesPerLine : count);
1494 inOutStream << ((count == GetDC()) ?
"Payload: " :
" ");
1495 for (uint8_t num(0); num < numBytes; num++)
1497 inOutStream <<
" " <<
HEX0N(uint32_t(pData[num]),2);
1501 inOutStream << endl;
1512 if (GetDID() != inRHS.GetDID())
1514 if (GetSID() != inRHS.GetSID())
1516 if (GetDC() != inRHS.GetDC())
1519 if (!inIgnoreChecksum)
1520 if (GetChecksum() != inRHS.GetChecksum())
1522 if (!inIgnoreLocation)
1523 if (
AJA_FAILURE(GetDataLocation().Compare(inRHS.GetDataLocation())))
1526 if (GetDataCoding() != inRHS.GetDataCoding())
1540 if (GetDID() != inRHS.GetDID())
1541 oss << endl <<
"DID mismatch: " <<
xHEX0N(uint16_t(GetDID()),2) <<
" != " <<
xHEX0N(uint16_t(inRHS.GetDID()),2);
1542 if (GetSID() != inRHS.GetSID())
1543 oss << endl <<
"SID mismatch: " <<
xHEX0N(uint16_t(GetSID()),2) <<
" != " <<
xHEX0N(uint16_t(inRHS.GetSID()),2);
1544 if (GetDC() != inRHS.GetDC())
1545 oss << endl <<
"DC mismatch: " <<
xHEX0N(GetDC(),4) <<
" != " <<
xHEX0N(inRHS.GetDC(),4);
1547 if (!inIgnoreChecksum)
1548 if (GetChecksum() != inRHS.GetChecksum())
1549 oss << endl <<
"CS mismatch: " <<
xHEX0N(uint16_t(GetChecksum()),2) <<
" != " <<
xHEX0N(uint16_t(inRHS.GetChecksum()),2);
1550 if (!inIgnoreLocation)
1551 {
const string info(GetDataLocation().CompareWithInfo(inRHS.GetDataLocation()));
1553 oss << endl <<
"Location mismatch: " << info;
1556 if (GetDataCoding() != inRHS.GetDataCoding())
1561 const uint8_t *pLHS(GetPayloadData()), *pRHS(inRHS.
GetPayloadData());
1563 for (
size_t ndx(0); ndx < GetPayloadByteCount(); ndx++)
1564 if (pLHS[ndx] != pRHS[ndx])
1565 diffNdxs.push_back(
ULWord(ndx));
1566 if (!diffNdxs.empty())
1567 oss << endl <<
DEC(diffNdxs.size()) <<
" of " <<
DEC(GetDC()) <<
" (" <<
fDEC(100.0*
double(diffNdxs.size())/double(GetDC()), 5, 2)
1568 <<
"%) mismatched payload bytes, starting at offset " <<
DEC(diffNdxs.at(0));
1571 if (oss.str().length() >
sENDL)
1572 return oss.str().substr(
sENDL, oss.str().length() -
sENDL);
1580 m_DID = inRHS.
m_DID;
1581 m_SID = inRHS.
m_SID;
1610 static const uint16_t gEvenParityTable[256] =
1612 0x200,0x101,0x102,0x203,0x104,0x205,0x206,0x107,
1613 0x108,0x209,0x20A,0x10B,0x20C,0x10D,0x10E,0x20F,
1614 0x110,0x211,0x212,0x113,0x214,0x115,0x116,0x217,
1615 0x218,0x119,0x11A,0x21B,0x11C,0x21D,0x21E,0x11F,
1616 0x120,0x221,0x222,0x123,0x224,0x125,0x126,0x227,
1617 0x228,0x129,0x12A,0x22B,0x12C,0x22D,0x22E,0x12F,
1618 0x230,0x131,0x132,0x233,0x134,0x235,0x236,0x137,
1619 0x138,0x239,0x23A,0x13B,0x23C,0x13D,0x13E,0x23F,
1620 0x140,0x241,0x242,0x143,0x244,0x145,0x146,0x247,
1621 0x248,0x149,0x14A,0x24B,0x14C,0x24D,0x24E,0x14F,
1622 0x250,0x151,0x152,0x253,0x154,0x255,0x256,0x157,
1623 0x158,0x259,0x25A,0x15B,0x25C,0x15D,0x15E,0x25F,
1624 0x260,0x161,0x162,0x263,0x164,0x265,0x266,0x167,
1625 0x168,0x269,0x26A,0x16B,0x26C,0x16D,0x16E,0x26F,
1626 0x170,0x271,0x272,0x173,0x274,0x175,0x176,0x277,
1627 0x278,0x179,0x17A,0x27B,0x17C,0x27D,0x27E,0x17F,
1628 0x180,0x281,0x282,0x183,0x284,0x185,0x186,0x287,
1629 0x288,0x189,0x18A,0x28B,0x18C,0x28D,0x28E,0x18F,
1630 0x290,0x191,0x192,0x293,0x194,0x295,0x296,0x197,
1631 0x198,0x299,0x29A,0x19B,0x29C,0x19D,0x19E,0x29F,
1632 0x2A0,0x1A1,0x1A2,0x2A3,0x1A4,0x2A5,0x2A6,0x1A7,
1633 0x1A8,0x2A9,0x2AA,0x1AB,0x2AC,0x1AD,0x1AE,0x2AF,
1634 0x1B0,0x2B1,0x2B2,0x1B3,0x2B4,0x1B5,0x1B6,0x2B7,
1635 0x2B8,0x1B9,0x1BA,0x2BB,0x1BC,0x2BD,0x2BE,0x1BF,
1636 0x2C0,0x1C1,0x1C2,0x2C3,0x1C4,0x2C5,0x2C6,0x1C7,
1637 0x1C8,0x2C9,0x2CA,0x1CB,0x2CC,0x1CD,0x1CE,0x2CF,
1638 0x1D0,0x2D1,0x2D2,0x1D3,0x2D4,0x1D5,0x1D6,0x2D7,
1639 0x2D8,0x1D9,0x1DA,0x2DB,0x1DC,0x2DD,0x2DE,0x1DF,
1640 0x1E0,0x2E1,0x2E2,0x1E3,0x2E4,0x1E5,0x1E6,0x2E7,
1641 0x2E8,0x1E9,0x1EA,0x2EB,0x1EC,0x2ED,0x2EE,0x1EF,
1642 0x2F0,0x1F1,0x1F2,0x2F3,0x1F4,0x2F5,0x2F6,0x1F7,
1643 0x1F8,0x2F9,0x2FA,0x1FB,0x2FC,0x1FD,0x1FE,0x2FF
1645 return gEvenParityTable[inDataByte];
1663 const uint16_t inStartIndex,
1664 const uint16_t inTotalCount,
1665 const uint16_t inIncrement = 2)
1669 if (inIncrement == 0 || inIncrement > 2)
1673 for (ndx = 3; ndx < inTotalCount - 1; ndx++)
1675 const UWord wordValue (inYUV16Line[inStartIndex + ndx * inIncrement]);
1678 LOGMYERROR (
"Parity error at word " << ndx <<
": got " <<
xHEX0N(wordValue,2)
1685 const UWord checksum (inYUV16Line [inStartIndex + (inTotalCount - 1) * inIncrement]);
1686 const bool b8 ((checksum &
BIT(8)) != 0);
1687 const bool b9 ((checksum &
BIT(9)) != 0);
1690 LOGMYERROR (
"Checksum word error: got " <<
xHEX0N(checksum,2) <<
", expected " <<
xHEX0N(checksum ^ 0x200, 2));
1696 for (ndx = 3; ndx < inTotalCount - 1; ndx++)
1697 sum += inYUV16Line [inStartIndex + ndx * inIncrement] & 0x1FF;
1699 if ((sum & 0x1FF) != (checksum & 0x1FF))
1701 LOGMYERROR (
"Checksum math error: got " <<
xHEX0N(checksum & 0x1FF, 2) <<
", expected " <<
xHEX0N(sum & 0x1FF, 2));
1715 const UWord wordCountMax (
UWord(inYUV16Line.size ()));
1723 outRawPackets.clear();
1724 outWordOffsets.clear();
1727 {
LOGMYERROR(
"Bad search select value " <<
DEC(inChanSelect));
return false;}
1728 if (wordCountMax < 12)
1729 {
LOGMYERROR(
"UWordSequence size " <<
DEC(wordCountMax) <<
" too small");
return false;}
1731 for (
UWord wordNum = searchOffset; wordNum < (wordCountMax - 12); wordNum += searchIncr)
1733 const UWord ancHdr0 (inYUV16Line.at (wordNum + (0 * searchIncr)));
1734 const UWord ancHdr1 (inYUV16Line.at (wordNum + (1 * searchIncr)));
1735 const UWord ancHdr2 (inYUV16Line.at (wordNum + (2 * searchIncr)));
1736 const UWord ancHdr3 (inYUV16Line.at (wordNum + (3 * searchIncr)));
1737 const UWord ancHdr4 (inYUV16Line.at (wordNum + (4 * searchIncr)));
1738 const UWord ancHdr5 (inYUV16Line.at (wordNum + (5 * searchIncr)));
1739 if (ancHdr0 == 0x000 && ancHdr1 == 0x3ff && ancHdr2 == 0x3ff)
1742 UWord dataCount (ancHdr5 & 0xFF);
1743 UWord totalCount (6 + dataCount + 1);
1745 if (totalCount > wordCountMax)
1747 totalCount = wordCountMax;
1748 LOGMYERROR (
"packet totalCount " << totalCount <<
" exceeds max " << wordCountMax);
1753 if (
ULWord (wordNum + totalCount) >= wordCountMax)
1755 LOGMYDEBUG (
"past end of line: " << wordNum <<
" + " << totalCount <<
" >= " << wordCountMax);
1763 for (
unsigned i = 0; i < totalCount; i++)
1764 packet.push_back (inYUV16Line.at (wordNum + (i * searchIncr)));
1765 outRawPackets.push_back (packet);
1766 outWordOffsets.push_back (wordNum);
1769 <<
": DID=" <<
xHEX0N(ancHdr3,4)
1770 <<
" SDID=" <<
xHEX0N(ancHdr4,4)
1771 <<
" word=" << wordNum
1772 <<
" DC=" << ancHdr5
1773 <<
" pix=" << (wordNum / searchIncr));
1784 const uint32_t inNumPixels)
1786 const UByte * pInYUV8Buffer (
reinterpret_cast <const UByte *
> (pInYUV8Line));
1787 const ULWord maxOutElements (inNumPixels * 2);
1789 outU16YUVLine.clear ();
1790 outU16YUVLine.reserve (maxOutElements);
1791 while (outU16YUVLine.size() <
size_t(maxOutElements))
1792 outU16YUVLine.push_back(0);
1795 {
LOGMYERROR(
"NULL/empty YUV8 buffer");
return false;}
1796 if (inNumPixels < 12)
1797 {
LOGMYERROR(
"width in pixels " <<
DEC(inNumPixels) <<
" too small (< 12)");
return false;}
1798 if (inNumPixels % 4)
1799 {
LOGMYERROR(
"width in pixels " <<
DEC(inNumPixels) <<
" not multiple of 4");
return false;}
1803 for (
ULWord comp = 0; comp < 2; comp++)
1805 bool bNoMoreAnc (
false);
1815 while (pixNum < inNumPixels)
1820 const ULWord index (2 * pixNum + comp);
1824 if (index <
ULWord(outU16YUVLine.size()))
1825 outU16YUVLine[index] = dataValue;
1827 outU16YUVLine.push_back(dataValue);
1834 if ((pixNum + 7) < inNumPixels)
1836 if ( pInYUV8Buffer [2*(pixNum+0) + comp] == 0x00
1837 && pInYUV8Buffer [2*(pixNum+1) + comp] == 0xFF
1838 && pInYUV8Buffer [2*(pixNum+2) + comp] == 0xFF)
1841 outU16YUVLine [2*pixNum++ + comp] = 0x000;
1842 outU16YUVLine [2*pixNum++ + comp] = 0x3ff;
1843 outU16YUVLine [2*pixNum++ + comp] = 0x3ff;
1845 ancCount = pInYUV8Buffer[2*(pixNum+2) + comp] + 3 + 1;
1854 else if (ancCount == 1)
1857 outU16YUVLine [2*pixNum + comp] = checksum & 0x1ff;
1858 outU16YUVLine [2*pixNum + comp] |= (~checksum & 0x100) << 1;
1866 const UByte ancByte (pInYUV8Buffer [2*pixNum + comp]);
1867 const UWord ancWord (AddEvenParity (ancByte));
1869 outU16YUVLine [2*pixNum + comp] = ancWord;
1871 checksum += (ancWord & 0x1ff);
1886 const uint32_t inNumPixels)
1888 const UByte * pInYUV8Buffer (
reinterpret_cast<const UByte*
>(pInYUV8Line));
1889 const ULWord maxNumElements(inNumPixels * 2);
1891 outU16YUVLine.clear ();
1892 outU16YUVLine.reserve (maxNumElements);
1893 while (outU16YUVLine.size() <
size_t(maxNumElements))
1894 outU16YUVLine.push_back(0);
1897 {
LOGMYERROR(
"NULL/empty YUV8 buffer");
return false;}
1898 if (inNumPixels < 12)
1899 {
LOGMYERROR(
"width in pixels " <<
DEC(inNumPixels) <<
" too small (< 12)");
return false;}
1900 if (inNumPixels % 4)
1901 {
LOGMYERROR(
"width in pixels " <<
DEC(inNumPixels) <<
" not multiple of 4");
return false;}
1904 bool bNoMoreAnc(
false);
1913 while (ndx < maxNumElements)
1921 if (ndx <
ULWord(outU16YUVLine.size()))
1922 outU16YUVLine[ndx] = dataValue;
1924 outU16YUVLine.push_back(dataValue);
1931 if ((ndx + 7) < maxNumElements)
1933 if ( pInYUV8Buffer [ndx+0] == 0x00
1934 && pInYUV8Buffer [ndx+1] == 0xFF
1935 && pInYUV8Buffer [ndx+2] == 0xFF)
1938 outU16YUVLine [ndx++] = 0x000;
1939 outU16YUVLine [ndx++] = 0x3ff;
1940 outU16YUVLine [ndx++] = 0x3ff;
1941 ancCount = pInYUV8Buffer[ndx+2] + 3 + 1;
1950 else if (ancCount == 1)
1953 outU16YUVLine[ndx] = checksum & 0x1ff;
1954 outU16YUVLine[ndx] |= (~checksum & 0x100) << 1;
1961 const UByte ancByte (pInYUV8Buffer[ndx]);
1962 const UWord ancWord (AddEvenParity(ancByte));
1963 outU16YUVLine[ndx] = ancWord;
1964 checksum += (ancWord & 0x1ff);
1980 outConstructed = outDestructed = 0;
2052 for (uint8_t sid(1); sid < 0x0A; sid++)
2062 for (uint8_t sid(0xD0); sid < 0xE0; sid++)
2132 return didIt->second;
2136 static const NTV2DIDSet sValidHDMIAuxPacketTypes = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A,
2137 0x80, 0x81, 0x82, 0x83, 0x84, 0x85};
2141 switch (auxPacketType)
2143 case 0x01:
return "Audio Clock Regeneration (N/CTS)";
2144 case 0x02:
return "Audio Sample (L-PCM & IEC-61937 compressed)";
2145 case 0x03:
return "General Control";
2146 case 0x04:
return "ACP Packet";
2147 case 0x05:
return "ISRC1 Packet";
2148 case 0x06:
return "ISRC2 Packet";
2149 case 0x07:
return "One Bit Audio Sample Packet";
2150 case 0x08:
return "DST Audio Packet";
2151 case 0x09:
return "High Bitrate Audio Stream Packet (IEC-61937)";
2152 case 0x0A:
return "Gamut Metadata Packet";
2153 case 0x80:
return "General InfoFrame Packet";
2154 case 0x81:
return "Vendor-Specific InfoFrame";
2155 case 0x82:
return "AVI InfoFrame";
2156 case 0x83:
return "Source Product Descriptor InfoFrame";
2157 case 0x84:
return "Audio InfoFrame";
2158 case 0x85:
return "MPEG Source InfoFrame";
2190 mSequenceNumber (0),
2205 uint32_t u32(uint32_t(mVBits << 30));
2206 u32 |= uint32_t(mPBit ? 1 : 0) << 29;
2207 u32 |= uint32_t(mPBit ? 1 : 0) << 29;
2208 u32 |= uint32_t(mXBit ? 1 : 0) << 28;
2209 u32 |= uint32_t(mCCBits & 0x0000000F) << 24;
2210 u32 |= uint32_t(IsEndOfFieldOrFrame() ? 1 : 0) << 23;
2211 u32 |= uint32_t(GetPayloadType() & 0x0000007F) << 16;
2212 u32 |= uint32_t(GetSequenceNumber() & 0x0000FFFF);
2227 const uint32_t u32 ((GetSequenceNumber() & 0xFFFF0000) | (GetPayloadLength()));
2234 uint32_t u32(uint32_t(GetAncPacketCount() & 0x000000FF) << 24);
2235 u32 |= uint32_t(GetFieldSignal() & 0x00000003) << 22;
2252 case 0: mVBits = uint8_t(u32 >> 30);
2253 mPBit = (u32 & 0x20000000) ?
true :
false;
2254 mXBit = (u32 & 0x10000000) ?
true :
false;
2255 mCCBits = uint8_t((u32 & 0x0F000000) >> 24);
2256 mMarkerBit = (u32 & 0x00800000) ?
true :
false;
2257 mPayloadType = uint8_t((u32 & 0x007F0000) >> 16);
2258 mSequenceNumber = (mSequenceNumber & 0xFFFF0000) | (u32 & 0x0000FFFF);
2261 case 1: mTimeStamp = u32;
2264 case 2: mSyncSourceID = u32;
2267 case 3: mSequenceNumber = (u32 & 0xFFFF0000) | (mSequenceNumber & 0x0000FFFF);
2268 mPayloadLength = uint16_t(u32 & 0x0000FFFF);
2271 case 4: mAncCount = uint8_t((u32 & 0xFF000000) >> 24);
2272 mFieldSignal = uint8_t((u32 & 0x00C00000) >> 22);
2275 default:
return false;
2284 while (outVector.size() < 5)
2285 outVector.push_back(0);
2286 for (
unsigned ndx(0); ndx < 5; ndx++)
2293 const ULWord startingByteOffset (inU32Offset *
sizeof(uint32_t));
2296 uint32_t * pU32s (
reinterpret_cast<uint32_t*
>(outBuffer.
GetHostAddress(startingByteOffset)));
2297 for (
unsigned ndx(0); ndx < 5; ndx++)
2305 if (inVector.size() < 5)
2307 for (
unsigned ndx(0); ndx < 5; ndx++)
2317 const uint32_t * pU32s (
reinterpret_cast <const uint32_t *
> (inBuffer.
GetHostPointer()));
2318 for (
unsigned ndx(0); ndx < 5; ndx++)
2326 static const string sStrs[] = {
"p/noF",
"BAD",
"i/F1",
"i/F2" };
2327 return sStrs[inFBits & 0x03];
2332 return mVBits == inRHS.mVBits
2333 && mPBit == inRHS.mPBit
2334 && mXBit == inRHS.mXBit
2335 && mCCBits == inRHS.mCCBits
2336 && mMarkerBit == inRHS.mMarkerBit
2337 && mPayloadType == inRHS.mPayloadType
2338 && mSequenceNumber == inRHS.mSequenceNumber
2339 && mTimeStamp == inRHS.mTimeStamp
2340 && mSyncSourceID == inRHS.mSyncSourceID
2341 && mPayloadLength == inRHS.mPayloadLength
2342 && mAncCount == inRHS.mAncCount
2343 && mFieldSignal == inRHS.mFieldSignal;
2349 inOutStream <<
xHEX0N(word0,8)
2351 <<
": V=" <<
DEC(uint16_t(mVBits))
2352 <<
" P=" << mPBit <<
" X=" << mXBit <<
" CC=" <<
DEC(uint16_t(mCCBits))
2353 <<
" M=" << (IsEndOfFieldOrFrame()?
"EOF":
"0") <<
" PT=" <<
xHEX0N(uint16_t(GetPayloadType()),2)
2354 <<
" Seq#=" <<
xHEX0N(GetSequenceNumber(),8) <<
" TS=" <<
xHEX0N(GetTimeStamp(),8)
2355 <<
" SSRC=" <<
xHEX0N(GetSyncSourceID(),8) <<
" PayLen=" <<
DEC(GetPayloadLength())
2357 << (
IsValid() ?
"" :
" (invalid)");
2363 return !(mVBits || mPBit || mXBit || mCCBits || mMarkerBit || mPayloadType || mSequenceNumber || mTimeStamp || mSyncSourceID || mPayloadLength || mAncCount || mFieldSignal);
2368 return mVBits == 0x02
2370 && IsValidFieldSignal();
2406 u32 |= (uint32_t(GetLineNumber()) & 0x000007FF) << 20;
2407 u32 |= (IsCBitSet() ? 0x80000000 : 0x00000000);
2408 u32 |= (uint32_t(GetHorizOffset()) & 0x00000FFF) << 8;
2409 u32 |= IsSBitSet() ? 0x00000080 : 0x00000000;
2411 u32 |= uint32_t(GetStreamNumber() & 0x7F);
2422 if (u32 & 0x80000000)
2443 if (inIndex0 >= inVector.size())
2484 mStreamNum = uint8_t(lnk);
2486 mStreamNum = uint8_t(ds);
2490 mLineNum = inLoc.GetLineNumber();
2498 inOutStream <<
xHEX0N(
GetULWord(),8) <<
": C=" << (IsCBitSet() ?
"1" :
"0")
2499 <<
" Line=" <<
DEC(GetLineNumber()) <<
" HOff=" <<
DEC(GetHorizOffset())
2500 <<
" S=" << (IsSBitSet() ?
"1" :
"0") <<
" Strm=" <<
DEC(uint16_t(GetStreamNumber()));