AJA NTV2 SDK  18.0.0.2122
NTV2 SDK 18.0.0.2122
ntv2fieldburn.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 #ifndef _NTV2FIELDBURN_H
9 #define _NTV2FIELDBURN_H
10 
11 #include "ntv2card.h"
12 #include "ntv2formatdescriptor.h"
13 #include "ntv2democommon.h"
14 #include "ajabase/common/types.h"
16 #include "ajabase/system/thread.h"
18 
19 
33 {
34  // Public Instance Methods
35  public:
41  NTV2FieldBurn (const BurnConfig & inConfig);
42  virtual ~NTV2FieldBurn ();
43 
47  virtual AJAStatus Init (void);
48 
53  virtual AJAStatus Run (void);
54 
58  virtual void Quit (void);
59 
68  virtual void GetStatus (ULWord & outNumProcessed, ULWord & outCaptureDrops, ULWord & outPlayoutDrops,
69  ULWord & outCaptureLevel, ULWord & outPlayoutLevel);
70 
71 
72  // Protected Instance Methods
73  protected:
77  virtual AJAStatus SetupVideo (void);
78 
82  virtual AJAStatus SetupAudio (void);
83 
87  virtual void RouteInputSignal (void);
88 
92  virtual void RouteOutputSignal (void);
93 
97  virtual AJAStatus SetupHostBuffers (void);
98 
102  virtual void StartPlayThread (void);
103 
107  virtual void PlayFrames (void);
108 
112  virtual void StartCaptureThread (void);
113 
117  virtual void CaptureFrames (void);
118 
119 
123  virtual bool InputSignalHasTimecode (void);
124 
125 
126  // Protected Class Methods
127  protected:
135  static void PlayThreadStatic (AJAThread * pThread, void * pContext);
136 
144  static void CaptureThreadStatic (AJAThread * pThread, void * pContext);
145 
146  // Private Member Data
147  private:
149  BurnConfig mConfig;
150  AJAThread mPlayThread;
151  AJAThread mCaptureThread;
152  CNTV2Card mDevice;
153  NTV2DeviceID mDeviceID;
154  NTV2VideoFormat mVideoFormat;
155  NTV2FormatDesc mFormatDesc;
156  NTV2TaskMode mSavedTaskMode;
157  NTV2OutputDest mOutputDest;
158  NTV2AudioSystem mAudioSystem;
159  AJATimeCodeBurn mTCBurner;
160  NTV2ChannelList mTCOutputs;
161  NTV2FrameDataArray mHostBuffers;
162  CircularBuffer mFrameDataRing;
163  bool mGlobalQuit;
164 
165 }; // NTV2FieldBurn
166 
167 #endif // _NTV2FIELDBURN_H
virtual AJAStatus SetupAudio(void)
Sets up everything I need for capturing and playing audio.
NTV2AudioSystem
Used to identify an Audio System on an NTV2 device. See Audio System Operation for more information...
Definition: ntv2enums.h:3895
Declares common types used in the ajabase library.
I interrogate and control an AJA video/audio capture/playout device.
Definition: ntv2card.h:28
NTV2TaskMode
Describes the task mode state. See also: Sharing AJA Devices With Other Applications.
AJAStatus
Definition: types.h:380
virtual AJAStatus Run(void)
Runs me.
enum _NTV2VideoFormat NTV2VideoFormat
Identifies a particular video format.
virtual void StartCaptureThread(void)
Starts my capture thread.
virtual void RouteOutputSignal(void)
Sets up board routing for playout.
Declares the AJATimeCodeBurn class.
uint32_t ULWord
Definition: ajatypes.h:223
virtual AJAStatus SetupHostBuffers(void)
Sets up my circular buffers.
virtual void RouteInputSignal(void)
Sets up board routing for capture.
static void PlayThreadStatic(AJAThread *pThread, void *pContext)
This is the playout thread's static callback function that gets called when the playout thread runs...
NTV2DeviceID
Identifies a specific AJA NTV2 device model number. The NTV2DeviceID is actually the PROM part number...
Definition: ntv2enums.h:20
Declares the AJAThread class.
virtual void CaptureFrames(void)
Repeatedly captures frames using AutoCirculate (until global quit flag set).
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.
Describes a video frame for a given video standard or format and pixel format, including the total nu...
NTV2FieldBurn(const BurnConfig &inConfig)
Constructs me using the given configuration settings.
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: ntv2fieldburn.h:32
Configures an NTV2Burn or NTV2FieldBurn instance.
std::vector< NTV2FrameData > NTV2FrameDataArray
A vector of NTV2FrameData elements.
Declaration of AJACircularBuffer template class.
virtual AJAStatus SetupVideo(void)
Sets up everything I need for capturing and playing video.
virtual void GetStatus(ULWord &outNumProcessed, ULWord &outCaptureDrops, ULWord &outPlayoutDrops, ULWord &outCaptureLevel, ULWord &outPlayoutLevel)
Provides status information about my input (capture) and output (playout) processes.
Declares the NTV2FormatDescriptor class.
Declares the CNTV2Card class.
virtual void Quit(void)
Gracefully stops me from running.
enum NTV2OutputDestination NTV2OutputDest
This file contains some structures, constants, classes and functions that are used in some of the dem...
std::vector< NTV2Channel > NTV2ChannelList
An ordered sequence of NTV2Channel values.
virtual void PlayFrames(void)
Repeatedly plays out frames using AutoCirculate (until global quit flag set).
virtual ~NTV2FieldBurn()
static void CaptureThreadStatic(AJAThread *pThread, void *pContext)
This is the capture thread&#39;s static callback function that gets called when the capture thread runs...
virtual bool InputSignalHasTimecode(void)
Returns true if the current input signal has timecode embedded in it; otherwise returns false...
virtual void StartPlayThread(void)
Starts my playout thread.