AJA NTV2 SDK  17.5.0.1242
NTV2 SDK 17.5.0.1242
NTV2FieldBurn Class Reference

I capture individual fields from an interlaced video signal provided to an SDI input. Each frame is captured as two fields in separate host buffers. I burn F1 timecode into the top of F1, and F2 timecode into the bottom half of F2. Then I reassemble both fields and play them through an output of the same device, with a 7-frame latency (by default). I make use of the AJACircularBuffer, which simplifies implementing a producer/consumer model, in which a "consumer" thread delivers burned-in frames to the AJA device output, and a "producer" thread captures raw frames from the AJA device input. I also demonstrate how to detect if an SDI input has embedded timecode, and if so, how AutoCirculate makes it available. I also show how to embed timecode into an SDI output signal using AutoCirculate during playout. More...

#include <ntv2fieldburn.h>

Public Member Functions

 NTV2FieldBurn (const BurnConfig &inConfig)
 Constructs me using the given configuration settings. More...
 
virtual ~NTV2FieldBurn ()
 
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 GetStatus (ULWord &outNumProcessed, ULWord &outCaptureDrops, ULWord &outPlayoutDrops, ULWord &outCaptureLevel, ULWord &outPlayoutLevel)
 Provides status information about my input (capture) and output (playout) processes. More...
 

Protected Member Functions

virtual AJAStatus SetupVideo (void)
 Sets up everything I need for capturing and playing video. More...
 
virtual AJAStatus SetupAudio (void)
 Sets up everything I need for capturing and playing audio. More...
 
virtual void RouteInputSignal (void)
 Sets up board routing for capture. More...
 
virtual void RouteOutputSignal (void)
 Sets up board routing for playout. More...
 
virtual AJAStatus SetupHostBuffers (void)
 Sets up my circular buffers. More...
 
virtual void StartPlayThread (void)
 Starts my playout thread. More...
 
virtual void PlayFrames (void)
 Repeatedly plays out frames using AutoCirculate (until global quit flag set). More...
 
virtual void StartCaptureThread (void)
 Starts my capture thread. More...
 
virtual void CaptureFrames (void)
 Repeatedly captures frames using AutoCirculate (until global quit flag set). More...
 
virtual bool InputSignalHasTimecode (void)
 Returns true if the current input signal has timecode embedded in it; otherwise returns false. More...
 

Static Protected Member Functions

static void PlayThreadStatic (AJAThread *pThread, void *pContext)
 This is the playout thread's static callback function that gets called when the playout thread runs. This function gets "Attached" to the playout thread's AJAThread instance. More...
 
static void CaptureThreadStatic (AJAThread *pThread, void *pContext)
 This is the capture thread's static callback function that gets called when the capture thread runs. This function gets "Attached" to the AJAThread instance. More...
 

Detailed Description

I capture individual fields from an interlaced video signal provided to an SDI input. Each frame is captured as two fields in separate host buffers. I burn F1 timecode into the top of F1, and F2 timecode into the bottom half of F2. Then I reassemble both fields and play them through an output of the same device, with a 7-frame latency (by default). I make use of the AJACircularBuffer, which simplifies implementing a producer/consumer model, in which a "consumer" thread delivers burned-in frames to the AJA device output, and a "producer" thread captures raw frames from the AJA device input. I also demonstrate how to detect if an SDI input has embedded timecode, and if so, how AutoCirculate makes it available. I also show how to embed timecode into an SDI output signal using AutoCirculate during playout.

Definition at line 32 of file ntv2fieldburn.h.

Constructor & Destructor Documentation

◆ NTV2FieldBurn()

NTV2FieldBurn::NTV2FieldBurn ( const BurnConfig inConfig)

Constructs me using the given configuration settings.

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

Definition at line 25 of file ntv2fieldburn.cpp.

◆ ~NTV2FieldBurn()

NTV2FieldBurn::~NTV2FieldBurn ( )
virtual

Definition at line 39 of file ntv2fieldburn.cpp.

Member Function Documentation

◆ CaptureFrames()

void NTV2FieldBurn::CaptureFrames ( void  )
protectedvirtual

Repeatedly captures frames using AutoCirculate (until global quit flag set).

