AJA NTV2 SDK  17.1.1.1245
NTV2 SDK 17.1.1.1245
CNTV2CaptionLogConfig Class Reference

#include <ntv2captionlogging.h>

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

Public Member Functions

 CNTV2CaptionLogConfig (const std::string inLogLabel=std::string())
 Default constructor. More...
 
virtual ~CNTV2CaptionLogConfig ()
 
virtual NTV2CaptionLogMask SetLogMask (const NTV2CaptionLogMask inLogMask)
 Specifies what, if any, debug information I will write to my log stream. More...
 
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 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)
 

Protected Attributes

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 77 of file ntv2captionlogging.h.

Constructor & Destructor Documentation

◆ CNTV2CaptionLogConfig()

CNTV2CaptionLogConfig::CNTV2CaptionLogConfig ( const std::string  inLogLabel = std::string())

Default constructor.

Parameters
[in]inLogLabelOptionally specifies a label for this instance's log output.

◆ ~CNTV2CaptionLogConfig()

virtual CNTV2CaptionLogConfig::~CNTV2CaptionLogConfig ( )
virtual

Member Function Documentation

◆ AppendToLogLabel()

virtual void CNTV2CaptionLogConfig::AppendToLogLabel ( const std::string &  inString)
virtual

Appends the given string to my current log label.

Parameters
[in]inStringSpecifies the string to append to my current log label.

◆ DumpMemory()

static std::ostream& CNTV2CaptionLogConfig::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 
)
static

Dumps a contiguous chunk of memory in hex, octal, decimal, with or without ascii, to the given output stream.

Parameters
pInStartAddressA valid, non-NULL pointer to the start of the host memory to be dumped.
inByteCountThe number of bytes to be dumped.
inOutputStreamOutput stream that will receive the dump.
inRadix16=hex, 10=decimal, 8=octal, 2=binary – all others disallowed.
inBytesPerGroupNumber of bytes to dump per contiguous group of numbers.
inGroupsPerLineNumber of contiguous groups of numbers to dump per output line. If zero, no grouping is done, and address & ASCII display is suppressed.
inAddressRadix0=omit, 2=binary, 8=octal, 10=decimal, 16=hex – all others disallowed.
inShowAsciiTrue = also dump ASCII characters; false = don't dump ASCII characters. Overridden to false if inGroupsPerLine is zero.
inAddrOffsetSpecifies a value to be added to the addresses that appear in the dump. Ignored if inGroupsPerLine is zero.
Returns
A non-constant reference to the output stream that received the dump.

◆ DumpYBytes_2vuy() [1/2]

static std::ostream& CNTV2CaptionLogConfig::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 
)
static

Dumps the luma values in hexadecimal from the given line of '2vuy' video to the given output stream.

Parameters
inVideoLineA vector of 8-bit values comprising the '2vuy' video line. It is assumed this is SD video, and the line width is at least 720 pixels (1440 elements).
inOutputStreamSpecifies the output stream that will receive the dump.
inFromPixelSpecifies starting pixel, a zero-based index. Defaults to the first pixel in the line.
inToPixelSpecifies the last pixel to appear in the dump, a zero-based index. Defaults to the last pixel in the line (assuming 720 pixel SD).
inShowRulerIf true, precedes the dump with a "ruler" to indicate pixel locations. Defaults to true.
inHiliteRangeFromSpecifies the starting pixel to hilight, a zero-based pixel index. Defaults to 9999, which indicates no highlighting should appear in the dump. If this value matches inHiliteRangeTo, only a single pixel will be highlighted.
inHiliteRangeToSpecifies the last pixel to hilight, a zero-based pixel index. Defaults to 9999, which indicates no highlighting should appear in the dump. If this value matches inHiliteRangeFrom, only a single pixel will be highlighted.
Returns
A non-constant reference to the output stream that received the dump.

◆ DumpYBytes_2vuy() [2/2]

static std::ostream& CNTV2CaptionLogConfig::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 
)
static

Dumps the luma values in hexadecimal from the given line of '2vuy' video to the given output stream.

