AJA NTV2 SDK  17.0.1.1246
NTV2 SDK 17.0.1.1246
ntv2democommon.h File Reference

This file contains some structures, constants, classes and functions that are used in some of the demo applications. There is nothing magical about anything in this file. What's in here simply works well with the demos. More...

#include "ntv2rp188.h"
#include "ntv2publicinterface.h"
#include "ntv2card.h"
#include "ntv2utils.h"
#include "ajaanc/includes/ancillarydata.h"
#include "ajabase/common/options_popt.h"
#include "ajabase/common/videotypes.h"
#include "ajabase/common/circularbuffer.h"
#include "ajabase/system/debug.h"
#include "ajabase/system/info.h"
#include "ajabase/system/systemtime.h"
#include "ajabase/common/common.h"
#include <algorithm>
#include <string>
Include dependency graph for ntv2democommon.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  AVDataBuffer
 This structure encapsulates the video, audio and anc buffers used in the AutoCirculate demos. These demos use a fixed number (CIRCULAR_BUFFER_SIZE) of these buffers in an AJACircularBuffer, which greatly simplifies processing frames between producer and consumer threads. More...
 
class  NTV2FrameData
 I encapsulate the video, audio and anc host buffers used in the AutoCirculate demos. I'm a more modern version of the AVDataBuffer. More...
 
class  Bouncer< T >
 A handy class that makes it easy to "bounce" an unsigned integer value between a minimum and maximum value using sequential calls to its Next method. More...
 
class  CaptureConfig
 This class is used to configure an NTV2Capture instance. More...
 
struct  PlayerConfig
 Configures an NTV2Player instance. More...
 
struct  BurnConfig
 Configures an NTV2Burn or NTV2FieldBurn instance. More...
 
class  CNTV2DemoCommon
 A set of common convenience functions used by the NTV2 Demonstration Applications. Most are used for converting a command line argument into NTV2VideoFormat, NTV2FrameBufferFormat, etc. types. More...
 
class  CNTV2DemoCommon::Popt
 

Macros

#define CAPFAIL(_expr_)   AJA_sERROR (AJA_DebugUnit_DemoCapture, AJAFUNC << ": " << _expr_)
 
#define CAPWARN(_expr_)   AJA_sWARNING(AJA_DebugUnit_DemoCapture, AJAFUNC << ": " << _expr_)
 
#define CAPDBG(_expr_)   AJA_sDEBUG (AJA_DebugUnit_DemoCapture, AJAFUNC << ": " << _expr_)
 
#define CAPNOTE(_expr_)   AJA_sNOTICE (AJA_DebugUnit_DemoCapture, AJAFUNC << ": " << _expr_)
 
#define CAPINFO(_expr_)   AJA_sINFO (AJA_DebugUnit_DemoCapture, AJAFUNC << ": " << _expr_)
 
#define PLFAIL(_xpr_)   AJA_sERROR (AJA_DebugUnit_DemoPlayout, AJAFUNC << ": " << _xpr_)
 
#define PLWARN(_xpr_)   AJA_sWARNING(AJA_DebugUnit_DemoPlayout, AJAFUNC << ": " << _xpr_)
 
#define PLNOTE(_xpr_)   AJA_sNOTICE (AJA_DebugUnit_DemoPlayout, AJAFUNC << ": " << _xpr_)
 
#define PLINFO(_xpr_)   AJA_sINFO (AJA_DebugUnit_DemoPlayout, AJAFUNC << ": " << _xpr_)
 
#define PLDBG(_xpr_)   AJA_sDEBUG (AJA_DebugUnit_DemoPlayout, AJAFUNC << ": " << _xpr_)
 
#define BURNFAIL(_expr_)   AJA_sERROR (AJA_DebugUnit_Application, AJAFUNC << ": " << _expr_)
 
#define BURNWARN(_expr_)   AJA_sWARNING(AJA_DebugUnit_Application, AJAFUNC << ": " << _expr_)
 
#define BURNDBG(_expr_)   AJA_sDEBUG (AJA_DebugUnit_Application, AJAFUNC << ": " << _expr_)
 
#define BURNNOTE(_expr_)   AJA_sNOTICE (AJA_DebugUnit_Application, AJAFUNC << ": " << _expr_)
 
