AJA NTV2 SDK  17.1.1.1245
NTV2 SDK 17.1.1.1245
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 "ajabase/system/lock.h"
#include <ios>
Include dependency graph for ancillarydata.cpp:

Go to the source code of this file.

Macros

#define LOGGING_ANCDATA   AJADebug::IsActive(AJA_DebugUnit_AJAAncData)
 
#define LOGGING_ANC2110RX   AJADebug::IsActive(AJA_DebugUnit_Anc2110Rcv)
 
#define LOGGING_ANC2110TX   AJADebug::IsActive(AJA_DebugUnit_Anc2110Xmit)
 
#define LOGMYERROR(__x__)   {if (LOGGING_ANCDATA) AJA_sERROR (AJA_DebugUnit_AJAAncData, AJAFUNC << ": " << __x__);}
 
#define LOGMYWARN(__x__)   {if (LOGGING_ANCDATA) AJA_sWARNING(AJA_DebugUnit_AJAAncData, AJAFUNC << ": " << __x__);}
 
#define LOGMYNOTE(__x__)   {if (LOGGING_ANCDATA) AJA_sNOTICE (AJA_DebugUnit_AJAAncData, AJAFUNC << ": " << __x__);}
 
#define LOGMYINFO(__x__)   {if (LOGGING_ANCDATA) AJA_sINFO (AJA_DebugUnit_AJAAncData, AJAFUNC << ": " << __x__);}
 
#define LOGMYDEBUG(__x__)   {if (LOGGING_ANCDATA) AJA_sDEBUG (AJA_DebugUnit_AJAAncData, AJAFUNC << ": " << __x__);}
 
#define RCV2110ERR(__x__)   {if (LOGGING_ANC2110RX) AJA_sERROR (AJA_DebugUnit_Anc2110Rcv, AJAFUNC << ": " << __x__);}
 
#define RCV2110WARN(__x__)   {if (LOGGING_ANC2110RX) AJA_sWARNING(AJA_DebugUnit_Anc2110Rcv, AJAFUNC << ": " << __x__);}
 
#define RCV2110NOTE(__x__)   {if (LOGGING_ANC2110RX) AJA_sNOTICE (AJA_DebugUnit_Anc2110Rcv, AJAFUNC << ": " << __x__);}
 
#define RCV2110INFO(__x__)   {if (LOGGING_ANC2110RX) AJA_sINFO (AJA_DebugUnit_Anc2110Rcv, AJAFUNC << ": " << __x__);}
 
#define RCV2110DBG(__x__)   {if (LOGGING_ANC2110RX) AJA_sDEBUG (AJA_DebugUnit_Anc2110Rcv, AJAFUNC << ": " << __x__);}
 
#define XMT2110ERR(__x__)   {if (LOGGING_ANC2110TX) AJA_sERROR (AJA_DebugUnit_Anc2110Xmit, AJAFUNC << ": " << __x__);}
 
#define XMT2110WARN(__x__)   {if (LOGGING_ANC2110TX) AJA_sWARNING(AJA_DebugUnit_Anc2110Xmit, AJAFUNC << ": " << __x__);}
 
#define XMT2110NOTE(__x__)   {if (LOGGING_ANC2110TX) AJA_sNOTICE (AJA_DebugUnit_Anc2110Xmit, AJAFUNC << ": " << __x__);}
 
#define XMT2110INFO(__x__)   {if (LOGGING_ANC2110TX) AJA_sINFO (AJA_DebugUnit_Anc2110Xmit, AJAFUNC << ": " << __x__);}
 
#define XMT2110DBG(__x__)   {if (LOGGING_ANC2110TX) AJA_sDEBUG (AJA_DebugUnit_Anc2110Xmit, 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__)
 

Typedefs

typedef map< uint8_t, string > DIDToStringMap
 
typedef DIDToStringMap::const_iterator DIDToStringMapCI
 
typedef pair< uint8_t, string > DIDToStringPair
 
typedef map< AJAAncDIDSIDPair, string > DIDSIDToStringMap
 
typedef DIDSIDToStringMap::const_iterator DIDSIDToStringMapCI
 
typedef pair< AJAAncDIDSIDPair, string > DIDSIDToStringPair
 

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
 
const uint32_t AJAAuxillaryPacketSize = 32
 
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
 
static AJALock sDIDToStringLock
 
static DIDToStringMap sDIDToStringMap
 
static DIDSIDToStringMap sDIDSIDToStringMap
 
static const NTV2DIDSet sValidHDMIAuxPacketTypes
 

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 69 of file ancillarydata.cpp.

◆ AJA_ENDIAN_16NtoH

#define AJA_ENDIAN_16NtoH (   __val__)    AJA_ENDIAN_SWAP16(__val__)

