AJA NTV2 SDK  17.1.1.1245
NTV2 SDK 17.1.1.1245
CNTV2CaptionEncoder708 Class Reference

#include <ntv2captionencoder708.h>

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

Public Member Functions

virtual ~CNTV2CaptionEncoder708 ()
 
virtual void Reset (void)
 
virtual void InitCaptionChannelPacket ()
 
virtual bool SetCaptionChannelPacket (const UBytePtr pInData, const size_t numBytes)
 
virtual UBytePtr GetCaptionChannelPacket (void)
 
virtual const UByteGetCaptionChannelPacket (void) const
 
virtual size_t GetCaptionChannelPacketSize (void) const
 
virtual bool SetCaptionChannelPacketSize (size_t packetSize)
 
virtual bool MakeCaptionChannelPacketHeader (const size_t index, size_t packetSize, size_t &outNewIndex)
 
virtual bool MakeNullServiceBlockHeader (size_t index, size_t &outNewIndex)
 
virtual bool MakeServiceBlockHeader (const size_t index, int serviceNum, const size_t blockSize, size_t &outNewIndex)
 
virtual bool MakeServiceBlockHeader (const size_t index, int serviceNum, const size_t blockSize)
 
virtual bool MakeServiceBlockCharData (const size_t index, UByte data, size_t &outNewIndex)
 
virtual bool MakeDefineWindowCommand (const size_t index, int windowID, const CC708WindowParms &inParms, size_t &outNewIndex)
 
virtual bool MakeClearWindowsCommand (const size_t index, UByte windowMap, size_t &outNewIndex)
 
virtual bool MakeDeleteWindowsCommand (const size_t index, UByte windowMap, size_t &outNewIndex)
 
virtual bool MakeDisplayWindowsCommand (const size_t index, UByte windowMap, size_t &outNewIndex)
 
virtual bool MakeHideWindowsCommand (const size_t index, UByte windowMap, size_t &outNewIndex)
 
virtual bool MakeToggleWindowsCommand (const size_t index, UByte windowMap, size_t &outNewIndex)
 
virtual bool MakeSetCurrentWindowCommand (const size_t index, const int windowID, size_t &outNewIndex)
 
virtual bool MakeSetWindowAttributesCommand (const size_t index, const CC708WindowAttr &inAttr, size_t &outNewIndex)
 
virtual bool MakeSetPenAttributesCommand (const size_t index, const CC708PenAttr &inAttr, size_t &outNewIndex)
 
virtual bool MakeSetPenColorCommand (const size_t index, const CC708PenColor &inColor, size_t &outNewIndex)
 
virtual bool MakeSetPenLocationCommand (const size_t index, const CC708PenLocation &inLoc, size_t &outNewIndex)
 
virtual bool MakeDelayCommand (const size_t index, const UByte delay, size_t &outNewIndex)
 
virtual bool MakeDelayCancelCommand (const size_t index, size_t &outNewIndex)
 
virtual bool MakeResetCommand (const size_t index, size_t &outNewIndex)
 
virtual bool Clear608CaptionData (void)
 Clears my private CEA-608 caption data buffer. More...
 
virtual bool Set608CaptionData (const CaptionData &inCC608Data)
 Sets the CEA-608 caption data in my private 608 data buffer. More...
 
virtual bool Set608CaptionData (const NTV2Line21Field inField, const UByte inChar1, const UByte inChar2, const bool inGotData)
 Sets my CEA-608 caption data for the given field. More...
 
virtual bool MakeSMPTE334AncPacket (const NTV2FrameRate inFrameRate, const NTV2Line21Field inVideoField)
 Generates a SMPTE-334 Ancillary data packet. More...
 
virtual bool MakeSMPTE334AncPacket (const NTV2FrameRate inFrameRate, const NTV2Line21Field inVideoField, UWordPtr &outAncPacketData, size_t &outSize)
 Generates a SMPTE-334 Ancillary data packet. More...
 
virtual bool MakeSMPTE334AncPacketFromCDP (const UBytePtr pInCDP, const size_t inCDPLength, UWordPtr &outAncPacketData, size_t &outSize)
 Generates a SMPTE 334 Ancillary Packet using a supplied CDP. More...
 
virtual bool MakeSMPTE334AncPacketFromCDP (const UBytePtr pInCDP, const size_t inCDPLength)
 Generates a SMPTE 334 Ancillary Packet using a supplied CDP. More...
 
virtual bool SetServiceInfoActive (int svcIndex, bool bActive)
 
virtual bool CopyAllServiceInfo (const NTV2_CC708ServiceData &inSrcSvcData)
 
