AJA NTV2 SDK  17.0.1.1246
NTV2 SDK 17.0.1.1246
NTV2Player Class Reference

I play out SD or HD test pattern (with timecode) to an output of an AJA device with or without audio tone in real time. I make use of the AJACircularBuffer, which simplifies implementing a producer/consumer model, in which a "producer" thread generates the test pattern frames, and a "consumer" thread (i.e., the "play" thread) sends those frames to the AJA device. I also show how to embed timecode into an SDI output signal using AutoCirculate during playout. More...

#include <ntv2player.h>

Public Member Functions

 NTV2Player (const PlayerConfig &inConfig)
 Constructs me using the given configuration settings. More...
 
virtual ~NTV2Player (void)
 
virtual AJAStatus Init (void)
 Initializes me and prepares me to Run. More...
 
virtual AJAStatus Run (void)
 Runs me. More...
 
virtual void Quit (void)
 Gracefully stops me from running. More...
 
virtual void GetACStatus (AUTOCIRCULATE_STATUS &outStatus)
 Provides status information about my output (playout) process. More...
 

Protected Member Functions

virtual AJAStatus SetUpVideo (void)
 Performs all video setup. More...
 
virtual AJAStatus SetUpAudio (void)
 Performs all audio setup. More...
 
virtual bool RouteOutputSignal (void)
 Performs all widget/signal routing for playout. More...
 
virtual AJAStatus SetUpHostBuffers (void)
 Sets up my host video & audio buffers. More...
 
virtual AJAStatus SetUpTestPatternBuffers (void)
 Creates my test pattern buffers. More...
 
virtual void StartConsumerThread (void)
 Starts my consumer thread. More...
 
virtual void ConsumeFrames (void)
 My consumer thread that repeatedly plays frames using AutoCirculate (until quit). More...
 
virtual void StartProducerThread (void)
 Starts my producer thread. More...
 
virtual void ProduceFrames (void)
 My producer thread that repeatedly produces video frames. More...
 
virtual uint32_t AddTone (NTV2FrameData &inFrameData)
 Inserts audio tone (based on my current tone frequency) into the given NTV2FrameData's audio buffer. More...
 
virtual bool OutputDestHasRP188BypassEnabled (const NTV2OutputDestination inOutputDest)
 
virtual void DisableRP188Bypass (const NTV2OutputDestination inOutputDest)
 Disables the given SDI output's RP188 bypass. More...
 

Static Protected Member Functions

static void ConsumerThreadStatic (AJAThread *pThread, void *pContext)
 This is the consumer thread's static callback function that gets called when the consumer thread starts. This function gets "Attached" to the consumer thread's AJAThread instance. More...
 
static void ProducerThreadStatic (AJAThread *pThread, void *pContext)
 This is the producer thread's static callback function that gets called when the producer thread starts. This function gets "Attached" to the producer thread's AJAThread instance. More...
 

Detailed Description

I play out SD or HD test pattern (with timecode) to an output of an AJA device with or without audio tone in real time. I make use of the AJACircularBuffer, which simplifies implementing a producer/consumer model, in which a "producer" thread generates the test pattern frames, and a "consumer" thread (i.e., the "play" thread) sends those frames to the AJA device. I also show how to embed timecode into an SDI output signal using AutoCirculate during playout.

Definition at line 24 of file ntv2player.h.

Constructor & Destructor Documentation

◆ NTV2Player()

NTV2Player::NTV2Player ( const PlayerConfig inConfig)

Constructs me using the given configuration settings.

Note
I'm not completely initialized and ready for use until after my Init method has been called.
Parameters
[in]inConfigSpecifies all configuration parameters.

Definition at line 56 of file ntv2player.cpp.

◆ ~NTV2Player()

NTV2Player::~NTV2Player ( void  )
virtual

Definition at line 77 of file ntv2player.cpp.

Member Function Documentation

◆ AddTone()

uint32_t NTV2Player::AddTone ( NTV2FrameData inFrameData)
protectedvirtual

Inserts audio tone (based on my current tone frequency) into the given NTV2FrameData's audio buffer.

Parameters
inFrameDataThe NTV2FrameData object having the audio buffer to be filled.
Returns
Total number of bytes written into the buffer.

Definition at line 745 of file ntv2player.cpp.

◆ ConsumeFrames()

void NTV2Player::ConsumeFrames ( void  )
protectedvirtual

