AJA NTV2 SDK  17.1.1.1245
NTV2 SDK 17.1.1.1245
CNTV2CaptionDecoder708 Class Reference

I am a CEA-708 captioning decoder used primarily to obtain CEA-608 captions carried in CEA-708 anc data packets. More...

#include <ntv2captiondecoder708.h>

Inheritance diagram for CNTV2CaptionDecoder708:
[legend]
Collaboration diagram for CNTV2CaptionDecoder708:
[legend]

Public Member Functions

virtual ~CNTV2CaptionDecoder708 ()
 
virtual void Reset (void)
 
virtual bool SetDisplayChannel (const NTV2Line21Channel inChan)
 Setsthe caption channel I'm currently focused on (i.e. that I'm currently "burning" into video). More...
 
virtual NTV2Line21Channel GetDisplayChannel (void) const
 Answers with the caption channel that I'm currently focused on (or that I'm currently "burning" into video). More...
 
virtual bool SetSMPTE334AncData (const AJAAncillaryData_Cea708 &inPacket)
 Copies the given SMPTE 334 CDP data from the given ancillary data packet into my private CDP buffer. More...
 
virtual bool SetSMPTE334AncData (const AJAAncillaryData_Cea708 *pInPacket)
 Copies the given SMPTE 334 CDP data from the given ancillary data packet into my private CDP buffer. More...
 
virtual bool SetSMPTE334AncData (const UByte *pInAncData, const size_t inByteCount)
 Copies a given SMPTE334 ancillary data packet into my private buffer for parsing. More...
 
virtual bool SetSMPTE334AncData (const UWord *pInAncData, const size_t inWordCount)
 Copies a given SMPTE334 ancillary data packet into my private buffer for parsing, assuming the packet data bytes are in the least significant byte of each 16-bit word in the buffer. More...
 
virtual bool GetSMPTE334AncData (const UByte **ppAncData, size_t &outAncSize) const
 Returns a constant reference to my current SMPTE 334 Ancillary data packet. More...
 
virtual bool ParseSMPTE334AncPacket (bool &outHasParityErrors)
 Parses the current frame's SMPTE 334 Ancillary packet and extracts the 608 and 708 caption data from it, assuming a SMPTE 334 Ancillary Packet has already been loaded into my private buffer. This function A) extracts any "608" (aka Line 21) data from the payload, and puts it into my mCC608FrameData member, and B) extracts the 708 "Caption Channel Packet" data from the Ancillary data, and puts it into my mCC708FrameData member, with the word count in mCC708FrameDataByteCount. Further parsing of the extracted 608 or 708 data is left to other functions. More...
 
virtual bool ParseSMPTE334AncPacket (void)
 Parses the current frame's SMPTE 334 Ancillary packet and extracts the 608 and 708 caption data from it, assuming a SMPTE 334 Ancillary Packet has already been loaded into my private buffer. This function A) extracts any "608" (aka Line 21) data from the payload, and puts it into my mCC608FrameData member, and B) extracts the 708 "Caption Channel Packet" data from the Ancillary data, and puts it into my mCC708FrameData member, with the word count in mCC708FrameDataByteCount. Further parsing of the extracted 608 or 708 data is left to other functions. More...
 
virtual bool ParseSMPTE334CCTimeCodeSection (size_t &index)
 
virtual bool ParseSMPTE334CCDataSection (size_t &index)
 
virtual bool ParseSMPTE334CCServiceInfoSection (size_t &index)
 
virtual bool UpdateServiceInfo (void)
 
virtual bool Clear608CaptionData (void)
 
virtual const CaptionDataGetCurrentFrameCC608Data (void) const
 
virtual CaptionData GetCC608CaptionData (void)
 Pops the next CC608 data. More...
 
virtual bool GetCaptionChannelPacket (UBytePtr &outDataPtr, size_t &outSize)
 
virtual const NTV2_CC708ServiceDataGetAllServiceInfoPtr (void) const
 
virtual bool GetNextServiceBlockInfoFromQueue (const size_t svcIndex, size_t &outBlockSize, size_t &outDataSize, int &outServiceNum, bool &outIsExtended) const
 
virtual size_t GetNextServiceBlockFromQueue (const size_t svcIndex, std::vector< UByte > &outData)
 
virtual size_t GetNextServiceBlockDataFromQueue (const size_t svcIndex, std::vector< UByte > &outData)
 