virtual bool InsertSMPTE334AncPacketInVideoFrame (void *pFrameBuffer, const NTV2VideoFormat inVideoFormat, const NTV2FrameBufferFormat inPixelFormat, const ULWord inVancLineNumber, const ULWord inWordOffset=1) const
 Inserts the encoder’s most recently generated ancillary data packet into the given host frame buffer. More...
 
virtual NTV2CaptionLogMask SetLogMask (const NTV2CaptionLogMask inLogMask)
 Specifies what, if any, debug information I will write to my log stream. More...
 
virtual void Set608TestIDMode (const bool inEnableTestIDMode)
 
virtual UWordSequence GetSMPTE334DataVector (void) const
 
virtual const UWordGetSMPTE334Data (void) const
 
virtual size_t GetSMPTE334Size (void) const
 
- 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 (CNTV2CaptionEncoder708Ptr &outEncoder)
 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

Definition at line 586 of file ntv2captionencoder708.h.

Constructor & Destructor Documentation

◆ ~CNTV2CaptionEncoder708()

virtual CNTV2CaptionEncoder708::~CNTV2CaptionEncoder708 ( )
virtual

Member Function Documentation

◆ Clear608CaptionData()

virtual bool CNTV2CaptionEncoder708::Clear608CaptionData ( void  )
virtual

Clears my private CEA-608 caption data buffer.

Returns
True if successful; otherwise false.

◆ CopyAllServiceInfo()

virtual bool CNTV2CaptionEncoder708::CopyAllServiceInfo ( const NTV2_CC708ServiceData inSrcSvcData)
virtual

◆ Create()

static bool CNTV2CaptionEncoder708::Create ( CNTV2CaptionEncoder708Ptr outEncoder)
static

Creates a new CNTV2CaptionEncoder708 instance.

Parameters
[out]outEncoderReceives the newly-created encoder instance.
Returns
True if successful; otherwise False.
Note
This method will catch any "bad_alloc" exception and return False if there's insufficient free memory to allocate the new encoder.

◆ GetCaptionChannelPacket() [1/2]

virtual UBytePtr CNTV2CaptionEncoder708::GetCaptionChannelPacket ( void  )
inlinevirtual

Definition at line 609 of file ntv2captionencoder708.h.

◆ GetCaptionChannelPacket() [2/2]

virtual const UByte* CNTV2CaptionEncoder708::GetCaptionChannelPacket ( void  ) const
inlinevirtual

Definition at line 610 of file ntv2captionencoder708.h.

◆ GetCaptionChannelPacketSize()

virtual size_t CNTV2CaptionEncoder708::GetCaptionChannelPacketSize ( void  ) const
inlinevirtual

Definition at line 611 of file ntv2captionencoder708.h.

◆ GetSMPTE334Data()

virtual const UWord* CNTV2CaptionEncoder708::GetSMPTE334Data ( void  ) const
inlinevirtual

Definition at line 735 of file ntv2captionencoder708.h.

◆ GetSMPTE334DataVector()

virtual UWordSequence CNTV2CaptionEncoder708::GetSMPTE334DataVector ( void  ) const
virtual

◆ GetSMPTE334Size()

virtual size_t CNTV2CaptionEncoder708::GetSMPTE334Size ( void  ) const
inlinevirtual

Definition at line 736 of file ntv2captionencoder708.h.

◆ InitCaptionChannelPacket()

virtual void CNTV2CaptionEncoder708::InitCaptionChannelPacket ( )
virtual

◆ InsertSMPTE334AncPacketInVideoFrame()

virtual bool CNTV2CaptionEncoder708::InsertSMPTE334AncPacketInVideoFrame ( void *  pFrameBuffer,
const NTV2VideoFormat  inVideoFormat,
const NTV2FrameBufferFormat  inPixelFormat,
const ULWord  inVancLineNumber,
const ULWord  inWordOffset = 1 
) const
virtual

Inserts the encoder’s most recently generated ancillary data packet into the given host frame buffer.

Parameters
pFrameBufferSpecifies a valid, non-NULL starting address of the host frame buffer.
[in]inVideoFormatSpecifies the video format of the host frame buffer.
[in]inPixelFormatSpecifies the pixel format of the host frame buffer.
[in]inVancLineNumberSpecifies the line number in the host frame buffer into which the anc data will be embedded. Note that this is not the same as the SMPTE line number, which, by convention, for SMPTE 334, is line 9. Use the CNTV2SMPTEAncData::GetVancLineOffset class method to calculate the correct frame buffer line number (i.e., the "VANC" line number).
[in]inWordOffsetSpecifies the two-byte word offset in the host buffer line into which the ancillary data will be inserted. Defaults to 1, which will embed the anc data into the luma channel.
Returns
True if successful; otherwise false.

◆ MakeCaptionChannelPacketHeader()

virtual bool CNTV2CaptionEncoder708::MakeCaptionChannelPacketHeader ( const size_t  index,
size_t  packetSize,
size_t &  outNewIndex 
)
virtual