Parameters
pInVideoLineA valid, non-NULL pointer to the first byte of the line of '2vuy' video in host memory. It is assumed this is SD video, and the line width is at least 720 pixels.
inOutputStreamSpecifies the output stream that will receive the dump.
inFromPixelSpecifies starting pixel, a zero-based index. Defaults to the first pixel in the line.
inToPixelSpecifies the last pixel to appear in the dump, a zero-based index. Defaults to the last pixel in the line (assuming 720 pixel SD).
inShowRulerIf true, precedes the dump with a "ruler" to indicate pixel locations. Defaults to true.
inHiliteRangeFromSpecifies the starting pixel to hilight, a zero-based pixel index. Defaults to 9999, which indicates no highlighting should appear in the dump. If this value matches inHiliteRangeTo, only a single pixel will be highlighted.
inHiliteRangeToSpecifies the last pixel to hilight, a zero-based pixel index. Defaults to 9999, which indicates no highlighting should appear in the dump. If this value matches inHiliteRangeFrom, only a single pixel will be highlighted.
Returns
A non-constant reference to the output stream that received the dump.

◆ GetLogLabel()

virtual const std::string& CNTV2CaptionLogConfig::GetLogLabel ( void  ) const
virtual

Answers with my current logging label.

Returns
My current logging label.

◆ GetLogMask()

virtual NTV2CaptionLogMask CNTV2CaptionLogConfig::GetLogMask ( void  ) const
inlinevirtual

Answers with my current caption logging bit mask.

Returns
My current caption logging mask.

Definition at line 193 of file ntv2captionlogging.h.

◆ GetSeverityLabel()

static std::string CNTV2CaptionLogConfig::GetSeverityLabel ( const unsigned  inSeverity)
static

◆ HexDump32Bytes()

static std::string CNTV2CaptionLogConfig::HexDump32Bytes ( const void *  pInStartAddress,
const size_t  inByteCount,
const size_t  inLimitBytes = 32 
)
static
Returns
A string containing a hex dump of up to 32 bytes from the given buffer.
Parameters
pInStartAddressA valid, non-NULL pointer to the start of the host memory to be dumped.
inByteCountThe maximum number of bytes from the buffer to be dumped.
inLimitBytesThe maximum number of bytes to be dumped. Defaults to 32.

◆ Log()

virtual std::ostream& CNTV2CaptionLogConfig::Log ( void  ) const
virtual
Deprecated:
Obsolete – now uses the AJALogger

◆ LogIf()

virtual std::ostream& CNTV2CaptionLogConfig::LogIf ( const NTV2CaptionLogMask  inLogMask) const
virtual
Deprecated:
Obsolete – now uses the AJALogger

◆ SetLogLabel()

virtual void CNTV2CaptionLogConfig::SetLogLabel ( const std::string &  inNewLabel)
virtual

Specifies my logging label.

Parameters
[in]inNewLabelSpecifies my new logging label.

◆ SetLogMask()

virtual NTV2CaptionLogMask CNTV2CaptionLogConfig::SetLogMask ( const NTV2CaptionLogMask  inLogMask)
inlinevirtual

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 in CNTV2CaptionEncoder708, CNTV2CaptionEncoder608, CNTV2CaptionDecoder608, CNTV2CaptionDecoder708, CNTV2Caption708Service, CNTV2CaptionTranslator608to708, and CNTV2CaptionTranslator708to708.

Definition at line 187 of file ntv2captionlogging.h.

◆ SetLogStream()

virtual void CNTV2CaptionLogConfig::SetLogStream ( std::ostream &  inOutputStream)
virtual
Deprecated:
Obsolete – now uses the AJALogger

◆ TestLogMask()

virtual bool CNTV2CaptionLogConfig::TestLogMask ( const NTV2CaptionLogMask  inLogMask,
const bool  inExact = false 
) const
inlinevirtual

Answers true if the given log mask bits are set in my current log mask.

Parameters
[in]inLogMaskSpecifies the log mask bits of interest.
[in]inExactIf true, the log mask must match exactly; otherwise any matching bit will constitute a match. Defaults to false (any matching bit).
Returns
True if all given log mask bits are set; otherwise false.

Definition at line 202 of file ntv2captionlogging.h.

Member Data Documentation

◆ mLogLabel

std::string CNTV2CaptionLogConfig::mLogLabel
protected

My debug label.

Definition at line 232 of file ntv2captionlogging.h.

◆ mLogMask

NTV2CaptionLogMask CNTV2CaptionLogConfig::mLogMask
protected

Determines what messages are logged.

Definition at line 231 of file ntv2captionlogging.h.

◆ mpLabelLock

void* CNTV2CaptionLogConfig::mpLabelLock
mutableprotected

Protects my debug label from simultaneous access by more than one thread.

Definition at line 233 of file ntv2captionlogging.h.


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