My consumer thread that repeatedly plays frames using AutoCirculate (until quit).

Definition at line 508 of file ntv2player.cpp.

◆ ConsumerThreadStatic()

void NTV2Player::ConsumerThreadStatic ( AJAThread pThread,
void *  pContext 
)
staticprotected

This is the consumer thread's static callback function that gets called when the consumer thread starts. This function gets "Attached" to the consumer thread's AJAThread instance.

Parameters
[in]pThreadA valid pointer to the consumer thread's AJAThread instance.
[in]pContextContext information to pass to the thread (the NTV2Player instance).

Definition at line 497 of file ntv2player.cpp.

◆ DisableRP188Bypass()

void NTV2Player::DisableRP188Bypass ( const NTV2OutputDestination  inOutputDest)
protectedvirtual

Disables the given SDI output's RP188 bypass.

Parameters
[in]inOutputDestSpecifies the NTV2OutputDestination of interest.

Definition at line 821 of file ntv2player.cpp.

◆ GetACStatus()

void NTV2Player::GetACStatus ( AUTOCIRCULATE_STATUS outStatus)
virtual

Provides status information about my output (playout) process.

Parameters
[out]outStatusReceives the AUTOCIRCULATE_STATUS information.

Definition at line 781 of file ntv2player.cpp.

◆ Init()

AJAStatus NTV2Player::Init ( void  )
virtual

Initializes me and prepares me to Run.

Definition at line 109 of file ntv2player.cpp.

◆ OutputDestHasRP188BypassEnabled()

bool NTV2Player::OutputDestHasRP188BypassEnabled ( const NTV2OutputDestination  inOutputDest)
protectedvirtual
Returns
True if the given output destination's RP188 bypass is enabled; otherwise false.
Parameters
[in]inOutputDestSpecifies the NTV2OutputDestination of interest.

Definition at line 805 of file ntv2player.cpp.

◆ ProduceFrames()

void NTV2Player::ProduceFrames ( void  )
protectedvirtual

My producer thread that repeatedly produces video frames.

Definition at line 671 of file ntv2player.cpp.

◆ ProducerThreadStatic()

void NTV2Player::ProducerThreadStatic ( AJAThread pThread,
void *  pContext 
)
staticprotected

This is the producer thread's static callback function that gets called when the producer thread starts. This function gets "Attached" to the producer thread's AJAThread instance.

Parameters
[in]pThreadA valid pointer to the producer thread's AJAThread instance.
[in]pContextContext information to pass to the thread (the NTV2Player instance).

Definition at line 662 of file ntv2player.cpp.

◆ Quit()

void NTV2Player::Quit ( void  )
virtual

Gracefully stops me from running.

Definition at line 86 of file ntv2player.cpp.

◆ RouteOutputSignal()

bool NTV2Player::RouteOutputSignal ( void  )
protectedvirtual

Performs all widget/signal routing for playout.

Definition at line 391 of file ntv2player.cpp.

◆ Run()

AJAStatus NTV2Player::Run ( void  )
virtual

Runs me.

Note
Do not call this method without first calling my Init method.

Definition at line 472 of file ntv2player.cpp.

◆ SetUpAudio()

AJAStatus NTV2Player::SetUpAudio ( void  )
protectedvirtual

Performs all audio setup.

Definition at line 251 of file ntv2player.cpp.

◆ SetUpHostBuffers()

AJAStatus NTV2Player::SetUpHostBuffers ( void  )
protectedvirtual

Sets up my host video & audio buffers.

Definition at line 295 of file ntv2player.cpp.

◆ SetUpTestPatternBuffers()

AJAStatus NTV2Player::SetUpTestPatternBuffers ( void  )
protectedvirtual

Creates my test pattern buffers.

Definition at line 340 of file ntv2player.cpp.

◆ SetUpVideo()

AJAStatus NTV2Player::SetUpVideo ( void  )
protectedvirtual

Performs all video setup.

Definition at line 183 of file ntv2player.cpp.

◆ StartConsumerThread()

void NTV2Player::StartConsumerThread ( void  )
protectedvirtual

Starts my consumer thread.

Definition at line 486 of file ntv2player.cpp.

◆ StartProducerThread()

void NTV2Player::StartProducerThread ( void  )
protectedvirtual

Starts my producer thread.

Definition at line 652 of file ntv2player.cpp.


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