virtual size_t GetNextServiceBlockFromQueue (const size_t svcIndex, UByte *pOutDataBuffer)
 
virtual size_t GetNextServiceBlockDataFromQueue (const size_t svcIndex, UByte *pOutDataBuffer)
 
virtual void GetCDPData (NTV2_CC708CDPPtr pCDP) const
 
virtual void ClearAllCaptionChannelPacketInfo (void)
 
virtual void ClearCaptionChannelPacketInfo (CaptionChannelPacketInfoPtr pCCPInfo)
 
virtual int GetNumCompleteCaptionChannelPacketInfo (int *pCompleteCount=0, int *pStartedCount=0)
 
virtual void ResetCaptionChannelPacketInfoForNewCDP (void)
 
virtual void CloseCurrentCaptionChannelPacketInfo (void)
 
virtual bool AddCaptionChannelPacketInfoData (UByte newData)
 
virtual bool GetCaptionChannelPacketInfoData (int index, UByte **ppData, int *pSize)
 
virtual bool ParseAllCaptionChannelPackets (void)
 
virtual bool ParseCaptionChannelPacket (CaptionChannelPacketInfoPtr pCCPInfo)
 
virtual bool FindSMPTE334AncPacketInVideoFrame (const UByte *pInVideoFrame, const NTV2VideoFormat inVideoFormat, const NTV2FrameBufferFormat inPixelFormat, bool &outHasParityErrors)
 
virtual bool FindSMPTE334AncPacketInVideoFrame (const UByte *pInVideoFrame, const NTV2VideoFormat inVideoFormat, const NTV2FrameBufferFormat inPixelFormat)
 
virtual NTV2CaptionLogMask SetLogMask (const NTV2CaptionLogMask inLogMask)
 Specifies what, if any, debug information I will write to my log stream. More...
 
- Public Member Functions inherited from CNTV2CaptionLogConfig
 CNTV2CaptionLogConfig (const std::string inLogLabel=std::string())
 Default constructor. More...
 
virtual ~CNTV2CaptionLogConfig ()
 
virtual NTV2CaptionLogMask GetLogMask (void) const
 Answers with my current caption logging bit mask. More...
 
virtual bool TestLogMask (const NTV2CaptionLogMask inLogMask, const bool inExact=false) const
 Answers true if the given log mask bits are set in my current log mask. More...
 
virtual void SetLogLabel (const std::string &inNewLabel)
 Specifies my logging label. More...
 
virtual void AppendToLogLabel (const std::string &inString)
 Appends the given string to my current log label. More...
 
virtual const std::string & GetLogLabel (void) const
 Answers with my current logging label. More...
 
virtual void SetLogStream (std::ostream &inOutputStream)
 
virtual std::ostream & LogIf (const NTV2CaptionLogMask inLogMask) const
 
virtual std::ostream & Log (void) const
 

Static Public Member Functions

static bool Create (CNTV2CaptionDecoder708Ptr &outDecoder)
 Creates a new CNTV2CaptionEncoder708 instance. More...
 
- Static Public Member Functions inherited from CNTV2CaptionLogConfig
static std::ostream & DumpMemory (const void *pInStartAddress, const size_t inByteCount, std::ostream &inOutputStream=std::cout, const size_t inRadix=16, const size_t inBytesPerGroup=4, const size_t inGroupsPerLine=8, const size_t inAddressRadix=16, const bool inShowAscii=true, const size_t inAddrOffset=0)
 Dumps a contiguous chunk of memory in hex, octal, decimal, with or without ascii, to the given output stream. More...
 
static std::string HexDump32Bytes (const void *pInStartAddress, const size_t inByteCount, const size_t inLimitBytes=32)
 
static std::ostream & DumpYBytes_2vuy (const UByte *pInVideoLine, std::ostream &inOutputStream, const unsigned inFromPixel=0, const unsigned inToPixel=719, const bool inShowRuler=true, const unsigned inHiliteRangeFrom=9999, const unsigned inHiliteRangeTo=9999)
 Dumps the luma values in hexadecimal from the given line of '2vuy' video to the given output stream. More...
 
static std::ostream & DumpYBytes_2vuy (const std::vector< uint8_t > &inVideoLine, std::ostream &inOutputStream, const size_t inFromPixel=0, const size_t inToPixel=719, const bool inShowRuler=true, const size_t inHiliteRangeFrom=9999, const size_t inHiliteRangeTo=9999)
 Dumps the luma values in hexadecimal from the given line of '2vuy' video to the given output stream. More...
 
