AJA NTV2 SDK  17.1.1.1245
NTV2 SDK 17.1.1.1245
CNTV2CaptionTranslator608to708 Class Reference

#include <ntv2captiontranslator608to708.h>

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

Public Member Functions

virtual void Reset (void)
 Resets me, clearing all of my channel decoders, and flushing any/all in-progress data. More...
 
virtual bool SetDisplayChannel (const NTV2Line21Channel chan)
 Specifies the CEA-608 channel to focus debugging on. More...
 
virtual bool Set708ServiceNumber (const NTV2Line21Channel chan, const int serviceNum)
 Maps the specified CEA-608 caption channel to the specified CEA-708 service number. More...
 
virtual int Get708ServiceNumber (const NTV2Line21Channel chan) const
 Returns the CEA-708 caption "service number" that's currently mapped to the given CEA-608 caption channel. More...
 
virtual bool Set708TranslateEnable (const NTV2Line21Channel chan, bool bEnable)
 Controls whether or not the given CEA-608 caption channel will be translated into an equivalent CEA-708 caption service. More...
 
virtual bool Get708TranslateEnable (const NTV2Line21Channel chan) const
 Returns true if the given CEA-608 caption channel is currently being translated to an equivalent CEA-708 caption service. More...
 
virtual bool GetCaptionChannelPacket (UBytePtr &outDataPtr, size_t &outByteCount)
 Returns a non-const pointer to my CEA-708 caption encoder's data packet buffer and also returns the number of data bytes it currently contains. This gives clients the ability to interrogate the Ancillary data and/or modify it, if needed. More...
 
virtual bool Translate608CCData (const CaptionData &inCC608Data)
 Translates the given CEA-608 caption data bytes for a full frame of video. More...
 
virtual bool CreateSMPTE334Anc (const NTV2FrameRate frameRate, const NTV2Line21Field field, UWordPtr &outAncPacketData, size_t &outSize)
 Builds and returns a SMPTE 334 ancillary data packet that contains the latest translated CEA-708 caption message. More...
 
virtual bool InsertSMPTE334AncPacketInVideoFrame (void *pFrameBuffer, const NTV2VideoFormat inVideoFormat, const NTV2FrameBufferFormat inPixelFormat, const ULWord inLineNumber) const
 Inserts any translated CEA-708 caption data into the given host frame buffer's VANC area with the given line offset. More...
 
virtual NTV2CaptionLogMask SetLogMask (const NTV2CaptionLogMask inLogMask)
 Specifies what, if any, debug information I will write to my log stream. More...
 
virtual void Set608TestIDMode (bool bTest)
 
virtual ~CNTV2CaptionTranslator608to708 ()
 
- 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 (CNTV2CaptionTranslator608to708Ptr &outInstance)
 Creates an instance of me. 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 45 of file ntv2captiontranslator608to708.h.

Constructor & Destructor Documentation

◆ ~CNTV2CaptionTranslator608to708()

virtual CNTV2CaptionTranslator608to708::~CNTV2CaptionTranslator608to708 ( )
virtual

Member Function Documentation

◆ Create()

static bool CNTV2CaptionTranslator608to708::Create ( CNTV2CaptionTranslator608to708Ptr outInstance)
static

Creates an instance of me.

Parameters
[out]outInstanceReceives the newly-created NTV2CaptionTranslator608to708 instance.
Returns
True if successful; otherwise false.
Note
This method catches std::bad_alloc. If a new translator cannot be allocated, false will be returned, and outInstance will contain a NULL pointer.

◆ CreateSMPTE334Anc()

virtual bool CNTV2CaptionTranslator608to708::CreateSMPTE334Anc ( const NTV2FrameRate  frameRate,
const NTV2Line21Field  field,
UWordPtr outAncPacketData,
size_t &  outSize 
)
virtual

Builds and returns a SMPTE 334 ancillary data packet that contains the latest translated CEA-708 caption message.

Parameters
[in]frameRateSpecifies the output frame rate.
[in]fieldSpecifies the "line 21" field (if interlaced).
[out]outAncPacketDataSpecifies the buffer that is to receive the ancillary data packet.
[out]outSizeOn input, specifies the capacity, in bytes, of the specified buffer. On output, receives the number of bytes that were copied into the buffer.
Returns
True if successful; false if unsuccessful.
Note
This method should be called once per (output) frame.

◆ Get708ServiceNumber()

virtual int CNTV2CaptionTranslator608to708::Get708ServiceNumber ( const NTV2Line21Channel  chan) const
virtual

Returns the CEA-708 caption "service number" that's currently mapped to the given CEA-608 caption channel.

Parameters
[in]chanSpecifies the CEA-608 caption channel of interest. This must be in the range of NTV2_CC608_CC1 thru NTV2_CC608_Text4 (inclusive).
Returns
If successful, the CEA-708 caption "service number" that's currently mapped to the given caption channel; otherwise zero.