Definition at line 68 of file ancillarydata.cpp.

◆ AJA_ENDIAN_32HtoN

#define AJA_ENDIAN_32HtoN (   __val__)    AJA_ENDIAN_SWAP32(__val__)

Definition at line 71 of file ancillarydata.cpp.

◆ AJA_ENDIAN_32NtoH

#define AJA_ENDIAN_32NtoH (   __val__)    AJA_ENDIAN_SWAP32(__val__)

Definition at line 70 of file ancillarydata.cpp.

◆ AJA_ENDIAN_64HtoN

#define AJA_ENDIAN_64HtoN (   __val__)    AJA_ENDIAN_SWAP64(__val__)

Definition at line 73 of file ancillarydata.cpp.

◆ AJA_ENDIAN_64NtoH

#define AJA_ENDIAN_64NtoH (   __val__)    AJA_ENDIAN_SWAP64(__val__)

Definition at line 72 of file ancillarydata.cpp.

◆ LOGGING_ANC2110RX

#define LOGGING_ANC2110RX   AJADebug::IsActive(AJA_DebugUnit_Anc2110Rcv)

Definition at line 22 of file ancillarydata.cpp.

◆ LOGGING_ANC2110TX

#define LOGGING_ANC2110TX   AJADebug::IsActive(AJA_DebugUnit_Anc2110Xmit)

Definition at line 23 of file ancillarydata.cpp.

◆ LOGGING_ANCDATA

#define LOGGING_ANCDATA   AJADebug::IsActive(AJA_DebugUnit_AJAAncData)

Definition at line 21 of file ancillarydata.cpp.

◆ LOGMYDEBUG

#define LOGMYDEBUG (   __x__)    {if (LOGGING_ANCDATA) AJA_sDEBUG (AJA_DebugUnit_AJAAncData, AJAFUNC << ": " << __x__);}

Definition at line 29 of file ancillarydata.cpp.

◆ LOGMYERROR

#define LOGMYERROR (   __x__)    {if (LOGGING_ANCDATA) AJA_sERROR (AJA_DebugUnit_AJAAncData, AJAFUNC << ": " << __x__);}

Definition at line 25 of file ancillarydata.cpp.

◆ LOGMYINFO

#define LOGMYINFO (   __x__)    {if (LOGGING_ANCDATA) AJA_sINFO (AJA_DebugUnit_AJAAncData, AJAFUNC << ": " << __x__);}

Definition at line 28 of file ancillarydata.cpp.

◆ LOGMYNOTE

#define LOGMYNOTE (   __x__)    {if (LOGGING_ANCDATA) AJA_sNOTICE (AJA_DebugUnit_AJAAncData, AJAFUNC << ": " << __x__);}

Definition at line 27 of file ancillarydata.cpp.

◆ LOGMYWARN

#define LOGMYWARN (   __x__)    {if (LOGGING_ANCDATA) AJA_sWARNING(AJA_DebugUnit_AJAAncData, AJAFUNC << ": " << __x__);}

Definition at line 26 of file ancillarydata.cpp.

◆ RCV2110DBG

#define RCV2110DBG (   __x__)    {if (LOGGING_ANC2110RX) AJA_sDEBUG (AJA_DebugUnit_Anc2110Rcv, AJAFUNC << ": " << __x__);}

Definition at line 35 of file ancillarydata.cpp.

◆ RCV2110DDBG

#define RCV2110DDBG (   __x__)

Definition at line 54 of file ancillarydata.cpp.

◆ RCV2110ERR

#define RCV2110ERR (   __x__)    {if (LOGGING_ANC2110RX) AJA_sERROR (AJA_DebugUnit_Anc2110Rcv, AJAFUNC << ": " << __x__);}

Definition at line 31 of file ancillarydata.cpp.

◆ RCV2110INFO

#define RCV2110INFO (   __x__)    {if (LOGGING_ANC2110RX) AJA_sINFO (AJA_DebugUnit_Anc2110Rcv, AJAFUNC << ": " << __x__);}

Definition at line 34 of file ancillarydata.cpp.

◆ RCV2110NOTE

#define RCV2110NOTE (   __x__)    {if (LOGGING_ANC2110RX) AJA_sNOTICE (AJA_DebugUnit_Anc2110Rcv, AJAFUNC << ": " << __x__);}

Definition at line 33 of file ancillarydata.cpp.

◆ RCV2110WARN

#define RCV2110WARN (   __x__)    {if (LOGGING_ANC2110RX) AJA_sWARNING(AJA_DebugUnit_Anc2110Rcv, AJAFUNC << ": " << __x__);}

Definition at line 32 of file ancillarydata.cpp.

◆ XMT2110DBG

#define XMT2110DBG (   __x__)    {if (LOGGING_ANC2110TX) AJA_sDEBUG (AJA_DebugUnit_Anc2110Xmit, AJAFUNC << ": " << __x__);}

Definition at line 41 of file ancillarydata.cpp.

◆ XMT2110DDBG

#define XMT2110DDBG (   __x__)

Definition at line 55 of file ancillarydata.cpp.

◆ XMT2110ERR

#define XMT2110ERR (   __x__)    {if (LOGGING_ANC2110TX) AJA_sERROR (AJA_DebugUnit_Anc2110Xmit, AJAFUNC << ": " << __x__);}

Definition at line 37 of file ancillarydata.cpp.

◆ XMT2110INFO

#define XMT2110INFO (   __x__)    {if (LOGGING_ANC2110TX) AJA_sINFO (AJA_DebugUnit_Anc2110Xmit, AJAFUNC << ": " << __x__);}

Definition at line 40 of file ancillarydata.cpp.

◆ XMT2110NOTE

#define XMT2110NOTE (   __x__)    {if (LOGGING_ANC2110TX) AJA_sNOTICE (AJA_DebugUnit_Anc2110Xmit, AJAFUNC << ": " << __x__);}

Definition at line 39 of file ancillarydata.cpp.

◆ XMT2110WARN

#define XMT2110WARN (   __x__)    {if (LOGGING_ANC2110TX) AJA_sWARNING(AJA_DebugUnit_Anc2110Xmit, AJAFUNC << ": " << __x__);}

Definition at line 38 of file ancillarydata.cpp.

Typedef Documentation

◆ DIDSIDToStringMap

typedef map<AJAAncDIDSIDPair, string> DIDSIDToStringMap

Definition at line 2021 of file ancillarydata.cpp.

◆ DIDSIDToStringMapCI

typedef DIDSIDToStringMap::const_iterator DIDSIDToStringMapCI

Definition at line 2022 of file ancillarydata.cpp.

◆ DIDSIDToStringPair

typedef pair<AJAAncDIDSIDPair, string> DIDSIDToStringPair

Definition at line 2023 of file ancillarydata.cpp.

◆ DIDToStringMap

typedef map<uint8_t, string> DIDToStringMap

Definition at line 2018 of file ancillarydata.cpp.

◆ DIDToStringMapCI

typedef DIDToStringMap::const_iterator DIDToStringMapCI

Definition at line 2019 of file ancillarydata.cpp.

◆ DIDToStringPair

typedef pair<uint8_t, string> DIDToStringPair

Definition at line 2020 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 1381 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 1253 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 1372 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 1234 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 1359 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 1262 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 1243 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 1391 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 1288 of file ancillarydata.cpp.

◆ AJAAncLineNumberToString()

string AJAAncLineNumberToString ( const uint16_t  inValue)

Definition at line 1271 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 1649 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 1662 of file ancillarydata.cpp.

◆ ENDIAN_32HtoN()

static uint32_t ENDIAN_32HtoN ( const uint32_t  inValue)
inlinestatic

Definition at line 78 of file ancillarydata.cpp.

◆ ENDIAN_32NtoH()

static uint32_t ENDIAN_32NtoH ( const uint32_t  inValue)
inlinestatic

Definition at line 77 of file ancillarydata.cpp.

◆ operator<<() [1/2]

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

Definition at line 1366 of file ancillarydata.cpp.

◆ operator<<() [2/2]

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

Definition at line 1475 of file ancillarydata.cpp.

◆ sENDL()

const size_t sENDL ( )

Variable Documentation

◆ AJAAncillaryDataWrapperSize

const uint32_t AJAAncillaryDataWrapperSize = 7

Definition at line 81 of file ancillarydata.cpp.

◆ AJAAuxillaryPacketSize

const uint32_t AJAAuxillaryPacketSize = 32

Definition at line 82 of file ancillarydata.cpp.

◆ gEmptyString

const string gEmptyString
static

Definition at line 1231 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 924 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 926 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 925 of file ancillarydata.cpp.

◆ sDIDSIDToStringMap

DIDSIDToStringMap sDIDSIDToStringMap
static

Definition at line 2026 of file ancillarydata.cpp.

◆ sDIDToStringLock

AJALock sDIDToStringLock
static

Definition at line 2024 of file ancillarydata.cpp.

◆ sDIDToStringMap

DIDToStringMap sDIDToStringMap
static

Definition at line 2025 of file ancillarydata.cpp.

◆ sValidHDMIAuxPacketTypes

const NTV2DIDSet sValidHDMIAuxPacketTypes
static
Initial value:
= {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A,
0x80, 0x81, 0x82, 0x83, 0x84, 0x85}

Definition at line 2136 of file ancillarydata.cpp.