AJA NTV2 SDK  17.5.0.1242
NTV2 SDK 17.5.0.1242
CNTV2CaptionDecoder608 Class Reference

#include <ntv2captiondecoder608.h>

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

Public Member Functions

virtual bool IsFlashCycleOff (void) const
 
virtual ~CNTV2CaptionDecoder608 ()
 My destructor. More...
 
virtual NTV2CaptionLogMask SetLogMask (const NTV2CaptionLogMask inLogMask)
 Specifies what, if any, debug information I will write to my log stream. More...
 
virtual bool BurnCaptions (UByte *pBuf, const NTV2FrameDimensions fd, const NTV2PixelFormat pf, const UWord rb)
 
virtual CNTV2CaptionDecodeChannel608Ptr Get608ChannelDecoder (const NTV2Line21Channel inChannel) const
 
Decoder Operation
virtual void Reset (void)
 Flushes me, clearing all in-progress data. More...
 
virtual bool SetDisplayChannel (const NTV2Line21Channel inChannel)
 Changes the caption channel that I'm focused on (or 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 void IdleFrame (void)
 Call this once per video frame when I'm doing display "burn-in", whether there is new caption data to parse or not. This keeps "flash" mode regular during "burn-in". More...
 
virtual bool ProcessNew608FrameData (const CaptionData &inCC608Data)
 Notifies me that new frame data has arrived. Clients should call this method once per video frame with the four bytes (2 per field) of new captioning data. More...
 
Caption Screen Access
virtual UByte GetOnAirCharacterWithAttributes (const UWord inRow, const UWord inCol, NTV2Line21Attrs &outAttrs) const
 Retrieves the "on-air" character and its attributes at the given on-screen row and column position. More...
 
virtual UWord GetOnAirUTF16CharacterWithAttributes (const UWord inRow, const UWord inCol, NTV2Line21Attrs &outAttrs) const
 Returns the UTF-16 character that best represents the caption character at the given screen position. More...
 
virtual std::string GetOnAirCharacter (const UWord inRow, const UWord inCol, NTV2Line21Attrs &outAttrs) const
 Retrieves the "on-air" character and its attributes at the given row and column position. More...
 
virtual std::string GetOnAirCharacter (const UWord inRow, const UWord inCol) const
 Retrieves the "on-air" character at the given on-screen row and column position. More...
 
virtual std::string GetOnAirCharacters (const UWord inRowNumber=0) const
 Retrieves all "on-air" characters either for all rows, or a specific row. More...
 
Caption Display Rendering
virtual bool BurnCaptions (NTV2Buffer &inFB, const NTV2FormatDesc &inFD)
 Blits all of my current caption channel's "on-air" captions into the given host buffer with the correct colors, display attributes and positioning. More...
 
Text Mode Operation
virtual UWord GetTextModeDisplayRowCount (const NTV2Line21Channel inChannel)
 Returns the number of rows used for displaying Text Mode captions for the given (TxN) caption channel. More...
 
virtual bool SetTextModeDisplayRowCount (const NTV2Line21Channel inChannel, const UWord inNumRows)
 Changes the number of rows used for displaying Text Mode captions for the given (TxN) caption channel. More...
 
virtual const NTV2Line21AttrsGetTextModeDisplayAttributes (const NTV2Line21Channel inChannel) const
 Returns the display attributes that Text Mode captions are currently using (assuming my caption channel is Tx1/Tx2/Tx3/Tx4). More...
 
virtual bool SetTextModeDisplayAttributes (const NTV2Line21Channel inChannel, const NTV2Line21Attrs &inAttrs)
 Sets the display attributes that Text Mode captions will use henceforth for the given (TxN) caption channel. More...
 
Change Notification
virtual bool SubscribeChangeNotification (NTV2Caption608Changed *pInCallback, void *pInUserData=0)
 Subscribes to change notifications. More...
 
virtual bool UnsubscribeChangeNotification (NTV2Caption608Changed *pInCallback, void *pInUserData=0)
 Unsubscribes a prior change notification subscription. More...
 
Decoder Debug Helpers
virtual void DebugPrintCurrentScreen (const bool inAllChannels=false, const bool inShowChars=true, const bool inShowTextChannels=false)
 
virtual void SetDebugRowsOfInterest (const NTV2Line21Channel inChannel, const UWord inFromRow, const UWord inToRow, const bool inAdd=false)
 
virtual void SetDebugColumnsOfInterest (const NTV2Line21Channel inChannel, const UWord inFromCol, const UWord inToCol, const bool inAdd=false)
 
- 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 (CNTV2CaptionDecoder608Ptr &outEncoder)
 Creates a new CNTV2CaptionEncoder608 instance. More...
 
