AJA NTV2 SDK  17.0.1.1246
NTV2 SDK 17.0.1.1246
ancillarydata.cpp File Reference

Implementation of the AJAAncillaryData class. More...

#include "ntv2publicinterface.h"
#include "ancillarydata.h"
#include "ajabase/system/debug.h"
#include "ajabase/system/atomic.h"
#include <ios>
Include dependency graph for ancillarydata.cpp:

Go to the source code of this file.

Macros

#define LOGMYERROR(__x__)   AJA_sREPORT(AJA_DebugUnit_AJAAncData, AJA_DebugSeverity_Error, AJAFUNC << ": " << __x__)
 
#define LOGMYWARN(__x__)   AJA_sREPORT(AJA_DebugUnit_AJAAncData, AJA_DebugSeverity_Warning, AJAFUNC << ": " << __x__)
 
#define LOGMYNOTE(__x__)   AJA_sREPORT(AJA_DebugUnit_AJAAncData, AJA_DebugSeverity_Notice, AJAFUNC << ": " << __x__)
 
#define LOGMYINFO(__x__)   AJA_sREPORT(AJA_DebugUnit_AJAAncData, AJA_DebugSeverity_Info, AJAFUNC << ": " << __x__)
 
#define LOGMYDEBUG(__x__)   AJA_sREPORT(AJA_DebugUnit_AJAAncData, AJA_DebugSeverity_Debug, AJAFUNC << ": " << __x__)
 
#define RCV2110ERR(__x__)   AJA_sREPORT(AJA_DebugUnit_Anc2110Rcv, AJA_DebugSeverity_Error, AJAFUNC << ": " << __x__)
 
#define RCV2110WARN(__x__)   AJA_sREPORT(AJA_DebugUnit_Anc2110Rcv, AJA_DebugSeverity_Warning, AJAFUNC << ": " << __x__)
 
#define RCV2110NOTE(__x__)   AJA_sREPORT(AJA_DebugUnit_Anc2110Rcv, AJA_DebugSeverity_Notice, AJAFUNC << ": " << __x__)
 
#define RCV2110INFO(__x__)   AJA_sREPORT(AJA_DebugUnit_Anc2110Rcv, AJA_DebugSeverity_Info, AJAFUNC << ": " << __x__)
 
#define RCV2110DBG(__x__)   AJA_sREPORT(AJA_DebugUnit_Anc2110Rcv, AJA_DebugSeverity_Debug, AJAFUNC << ": " << __x__)
 
#define XMT2110ERR(__x__)   AJA_sREPORT(AJA_DebugUnit_Anc2110Xmit, AJA_DebugSeverity_Error, AJAFUNC << ": " << __x__)
 
#define XMT2110WARN(__x__)   AJA_sREPORT(AJA_DebugUnit_Anc2110Xmit, AJA_DebugSeverity_Warning, AJAFUNC << ": " << __x__)
 
#define XMT2110NOTE(__x__)   AJA_sREPORT(AJA_DebugUnit_Anc2110Xmit, AJA_DebugSeverity_Notice, AJAFUNC << ": " << __x__)
 
#define XMT2110INFO(__x__)   AJA_sREPORT(AJA_DebugUnit_Anc2110Xmit, AJA_DebugSeverity_Info, AJAFUNC << ": " << __x__)
 
#define XMT2110DBG(__x__)   AJA_sREPORT(AJA_DebugUnit_Anc2110Xmit, AJA_DebugSeverity_Debug, AJAFUNC << ": " << __x__)
 
#define RCV2110DDBG(__x__)
 
#define XMT2110DDBG(__x__)
 
#define AJA_ENDIAN_16NtoH(__val__)   AJA_ENDIAN_SWAP16(__val__)
 
#define AJA_ENDIAN_16HtoN(__val__)   AJA_ENDIAN_SWAP16(__val__)
 
#define AJA_ENDIAN_32NtoH(__val__)   AJA_ENDIAN_SWAP32(__val__)
 