#define BURNINFO(_expr_)   AJA_sINFO (AJA_DebugUnit_Application, AJAFUNC << ": " << _expr_)
 
#define NTV2_AUDIOSIZE_MAX   (401 * 1024)
 
#define NTV2_ANCSIZE_MAX   (0x2000)
 
#define AJA_NTV2_AUDIO_RECORD_BEGIN
 
#define AJA_NTV2_AUDIO_RECORD_DO
 
#define AJA_NTV2_AUDIO_RECORD_END
 
#define AJA_NTV2_MLAUDIO_RECORD_BEGIN
 
#define AJA_NTV2_MLAUDIO_RECORD_DO
 
#define AJA_NTV2_MLAUDIO_RECORD_END
 

Typedefs

typedef std::vector< NTV2FrameDataNTV2FrameDataArray
 A vector of NTV2FrameData elements. More...
 
typedef NTV2FrameDataArray::iterator NTV2FrameDataArrayIter
 Handy non-const iterator. More...
 
typedef NTV2FrameDataArray::const_iterator NTV2FrameDataArrayConstIter
 Handy const iterator. More...
 
typedef AJACircularBuffer< NTV2FrameData * > FrameDataRingBuffer
 Buffer ring of NTV2FrameData's. More...
 
typedef enum _NTV2VideoFormatKinds NTV2VideoFormatKinds
 
typedef enum _NTV2PixelFormatKinds NTV2PixelFormatKinds
 
typedef enum _NTV2TCIndexKinds NTV2TCIndexKinds
 
typedef struct PlayerConfig PlayerConfig
 Configures an NTV2Player instance. More...
 
typedef struct BurnConfig BurnConfig
 Configures an NTV2Burn or NTV2FieldBurn instance. More...
 

Enumerations

enum  _NTV2VideoFormatKinds {
  VIDEO_FORMATS_ALL = 0xFF, VIDEO_FORMATS_NON_4KUHD = 1, VIDEO_FORMATS_4KUHD = 2, VIDEO_FORMATS_8KUHD2 = 3,
  VIDEO_FORMATS_NONE = 0, VIDEO_FORMATS_UHD2 = VIDEO_FORMATS_8KUHD2, BOTH_VIDEO_FORMATS = VIDEO_FORMATS_ALL, NON_UHD_VIDEO_FORMATS = VIDEO_FORMATS_NON_4KUHD,
  UHD_VIDEO_FORMATS = VIDEO_FORMATS_4KUHD
}
 
enum  _NTV2PixelFormatKinds {
  PIXEL_FORMATS_ALL = 0xFF, PIXEL_FORMATS_RGB = 1, PIXEL_FORMATS_PLANAR = 2, PIXEL_FORMATS_RAW = 4,
  PIXEL_FORMATS_PACKED = 8, PIXEL_FORMATS_ALPHA = 16, PIXEL_FORMATS_NONE = 0
}
 
enum  _NTV2TCIndexKinds {
  TC_INDEXES_ALL = 0xFF, TC_INDEXES_SDI = 1, TC_INDEXES_ANALOG = 2, TC_INDEXES_ATCLTC = 4,
  TC_INDEXES_VITC1 = 8, TC_INDEXES_VITC2 = 16, TC_INDEXES_NONE = 0
}
 

Functions

static const size_t CIRCULAR_BUFFER_SIZE (10)
 Number of NTV2FrameData's in our ring. More...
 
static const ULWord kDemoAppSignature ((((uint32_t)( 'D'))<< 24)|(((uint32_t)( 'E'))<< 16)|(((uint32_t)( 'M'))<< 8)|(((uint32_t)( 'O'))<< 0))
 
std::ostream & operator<< (std::ostream &ioStrm, const CaptureConfig &inObj)
 
std::ostream & operator<< (std::ostream &ioStrm, const PlayerConfig &inObj)
 
std::ostream & operator<< (std::ostream &strm, const BurnConfig &inObj)
 Renders a human-readable representation of a BurnConfig into an output stream. More...
 

Detailed Description

This file contains some structures, constants, classes and functions that are used in some of the demo applications. There is nothing magical about anything in this file. What's in here simply works well with the demos.

Definition in file ntv2democommon.h.

Macro Definition Documentation

◆ AJA_NTV2_AUDIO_RECORD_BEGIN

#define AJA_NTV2_AUDIO_RECORD_BEGIN