static CaptionData DecodeCaptionData (const UByte *pFB, const NTV2PixelFormat pf, const NTV2VideoFormat vf, const NTV2FrameGeometry fg=NTV2_FG_720x486)
 @deprecate This function is obsolete 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)
 

Static Public Attributes

static const int CharacterFlashCycleFrames = 30
 Determines the flash/blink rate for characters having the "flash" attribute. It's the number of frames required to complete a full cycle from "on" thru "off". Defaults to 30 frames, or about a second at 29.97 fps. More...
 
Global Decoder Operation Options
static bool UseNewBurnCaptionsMethod
 Default is false. Reserved for future use. More...
 
static bool RenderPrePostSpaces
 Default is true. If true, BurnCaptions leads & follows character runs with blank space. More...
 
static bool AutoCallIdleFrame
 Default is false. If true, ProcessNew608FrameData will automatically call IdleFrame. More...
 
static bool AutoFlashOnAirChars
 Default is false. If true, GetOnAir... functions will automatically "flash" (periodically return spaces) More...
 

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 67 of file ntv2captiondecoder608.h.

Constructor & Destructor Documentation

◆ ~CNTV2CaptionDecoder608()

virtual CNTV2CaptionDecoder608::~CNTV2CaptionDecoder608 ( )
virtual

My destructor.

Member Function Documentation

◆ BurnCaptions() [1/2]

virtual bool CNTV2CaptionDecoder608::BurnCaptions ( NTV2Buffer inFB,
const NTV2FormatDesc inFD 
)
virtual

Blits all of my current caption channel's "on-air" captions into the given host buffer with the correct colors, display attributes and positioning.

Parameters
inFBSpecifies a valid host buffer that is to be blitted into.
[in]inFDDescribes the raster and pixel format of the given host buffer.
Returns
True if successful; otherwise False.

◆ BurnCaptions() [2/2]

virtual bool CNTV2CaptionDecoder608::BurnCaptions ( UByte pBuf,
const NTV2FrameDimensions  fd,
const NTV2PixelFormat  pf,
const UWord  rb 
)
virtual

◆ Create()

static bool CNTV2CaptionDecoder608::Create ( CNTV2CaptionDecoder608Ptr outEncoder)
static

Creates a new CNTV2CaptionEncoder608 instance.

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

◆ DebugPrintCurrentScreen()

virtual void CNTV2CaptionDecoder608::DebugPrintCurrentScreen ( const bool  inAllChannels = false,
const bool  inShowChars = true,
const bool  inShowTextChannels = false 
)
virtual

◆ DecodeCaptionData()

static CaptionData CNTV2CaptionDecoder608::DecodeCaptionData ( const UByte pFB,
const NTV2PixelFormat  pf,
const NTV2VideoFormat  vf,
const NTV2FrameGeometry  fg = NTV2_FG_720x486 
)
static

@deprecate This function is obsolete

◆ Get608ChannelDecoder()

virtual CNTV2CaptionDecodeChannel608Ptr CNTV2CaptionDecoder608::Get608ChannelDecoder ( const NTV2Line21Channel  inChannel) const
virtual

◆ GetDisplayChannel()

virtual NTV2Line21Channel CNTV2CaptionDecoder608::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 108 of file ntv2captiondecoder608.h.

◆ GetOnAirCharacter() [1/2]

virtual std::string CNTV2CaptionDecoder608::GetOnAirCharacter ( const UWord  inRow,
const UWord  inCol 
) const
inlinevirtual

Retrieves the "on-air" character at the given on-screen row and column position.

Parameters
[in]inRowSpecifies the row number of interest (1-15).
[in]inColSpecifies the column number of interest (1-32).
Returns
A UTF-8 encoded string that contains the "on-air" character, if successful; otherwise an empty string.
Note
Starting in SDK 17.0, if AutoFlashOnAirChars is set to 'true', and my current flash cycle is "off", and the attributes of the character at that position includes "flashing", the returned string will be a non-underlined space.

Definition at line 191 of file ntv2captiondecoder608.h.

◆ GetOnAirCharacter() [2/2]

virtual std::string CNTV2CaptionDecoder608::GetOnAirCharacter ( const UWord  inRow,
const UWord  inCol,
NTV2Line21Attrs outAttrs 
) const
virtual

Retrieves the "on-air" character and its attributes at the given row and column position.

Parameters
[in]inRowSpecifies the row number of interest (1-15).
[in]inColSpecifies the column number of interest (1-32).
[out]outAttrsReceives the attributes of the "on-air" character of interest.
Returns
A UTF8-encoded string that contains the "on-air" character, if successful; otherwise an empty string.
Note
Starting in SDK 17.0, if AutoFlashOnAirChars is set to 'true', and my current flash cycle is "off", and the attributes of the character at that position includes "flashing", the returned string will be a non-underlined space.

