AJA NTV2 SDK  17.5.0.1242
NTV2 SDK 17.5.0.1242
NTV2DolbyPlayer Class Reference

I am similar to NTV2Player, but I demonstrate how to play/output 8 channels of audio tone (or ramp data, or Dolby audio read from a binary data file) to an AJA device's HDMI output. More...

#include <ntv2dolbyplayer.h>

Classes

struct  NTV2DolbyBSI
 

Public Member Functions

 NTV2DolbyPlayer (const DolbyPlayerConfig &inConfigData)
 Constructs me using the given configuration settings. More...
 
virtual ~NTV2DolbyPlayer (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 uint32_t AddRamp (NTV2FrameData &inFrameData)
 Inserts audio test ramp into the given NTV2FrameData's audio buffer. More...
 
virtual uint32_t AddDolby (NTV2FrameData &inFrameData)
 Inserts dolby audio into the given NTV2FrameData's audio buffer. More...
 
virtual bool GetDolbyFrame (uint16_t *pInDolbyBuffer, uint32_t &numSamples)
 Get a dolby audio frame from the input file. More...
 
virtual bool ParseBSI (uint16_t *pInDolbyBuffer, uint32_t numSamples, NTV2DolbyBSI *pBsi)
 Parse the dolby audio bit stream information block. More...
 
virtual void SetBitBuffer (uint8_t *pBuffer, uint32_t size)
 Set the bitstream buffer for bit retrieval. More...
 
virtual bool GetBits (uint32_t &data, uint32_t inBitCount)
 Retreive the specified number of bits from the bitstream buffer. 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 am similar to NTV2Player, but I demonstrate how to play/output 8 channels of audio tone (or ramp data, or Dolby audio read from a binary data file) to an AJA device's HDMI output.

Definition at line 52 of file ntv2dolbyplayer.h.

Constructor & Destructor Documentation

◆ NTV2DolbyPlayer()

NTV2DolbyPlayer::NTV2DolbyPlayer ( const DolbyPlayerConfig inConfigData)

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]inConfigDataSpecifies the player configuration.

Definition at line 54 of file ntv2dolbyplayer.cpp.

◆ ~NTV2DolbyPlayer()

NTV2DolbyPlayer::~NTV2DolbyPlayer ( void  )
virtual

Definition at line 85 of file ntv2dolbyplayer.cpp.

Member Function Documentation

◆ AddDolby()

uint32_t NTV2DolbyPlayer::AddDolby ( NTV2FrameData inFrameData)
protectedvirtual

Inserts dolby audio into the given NTV2FrameData's audio buffer.

Parameters
[out]audioBufferSpecifies a valid, non-NULL pointer to the buffer that is to receive the audio tone data.
Returns
Total number of bytes written into the buffer.

Definition at line 705 of file ntv2dolbyplayer.cpp.

◆ AddRamp()

uint32_t NTV2DolbyPlayer::AddRamp ( NTV2FrameData inFrameData)
protectedvirtual

Inserts audio test ramp into the given NTV2FrameData's audio buffer.

Parameters
inFrameDataThe NTV2FrameData object having the audio buffer that is to receive the audio ramp data.
Returns
Total number of bytes written into the buffer.

Definition at line 674 of file ntv2dolbyplayer.cpp.

◆ AddTone()

uint32_t NTV2DolbyPlayer::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 639 of file ntv2dolbyplayer.cpp.

◆ ConsumeFrames()

void NTV2DolbyPlayer::ConsumeFrames ( void  )
protectedvirtual

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

Definition at line 457 of file ntv2dolbyplayer.cpp.

◆ ConsumerThreadStatic()

void NTV2DolbyPlayer::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. (For this application, this will be set to point to the NTV2DolbyPlayer instance.)

Definition at line 446 of file ntv2dolbyplayer.cpp.

◆ GetACStatus()

void NTV2DolbyPlayer::GetACStatus ( AUTOCIRCULATE_STATUS outStatus)
virtual

Provides status information about my output (playout) process.

Parameters
[out]outStatusReceives the AUTOCIRCULATE_STATUS information.

Definition at line 633 of file ntv2dolbyplayer.cpp.

◆ GetBits()

bool NTV2DolbyPlayer::GetBits ( uint32_t &  data,
uint32_t  inBitCount 
)
protectedvirtual

Retreive the specified number of bits from the bitstream buffer.