#define AJA_ENDIAN_32HtoN(__val__)   AJA_ENDIAN_SWAP32(__val__)
 
#define AJA_ENDIAN_64NtoH(__val__)   AJA_ENDIAN_SWAP64(__val__)
 
#define AJA_ENDIAN_64HtoN(__val__)   AJA_ENDIAN_SWAP64(__val__)
 

Functions

const size_t sENDL (1)
 
static uint32_t ENDIAN_32NtoH (const uint32_t inValue)
 
static uint32_t ENDIAN_32HtoN (const uint32_t inValue)
 
const string & AJAAncDataLinkToString (const AJAAncDataLink inValue, const bool inCompact)
 
const string & AJAAncDataStreamToString (const AJAAncDataStream inValue, const bool inCompact)
 
const string & AJAAncDataChannelToString (const AJAAncDataChannel inValue, const bool inCompact)
 
const string & AJAAncDataSpaceToString (const AJAAncDataSpace inValue, const bool inCompact)
 
string AJAAncLineNumberToString (const uint16_t inValue)
 
string AJAAncHorizOffsetToString (const uint16_t inValue)
 
string AJAAncDataLocToString (const AJAAncDataLoc &inValue, const bool inCompact)
 
ostream & operator<< (ostream &inOutStream, const AJAAncDataLoc &inValue)
 
const string & AJAAncDataCodingToString (const AJAAncDataCoding inValue, const bool inCompact)
 
const string & AJAAncBufferFormatToString (const AJAAncBufferFormat inValue, const bool inCompact)
 
const string & AJAAncDataTypeToString (const AJAAncDataType inValue, const bool inCompact)
 
ostream & operator<< (ostream &inOutStream, const AJAAncDIDSIDPair &inData)
 
string AncChannelSearchSelectToString (const AncChannelSearchSelect inSelect, const bool inCompact)
 
static bool CheckAncParityAndChecksum (const AJAAncillaryData::U16Packet &inYUV16Line, const uint16_t inStartIndex, const uint16_t inTotalCount, const uint16_t inIncrement=2)
 

Variables

const uint32_t AJAAncillaryDataWrapperSize = 7
 
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 }
 
static const unsigned gShifts [] = { 22,12,2,8, 24,14,4,6, 26,16,6,4, 28,18,8,2, 30,20,10,0 }
 
static const uint32_t gMasks []
 
static const string gEmptyString
 

Detailed Description

Implementation of the AJAAncillaryData class.

Definition in file ancillarydata.cpp.

Macro Definition Documentation

◆ AJA_ENDIAN_16HtoN

#define AJA_ENDIAN_16HtoN (   __val__)    AJA_ENDIAN_SWAP16(__val__)

Definition at line 63 of file ancillarydata.cpp.

◆ AJA_ENDIAN_16NtoH

#define AJA_ENDIAN_16NtoH (   __val__)    AJA_ENDIAN_SWAP16(__val__)

Definition at line 62 of file ancillarydata.cpp.

◆ AJA_ENDIAN_32HtoN

#define AJA_ENDIAN_32HtoN (   __val__)    AJA_ENDIAN_SWAP32(__val__)

Definition at line 65 of file ancillarydata.cpp.

◆ AJA_ENDIAN_32NtoH

#define AJA_ENDIAN_32NtoH (   __val__)    AJA_ENDIAN_SWAP32(__val__)

Definition at line 64 of file ancillarydata.cpp.

◆ AJA_ENDIAN_64HtoN

#define AJA_ENDIAN_64HtoN (   __val__)    AJA_ENDIAN_SWAP64(__val__)

Definition at line 67 of file ancillarydata.cpp.

◆ AJA_ENDIAN_64NtoH

#define AJA_ENDIAN_64NtoH (   __val__)    AJA_ENDIAN_SWAP64(__val__)

Definition at line 66 of file ancillarydata.cpp.

◆ LOGMYDEBUG

