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>
|
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...
|
|
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.
◆ NTV2FieldBurn()
NTV2FieldBurn::NTV2FieldBurn |
( |
const BurnConfig & |
inConfig | ) |
|
Constructs me using the given configuration settings.
- Parameters
-
[in] | inConfig | Specifies 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 |
◆ 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] | pThread | Points to the AJAThread instance. |
[in] | pContext | Context 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] | outNumProcessed | Receives the number of fields/frames successfully processed. |
[out] | outCaptureDrops | Receives the number of dropped capture fields/frames. |
[out] | outPlayoutDrops | Receives the number of dropped playout fields/frames. |
[out] | outCaptureLevel | Receives the capture driver buffer level. |
[out] | outPlayoutLevel | Receives the playout driver buffer level. |
Definition at line 765 of file ntv2fieldburn.cpp.
◆ Init()
◆ 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] | pThread | A valid pointer to the playout thread's AJAThread instance. |
[in] | pContext | Context 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 |
◆ RouteInputSignal()
void NTV2FieldBurn::RouteInputSignal |
( |
void |
| ) |
|
|
protectedvirtual |
◆ RouteOutputSignal()
void NTV2FieldBurn::RouteOutputSignal |
( |
void |
| ) |
|
|
protectedvirtual |
◆ Run()
Runs me.
- Note
- Do not call this method without first calling my Init method.
Definition at line 446 of file ntv2fieldburn.cpp.
◆ SetupAudio()
Sets up everything I need for capturing and playing audio.
Definition at line 262 of file ntv2fieldburn.cpp.
◆ SetupHostBuffers()
AJAStatus NTV2FieldBurn::SetupHostBuffers |
( |
void |
| ) |
|
|
protectedvirtual |
◆ SetupVideo()
Sets up everything I need for capturing and playing video.
Definition at line 131 of file ntv2fieldburn.cpp.
◆ StartCaptureThread()
void NTV2FieldBurn::StartCaptureThread |
( |
void |
| ) |
|
|
protectedvirtual |
◆ StartPlayThread()
void NTV2FieldBurn::StartPlayThread |
( |
void |
| ) |
|
|
protectedvirtual |
The documentation for this class was generated from the following files:
- /home/tcbuilder/buildAgent/work/df8e8cce5bebfd58/libajantv2/demos/ntv2fieldburn/ntv2fieldburn.h
- /home/tcbuilder/buildAgent/work/df8e8cce5bebfd58/libajantv2/demos/ntv2fieldburn/ntv2fieldburn.cpp