◆ GetOnAirCharacters()

virtual std::string CNTV2CaptionDecoder608::GetOnAirCharacters ( const UWord  inRowNumber = 0) const
virtual

Retrieves all "on-air" characters either for all rows, or a specific row.

Parameters
[in]inRowNumberOptionally specifies the row number of interest (1 thru 15). Specify zero (the default) to return all rows.
Returns
A UTF-8 encoded string that contains all "on-air" characters, if successful; otherwise an empty string. Multiple rows will include newline character(s) between successive rows.
Note
Starting in SDK 17.0, if AutoFlashOnAirChars is set to 'true',, and my current flash cycle is "off", and the attributes of the character at that position includes "flashing", the returned string will be a non-underlined space.

◆ GetOnAirCharacterWithAttributes()

virtual UByte CNTV2CaptionDecoder608::GetOnAirCharacterWithAttributes ( const UWord  inRow,
const UWord  inCol,
NTV2Line21Attrs outAttrs 
) const
virtual

Retrieves the "on-air" character and its attributes at the given on-screen row and column position.

Parameters
[in]inRowSpecifies the row number of interest. Must be 1-15.
[in]inColSpecifies the column number of interest. Must be 1-32.
[out]outAttrsReceives the attributes of the "on-air" character of interest.
Note
Starting in SDK 17.0, if AutoFlashOnAirChars is set to 'true', and my current flash cycle is "off", and the attributes of the character at that position includes "flashing", the returned string will be a non-underlined space.
Returns
The "on-air" character if successful; otherwise zero.

◆ GetOnAirUTF16CharacterWithAttributes()

virtual UWord CNTV2CaptionDecoder608::GetOnAirUTF16CharacterWithAttributes ( const UWord  inRow,
const UWord  inCol,
NTV2Line21Attrs outAttrs 
) const
virtual

Returns the UTF-16 character that best represents the caption character at the given screen position.

Parameters
[in]inRowThe row number of interest (1-15).
[in]inColThe column number of interest (1-32).
[out]outAttrsReceives the NTV2Line21Attributes of the on-screen character.
Note
Starting in SDK 17.0, if AutoFlashOnAirChars is set to 'true', and my current flash cycle is "off", and the attributes of the character at that position includes "flashing", the returned string will be a non-underlined space.
Returns
The UTF-16 character that best represents the on-screen caption character, if successful, or zero upon failure.

◆ GetTextModeDisplayAttributes()

virtual const NTV2Line21Attrs& CNTV2CaptionDecoder608::GetTextModeDisplayAttributes ( const NTV2Line21Channel  inChannel) const
virtual

Returns the display attributes that Text Mode captions are currently using (assuming my caption channel is Tx1/Tx2/Tx3/Tx4).

Parameters
[in]inChannelSpecifies the [Text] caption channel of interest.
Returns
My current Text Mode caption display attributes.

◆ GetTextModeDisplayRowCount()

virtual UWord CNTV2CaptionDecoder608::GetTextModeDisplayRowCount ( const NTV2Line21Channel  inChannel)
virtual

Returns the number of rows used for displaying Text Mode captions for the given (TxN) caption channel.

Parameters
[in]inChannelSpecifies the [Text] caption channel of interest.
Returns
True if successful; otherwise false.

◆ IdleFrame()

virtual void CNTV2CaptionDecoder608::IdleFrame ( void  )
virtual

Call this once per video frame when I'm doing display "burn-in", whether there is new caption data to parse or not. This keeps "flash" mode regular during "burn-in".

Note
Starting in SDK 17.0, if AutoCallIdleFrame is set to 'true', this function will be called automatically when ProcessNew608FrameData is called.

◆ IsFlashCycleOff()

virtual bool CNTV2CaptionDecoder608::IsFlashCycleOff ( void  ) const
inlinevirtual
Returns
True if current flash cycle is off (and a blank space should be displayed instead of the character itself).

Definition at line 291 of file ntv2captiondecoder608.h.

◆ ProcessNew608FrameData()

virtual bool CNTV2CaptionDecoder608::ProcessNew608FrameData ( const CaptionData inCC608Data)
virtual

Notifies me that new frame data has arrived. Clients should call this method once per video frame with the four bytes (2 per field) of new captioning data.

Parameters
[in]inCC608DataSpecifies the caption data that arrived for the lastest frame.
Returns
True if successful; otherwise False.
Note
Starting in SDK 17.0, if AutoCallIdleFrame is set to 'true', this function will automatically call IdleFrame.

◆ Reset()

virtual void CNTV2CaptionDecoder608::Reset ( void  )
virtual