Definition at line 872 of file ntv2democommon.h.

◆ AJA_NTV2_AUDIO_RECORD_DO

#define AJA_NTV2_AUDIO_RECORD_DO

Definition at line 873 of file ntv2democommon.h.

◆ AJA_NTV2_AUDIO_RECORD_END

#define AJA_NTV2_AUDIO_RECORD_END

Definition at line 874 of file ntv2democommon.h.

◆ AJA_NTV2_MLAUDIO_RECORD_BEGIN

#define AJA_NTV2_MLAUDIO_RECORD_BEGIN

Definition at line 900 of file ntv2democommon.h.

◆ AJA_NTV2_MLAUDIO_RECORD_DO

#define AJA_NTV2_MLAUDIO_RECORD_DO

Definition at line 901 of file ntv2democommon.h.

◆ AJA_NTV2_MLAUDIO_RECORD_END

#define AJA_NTV2_MLAUDIO_RECORD_END

Definition at line 902 of file ntv2democommon.h.

◆ BURNDBG

#define BURNDBG (   _expr_)    AJA_sDEBUG (AJA_DebugUnit_Application, AJAFUNC << ": " << _expr_)

Definition at line 42 of file ntv2democommon.h.

◆ BURNFAIL

#define BURNFAIL (   _expr_)    AJA_sERROR (AJA_DebugUnit_Application, AJAFUNC << ": " << _expr_)

Definition at line 40 of file ntv2democommon.h.

◆ BURNINFO

#define BURNINFO (   _expr_)    AJA_sINFO (AJA_DebugUnit_Application, AJAFUNC << ": " << _expr_)

Definition at line 44 of file ntv2democommon.h.

◆ BURNNOTE

#define BURNNOTE (   _expr_)    AJA_sNOTICE (AJA_DebugUnit_Application, AJAFUNC << ": " << _expr_)

Definition at line 43 of file ntv2democommon.h.

◆ BURNWARN

#define BURNWARN (   _expr_)    AJA_sWARNING(AJA_DebugUnit_Application, AJAFUNC << ": " << _expr_)

Definition at line 41 of file ntv2democommon.h.

◆ CAPDBG

#define CAPDBG (   _expr_)    AJA_sDEBUG (AJA_DebugUnit_DemoCapture, AJAFUNC << ": " << _expr_)

Definition at line 30 of file ntv2democommon.h.

◆ CAPFAIL

#define CAPFAIL (   _expr_)    AJA_sERROR (AJA_DebugUnit_DemoCapture, AJAFUNC << ": " << _expr_)

Definition at line 28 of file ntv2democommon.h.

◆ CAPINFO

#define CAPINFO (   _expr_)    AJA_sINFO (AJA_DebugUnit_DemoCapture, AJAFUNC << ": " << _expr_)

Definition at line 32 of file ntv2democommon.h.

◆ CAPNOTE

#define CAPNOTE (   _expr_)    AJA_sNOTICE (AJA_DebugUnit_DemoCapture, AJAFUNC << ": " << _expr_)

Definition at line 31 of file ntv2democommon.h.

◆ CAPWARN

#define CAPWARN (   _expr_)    AJA_sWARNING(AJA_DebugUnit_DemoCapture, AJAFUNC << ": " << _expr_)

Definition at line 29 of file ntv2democommon.h.

◆ NTV2_ANCSIZE_MAX

#define NTV2_ANCSIZE_MAX   (0x2000)

Definition at line 47 of file ntv2democommon.h.

◆ NTV2_AUDIOSIZE_MAX

#define NTV2_AUDIOSIZE_MAX   (401 * 1024)

Definition at line 46 of file ntv2democommon.h.

◆ PLDBG

#define PLDBG (   _xpr_)    AJA_sDEBUG (AJA_DebugUnit_DemoPlayout, AJAFUNC << ": " << _xpr_)

Definition at line 38 of file ntv2democommon.h.

◆ PLFAIL

#define PLFAIL (   _xpr_)    AJA_sERROR (AJA_DebugUnit_DemoPlayout, AJAFUNC << ": " << _xpr_)

Definition at line 34 of file ntv2democommon.h.

◆ PLINFO

#define PLINFO (   _xpr_)    AJA_sINFO (AJA_DebugUnit_DemoPlayout, AJAFUNC << ": " << _xpr_)

