AJA NTV2 SDK  18.1.0.2439
NTV2 SDK 18.1.0.2439
NTV2StreamPlayer 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 <ntv2streamplayer.h>

Public Member Functions

 NTV2StreamPlayer (const PlayerConfig &inConfig)
 Constructs me using the given configuration settings. More...
 
virtual ~NTV2StreamPlayer (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 bool IsRunning (void) const
 
virtual void GetStreamStatus (NTV2StreamChannel &outStatus)
 Provides status information about my output (playout) process. More...
 

Protected Member Functions

virtual AJAStatus SetUpVideo (void)
 Performs all video 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...
 

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 ntv2streamplayer.h.

Constructor & Destructor Documentation

◆ NTV2StreamPlayer()

NTV2StreamPlayer::NTV2StreamPlayer ( 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 28 of file ntv2streamplayer.cpp.

◆ ~NTV2StreamPlayer()

NTV2StreamPlayer::~NTV2StreamPlayer ( void  )
virtual

Definition at line 44 of file ntv2streamplayer.cpp.

Member Function Documentation

◆ ConsumeFrames()

void NTV2StreamPlayer::ConsumeFrames ( void  )
protectedvirtual

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

Definition at line 378 of file ntv2streamplayer.cpp.

◆ ConsumerThreadStatic()

void NTV2StreamPlayer::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 NTV2StreamPlayer instance).

Definition at line 367 of file ntv2streamplayer.cpp.

◆ GetStreamStatus()

void NTV2StreamPlayer::GetStreamStatus ( NTV2StreamChannel &  outStatus)
virtual

Provides status information about my output (playout) process.

Parameters
[out]outStatusReceives the AUTOCIRCULATE_STATUS information.

Definition at line 596 of file ntv2streamplayer.cpp.

◆ Init()

AJAStatus NTV2StreamPlayer::Init ( void  )
virtual

Initializes me and prepares me to Run.

Definition at line 71 of file ntv2streamplayer.cpp.

◆ IsRunning()

virtual bool NTV2StreamPlayer::IsRunning ( void  ) const
inlinevirtual
Returns
True if I'm running; otherwise false.

Definition at line 47 of file ntv2streamplayer.h.

◆ ProduceFrames()

void NTV2StreamPlayer::ProduceFrames ( void  )
protectedvirtual

My producer thread that repeatedly produces video frames.

Definition at line 528 of file ntv2streamplayer.cpp.

◆ ProducerThreadStatic()

void NTV2StreamPlayer::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 NTV2StreamPlayer instance).

Definition at line 519 of file ntv2streamplayer.cpp.

◆ Quit()

void NTV2StreamPlayer::Quit ( void  )
virtual

Gracefully stops me from running.

Definition at line 51 of file ntv2streamplayer.cpp.

◆ RouteOutputSignal()

bool NTV2StreamPlayer::RouteOutputSignal ( void  )
protectedvirtual

Performs all widget/signal routing for playout.

Definition at line 276 of file ntv2streamplayer.cpp.

◆ Run()

AJAStatus NTV2StreamPlayer::Run ( void  )
virtual

Runs me.

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

Definition at line 342 of file ntv2streamplayer.cpp.

◆ SetUpHostBuffers()

AJAStatus NTV2StreamPlayer::SetUpHostBuffers ( void  )
protectedvirtual

Sets up my host video & audio buffers.

Definition at line 199 of file ntv2streamplayer.cpp.

◆ SetUpTestPatternBuffers()

AJAStatus NTV2StreamPlayer::SetUpTestPatternBuffers ( void  )
protectedvirtual

Creates my test pattern buffers.

Definition at line 230 of file ntv2streamplayer.cpp.

◆ SetUpVideo()

AJAStatus NTV2StreamPlayer::SetUpVideo ( void  )
protectedvirtual

Performs all video setup.

Definition at line 142 of file ntv2streamplayer.cpp.

◆ StartConsumerThread()

void NTV2StreamPlayer::StartConsumerThread ( void  )
protectedvirtual

Starts my consumer thread.

Definition at line 356 of file ntv2streamplayer.cpp.

◆ StartProducerThread()

void NTV2StreamPlayer::StartProducerThread ( void  )
protectedvirtual

Starts my producer thread.

Definition at line 509 of file ntv2streamplayer.cpp.


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