I am an object that can play out a 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 demonstrate how to embed timecode into an SDI output signal using AutoCirculate during playout.
More...
#include <ntv2dolbyplayer.h>
I am an object that can play out a 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 demonstrate how to embed timecode into an SDI output signal using AutoCirculate during playout.
Definition at line 30 of file ntv2dolbyplayer.h.
◆ NTV2DolbyPlayer()
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] | inDeviceSpecifier | Specifies the AJA device to use. Defaults to "0", the first device found. |
[in] | inWithAudio | If true, include audio tone in the output signal; otherwise, omit it. Defaults to "true". |
[in] | inChannel | Specifies the channel to use. Defaults to NTV2_CHANNEL1. |
[in] | inPixelFormat | Specifies the pixel format to use for the device's frame buffers. Defaults to 8-bit YUV. |
[in] | inVideoFormat | Specifies the video format to use. Defaults to 1080i5994. |
[in] | inDoMultiFormat | If true, use multi-format mode; otherwise use uniformat mode. Defaults to false (uniformat mode). |
Definition at line 53 of file ntv2dolbyplayer.cpp.
◆ ~NTV2DolbyPlayer()
NTV2DolbyPlayer::~NTV2DolbyPlayer |
( |
void |
| ) |
|
|
virtual |
◆ AddDolby()
uint32_t NTV2DolbyPlayer::AddDolby |
( |
ULWord * |
audioBuffer | ) |
|
|
protectedvirtual |
Inserts dolby audio into the given audio buffer.
- Parameters
-
[out] | audioBuffer | Specifies 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 676 of file ntv2dolbyplayer.cpp.
◆ AddRamp()
uint32_t NTV2DolbyPlayer::AddRamp |
( |
ULWord * |
audioBuffer | ) |
|
|
protectedvirtual |
Inserts audio test ramp into the given audio buffer.
- Parameters
-
[out] | audioBuffer | Specifies a valid, non-NULL pointer to the buffer that is to receive the audio ramp data. |
- Returns
- Total number of bytes written into the buffer.
Definition at line 645 of file ntv2dolbyplayer.cpp.
◆ AddTone()
uint32_t NTV2DolbyPlayer::AddTone |
( |
ULWord * |
audioBuffer | ) |
|
|
protectedvirtual |
Inserts audio tone (based on my current tone frequency) into the given audio buffer.
- Parameters
-
[out] | audioBuffer | Specifies 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 610 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] | pThread | A valid pointer to the consumer thread's AJAThread instance. |
[in] | pContext | Context information to pass to the thread. (For this application, this will be set to point to the NTV2DolbyPlayer instance.) |
Definition at line 390 of file ntv2dolbyplayer.cpp.
◆ GetACStatus()
void NTV2DolbyPlayer::GetACStatus |
( |
ULWord & |
outGoodFrames, |
|
|
ULWord & |
outDroppedFrames, |
|
|
ULWord & |
outBufferLevel |
|
) |
| |
|
virtual |
Provides status information about my output (playout) process.
- Parameters
-
[out] | outGoodFrames | Receives the number of successfully played frames. |
[out] | outDroppedFrames | Receives the number of dropped frames. |
[out] | outBufferLevel | Receives the driver's current buffer level. |
Definition at line 600 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
-
| data | Bitstream data |
[in] | inBitCount | Number of bits to retrieve from the buffer |
- Returns
- True if suceeded.
Definition at line 1239 of file ntv2dolbyplayer.cpp.
◆ GetDolbyFrame()
bool NTV2DolbyPlayer::GetDolbyFrame |
( |
uint16_t * |
pInDolbyBuffer, |
|
|
uint32_t & |
numSamples |
|
) |
| |
|
protectedvirtual |
Get a dolby audio audio frame from the input file.
- Parameters
-
[out] | pInDolbyBuffer | Specifies a valid, non-NULL pointer to the buffer that is to receive the dolby frame data. |
[out] | numSamples | Number of samples in the buffer. |
- Returns
- True if valid sync frame in buffer.
Definition at line 879 of file ntv2dolbyplayer.cpp.
◆ GetRP188RegisterForOutput()
Returns the RP188 DBB register number to use for the given NTV2OutputDestination.
- Parameters
-
[in] | inOutputSource | Specifies the NTV2OutputDestination of interest. |
- Returns
- The number of the RP188 DBB register to use for the given output destination.
◆ Init()
◆ IsRunning()
virtual bool NTV2DolbyPlayer::IsRunning |
( |
void |
| ) |
const |
|
inlinevirtual |
◆ ParseBSI()
bool NTV2DolbyPlayer::ParseBSI |
( |
uint16_t * |
pInDolbyBuffer, |
|
|
uint32_t |
numSamples, |
|
|
NTV2DolbyBSI * |
pBsi |
|
) |
| |
|
protectedvirtual |
Parse the dolby audio bit stream information block.
- Parameters
-
[out] | pInDolbyBuffer | Specifies a valid, non-NULL pointer to the buffer that is to receive the dolby frame data. |
[out] | numSamples | Number of samples in the buffer. |
[out] | pBsi | Parsed Dolby header data. |
- Returns
- True if parser suceeded.
Definition at line 922 of file ntv2dolbyplayer.cpp.
◆ PlayFrames()
void NTV2DolbyPlayer::PlayFrames |
( |
void |
| ) |
|
|
protectedvirtual |
Repeatedly plays out frames using AutoCirculate (until quit).
Definition at line 403 of file ntv2dolbyplayer.cpp.
◆ ProduceFrames()
void NTV2DolbyPlayer::ProduceFrames |
( |
void |
| ) |
|
|
protectedvirtual |
Repeatedly produces test pattern frames (until global quit flag set).
Definition at line 530 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] | pThread | A valid pointer to the producer thread's AJAThread instance. |
[in] | pContext | Context information to pass to the thread. (For this application, this will be set to point to the NTV2DolbyPlayer instance.) |
Definition at line 474 of file ntv2dolbyplayer.cpp.
◆ Quit()
void NTV2DolbyPlayer::Quit |
( |
void |
| ) |
|
|
virtual |
◆ RouteOutputSignal()
void NTV2DolbyPlayer::RouteOutputSignal |
( |
void |
| ) |
|
|
protectedvirtual |
◆ Run()
Runs me.
- Note
- Do not call this method without first calling my Init method.
Definition at line 363 of file ntv2dolbyplayer.cpp.
◆ SetBitBuffer()
void NTV2DolbyPlayer::SetBitBuffer |
( |
uint8_t * |
pBuffer, |
|
|
uint32_t |
size |
|
) |
| |
|
protectedvirtual |
Set the bitstream buffer for bit retrieval.
- Parameters
-
[in] | pBuffer | Specifies a valid, non-NULL pointer to the bitstream buffer |
[in] | size | Bitstream buffer size |
Definition at line 1232 of file ntv2dolbyplayer.cpp.
◆ SetUpAudio()
AJAStatus NTV2DolbyPlayer::SetUpAudio |
( |
void |
| ) |
|
|
protectedvirtual |
◆ SetUpHostBuffers()
void NTV2DolbyPlayer::SetUpHostBuffers |
( |
void |
| ) |
|
|
protectedvirtual |
◆ SetUpTestPatternVideoBuffers()
AJAStatus NTV2DolbyPlayer::SetUpTestPatternVideoBuffers |
( |
void |
| ) |
|
|
protectedvirtual |
◆ SetUpVideo()
AJAStatus NTV2DolbyPlayer::SetUpVideo |
( |
void |
| ) |
|
|
protectedvirtual |
◆ StartConsumerThread()
void NTV2DolbyPlayer::StartConsumerThread |
( |
void |
| ) |
|
|
protectedvirtual |
◆ StartProducerThread()
void NTV2DolbyPlayer::StartProducerThread |
( |
void |
| ) |
|
|
protectedvirtual |
The documentation for this class was generated from the following files:
- /home/tcbuilder/buildAgent/work/df8e8cce5bebfd58/libajantv2/demos/ntv2dolbyplayer/ntv2dolbyplayer.h
- /home/tcbuilder/buildAgent/work/df8e8cce5bebfd58/libajantv2/demos/ntv2dolbyplayer/ntv2dolbyplayer.cpp