Flushes me, clearing all in-progress data.

Note
This is NOT thread-safe!

◆ SetDebugColumnsOfInterest()

virtual void CNTV2CaptionDecoder608::SetDebugColumnsOfInterest ( const NTV2Line21Channel  inChannel,
const UWord  inFromCol,
const UWord  inToCol,
const bool  inAdd = false 
)
virtual

◆ SetDebugRowsOfInterest()

virtual void CNTV2CaptionDecoder608::SetDebugRowsOfInterest ( const NTV2Line21Channel  inChannel,
const UWord  inFromRow,
const UWord  inToRow,
const bool  inAdd = false 
)
virtual

◆ SetDisplayChannel()

virtual bool CNTV2CaptionDecoder608::SetDisplayChannel ( const NTV2Line21Channel  inChannel)
virtual

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

Parameters
[in]inChannelSpecifies the new caption channel that I am to focus on.
Returns
True if successful; otherwise False.

◆ SetLogMask()

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

◆ SetTextModeDisplayAttributes()

virtual bool CNTV2CaptionDecoder608::SetTextModeDisplayAttributes ( const NTV2Line21Channel  inChannel,
const NTV2Line21Attrs inAttrs 
)
virtual

Sets the display attributes that Text Mode captions will use henceforth for the given (TxN) caption channel.

Parameters
[in]inChannelSpecifies the [Text] caption channel to be configured.
[in]inAttrsSpecifies the new display attributes for Text Mode captions will have going forward.
Returns
True if successful; otherwise false.
Note
This has no effect on captions that have already been decoded (that may be currently displayed).

◆ SetTextModeDisplayRowCount()

virtual bool CNTV2CaptionDecoder608::SetTextModeDisplayRowCount ( const NTV2Line21Channel  inChannel,
const UWord  inNumRows 
)
virtual

Changes the number of rows used for displaying Text Mode captions for the given (TxN) caption channel.

Parameters
[in]inChannelSpecifies the [Text] caption channel to be configured.
[in]inNumRowsSpecifies the number of rows to use for displaying Text Mode captions. Must be at least 1 and no more than 32.
Returns
True if successful; otherwise false.

◆ SubscribeChangeNotification()

virtual bool CNTV2CaptionDecoder608::SubscribeChangeNotification ( NTV2Caption608Changed pInCallback,
void *  pInUserData = 0 
)
virtual

Subscribes to change notifications.

Parameters
[in]pInCallbackSpecifies a pointer to the callback function to be called if/when changes occur.
[in]pInUserDataOptionally specifies a data pointer to be passed to the callback function.
Returns
True if successful; otherwise False.
Note
In this implementation, each decoder instance only accommodates a single subscriber. Thus, each call to this function replaces the callback/userData used in prior calls to this function.

◆ UnsubscribeChangeNotification()

virtual bool CNTV2CaptionDecoder608::UnsubscribeChangeNotification ( NTV2Caption608Changed pInCallback,
void *  pInUserData = 0 
)
virtual

Unsubscribes a prior change notification subscription.

Parameters
[in]pInCallbackSpecifies a pointer to the callback function that was specified in the prior call to SubscribeChangeNotification.
[in]pInUserDataSpecifies the userData pointer that was specified in the prior call to SubscribeChangeNotification.
Returns
True if successful; otherwise False.

Member Data Documentation

◆ AutoCallIdleFrame

bool CNTV2CaptionDecoder608::AutoCallIdleFrame
static

Default is false. If true, ProcessNew608FrameData will automatically call IdleFrame.

Definition at line 338 of file ntv2captiondecoder608.h.

◆ AutoFlashOnAirChars

bool CNTV2CaptionDecoder608::AutoFlashOnAirChars
static

Default is false. If true, GetOnAir... functions will automatically "flash" (periodically return spaces)

Definition at line 339 of file ntv2captiondecoder608.h.

◆ CharacterFlashCycleFrames

const int CNTV2CaptionDecoder608::CharacterFlashCycleFrames = 30
static

Determines the flash/blink rate for characters having the "flash" attribute. It's the number of frames required to complete a full cycle from "on" thru "off". Defaults to 30 frames, or about a second at 29.97 fps.

Definition at line 83 of file ntv2captiondecoder608.h.

◆ RenderPrePostSpaces

bool CNTV2CaptionDecoder608::RenderPrePostSpaces
static

Default is true. If true, BurnCaptions leads & follows character runs with blank space.

Definition at line 337 of file ntv2captiondecoder608.h.

◆ UseNewBurnCaptionsMethod

bool CNTV2CaptionDecoder608::UseNewBurnCaptionsMethod
static

Default is false. Reserved for future use.

Definition at line 336 of file ntv2captiondecoder608.h.


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