Definition at line 37 of file ntv2democommon.h.

◆ PLNOTE

#define PLNOTE (   _xpr_)    AJA_sNOTICE (AJA_DebugUnit_DemoPlayout, AJAFUNC << ": " << _xpr_)

Definition at line 36 of file ntv2democommon.h.

◆ PLWARN

#define PLWARN (   _xpr_)    AJA_sWARNING(AJA_DebugUnit_DemoPlayout, AJAFUNC << ": " << _xpr_)

Definition at line 35 of file ntv2democommon.h.

Typedef Documentation

◆ BurnConfig

typedef struct BurnConfig BurnConfig

Configures an NTV2Burn or NTV2FieldBurn instance.

◆ FrameDataRingBuffer

Buffer ring of NTV2FrameData's.

Definition at line 155 of file ntv2democommon.h.

◆ NTV2FrameDataArray

typedef std::vector<NTV2FrameData> NTV2FrameDataArray

A vector of NTV2FrameData elements.

Definition at line 152 of file ntv2democommon.h.

◆ NTV2FrameDataArrayConstIter

typedef NTV2FrameDataArray::const_iterator NTV2FrameDataArrayConstIter

Handy const iterator.

Definition at line 154 of file ntv2democommon.h.

◆ NTV2FrameDataArrayIter

typedef NTV2FrameDataArray::iterator NTV2FrameDataArrayIter

Handy non-const iterator.

Definition at line 153 of file ntv2democommon.h.

◆ NTV2PixelFormatKinds

◆ NTV2TCIndexKinds

◆ NTV2VideoFormatKinds

◆ PlayerConfig

typedef struct PlayerConfig PlayerConfig

Configures an NTV2Player instance.

Enumeration Type Documentation

◆ _NTV2PixelFormatKinds

Enumerator
PIXEL_FORMATS_ALL 
PIXEL_FORMATS_RGB 
PIXEL_FORMATS_PLANAR 
PIXEL_FORMATS_RAW 
PIXEL_FORMATS_PACKED 
PIXEL_FORMATS_ALPHA 
PIXEL_FORMATS_NONE 

Definition at line 238 of file ntv2democommon.h.

◆ _NTV2TCIndexKinds

Enumerator
TC_INDEXES_ALL 
TC_INDEXES_SDI 
TC_INDEXES_ANALOG 
TC_INDEXES_ATCLTC 
TC_INDEXES_VITC1 
TC_INDEXES_VITC2 
TC_INDEXES_NONE 

Definition at line 250 of file ntv2democommon.h.

◆ _NTV2VideoFormatKinds

Enumerator
VIDEO_FORMATS_ALL 
VIDEO_FORMATS_NON_4KUHD 
VIDEO_FORMATS_4KUHD 
VIDEO_FORMATS_8KUHD2 
VIDEO_FORMATS_NONE 
VIDEO_FORMATS_UHD2 
BOTH_VIDEO_FORMATS 
NON_UHD_VIDEO_FORMATS 
UHD_VIDEO_FORMATS 

Definition at line 222 of file ntv2democommon.h.

Function Documentation

◆ CIRCULAR_BUFFER_SIZE()

static const size_t CIRCULAR_BUFFER_SIZE ( 10  )
static

Number of NTV2FrameData's in our ring.

◆ kDemoAppSignature()

static const ULWord kDemoAppSignature ( (((uint32_t)('D'))<< 24)|(((uint32_t)('E'))<< 16)|(((uint32_t)('M'))<< 8)|(((uint32_t)('O'))<< 0)  )
static

◆ operator<<() [1/3]

std::ostream& operator<< ( std::ostream &  ioStrm,
const CaptureConfig inObj 
)

Definition at line 1705 of file ntv2democommon.cpp.

◆ operator<<() [2/3]

std::ostream& operator<< ( std::ostream &  ioStrm,
const PlayerConfig inObj 
)

Definition at line 1742 of file ntv2democommon.cpp.

◆ operator<<() [3/3]

std::ostream& operator<< ( std::ostream &  strm,
const BurnConfig inObj 
)
inline

Renders a human-readable representation of a BurnConfig into an output stream.

Parameters
strmThe output stream.
[in]inObjThe configuration to be rendered into the output stream.
Returns
A reference to the specified output stream.

Definition at line 439 of file ntv2democommon.h.