static std::string GetSeverityLabel (const unsigned inSeverity)
 

Additional Inherited Members

- Protected Attributes inherited from CNTV2CaptionLogConfig
NTV2CaptionLogMask mLogMask
 Determines what messages are logged. More...
 
std::string mLogLabel
 My debug label. More...
 
void * mpLabelLock
 Protects my debug label from simultaneous access by more than one thread. More...
 

Detailed Description

I am a CEA-708 captioning decoder used primarily to obtain CEA-608 captions carried in CEA-708 anc data packets.

Definition at line 69 of file ntv2captiondecoder708.h.

Constructor & Destructor Documentation

◆ ~CNTV2CaptionDecoder708()

virtual CNTV2CaptionDecoder708::~CNTV2CaptionDecoder708 ( )
virtual

Member Function Documentation

◆ AddCaptionChannelPacketInfoData()

virtual bool CNTV2CaptionDecoder708::AddCaptionChannelPacketInfoData ( UByte  newData)
virtual

◆ Clear608CaptionData()

virtual bool CNTV2CaptionDecoder708::Clear608CaptionData ( void  )
virtual

◆ ClearAllCaptionChannelPacketInfo()

virtual void CNTV2CaptionDecoder708::ClearAllCaptionChannelPacketInfo ( void  )
virtual

◆ ClearCaptionChannelPacketInfo()

virtual void CNTV2CaptionDecoder708::ClearCaptionChannelPacketInfo ( CaptionChannelPacketInfoPtr  pCCPInfo)
virtual

◆ CloseCurrentCaptionChannelPacketInfo()

virtual void CNTV2CaptionDecoder708::CloseCurrentCaptionChannelPacketInfo ( void  )
virtual

◆ Create()

static bool CNTV2CaptionDecoder708::Create ( CNTV2CaptionDecoder708Ptr outDecoder)
static

Creates a new CNTV2CaptionEncoder708 instance.

Parameters
[out]outDecoderReceives the newly-created encoder instance.
Returns
True if successful; otherwise False.

◆ FindSMPTE334AncPacketInVideoFrame() [1/2]

virtual bool CNTV2CaptionDecoder708::FindSMPTE334AncPacketInVideoFrame ( const UByte pInVideoFrame,
const NTV2VideoFormat  inVideoFormat,
const NTV2FrameBufferFormat  inPixelFormat 
)
virtual

◆ FindSMPTE334AncPacketInVideoFrame() [2/2]

virtual bool CNTV2CaptionDecoder708::FindSMPTE334AncPacketInVideoFrame ( const UByte pInVideoFrame,
const NTV2VideoFormat  inVideoFormat,
const NTV2FrameBufferFormat  inPixelFormat,
bool &  outHasParityErrors 
)
virtual

◆ GetAllServiceInfoPtr()

virtual const NTV2_CC708ServiceData& CNTV2CaptionDecoder708::GetAllServiceInfoPtr ( void  ) const
inlinevirtual

Definition at line 189 of file ntv2captiondecoder708.h.

◆ GetCaptionChannelPacket()

virtual bool CNTV2CaptionDecoder708::GetCaptionChannelPacket ( UBytePtr outDataPtr,
size_t &  outSize 
)
virtual

◆ GetCaptionChannelPacketInfoData()

virtual bool CNTV2CaptionDecoder708::GetCaptionChannelPacketInfoData ( int  index,
UByte **  ppData,
int *  pSize 
)
virtual

◆ GetCC608CaptionData()

virtual CaptionData CNTV2CaptionDecoder708::GetCC608CaptionData ( void  )
virtual

Pops the next CC608 data.

Returns
The CaptionData, if any, found in my current anc packet.

◆ GetCDPData()

virtual void CNTV2CaptionDecoder708::GetCDPData ( NTV2_CC708CDPPtr  pCDP) const
inlinevirtual

Definition at line 197 of file ntv2captiondecoder708.h.

◆ GetCurrentFrameCC608Data()

virtual const CaptionData& CNTV2CaptionDecoder708::GetCurrentFrameCC608Data ( void  ) const
inlinevirtual

Definition at line 179 of file ntv2captiondecoder708.h.

◆ GetDisplayChannel()

virtual NTV2Line21Channel CNTV2CaptionDecoder708::GetDisplayChannel ( void  ) const
inlinevirtual