#define LOGMYDEBUG (   __x__)    AJA_sREPORT(AJA_DebugUnit_AJAAncData, AJA_DebugSeverity_Debug, AJAFUNC << ": " << __x__)

Definition at line 24 of file ancillarydata.cpp.

◆ LOGMYERROR

#define LOGMYERROR (   __x__)    AJA_sREPORT(AJA_DebugUnit_AJAAncData, AJA_DebugSeverity_Error, AJAFUNC << ": " << __x__)

Definition at line 20 of file ancillarydata.cpp.

◆ LOGMYINFO

#define LOGMYINFO (   __x__)    AJA_sREPORT(AJA_DebugUnit_AJAAncData, AJA_DebugSeverity_Info, AJAFUNC << ": " << __x__)

Definition at line 23 of file ancillarydata.cpp.

◆ LOGMYNOTE

#define LOGMYNOTE (   __x__)    AJA_sREPORT(AJA_DebugUnit_AJAAncData, AJA_DebugSeverity_Notice, AJAFUNC << ": " << __x__)

Definition at line 22 of file ancillarydata.cpp.

◆ LOGMYWARN

#define LOGMYWARN (   __x__)    AJA_sREPORT(AJA_DebugUnit_AJAAncData, AJA_DebugSeverity_Warning, AJAFUNC << ": " << __x__)

Definition at line 21 of file ancillarydata.cpp.

◆ RCV2110DBG

#define RCV2110DBG (   __x__)    AJA_sREPORT(AJA_DebugUnit_Anc2110Rcv, AJA_DebugSeverity_Debug, AJAFUNC << ": " << __x__)

Definition at line 30 of file ancillarydata.cpp.

◆ RCV2110DDBG

#define RCV2110DDBG (   __x__)

Definition at line 48 of file ancillarydata.cpp.

◆ RCV2110ERR

#define RCV2110ERR (   __x__)    AJA_sREPORT(AJA_DebugUnit_Anc2110Rcv, AJA_DebugSeverity_Error, AJAFUNC << ": " << __x__)

Definition at line 26 of file ancillarydata.cpp.

◆ RCV2110INFO

#define RCV2110INFO (   __x__)    AJA_sREPORT(AJA_DebugUnit_Anc2110Rcv, AJA_DebugSeverity_Info, AJAFUNC << ": " << __x__)

Definition at line 29 of file ancillarydata.cpp.

◆ RCV2110NOTE

#define RCV2110NOTE (   __x__)    AJA_sREPORT(AJA_DebugUnit_Anc2110Rcv, AJA_DebugSeverity_Notice, AJAFUNC << ": " << __x__)

Definition at line 28 of file ancillarydata.cpp.

◆ RCV2110WARN

#define RCV2110WARN (   __x__)    AJA_sREPORT(AJA_DebugUnit_Anc2110Rcv, AJA_DebugSeverity_Warning, AJAFUNC << ": " << __x__)

Definition at line 27 of file ancillarydata.cpp.

◆ XMT2110DBG

#define XMT2110DBG (   __x__)    AJA_sREPORT(AJA_DebugUnit_Anc2110Xmit, AJA_DebugSeverity_Debug, AJAFUNC << ": " << __x__)

Definition at line 36 of file ancillarydata.cpp.

◆ XMT2110DDBG

#define XMT2110DDBG (   __x__)

Definition at line 49 of file ancillarydata.cpp.

◆ XMT2110ERR

#define XMT2110ERR (   __x__)    AJA_sREPORT(AJA_DebugUnit_Anc2110Xmit, AJA_DebugSeverity_Error, AJAFUNC << ": " << __x__)

Definition at line 32 of file ancillarydata.cpp.

◆ XMT2110INFO

#define XMT2110INFO (   __x__)    AJA_sREPORT(AJA_DebugUnit_Anc2110Xmit, AJA_DebugSeverity_Info, AJAFUNC << ": " << __x__)

Definition at line 35 of file ancillarydata.cpp.

◆ XMT2110NOTE