◆ MakeClearWindowsCommand()

virtual bool CNTV2CaptionEncoder708::MakeClearWindowsCommand ( const size_t  index,
UByte  windowMap,
size_t &  outNewIndex 
)
virtual

◆ MakeDefineWindowCommand()

virtual bool CNTV2CaptionEncoder708::MakeDefineWindowCommand ( const size_t  index,
int  windowID,
const CC708WindowParms inParms,
size_t &  outNewIndex 
)
virtual

◆ MakeDelayCancelCommand()

virtual bool CNTV2CaptionEncoder708::MakeDelayCancelCommand ( const size_t  index,
size_t &  outNewIndex 
)
virtual

◆ MakeDelayCommand()

virtual bool CNTV2CaptionEncoder708::MakeDelayCommand ( const size_t  index,
const UByte  delay,
size_t &  outNewIndex 
)
virtual

◆ MakeDeleteWindowsCommand()

virtual bool CNTV2CaptionEncoder708::MakeDeleteWindowsCommand ( const size_t  index,
UByte  windowMap,
size_t &  outNewIndex 
)
virtual

◆ MakeDisplayWindowsCommand()

virtual bool CNTV2CaptionEncoder708::MakeDisplayWindowsCommand ( const size_t  index,
UByte  windowMap,
size_t &  outNewIndex 
)
virtual

◆ MakeHideWindowsCommand()

virtual bool CNTV2CaptionEncoder708::MakeHideWindowsCommand ( const size_t  index,
UByte  windowMap,
size_t &  outNewIndex 
)
virtual

◆ MakeNullServiceBlockHeader()

virtual bool CNTV2CaptionEncoder708::MakeNullServiceBlockHeader ( size_t  index,
size_t &  outNewIndex 
)
virtual

◆ MakeResetCommand()

virtual bool CNTV2CaptionEncoder708::MakeResetCommand ( const size_t  index,
size_t &  outNewIndex 
)
virtual

◆ MakeServiceBlockCharData()

virtual bool CNTV2CaptionEncoder708::MakeServiceBlockCharData ( const size_t  index,
UByte  data,
size_t &  outNewIndex 
)
virtual

◆ MakeServiceBlockHeader() [1/2]

virtual bool CNTV2CaptionEncoder708::MakeServiceBlockHeader ( const size_t  index,
int  serviceNum,
const size_t  blockSize 
)
virtual

◆ MakeServiceBlockHeader() [2/2]

virtual bool CNTV2CaptionEncoder708::MakeServiceBlockHeader ( const size_t  index,
int  serviceNum,
const size_t  blockSize,
size_t &  outNewIndex 
)
virtual

◆ MakeSetCurrentWindowCommand()

virtual bool CNTV2CaptionEncoder708::MakeSetCurrentWindowCommand ( const size_t  index,
const int  windowID,
size_t &  outNewIndex 
)
virtual

◆ MakeSetPenAttributesCommand()

virtual bool CNTV2CaptionEncoder708::MakeSetPenAttributesCommand ( const size_t  index,
const CC708PenAttr inAttr,
size_t &  outNewIndex 
)
virtual

◆ MakeSetPenColorCommand()

virtual bool CNTV2CaptionEncoder708::MakeSetPenColorCommand ( const size_t  index,
const CC708PenColor inColor,
size_t &  outNewIndex 
)
virtual

◆ MakeSetPenLocationCommand()

virtual bool CNTV2CaptionEncoder708::MakeSetPenLocationCommand ( const size_t  index,
const CC708PenLocation inLoc,
size_t &  outNewIndex 
)
virtual

◆ MakeSetWindowAttributesCommand()

virtual bool CNTV2CaptionEncoder708::MakeSetWindowAttributesCommand ( const size_t  index,
const CC708WindowAttr inAttr,
size_t &  outNewIndex 
)
virtual

◆ MakeSMPTE334AncPacket() [1/2]

virtual bool CNTV2CaptionEncoder708::MakeSMPTE334AncPacket ( const NTV2FrameRate  inFrameRate,
const NTV2Line21Field  inVideoField 
)
virtual

Generates a SMPTE-334 Ancillary data packet.

Parameters
[in]inFrameRateSpecifies the frame rate of the outgoing video into which the resulting ancillary data packet(s) will be inserted.
[in]inVideoFieldSpecifies the video field.
Returns
True if successful; otherwise false.
Note
For NTV2_FRAMERATE_2398, NTV2_FRAMERATE_2400, NTV2_FRAMERATE_2997 and NTV2_FRAMERATE_3000, the inVideoField parameter is ignored, and whatever CaptionData for fields F1 and/or F2 is valid (as set in an earlier call to CNTV2CaptionEncoder708::Set608CaptionData) will be inserted into the packet.