◆ Get708TranslateEnable()

virtual bool CNTV2CaptionTranslator608to708::Get708TranslateEnable ( const NTV2Line21Channel  chan) const
virtual

Returns true if the given CEA-608 caption channel is currently being translated to an equivalent CEA-708 caption service.

Parameters
[in]chanSpecifies the CEA-608 caption channel of interest. This must be in the range of NTV2_CC608_CC1 thru NTV2_CC608_Text4 (inclusive).
Returns
True if the given caption channel is currently being translated; otherwise false.

◆ GetCaptionChannelPacket()

virtual bool CNTV2CaptionTranslator608to708::GetCaptionChannelPacket ( UBytePtr outDataPtr,
size_t &  outByteCount 
)
virtual

Returns a non-const pointer to my CEA-708 caption encoder's data packet buffer and also returns the number of data bytes it currently contains. This gives clients the ability to interrogate the Ancillary data and/or modify it, if needed.

Parameters
[out]outDataPtrReceives the address of my 708 encoder's ancillary data buffer.
[out]outByteCountReceives the number of data bytes currently held in my 708 encoder's ancillary data buffer. The returned value will never exceed NTV2_CC708MaxPktSize.
Returns
True if successful; otherwise false.

◆ InsertSMPTE334AncPacketInVideoFrame()

virtual bool CNTV2CaptionTranslator608to708::InsertSMPTE334AncPacketInVideoFrame ( void *  pFrameBuffer,
const NTV2VideoFormat  inVideoFormat,
const NTV2FrameBufferFormat  inPixelFormat,
const ULWord  inLineNumber 
) const
virtual

Inserts any translated CEA-708 caption data into the given host frame buffer's VANC area with the given line offset.

Parameters
pFrameBufferSpecifies a valid, non-NULL starting address of the host frame buffer into which the SMPTE334 caption data will be written.
[in]inVideoFormatSpecifies the video format.
[in]inPixelFormatSpecifies the pixel format of the host frame buffer.
[in]inLineNumberSpecifies the line offset into the host frame buffer.
Returns
True if successful; otherwise false.

◆ Reset()

virtual void CNTV2CaptionTranslator608to708::Reset ( void  )
virtual

Resets me, clearing all of my channel decoders, and flushing any/all in-progress data.

Note
This method is not thread-safe.

◆ Set608TestIDMode()

virtual void CNTV2CaptionTranslator608to708::Set608TestIDMode ( bool  bTest)
virtual

◆ Set708ServiceNumber()

virtual bool CNTV2CaptionTranslator608to708::Set708ServiceNumber ( const NTV2Line21Channel  chan,
const int  serviceNum 
)
virtual

Maps the specified CEA-608 caption channel to the specified CEA-708 service number.

Parameters
[in]chanSpecifies the CEA-608 caption channel to be re-mapped. This must be in the range of NTV2_CC608_CC1 thru NTV2_CC608_Text4 (inclusive).
[in]serviceNumSpecifies the CEA-708 caption "service number", which must be in the range 0 thru 64 (inclusive).
Returns
True if successful; otherwise false.

◆ Set708TranslateEnable()

virtual bool CNTV2CaptionTranslator608to708::Set708TranslateEnable ( const NTV2Line21Channel  chan,
bool  bEnable 
)
virtual

Controls whether or not the given CEA-608 caption channel will be translated into an equivalent CEA-708 caption service.

Parameters
[in]chanSpecifies the CEA-608 caption channel to be enabled or disabled. This must be in the range of NTV2_CC608_CC1 thru NTV2_CC608_Text4 (inclusive).
[in]bEnableEnables translation if true; otherwise disables translation.
Returns
True if successful; otherwise false.

◆ SetDisplayChannel()

virtual bool CNTV2CaptionTranslator608to708::SetDisplayChannel ( const NTV2Line21Channel  chan)
virtual

Specifies the CEA-608 channel to focus debugging on.

Parameters
[in]chanSpecifies the "line 21" channel to debug. Must be one of NTV2_CC608_CC1...NTV2_CC608_CC4, NTV2_CC608_Text1...NTV2_CC608_Text4, or NTV2_CC608_XDS.

◆ SetLogMask()

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

◆ Translate608CCData()

virtual bool CNTV2CaptionTranslator608to708::Translate608CCData ( const CaptionData inCC608Data)
virtual

Translates the given CEA-608 caption data bytes for a full frame of video.

Parameters
[in]inCC608DataSpecifies an entire frame's worth of CEA-608 caption data bytes.
Returns
True if successful; otherwise false.
Note
This method should be called once per frame, even if no caption data was present in the frame. CEA-608 caption rules call for certain commands to be sent twice on adjacent frames, which means that if there's a difference between |command|command| and |command|null|command|, if I never see the intervening null frames, I may mistakenly think two commands arrived from adjacent frames and misinterpret them.

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