Answers with the caption channel that I'm currently focused on (or that I'm currently "burning" into video).

Returns
My current NTV2Line21Channel of interest.

Definition at line 98 of file ntv2captiondecoder708.h.

◆ GetNextServiceBlockDataFromQueue() [1/2]

virtual size_t CNTV2CaptionDecoder708::GetNextServiceBlockDataFromQueue ( const size_t  svcIndex,
std::vector< UByte > &  outData 
)
virtual

◆ GetNextServiceBlockDataFromQueue() [2/2]

virtual size_t CNTV2CaptionDecoder708::GetNextServiceBlockDataFromQueue ( const size_t  svcIndex,
UByte pOutDataBuffer 
)
virtual

◆ GetNextServiceBlockFromQueue() [1/2]

virtual size_t CNTV2CaptionDecoder708::GetNextServiceBlockFromQueue ( const size_t  svcIndex,
std::vector< UByte > &  outData 
)
virtual

◆ GetNextServiceBlockFromQueue() [2/2]

virtual size_t CNTV2CaptionDecoder708::GetNextServiceBlockFromQueue ( const size_t  svcIndex,
UByte pOutDataBuffer 
)
virtual

◆ GetNextServiceBlockInfoFromQueue()

virtual bool CNTV2CaptionDecoder708::GetNextServiceBlockInfoFromQueue ( const size_t  svcIndex,
size_t &  outBlockSize,
size_t &  outDataSize,
int &  outServiceNum,
bool &  outIsExtended 
) const
virtual

◆ GetNumCompleteCaptionChannelPacketInfo()

virtual int CNTV2CaptionDecoder708::GetNumCompleteCaptionChannelPacketInfo ( int *  pCompleteCount = 0,
int *  pStartedCount = 0 
)
virtual

◆ GetSMPTE334AncData()

virtual bool CNTV2CaptionDecoder708::GetSMPTE334AncData ( const UByte **  ppAncData,
size_t &  outAncSize 
) const
virtual

Returns a constant reference to my current SMPTE 334 Ancillary data packet.

Parameters
[out]ppAncDataSpecifies a pointer to a const UByte pointer variable that is to receive the pointer to my private Ancillary data packet buffer.
[out]outAncSizeReceives the size of my Ancillary data packet, in bytes.

◆ ParseAllCaptionChannelPackets()

virtual bool CNTV2CaptionDecoder708::ParseAllCaptionChannelPackets ( void  )
virtual

◆ ParseCaptionChannelPacket()

virtual bool CNTV2CaptionDecoder708::ParseCaptionChannelPacket ( CaptionChannelPacketInfoPtr  pCCPInfo)
virtual

◆ ParseSMPTE334AncPacket() [1/2]

virtual bool CNTV2CaptionDecoder708::ParseSMPTE334AncPacket ( bool &  outHasParityErrors)
virtual

Parses the current frame's SMPTE 334 Ancillary packet and extracts the 608 and 708 caption data from it, assuming a SMPTE 334 Ancillary Packet has already been loaded into my private buffer. This function A) extracts any "608" (aka Line 21) data from the payload, and puts it into my mCC608FrameData member, and B) extracts the 708 "Caption Channel Packet" data from the Ancillary data, and puts it into my mCC708FrameData member, with the word count in mCC708FrameDataByteCount. Further parsing of the extracted 608 or 708 data is left to other functions.

Parameters
[out]outHasParityErrorsSpecifies a boolean variable that is to receive "true" if any parity errors were detected while parsing the Ancillary data.
Note
This method assumes that the parity bits have already been stripped from the loaded Anc data. If the client needs to perform parity checks, they'll need to be done before calling this method.

◆ ParseSMPTE334AncPacket() [2/2]

virtual bool CNTV2CaptionDecoder708::ParseSMPTE334AncPacket ( void  )
virtual

Parses the current frame's SMPTE 334 Ancillary packet and extracts the 608 and 708 caption data from it, assuming a SMPTE 334 Ancillary Packet has already been loaded into my private buffer. This function A) extracts any "608" (aka Line 21) data from the payload, and puts it into my mCC608FrameData member, and B) extracts the 708 "Caption Channel Packet" data from the Ancillary data, and puts it into my mCC708FrameData member, with the word count in mCC708FrameDataByteCount. Further parsing of the extracted 608 or 708 data is left to other functions.