◆ MakeSMPTE334AncPacket() [2/2]

virtual bool CNTV2CaptionEncoder708::MakeSMPTE334AncPacket ( const NTV2FrameRate  inFrameRate,
const NTV2Line21Field  inVideoField,
UWordPtr outAncPacketData,
size_t &  outSize 
)
virtual

Generates a SMPTE-334 Ancillary data packet.

Parameters
[in]inFrameRateSpecifies the frame rate of the outgoing video into which the resulting ancillary data packet(s) will be inserted.
[in]inVideoFieldSpecifies the video field.
[out]outAncPacketDataSpecifies a variable that is to receive a pointer to my internal buffer that contains the generated caption data packet (CDP).
[out]outSizeSpecifies a variable that is to receive the number of bytes of CDP data that got placed into my internal buffer.
Returns
True if successful; otherwise false.

◆ MakeSMPTE334AncPacketFromCDP() [1/2]

virtual bool CNTV2CaptionEncoder708::MakeSMPTE334AncPacketFromCDP ( const UBytePtr  pInCDP,
const size_t  inCDPLength 
)
virtual

Generates a SMPTE 334 Ancillary Packet using a supplied CDP.

Parameters
[in]pInCDPSpecifies a valid, non-NULL pointer to a buffer that contains the CDP to be used.
[in]inCDPLengthSpecifies the length of the specified CDP, in bytes.
Note
This function assumes that the supplied 8-bit CDP is correct and complete, and only needs parity added.
Returns
True if successful; otherwise false.

◆ MakeSMPTE334AncPacketFromCDP() [2/2]

virtual bool CNTV2CaptionEncoder708::MakeSMPTE334AncPacketFromCDP ( const UBytePtr  pInCDP,
const size_t  inCDPLength,
UWordPtr outAncPacketData,
size_t &  outSize 
)
virtual

Generates a SMPTE 334 Ancillary Packet using a supplied CDP.

Parameters
[in]pInCDPSpecifies a valid, non-NULL pointer to a buffer that contains the CDP to be used.
[in]inCDPLengthSpecifies the length of the specified CDP, in bytes.
[out]outAncPacketDataReceives a pointer to my internal buffer that contains the generated packet.
[out]outSizeReceives the number of bytes of packet data that got placed into my internal buffer.
Note
This function assumes that the supplied 8-bit CDP is correct and complete, and only needs parity added.
Returns
True if successful; otherwise false.

◆ MakeToggleWindowsCommand()

virtual bool CNTV2CaptionEncoder708::MakeToggleWindowsCommand ( const size_t  index,
UByte  windowMap,
size_t &  outNewIndex 
)
virtual

◆ Reset()

virtual void CNTV2CaptionEncoder708::Reset ( void  )
virtual

◆ Set608CaptionData() [1/2]

virtual bool CNTV2CaptionEncoder708::Set608CaptionData ( const CaptionData inCC608Data)
virtual

Sets the CEA-608 caption data in my private 608 data buffer.

Parameters
[in]inCC608DataSpecifies the caption data bytes to be stored in my private buffer.
Note
The caption bytes must have the standard CEA-608 odd parity.
Returns
True if successful; otherwise false.

◆ Set608CaptionData() [2/2]

virtual bool CNTV2CaptionEncoder708::Set608CaptionData ( const NTV2Line21Field  inField,
const UByte  inChar1,
const UByte  inChar2,
const bool  inGotData 
)
virtual

Sets my CEA-608 caption data for the given field.

Parameters
[in]inFieldSpecifies the field.
[in]inChar1Specifies the first caption data byte. (Must include odd parity.)
[in]inChar2Specifies the second caption data byte. (Must include odd parity.)
[in]inGotDataSpecifies whether or not the specified data bytes are valid.
Returns
True if successful; otherwise false.

◆ Set608TestIDMode()

virtual void CNTV2CaptionEncoder708::Set608TestIDMode ( const bool  inEnableTestIDMode)
inlinevirtual

Definition at line 732 of file ntv2captionencoder708.h.

◆ SetCaptionChannelPacket()

virtual bool CNTV2CaptionEncoder708::SetCaptionChannelPacket ( const UBytePtr  pInData,
const size_t  numBytes 
)
virtual

◆ SetCaptionChannelPacketSize()

virtual bool CNTV2CaptionEncoder708::SetCaptionChannelPacketSize ( size_t  packetSize)
virtual

◆ SetLogMask()

virtual NTV2CaptionLogMask CNTV2CaptionEncoder708::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.

◆ SetServiceInfoActive()

virtual bool CNTV2CaptionEncoder708::SetServiceInfoActive ( int  svcIndex,
bool  bActive 
)
virtual

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