AJA NTV2 SDK
17.1.3.1410
NTV2 SDK 17.1.3.1410
|
This class handles CEA-708 SMPTE 334 packets. More...
#include <ancillarydata_cea708.h>
Public Member Functions | |
AJAAncillaryData_Cea708 () | |
My default constructor. More... | |
AJAAncillaryData_Cea708 (const AJAAncillaryData_Cea708 &inClone) | |
My copy constructor. More... | |
AJAAncillaryData_Cea708 (const AJAAncillaryData_Cea708 *pInClone) | |
My copy constructor. More... | |
AJAAncillaryData_Cea708 (const AJAAncillaryData *pInData) | |
My copy constructor. More... | |
virtual | ~AJAAncillaryData_Cea708 () |
My destructor. More... | |
virtual void | Clear (void) |
Frees my allocated memory, if any, and resets my members to their default values. More... | |
virtual AJAAncillaryData_Cea708 & | operator= (const AJAAncillaryData_Cea708 &inRHS) |
Assignment operator – replaces my contents with the right-hand-side value. More... | |
virtual AJAStatus | ParsePayloadData (void) |
Parses out (interprets) the "local" ancillary data from my payload data. More... | |
virtual AJAStatus | GeneratePayloadData (void) |
Generate the payload data from the "local" ancillary data. More... | |
virtual std::ostream & | Print (std::ostream &inOutStream, const bool inDetailed=false) const |
Streams a human-readable representation of me to the given output stream. More... | |
Public Member Functions inherited from AJAAncillaryData | |
AJAAncillaryData () | |
My default constructor. More... | |
AJAAncillaryData (const AJAAncillaryData &inClone) | |
My copy constructor (from reference). More... | |
AJAAncillaryData (const AJAAncillaryData *pInClone) | |
My copy constructor (from pointer). More... | |
virtual | ~AJAAncillaryData () |
My destructor. More... | |
virtual AJAAncillaryData * | Clone (void) const |
virtual uint16_t | GetStreamInfo (void) const |
virtual bool | HasStreamInfo (void) const |
virtual bool | isHDMIAuxInfoFrame (void) const |
Returns whether or not this is an HDMI Aux Info Frame Packet. More... | |
virtual uint8_t | Calculate8BitChecksum (void) const |
Generates an 8-bit checksum from the DID + SID + DC + payload data. More... | |
virtual uint16_t | Calculate9BitChecksum (void) const |
Generates the official SMPTE 291 9-bit checksum from the DID + SID + DC + payload data. More... | |
virtual bool | ChecksumOK (void) const |
Compares the received 8-bit checksum with a newly calculated 8-bit checksum. Returns 'true' if they match. More... | |
AJAAncillaryData & | operator= (const AJAAncillaryData &inRHS) |
virtual bool | operator== (const AJAAncillaryData &inRHS) const |
virtual bool | operator!= (const AJAAncillaryData &inRHS) const |
virtual AJAStatus | Compare (const AJAAncillaryData &inRHS, const bool inIgnoreLocation=true, const bool inIgnoreChecksum=true) const |
Compares me with another packet. More... | |
virtual AJAStatus | SetDID (const uint8_t inDataID) |
Sets my Data ID (DID). More... | |
virtual AJAStatus | SetSID (const uint8_t inSID) |
Sets my Secondary Data ID (SID) - (aka the Data Block Number (DBN) for "Type 1" SMPTE-291 packets). More... | |
virtual AJAStatus | SetDIDSID (const AJAAncDIDSIDPair &inDIDSID) |
Sets both my Data ID (DID) and Secondary Data ID (SID). More... | |
virtual AJAStatus | SetChecksum (const uint8_t inChecksum8, const bool inValidate=false) |
Sets my 8-bit checksum. Note that it is not usually necessary to generate an 8-bit checksum, since the ANC Insertion hardware ignores this field and (for SMPTE-291 Anc packets) generates and inserts its own "proper" 9-bit SMPTE-291 checksum. More... | |
virtual AJAStatus | SetDataLocation (const AJAAncDataLoc &inLoc) |
Sets my ancillary data "location" within the video stream. More... | |
virtual AJAStatus | SetLocationVideoLink (const AJAAncDataLink inLink) |
Sets my ancillary data "location" within the video stream. More... | |
virtual AJAStatus | SetLocationDataStream (const AJAAncDataStream inStream) |
Sets my ancillary data "location" data stream value (DS1,DS2...). More... | |
virtual AJAStatus | SetLocationDataChannel (const AJAAncDataChannel inChannel) |
Sets my ancillary data "location" data channel value (Y or C). More... | |
virtual AJAStatus | SetLocationLineNumber (const uint16_t inLineNum) |
Sets my ancillary data "location" frame line number. More... | |
virtual AJAStatus | SetLocationHorizOffset (const uint16_t inOffset) |
Sets my ancillary data "location" horizontal offset. More... | |
virtual AJAStatus | SetDataCoding (const AJAAncDataCoding inCodingType) |
Sets my ancillary data coding type (e.g. digital or analog/raw waveform). More... | |
virtual AJAAncillaryData & | SetFrameID (const uint32_t inFrameID) |
Sets my originating frame identifier. More... | |
virtual AJAAncillaryData & | SetBufferFormat (const AJAAncBufferFormat inFmt) |
Sets my originating buffer format. More... | |
virtual uint8_t | GetPayloadByteAtIndex (const uint32_t inIndex0) const |
virtual const uint8_t * | GetPayloadData (void) const |
virtual AJAStatus | GetPayloadData (uint8_t *pBuffer, const uint32_t inByteCapacity) const |
Copies my payload data into an external buffer. More... | |
virtual AJAStatus | GetPayloadData (UWordSequence &outUDWs, const bool inAddParity=true) const |
Appends my payload data onto the given UDW vector as 10-bit User Data Words (UDWs), adding parity as needed. More... | |
virtual AJAStatus | SetPayloadByteAtIndex (const uint8_t inDataByte, const uint32_t inIndex0) |
virtual AJAStatus | SetPayloadData (const uint8_t *pInData, const uint32_t inByteCount) |
Copy data from external memory into my local payload memory. More... | |
virtual AJAStatus | AppendPayloadData (const uint8_t *pInBuffer, const uint32_t inByteCount) |
Appends data from an external buffer onto the end of my existing payload. More... | |
virtual AJAStatus | AppendPayload (const AJAAncillaryData &inAncData) |
Appends payload data from another AJAAncillaryData object to my existing payload. More... | |
virtual AJAStatus | AppendPayload (const AJAAncillaryData *pInAncData) |
virtual AJAStatus | SetFromSMPTE334 (const uint16_t *pInData, const uint32_t inNumWords, const AJAAncDataLoc &inLocInfo) |
Copies payload data from an external 16-bit source into local payload memory. More... | |
virtual bool | GotValidReceiveData (void) const |
virtual AJAStatus | InitWithReceivedData (const uint8_t *pInData, const size_t inMaxBytes, const AJAAncDataLoc &inLocationInfo, uint32_t &outPacketByteCount) |
Initializes me from "raw" ancillary data received from hardware (ingest) – see SDI Anc Buffer Data Format. More... | |
virtual AJAStatus | InitAuxWithReceivedData (const uint8_t *pInData, const size_t inMaxBytes, uint32_t &outPacketByteCount) |
Initializes me from "raw" ancillary data received from hardware (ingest) – see SDI Anc Buffer Data Format. More... | |
virtual AJAStatus | InitWithReceivedData (const std::vector< uint8_t > &inData, const AJAAncDataLoc &inLocationInfo) |
Initializes me from "raw" ancillary data received from hardware (ingest) – see SDI Anc Buffer Data Format. More... | |
virtual AJAStatus | InitWithReceivedData (const ULWordSequence &inData, uint16_t &inOutStartIndex, const bool inIgnoreChecksum=false) |
Initializes me from the given 32-bit IP packet words received from hardware (ingest). More... | |
virtual AJAStatus | GetRawPacketSize (uint32_t &outPacketSize) const |
Returns the number of "raw" ancillary data bytes that will be generated by AJAAncillaryData::GenerateTransmitData (for playback mode). More... | |
virtual AJAStatus | GenerateTransmitData (uint8_t *pBuffer, const size_t inMaxBytes, uint32_t &outPacketSize) |
Generates "raw" ancillary data from my internal ancillary data (playback) – see SDI Anc Buffer Data Format. More... | |
virtual AJAStatus | GenerateTransmitData (UWordSequence &outData) |
Generates "raw" 10-bit ancillary packet component data from my internal ancillary data (playback). More... | |
virtual AJAStatus | GenerateTransmitData (ULWordSequence &outData) |
Generates the 32-bit IP packet words necessary for constructing an outgoing IP/RTP stream. More... | |
virtual std::ostream & | DumpPayload (std::ostream &inOutStream) const |
Dumps a human-readable representation of my payload bytes into the given output stream. More... | |
virtual std::string | CompareWithInfo (const AJAAncillaryData &inRHS, const bool inIgnoreLocation=true, const bool inIgnoreChecksum=true) const |
Compares me with another packet and returns a string that describes what's different. More... | |
virtual std::string | IDAsString (void) const |
virtual std::string | AsString (const uint16_t inDumpMaxBytes=0) const |
Static Public Member Functions | |
static AJAAncDataType | RecognizeThisAncillaryData (const AJAAncillaryData *pInAncData) |
Static Public Member Functions inherited from AJAAncillaryData | |
static uint16_t | AddEvenParity (const uint8_t inDataByte) |
static bool | GetAncPacketsFromVANCLine (const UWordSequence &inYUV16Line, const AncChannelSearchSelect inChanSelect, U16Packets &outRawPackets, U16Packet &outWordOffsets) |
Extracts whatever VANC packets are found inside the given 16-bit YUV line buffer. More... | |
static bool | Unpack8BitYCbCrToU16sVANCLine (const void *pInYUV8Line, U16Packet &outU16YUVLine, const uint32_t inNumPixels) |
Converts a single line of NTV2_FBF_8BIT_YCBCR data from the given source buffer into an ordered sequence of uint16_t values that contain the resulting 10-bit even-parity data. More... | |
static bool | Unpack8BitYCbCrToU16sVANCLineSD (const void *pInYUV8Line, UWordSequence &outU16YUVLine, const uint32_t inNumPixels) |
SD version of Unpack8BitYCbCrToU16sVANCLine. More... | |
static void | GetInstanceCounts (uint32_t &outConstructed, uint32_t &outDestructed) |
static uint32_t | GetNumActiveInstances (void) |
static uint32_t | GetNumConstructed (void) |
static uint32_t | GetNumDestructed (void) |
static void | ResetInstanceCounts (void) |
static std::string | DIDSIDToString (const uint8_t inDID, const uint8_t inSDID) |
static std::string | AuxPacketTypeToString (const uint8_t inAuxPktType) |
static bool | AuxPacketTypeIsValid (const uint8_t inAuxPktType) |
Protected Member Functions | |
void | Init (void) |
Protected Member Functions inherited from AJAAncillaryData | |
void | Init (void) |
AJAStatus | AllocDataMemory (const uint32_t inNumBytes) |
AJAStatus | FreeDataMemory (void) |
virtual uint8_t | GetGUMPHeaderByte2 (void) const |
virtual uint8_t | GetGUMPHeaderByte3 (void) const |
Additional Inherited Members | |
Public Types inherited from AJAAncillaryData | |
typedef UWordSequence | U16Packet |
An ordered sequence of 10-bit packet words stored in uint16_t values. More... | |
typedef std::vector< U16Packet > | U16Packets |
An ordered sequence of zero or more U16Packet values. More... | |
Protected Types inherited from AJAAncillaryData | |
typedef std::vector< uint8_t > | ByteVector |
typedef ByteVector::size_type | ByteVectorIndex |
typedef ByteVector::const_iterator | ByteVectorConstIter |
Static Protected Member Functions inherited from AJAAncillaryData | |
static uint8_t | GetGUMPHeaderByte1 (void) |
Protected Attributes inherited from AJAAncillaryData | |
uint8_t | m_DID |
Official SMPTE ancillary packet ID (w/o parity) More... | |
uint8_t | m_SID |
Official SMPTE secondary ID (or DBN - w/o parity) More... | |
uint8_t | m_checksum |
My 8-bit checksum: DID + SID + DC + payload (w/o parity) [note: NOT the same as the 9-bit checksum in a SMPTE-291 packet!]. More... | |
AJAAncDataLoc | m_location |
Location of the ancillary data in the video stream (Y or C, HANC or VANC, etc.) More... | |
AJAAncDataCoding | m_coding |
Analog or digital data. More... | |
ByteVector | m_payload |
My payload data (DC = size) More... | |
bool | m_rcvDataValid |
This is set true (or not) by ParsePayloadData() More... | |
AJAAncDataType | m_ancType |
One of a known set of ancillary data types (or "Custom" if not identified) More... | |
AJAAncBufferFormat | m_bufferFmt |
My originating buffer format, if known. More... | |
uint32_t | m_frameID |
ID of my originating frame, if known. More... | |
uint64_t | m_userData |
User data (for client use) More... | |
uint8_t | m_auxType |
HDMI Aux Header Byte 0 (Packet Type) More... | |
uint8_t | m_auxHB1 |
HDMI Aux Header Byte 1 (Header Data) More... | |
uint8_t | m_auxHB2 |
HDMI Aux Header Byte 2 (Header Data) More... | |
This class handles CEA-708 SMPTE 334 packets.
Definition at line 23 of file ancillarydata_cea708.h.
AJAAncillaryData_Cea708::AJAAncillaryData_Cea708 | ( | ) |
My default constructor.
Definition at line 16 of file ancillarydata_cea708.cpp.
AJAAncillaryData_Cea708::AJAAncillaryData_Cea708 | ( | const AJAAncillaryData_Cea708 & | inClone | ) |
My copy constructor.
[in] | inClone | The object to be cloned. |
Definition at line 23 of file ancillarydata_cea708.cpp.
AJAAncillaryData_Cea708::AJAAncillaryData_Cea708 | ( | const AJAAncillaryData_Cea708 * | pInClone | ) |
My copy constructor.
[in] | pInClone | A valid pointer to the object to be cloned. |
Definition at line 31 of file ancillarydata_cea708.cpp.
AJAAncillaryData_Cea708::AJAAncillaryData_Cea708 | ( | const AJAAncillaryData * | pInData | ) |
My copy constructor.
[in] | pInData | A valid pointer to the object to be cloned. |
Definition at line 40 of file ancillarydata_cea708.cpp.
|
virtual |
My destructor.
Definition at line 47 of file ancillarydata_cea708.cpp.
|
virtual |
Frees my allocated memory, if any, and resets my members to their default values.
Reimplemented from AJAAncillaryData.
Definition at line 66 of file ancillarydata_cea708.cpp.
|
virtual |
Generate the payload data from the "local" ancillary data.
Reimplemented from AJAAncillaryData.
Definition at line 88 of file ancillarydata_cea708.cpp.
|
protected |
Definition at line 52 of file ancillarydata_cea708.cpp.
|
virtual |
Assignment operator – replaces my contents with the right-hand-side value.
[in] | inRHS | The value to be assigned to me. |
Definition at line 58 of file ancillarydata_cea708.cpp.
|
virtual |
Parses out (interprets) the "local" ancillary data from my payload data.
Reimplemented from AJAAncillaryData.
Definition at line 73 of file ancillarydata_cea708.cpp.
|
virtual |
Streams a human-readable representation of me to the given output stream.
inOutStream | Specifies the output stream. | |
[in] | inDetailed | Specify 'true' for a detailed representation; otherwise use 'false' for a brief one. |
Reimplemented from AJAAncillaryData.
Definition at line 122 of file ancillarydata_cea708.cpp.
|
static |
[in] | pInAncData | A valid pointer to a base AJAAncillaryData object that contains the Anc data to inspect. |
Definition at line 107 of file ancillarydata_cea708.cpp.