#define XMT2110NOTE (   __x__)    AJA_sREPORT(AJA_DebugUnit_Anc2110Xmit, AJA_DebugSeverity_Notice, AJAFUNC << ": " << __x__)

Definition at line 34 of file ancillarydata.cpp.

◆ XMT2110WARN

#define XMT2110WARN (   __x__)    AJA_sREPORT(AJA_DebugUnit_Anc2110Xmit, AJA_DebugSeverity_Warning, AJAFUNC << ": " << __x__)

Definition at line 33 of file ancillarydata.cpp.

Function Documentation

◆ AJAAncBufferFormatToString()

const string& AJAAncBufferFormatToString ( const AJAAncBufferFormat  inValue,
const bool  inCompact = true 
)
Returns
A string containing a human-readable representation of the given AJAAncBufferFormat value (or empty if invalid).
Parameters
[in]inValueSpecifies the AJAAncBufferFormat to be converted.
[in]inCompactIf true (the default), returns the compact representation; otherwise use the longer symbolic format.

Definition at line 1279 of file ancillarydata.cpp.

◆ AJAAncDataChannelToString()

const string& AJAAncDataChannelToString ( const AJAAncDataChannel  inValue,
const bool  inCompact = true 
)
Returns
A string containing a human-readable representation of the given AJAAncDataChannel value (or empty if not possible).
Parameters
[in]inValueSpecifies the AJAAncDataChannel value to be converted.
[in]inCompactIf true (the default), returns the compact representation; otherwise use the longer symbolic format.

Definition at line 1151 of file ancillarydata.cpp.

◆ AJAAncDataCodingToString()

const string& AJAAncDataCodingToString ( const AJAAncDataCoding  inValue,
const bool  inCompact = true 
)
Returns
A string containing a human-readable representation of the given AJAAncDataCoding value (or empty if invalid).
Parameters
[in]inValueSpecifies the AJAAncDataCoding to be converted.
[in]inCompactIf true (the default), returns the compact representation; otherwise use the longer symbolic format.

Definition at line 1270 of file ancillarydata.cpp.

◆ AJAAncDataLinkToString()

const string& AJAAncDataLinkToString ( const AJAAncDataLink  inValue,
const bool  inCompact = true 
)
Returns
A string containing a human-readable representation of the given AJAAncDataLink value (or empty if not possible).
Parameters
[in]inValueSpecifies the AJAAncDataLink value to be converted.
[in]inCompactIf true (the default), returns the compact representation; otherwise use the longer symbolic format.

Definition at line 1132 of file ancillarydata.cpp.

◆ AJAAncDataLocToString()

string AJAAncDataLocToString ( const AJAAncDataLoc inValue,
const bool  inCompact = true 
)
Returns
A string containing a human-readable representation of the given AJAAncDataLoc value (or empty if invalid).
Parameters
[in]inValueSpecifies the AJAAncDataLoc to be converted.
[in]inCompactIf true (the default), returns the compact representation; otherwise use the longer symbolic format.

Definition at line 1257 of file ancillarydata.cpp.

◆ AJAAncDataSpaceToString()

const string& AJAAncDataSpaceToString ( const AJAAncDataSpace  inValue,
const bool  inCompact = true 
)
Returns
A string containing a human-readable representation of the given AJAAncDataSpace value (or empty if not possible).
Parameters
[in]inValueSpecifies the AJAAncDataSpace value to be converted.
[in]inCompactIf true (the default), returns the compact representation; otherwise use the longer symbolic format.

Definition at line 1160 of file ancillarydata.cpp.

◆ AJAAncDataStreamToString()

const string& AJAAncDataStreamToString ( const AJAAncDataStream  inValue,
const bool  inCompact = true 
)
Returns
A string containing a human-readable representation of the given AJAAncDataStream value (or empty if not possible).
Parameters
[in]inValueSpecifies the AJAAncDataStream value to be converted.
[in]inCompactIf true (the default), returns the compact representation; otherwise use the longer symbolic format.

Definition at line 1141 of file ancillarydata.cpp.

◆ AJAAncDataTypeToString()

