AJA NTV2 SDK
17.1.3.1410
NTV2 SDK 17.1.3.1410
|
#include <ntv2captionencoder608.h>
Public Member Functions | |
virtual | ~CNTV2CaptionEncoder608 () |
My destructor. More... | |
virtual NTV2CaptionLogMask | SetLogMask (const NTV2CaptionLogMask inLogMask) |
Specifies what, if any, debug information I will write to my log stream. More... | |
Enqueueing | |
virtual bool | EnqueuePopOnMessage (const std::string &inMessageStr, const NTV2Line21Channel inChannel=NTV2_CC608_CC1, const UWord inRowNumber=0, const UWord inColumnNumber=0, const NTV2Line21Attrs &inDisplayAttribs=NTV2Line21Attrs()) |
Enqueues the given message for eventual "pop-on" display. More... | |
virtual bool | EnqueuePaintOnMessage (const std::string &inMessageStr, const bool inEraseFirst=false, const NTV2Line21Channel inChannel=NTV2_CC608_CC1, const UWord inRowNumber=0, const UWord inColumnNumber=0, const NTV2Line21Attrs &inDisplayAttribs=NTV2Line21Attrs()) |
Enqueues the given message for eventual "paint-on" display. More... | |
virtual bool | EnqueueRollUpMessage (const std::string &inMessageStr, const NTV2Line21Mode inRollMode=NTV2_CC608_CapModeRollUp4, const NTV2Line21Channel inChannel=NTV2_CC608_CC1, const UWord inRowNumber=NTV2_CC608_MaxRow, const UWord inColumnNumber=NTV2_CC608_MinCol, const NTV2Line21Attrs &inDisplayAttribs=NTV2Line21Attrs()) |
Enqueues the given message for eventual "roll up" display. More... | |
virtual bool | EnqueueTextMessage (const std::string &inMessageStr, const bool inEraseFirst=false, const NTV2Line21Channel inChannel=NTV2_CC608_Text1) |
Enqueues the given message for eventual reception and possible display on a receiver capable of displaying Tx data. More... | |
virtual bool | EnqueueCaptionData (const CaptionData &inCaptionData) |
This is a low-level method that enqueues the given CaptionData for eventual transmission. More... | |
virtual bool | EnqueueDelay (const uint32_t inFrameCount, const NTV2Line21Channel inChannel=NTV2_CC608_CC1) |
Adds a delay to the given channel queue. More... | |
Dequeueing | |
virtual bool | EncodeNextCaptionBytesIntoLine21 (void *pFrameBuffer, const NTV2PixelFormat inPixelFormat, const NTV2VideoFormat inVideoFormat, const NTV2Line21Field inFieldNum) |
For the given field, pops the next two pending caption bytes from the current message being transmitted, and encodes them into a valid "line 21" waveform in the given frame buffer. If there is no current message being transmitted, the next pending caption message is dequeued and is started transmitting. If there's nothing being transmitted and nothing in my queue, the frame buffer is not modified. More... | |
virtual bool | GetNextCaptionData (CaptionData &outCaptionData) |
This high-level method is used to dequeue caption data for an entire frame. More... | |
virtual UByte * | GetNextLine21TransmitCaptions (const NTV2Line21Field inFieldNum) |
This calls my lower level "GetNextTransmitCaptionBytes" method (below), and is typically called twice per frame (once per field). If there is a pending message in my queue for the designated field, it pulls the next two bytes out of the message, encodes them into a "Line
21" video waveform and returns a pointer to the waveform buffer. If the two bytes complete the current message, the message is automatically "popped" from the queue and the next message (if any) is rippled into place for the next frame. More... | |
virtual bool | GetNextTransmitCaptionBytes (const NTV2Line21Field inFieldNum, UByte &outChar1, UByte &outChar2) |
This low-level function is called by the higher level "GetNextLine21TransmitCaptions" function. Typically, this is called twice per frame (once per field). If there is a pending message in my queue for the designated field, it pulls the next two bytes out of the message, and returns them via the "outChar1" and "outChar2" output parameters. If the two bytes complete the current message, the message is automatically "popped" from my queue and the next message (if any) is rippled into place for the next frame. More... | |
Inquiry | |
virtual size_t | GetQueuedMessageCount (const NTV2Line21Field inFieldNum=NTV2_CC608_Field1) const |
Answers with the current depth of my queue (for the given CC608 field). More... | |
virtual size_t | GetQueuedByteCount (const NTV2Line21Field inFieldNum=NTV2_CC608_Field1) const |
Answers with the total number of bytes (including command bytes) that are currently queued (for the given CC608 field). More... | |
virtual void | Flush (const NTV2Line21Field inFieldNum=NTV2_CC608_Field1, const bool inAlsoInProgress=true) |
Flushes all queued command bytes for the given CC608 field. More... | |
virtual void | FlushChannel (const NTV2Line21Channel inChannel, const bool inAlsoInProgress=true) |
Flushes all queued command bytes for the given caption channel. More... | |
virtual bool | Erase (const NTV2Line21Channel inChannel=NTV2_CC608_CC1) |
Clears captions on the given channel by emitting ENM (Erase Non-displayed Memory) and EOC (End Of Caption) control codes. More... | |
virtual void | GetQueueInfoForChannel (const NTV2Line21Channel inChannel, size_t &outBytesQueued, size_t &outMessagesQueued) const |
Returns queue information for a given caption channel. More... | |
virtual size_t | GetEnqueueByteTally (void) const |
Returns the total number of bytes (including command bytes) that have been enqueued onto me since I was instantiated. More... | |
virtual size_t | GetDequeueByteTally (void) const |
Returns the total number of bytes (including command bytes) that have been dequeued from me since I was instantiated. More... | |
virtual size_t | GetEnqueueMessageTally (void) const |
Returns the total number of messages that have been enqueued onto me since I was instantiated. More... | |
virtual size_t | GetDequeueMessageTally (void) const |
Returns the total number of messages that have been dequeued from me since I was instantiated. More... | |
virtual size_t | GetHighestQueueDepth (void) const |
Returns the highest queue depth – i.e., the maximum number of messages I held in either of my queues – since I was instantiated. More... | |
virtual void | GetQueueStatsForChannel (const NTV2Line21Channel inChannel, size_t &outEnqueueBytes, size_t &outEnqueueMsgs, size_t &outDequeueBytes, size_t &outDequeueMsgs) const |
Returns stats for a given caption channel. 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 (CNTV2CaptionEncoder608Ptr &outEncoder) |
Creates a new CNTV2CaptionEncoder608 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... | |
Definition at line 53 of file ntv2captionencoder608.h.
|
virtual |
My destructor.
|
static |
Creates a new CNTV2CaptionEncoder608 instance.
[out] | outEncoder | Receives the newly-created encoder instance. |
|
virtual |
For the given field, pops the next two pending caption bytes from the current message being transmitted, and encodes them into a valid "line 21" waveform in the given frame buffer. If there is no current message being transmitted, the next pending caption message is dequeued and is started transmitting. If there's nothing being transmitted and nothing in my queue, the frame buffer is not modified.
pFrameBuffer | A valid, non-NULL pointer to the frame buffer whose "line 21" will be replaced if there are caption bytes to transmit. | |
[in] | inPixelFormat | Specifies the format of the given frame buffer. (Must be 8 or 10 bit YUV.) |
[in] | inVideoFormat | Specifies the video format. (Currently only NTV2_FORMAT_525_5994 is supported.) |
[in] | inFieldNum | Specifies the field of interest – NTV2_CC608_Field1 or NTV2_CC608_Field2. |
|
virtual |
This is a low-level method that enqueues the given CaptionData for eventual transmission.
[in] | inCaptionData | Specifies the CaptionData to be enqueued for eventual transmission. Field 1 data bytes are queued for NTV2_CC608_CC1, NTV2_CC608_CC2, NTV2_CC608_Text1, or NTV2_CC608_Text2 transmission. Field 2 data bytes are queued for NTV2_CC608_CC3, NTV2_CC608_CC4, NTV2_CC608_Text3, or NTV2_CC608_Text4 transmission. |
|
virtual |
Adds a delay to the given channel queue.
[in] | inFrameCount | Specifies the delay, in frames. |
[in] | inChannel | Specifies the CEA-608 caption channel to use. Defaults to NTV2_CC608_CC1. |
|
virtual |
Enqueues the given message for eventual "paint-on" display.
[in] | inMessageStr | Specifies the message to be enqueued for eventual dequeuing/encoding/display. Must not be empty. May contain line-breaks, but only the first four lines will be utilized. Must not utilize any Unicode encoding (e.g., UTF-8). May contain two-byte CEA-608 command sequences for encoding special characters, but these are caption-channel specific, and thus, should match what's specified in the "inChannel" parameter. The caller is also responsible for abiding by the CEA-608 standard practice of immediately preceding each special character with its ASCII equivalent (as downstream decoders that support special characters are expected to "backspace" over the ASCII equivalent with the correct glyph). |
[in] | inEraseFirst | If true, specifies that the caption area should be erased before displaying the message; otherwise the message will simply be painted on top of what is already in the caption area (the default). |
[in] | inChannel | Specifies the CEA-608 caption channel to use, which must be CC1, CC2, CC3 or CC4. |
[in] | inRowNumber | Specifies the row number at which the caption should be displayed. Defaults to zero. |
[in] | inColumnNumber | Specifies the column number at which the caption should be displayed. Defaults to zero. |
[in] | pInDisplayAttribs | Specifies a valid, non-NULL pointer to the display attributes to be used. Defaults to the default display attributes. |
|
virtual |
Enqueues the given message for eventual "pop-on" display.
[in] | inMessageStr | Specifies the message to be enqueued for eventual dequeuing/encoding/display. Must not be empty. May contain line-breaks, but only the first four lines will be utilized. Must not utilize any Unicode encoding (e.g., UTF-8). May contain two-byte CEA-608 command sequences for encoding special characters, but these are caption-channel specific, and thus, should match what's specified in the "inChannel" parameter. The caller is also responsible for abiding by the CEA-608 standard practice of immediately preceding each special character with its ASCII equivalent (as downstream decoders that support special characters are expected to "backspace" over the ASCII equivalent with the correct glyph). |
[in] | inChannel | Specifies the CEA-608 caption channel to use, which must be CC1, CC2, CC3 or CC4. |
[in] | inRowNumber | Specifies the row number at which the caption should be displayed. Defaults to zero, which centers it vertically. |
[in] | inColumnNumber | Specifies the column number at which the caption should be displayed. Defaults to zero, which centers it horizontally. |
[in] | pInDisplayAttribs | Specifies a valid, non-NULL pointer to the display attributes to be used. Defaults to the default display attributes. |
|
virtual |
Enqueues the given message for eventual "roll up" display.
[in] | inMessageStr | Specifies the message to be enqueued for eventual dequeuing/encoding/display. Must not exceed NTV2_CC608_MaxCol characters in length. Must not be empty. Must not contain any line-break characters. Must not utilize any Unicode encoding (e.g., UTF-8). May contain two-byte CEA-608 command sequences for encoding special characters, but these are caption-channel specific, and thus, should match what's specified in the "inChannel" parameter. The caller is also responsible for abiding by the CEA-608 standard practice of immediately preceding each special character with its ASCII equivalent (as downstream decoders that support special characters are expected to "backspace" over the ASCII equivalent with the correct glyph). |
[in] | inRollMode | Specifies the "roll-up" behavior to use – 2, 3 or 4-row roll-up. Defaults to NTV2_CC608_CapModeRollUp4 (4-line roll-up). |
[in] | inChannel | Specifies the CEA-608 caption channel to use, which must be CC1, CC2, CC3 or CC4. Defaults to NTV2_CC608_CC1. |
[in] | inRowNumber | Specifies the row number at which the caption should be displayed. Defaults to the most appropriate bottom-most row. |
[in] | inColumnNumber | Specifies the column number at which the caption should be displayed. Defaults to the most appropriate left-most column. |
[in] | pInDisplayAttribs | Specifies a valid, non-NULL pointer to the display attributes to be used. Defaults to the default display attributes. |
|
virtual |
Enqueues the given message for eventual reception and possible display on a receiver capable of displaying Tx data.
[in] | inMessageStr | Specifies the message to be enqueued for eventual dequeuing/encoding/display. The string must not be empty, nor contain line breaks, nor contain any characters not in the ISO 8859-1 (Latin 1) character set. |
[in] | inEraseFirst | If true, specifies that the caption area should be erased before displaying the message; otherwise the message will simply be painted on top of what is already in the caption area (the default). |
[in] | inChannel | Specifies the CEA-608 caption channel to use, which must be Text1, Text2, Text3 or Text4. |
|
virtual |
Clears captions on the given channel by emitting ENM (Erase Non-displayed Memory) and EOC (End Of Caption) control codes.
[in] | inChannel | Specifies the CEA-608 caption channel to use, which must be CC1, CC2, CC3 or CC4. Illegal values are overridden to use the default CC1 value (NTV2_CC608_CC1). |
|
virtual |
Flushes all queued command bytes for the given CC608 field.
[in] | inFieldNum | Specifies the c608 caption field of interest. Defaults to NTV2_CC608_Field1. |
[in] | inAlsoInProgress | If true, also flush any in-progress messages; otherwise leave in-progress messages intact. Defaults to true. |
|
virtual |
Flushes all queued command bytes for the given caption channel.
[in] | inChannel | Specifies the caption channel of interest. |
[in] | inAlsoInProgress | If true, also flush any in-progress messages for the channel; otherwise leave in-progress messages intact. Defaults to true. |
|
inlinevirtual |
Returns the total number of bytes (including command bytes) that have been dequeued from me since I was instantiated.
Definition at line 329 of file ntv2captionencoder608.h.
|
inlinevirtual |
Returns the total number of messages that have been dequeued from me since I was instantiated.
Definition at line 339 of file ntv2captionencoder608.h.
|
inlinevirtual |
Returns the total number of bytes (including command bytes) that have been enqueued onto me since I was instantiated.
Definition at line 323 of file ntv2captionencoder608.h.
|
inlinevirtual |
Returns the total number of messages that have been enqueued onto me since I was instantiated.
Definition at line 334 of file ntv2captionencoder608.h.
|
inlinevirtual |
Returns the highest queue depth – i.e., the maximum number of messages I held in either of my queues – since I was instantiated.
Definition at line 345 of file ntv2captionencoder608.h.
|
virtual |
This high-level method is used to dequeue caption data for an entire frame.
[out] | outCaptionData | Receives the dequeued caption data for an entire frame. |
|
virtual |
This calls my lower level "GetNextTransmitCaptionBytes" method (below), and is typically called twice per frame (once per field). If there is a pending message in my queue for the designated field, it pulls the next two bytes out of the message, encodes them into a "Line 21" video waveform and returns a pointer to the waveform buffer. If the two bytes complete the current message, the message is automatically "popped" from the queue and the next message (if any) is rippled into place for the next frame.
[in] | inFieldNum | Specifies the field of interest – NTV2_CC608_Field1 or NTV2_CC608_Field2. |
|
virtual |
This low-level function is called by the higher level "GetNextLine21TransmitCaptions" function. Typically, this is called twice per frame (once per field). If there is a pending message in my queue for the designated field, it pulls the next two bytes out of the message, and returns them via the "outChar1" and "outChar2" output parameters. If the two bytes complete the current message, the message is automatically "popped" from my queue and the next message (if any) is rippled into place for the next frame.
[in] | inFieldNum | Specifies the field – NTV2_CC608_Field1 or NTV2_CC608_Field2. |
[out] | outChar1 | Receives the first byte code, with the appropriate parity applied. |
[out] | outChar2 | Receives the second byte code, with the appropriate parity applied. |
|
virtual |
Answers with the total number of bytes (including command bytes) that are currently queued (for the given CC608 field).
[in] | inFieldNum | Specifies the c608 caption field of interest. Defaults to NTV2_CC608_Field1. |
|
virtual |
Answers with the current depth of my queue (for the given CC608 field).
[in] | inFieldNum | Specifies the c608 caption field of interest. Defaults to NTV2_CC608_Field1. |
|
virtual |
Returns queue information for a given caption channel.
[in] | inChannel | Specifies the CEA608 caption channel of interest. |
[out] | outBytesQueued | Receives the total number of message bytes queued for the given channel. |
[out] | outMessagesQueued | Receives the total number of messages queued for the given channel. |
|
virtual |
Returns stats for a given caption channel.
[in] | inChannel | Specifies the CEA608 caption channel of interest. |
[out] | outEnqueueBytes | Receives the total number of message bytes enqueued for the given channel. |
[out] | outEnqueueMsgs | Receives the total number of messages enqueued for the given channel. |
[out] | outDequeueBytes | Receives the total number of message bytes ever dequeued for the given channel. |
[out] | outDequeueMsgs | Receives the total number of messages dequeued for the given channel. |
|
virtual |
Specifies what, if any, debug information I will write to my log stream.
[in] | inLogMask | A bit mask that specifies what information will be logged. |
Reimplemented from CNTV2CaptionLogConfig.