Parameters
dataBitstream data
[in]inBitCountNumber of bits to retrieve from the buffer
Returns
True if suceeded.

Definition at line 1269 of file ntv2dolbyplayer.cpp.

◆ GetDolbyFrame()

bool NTV2DolbyPlayer::GetDolbyFrame ( uint16_t *  pInDolbyBuffer,
uint32_t &  numSamples 
)
protectedvirtual

Get a dolby audio frame from the input file.

Parameters
[out]pInDolbyBufferSpecifies a valid, non-NULL pointer to the buffer that is to receive the dolby frame data.
[out]numSamplesNumber of samples in the buffer.
Returns
True if valid sync frame in buffer.

Definition at line 909 of file ntv2dolbyplayer.cpp.

◆ Init()

AJAStatus NTV2DolbyPlayer::Init ( void  )
virtual

Initializes me and prepares me to Run.

Definition at line 134 of file ntv2dolbyplayer.cpp.

◆ ParseBSI()

bool NTV2DolbyPlayer::ParseBSI ( uint16_t *  pInDolbyBuffer,
uint32_t  numSamples,
NTV2DolbyBSI pBsi 
)
protectedvirtual

Parse the dolby audio bit stream information block.

Parameters
[out]pInDolbyBufferSpecifies a valid, non-NULL pointer to the buffer that is to receive the dolby frame data.
[out]numSamplesNumber of samples in the buffer.
[out]pBsiParsed Dolby header data.
Returns
True if parser suceeded.

Definition at line 952 of file ntv2dolbyplayer.cpp.

◆ ProduceFrames()

void NTV2DolbyPlayer::ProduceFrames ( void  )
protectedvirtual

My producer thread that repeatedly produces video frames.

Definition at line 559 of file ntv2dolbyplayer.cpp.

◆ ProducerThreadStatic()

void NTV2DolbyPlayer::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. (For this application, this will be set to point to the NTV2DolbyPlayer instance.)

Definition at line 549 of file ntv2dolbyplayer.cpp.

◆ Quit()

void NTV2DolbyPlayer::Quit ( void  )
virtual

Gracefully stops me from running.

Definition at line 107 of file ntv2dolbyplayer.cpp.

◆ RouteOutputSignal()

bool NTV2DolbyPlayer::RouteOutputSignal ( void  )
protectedvirtual

Performs all widget/signal routing for playout.

Definition at line 408 of file ntv2dolbyplayer.cpp.

◆ Run()

AJAStatus NTV2DolbyPlayer::Run ( void  )
virtual

Runs me.

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

Definition at line 421 of file ntv2dolbyplayer.cpp.

◆ SetBitBuffer()

void NTV2DolbyPlayer::SetBitBuffer ( uint8_t *  pBuffer,
uint32_t  size 
)
protectedvirtual

Set the bitstream buffer for bit retrieval.

Parameters
[in]pBufferSpecifies a valid, non-NULL pointer to the bitstream buffer
[in]sizeBitstream buffer size

Definition at line 1262 of file ntv2dolbyplayer.cpp.

◆ SetUpAudio()

AJAStatus NTV2DolbyPlayer::SetUpAudio ( void  )
protectedvirtual

Performs all audio setup.

Definition at line 265 of file ntv2dolbyplayer.cpp.

◆ SetUpHostBuffers()

AJAStatus NTV2DolbyPlayer::SetUpHostBuffers ( void  )
protectedvirtual

Sets up my host video & audio buffers.

Definition at line 301 of file ntv2dolbyplayer.cpp.

◆ SetUpTestPatternBuffers()

AJAStatus NTV2DolbyPlayer::SetUpTestPatternBuffers ( void  )
protectedvirtual

Creates my test pattern buffers.

Definition at line 357 of file ntv2dolbyplayer.cpp.

◆ SetUpVideo()

AJAStatus NTV2DolbyPlayer::SetUpVideo ( void  )
protectedvirtual

Performs all video setup.

Definition at line 218 of file ntv2dolbyplayer.cpp.

◆ StartConsumerThread()

void NTV2DolbyPlayer::StartConsumerThread ( void  )
protectedvirtual

Starts my consumer thread.

Definition at line 435 of file ntv2dolbyplayer.cpp.

◆ StartProducerThread()

void NTV2DolbyPlayer::StartProducerThread ( void  )
protectedvirtual

Starts my producer thread.

Definition at line 539 of file ntv2dolbyplayer.cpp.


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