const string& AJAAncDataTypeToString ( const AJAAncDataType  inValue,
const bool  inCompact = true 
)
Returns
A string containing a human-readable representation of the given AJAAncDataType value (or empty if not possible).
Parameters
[in]inValueSpecifies the AJAAncDataType value to be converted.
[in]inCompactIf true (the default), returns the compact representation; otherwise use the longer symbolic format.

Definition at line 1289 of file ancillarydata.cpp.

◆ AJAAncHorizOffsetToString()

string AJAAncHorizOffsetToString ( const uint16_t  inValue)
Returns
A string containing a human-readable representation of the given horizontal offset location value.
Parameters
[in]inValueSpecifies the horizontal offset location value to be converted.

Definition at line 1186 of file ancillarydata.cpp.

◆ AJAAncLineNumberToString()

string AJAAncLineNumberToString ( const uint16_t  inValue)

Definition at line 1169 of file ancillarydata.cpp.

◆ AncChannelSearchSelectToString()

string AncChannelSearchSelectToString ( const AncChannelSearchSelect  inSelect,
const bool  inCompact = true 
)
Returns
A string containing a human-readable representation of the given AncChannelSearchSelect value (or empty if not possible).
Parameters
[in]inSelectSpecifies the AncChannelSearchSelect value to be converted.
[in]inCompactIf true (the default), returns the compact representation; otherwise returns the longer symbolic format.

Definition at line 1533 of file ancillarydata.cpp.

◆ CheckAncParityAndChecksum()

static bool CheckAncParityAndChecksum ( const AJAAncillaryData::U16Packet inYUV16Line,
const uint16_t  inStartIndex,
const uint16_t  inTotalCount,
const uint16_t  inIncrement = 2 
)
static

Definition at line 1546 of file ancillarydata.cpp.

◆ ENDIAN_32HtoN()

static uint32_t ENDIAN_32HtoN ( const uint32_t  inValue)
inlinestatic

Definition at line 72 of file ancillarydata.cpp.

◆ ENDIAN_32NtoH()

static uint32_t ENDIAN_32NtoH ( const uint32_t  inValue)
inlinestatic

Definition at line 71 of file ancillarydata.cpp.

◆ operator<<() [1/2]

ostream& operator<< ( ostream &  inOutStream,
const AJAAncDataLoc inValue 
)

Definition at line 1264 of file ancillarydata.cpp.

◆ operator<<() [2/2]

ostream& operator<< ( ostream &  inOutStream,
const AJAAncDIDSIDPair inData 
)

Definition at line 1363 of file ancillarydata.cpp.

◆ sENDL()

const size_t sENDL ( )

Variable Documentation

◆ AJAAncillaryDataWrapperSize

const uint32_t AJAAncillaryDataWrapperSize = 7

Definition at line 75 of file ancillarydata.cpp.

◆ gEmptyString

const string gEmptyString
static

Definition at line 1129 of file ancillarydata.cpp.

◆ gIndexes

const size_t gIndexes[] = { 0,1,2,3, 3,4,5,6, 6,7,8,9, 9,10,11,12, 12,13,14,15 }
static

Definition at line 822 of file ancillarydata.cpp.

◆ gMasks

const uint32_t gMasks[]
static
Initial value:
= { 0xFFC00000, 0x003FF000, 0x00000FFC, 0x00000003,
0xFF000000, 0x00FFC000, 0x00003FF0, 0x0000000F,
0xFC000000, 0x03FF0000, 0x0000FFC0, 0x0000003F,
0xF0000000, 0x0FFC0000, 0x0003FF00, 0x000000FF,
0xC0000000, 0x3FF00000, 0x000FFC00, 0x000003FF }

Definition at line 824 of file ancillarydata.cpp.

◆ gShifts

const unsigned gShifts[] = { 22,12,2,8, 24,14,4,6, 26,16,6,4, 28,18,8,2, 30,20,10,0 }
static

Definition at line 823 of file ancillarydata.cpp.