Definition at line 617 of file ntv2fieldburn.cpp.

◆ CaptureThreadStatic()

void NTV2FieldBurn::CaptureThreadStatic ( AJAThread pThread,
void *  pContext 
)
staticprotected

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

Parameters
[in]pThreadPoints to the AJAThread instance.
[in]pContextContext information to pass to the thread. (For this application, this will be set to point to the NTV2FieldBurn instance.)

Definition at line 605 of file ntv2fieldburn.cpp.

◆ GetStatus()

void NTV2FieldBurn::GetStatus ( ULWord outNumProcessed,
ULWord outCaptureDrops,
ULWord outPlayoutDrops,
ULWord outCaptureLevel,
ULWord outPlayoutLevel 
)
virtual

Provides status information about my input (capture) and output (playout) processes.

Parameters
[out]outNumProcessedReceives the number of fields/frames successfully processed.
[out]outCaptureDropsReceives the number of dropped capture fields/frames.
[out]outPlayoutDropsReceives the number of dropped playout fields/frames.
[out]outCaptureLevelReceives the capture driver buffer level.
[out]outPlayoutLevelReceives the playout driver buffer level.

Definition at line 765 of file ntv2fieldburn.cpp.

◆ Init()

AJAStatus NTV2FieldBurn::Init ( void  )
virtual

Initializes me and prepares me to Run.

Definition at line 66 of file ntv2fieldburn.cpp.

◆ InputSignalHasTimecode()

bool NTV2FieldBurn::InputSignalHasTimecode ( void  )
protectedvirtual

Returns true if the current input signal has timecode embedded in it; otherwise returns false.

Definition at line 800 of file ntv2fieldburn.cpp.

◆ PlayFrames()

void NTV2FieldBurn::PlayFrames ( void  )
protectedvirtual

Repeatedly plays out frames using AutoCirculate (until global quit flag set).

Definition at line 481 of file ntv2fieldburn.cpp.

◆ PlayThreadStatic()

void NTV2FieldBurn::PlayThreadStatic ( AJAThread pThread,
void *  pContext 
)
staticprotected

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

Parameters
[in]pThreadA valid pointer to the playout thread's AJAThread instance.
[in]pContextContext information to pass to the thread. (For this application, this will be set to point to the NTV2FieldBurn instance.)

Definition at line 471 of file ntv2fieldburn.cpp.

◆ Quit()

void NTV2FieldBurn::Quit ( void  )
virtual

Gracefully stops me from running.

Definition at line 46 of file ntv2fieldburn.cpp.

◆ RouteInputSignal()

void NTV2FieldBurn::RouteInputSignal ( void  )
protectedvirtual

Sets up board routing for capture.

Definition at line 362 of file ntv2fieldburn.cpp.

◆ RouteOutputSignal()

void NTV2FieldBurn::RouteOutputSignal ( void  )
protectedvirtual

Sets up board routing for playout.

Definition at line 385 of file ntv2fieldburn.cpp.

◆ Run()

AJAStatus NTV2FieldBurn::Run ( void  )
virtual

Runs me.

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

Definition at line 446 of file ntv2fieldburn.cpp.

◆ SetupAudio()

AJAStatus NTV2FieldBurn::SetupAudio ( void  )
protectedvirtual

Sets up everything I need for capturing and playing audio.

Definition at line 262 of file ntv2fieldburn.cpp.

◆ SetupHostBuffers()

AJAStatus NTV2FieldBurn::SetupHostBuffers ( void  )
protectedvirtual

Sets up my circular buffers.

Definition at line 309 of file ntv2fieldburn.cpp.

◆ SetupVideo()

AJAStatus NTV2FieldBurn::SetupVideo ( void  )
protectedvirtual

Sets up everything I need for capturing and playing video.

Definition at line 131 of file ntv2fieldburn.cpp.

◆ StartCaptureThread()

void NTV2FieldBurn::StartCaptureThread ( void  )
protectedvirtual

Starts my capture thread.

Definition at line 592 of file ntv2fieldburn.cpp.

◆ StartPlayThread()

void NTV2FieldBurn::StartPlayThread ( void  )
protectedvirtual

Starts my playout thread.

Definition at line 460 of file ntv2fieldburn.cpp.


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