Note
This method assumes that the parity bits have already been stripped from the loaded Anc data. If the client needs to perform parity checks, they'll need to be done before calling this method.

◆ ParseSMPTE334CCDataSection()

virtual bool CNTV2CaptionDecoder708::ParseSMPTE334CCDataSection ( size_t &  index)
virtual

◆ ParseSMPTE334CCServiceInfoSection()

virtual bool CNTV2CaptionDecoder708::ParseSMPTE334CCServiceInfoSection ( size_t &  index)
virtual

◆ ParseSMPTE334CCTimeCodeSection()

virtual bool CNTV2CaptionDecoder708::ParseSMPTE334CCTimeCodeSection ( size_t &  index)
virtual

◆ Reset()

virtual void CNTV2CaptionDecoder708::Reset ( void  )
virtual

◆ ResetCaptionChannelPacketInfoForNewCDP()

virtual void CNTV2CaptionDecoder708::ResetCaptionChannelPacketInfoForNewCDP ( void  )
virtual

◆ SetDisplayChannel()

virtual bool CNTV2CaptionDecoder708::SetDisplayChannel ( const NTV2Line21Channel  inChan)
virtual

Setsthe caption channel I'm currently focused on (i.e. that I'm currently "burning" into video).

Parameters
[in]inChanThe NTV2Line21Channel of interest.
Returns
True if successful; otherwise false.

◆ SetLogMask()

virtual NTV2CaptionLogMask CNTV2CaptionDecoder708::SetLogMask ( const NTV2CaptionLogMask  inLogMask)
virtual

Specifies what, if any, debug information I will write to my log stream.

Parameters
[in]inLogMaskA bit mask that specifies what information will be logged.

Reimplemented from CNTV2CaptionLogConfig.

◆ SetSMPTE334AncData() [1/4]

virtual bool CNTV2CaptionDecoder708::SetSMPTE334AncData ( const AJAAncillaryData_Cea708 inPacket)
inlinevirtual

Copies the given SMPTE 334 CDP data from the given ancillary data packet into my private CDP buffer.

Parameters
[in]inPacketSpecifies the AJAAncillaryData_Cea708 packet that will supply the CDP data.
Returns
True if successful; otherwise, false.

Definition at line 106 of file ntv2captiondecoder708.h.

◆ SetSMPTE334AncData() [2/4]

virtual bool CNTV2CaptionDecoder708::SetSMPTE334AncData ( const AJAAncillaryData_Cea708 pInPacket)
inlinevirtual

Copies the given SMPTE 334 CDP data from the given ancillary data packet into my private CDP buffer.

Parameters
[in]pInPacketSpecifies the AJAAncillaryData_Cea708 packet that will supply the CDP data.
Returns
True if successful; otherwise, false.

Definition at line 114 of file ntv2captiondecoder708.h.

◆ SetSMPTE334AncData() [3/4]

virtual bool CNTV2CaptionDecoder708::SetSMPTE334AncData ( const UByte pInAncData,
const size_t  inByteCount 
)
virtual

Copies a given SMPTE334 ancillary data packet into my private buffer for parsing.

Parameters
[in]pInAncDataSpecifies the host address of the start of the SMPTE334 data packet to be copied.
[in]inByteCountSpecifies the size, in bytes, of the data packet. Must be less than 256.
Returns
True if successful; otherwise, false.
Note
Do not use this function if the host buffer contains multiple ancillary data packets, even if one of them is a SMPTE334 packet. You must first locate the SMPTE334 packet in the buffer before calling this function.

◆ SetSMPTE334AncData() [4/4]

virtual bool CNTV2CaptionDecoder708::SetSMPTE334AncData ( const UWord pInAncData,
const size_t  inWordCount 
)
virtual

Copies a given SMPTE334 ancillary data packet into my private buffer for parsing, assuming the packet data bytes are in the least significant byte of each 16-bit word in the buffer.

Parameters
[in]pInAncDataSpecifies the host address of the start of the SMPTE334 data packet to be copied.
[in]inWordCountSpecifies the data packet size. Must be less than 256.
Returns
True if successful; otherwise, false.
Note
Do not use this function if the host buffer contains multiple ancillary data packets, even if one of them is a SMPTE334 packet. You must first locate the SMPTE334 packet in the buffer before calling this function.

◆ UpdateServiceInfo()

virtual bool CNTV2CaptionDecoder708::UpdateServiceInfo ( void  )
virtual

The documentation for this class was generated from the following file: