AJA NTV2 SDK  17.0.1.1246
NTV2 SDK 17.0.1.1246
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 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 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...
 

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 56 of file ntv2streamplayer.cpp.

◆ ~NTV2StreamPlayer()

NTV2StreamPlayer::~NTV2StreamPlayer ( void  )
virtual

Definition at line 77 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 498 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 487 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 667 of file ntv2streamplayer.cpp.

◆ Init()

AJAStatus NTV2StreamPlayer::Init ( void  )
virtual

Initializes me and prepares me to Run.

Definition at line 109 of file ntv2streamplayer.cpp.

◆ ProduceFrames()

void NTV2StreamPlayer::ProduceFrames ( void  )
protectedvirtual

My producer thread that repeatedly produces video frames.

Definition at line 634 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 625 of file ntv2streamplayer.cpp.

◆ Quit()

void NTV2StreamPlayer::Quit ( void  )
virtual

Gracefully stops me from running.

Definition at line 86 of file ntv2streamplayer.cpp.

◆ RouteOutputSignal()

bool NTV2StreamPlayer::RouteOutputSignal ( void  )
protectedvirtual

Performs all widget/signal routing for playout.

Definition at line 393 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 462 of file ntv2streamplayer.cpp.

◆ SetUpAudio()

AJAStatus NTV2StreamPlayer::SetUpAudio ( void  )
protectedvirtual

Performs all audio setup.

Definition at line 250 of file ntv2streamplayer.cpp.

◆ SetUpHostBuffers()

AJAStatus NTV2StreamPlayer::SetUpHostBuffers ( void  )
protectedvirtual

Sets up my host video & audio buffers.

Definition at line 294 of file ntv2streamplayer.cpp.

◆ SetUpTestPatternBuffers()

AJAStatus NTV2StreamPlayer::SetUpTestPatternBuffers ( void  )
protectedvirtual

Creates my test pattern buffers.

Definition at line 341 of file ntv2streamplayer.cpp.

◆ SetUpVideo()

AJAStatus NTV2StreamPlayer::SetUpVideo ( void  )
protectedvirtual

Performs all video setup.

Definition at line 181 of file ntv2streamplayer.cpp.

◆ StartConsumerThread()

void NTV2StreamPlayer::StartConsumerThread ( void  )
protectedvirtual

Starts my consumer thread.

Definition at line 476 of file ntv2streamplayer.cpp.

◆ StartProducerThread()

void NTV2StreamPlayer::StartProducerThread ( void  )
protectedvirtual

Starts my producer thread.

Definition at line 615 of file ntv2streamplayer.cpp.


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