AJA NTV2 SDK  18.0.0.2122
NTV2 SDK 18.0.0.2122
ntv2capture8k.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
9 #ifndef _NTV2CAPTURE_H
10 #define _NTV2CAPTURE_H
11 
12 #include "ntv2democommon.h"
13 #include "ajabase/system/thread.h"
14 
15 
20 {
21  // Public Instance Methods
22  public:
28  NTV2Capture8K (const CaptureConfig & inConfig);
29 
30  virtual ~NTV2Capture8K ();
31 
35  virtual AJAStatus Init (void);
36 
41  virtual AJAStatus Run (void);
42 
46  virtual void Quit (void);
47 
54  virtual void GetACStatus (ULWord & outGoodFrames, ULWord & outDroppedFrames, ULWord & outBufferLevel);
55 
56 
57  // Protected Instance Methods
58  protected:
62  virtual AJAStatus SetupVideo (void);
63 
67  virtual AJAStatus SetupAudio (void);
68 
72  virtual bool RouteInputSignal (void);
73 
77  virtual void SetupHostBuffers (void);
78 
82  virtual void StartProducerThread (void);
83 
87  virtual void CaptureFrames (void);
88 
92  virtual void StartConsumerThread (void);
93 
97  virtual void ConsumeFrames (void);
98 
99 
100  // Protected Class Methods
101  protected:
109  static void ConsumerThreadStatic (AJAThread * pThread, void * pContext);
110 
118  static void ProducerThreadStatic (AJAThread * pThread, void * pContext);
119 
120 
121  // Private Member Data
122  private:
123  AJAThread mConsumerThread;
124  AJAThread mProducerThread;
125  CNTV2Card mDevice;
126  NTV2DeviceID mDeviceID;
127  CaptureConfig mConfig;
128  NTV2VideoFormat mVideoFormat;
129  NTV2FormatDesc mFormatDesc;
130  NTV2TaskMode mSavedTaskMode;
131  NTV2AudioSystem mAudioSystem;
132  NTV2FrameDataArray mHostBuffers;
133  FrameDataRingBuffer mAVCircularBuffer;
134  bool mGlobalQuit;
135  NTV2ChannelSet mActiveFrameStores;
136  NTV2ChannelSet mActiveSDIs;
137 
138 }; // NTV2Capture
139 
140 #endif // _NTV2CAPTURE_H
virtual ~NTV2Capture8K()
NTV2Capture8K(const CaptureConfig &inConfig)
Constructs me using the given settings.
NTV2AudioSystem
Used to identify an Audio System on an NTV2 device. See Audio System Operation for more information...
Definition: ntv2enums.h:3895
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.
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 void ConsumeFrames(void)
Repeatedly consumes frames from the circular buffer (until global quit flag set). ...
enum _NTV2VideoFormat NTV2VideoFormat
Identifies a particular video format.
static void ConsumerThreadStatic(AJAThread *pThread, void *pContext)
This is the consumer thread's static callback function that gets called when the consumer thread runs...
uint32_t ULWord
Definition: ajatypes.h:223
virtual bool RouteInputSignal(void)
Sets up device routing for capture.
virtual void Quit(void)
Gracefully stops me from running.
virtual AJAStatus Run(void)
Runs me.
static void ProducerThreadStatic(AJAThread *pThread, void *pContext)
This is the capture thread's static callback function that gets called when the capture thread runs...
NTV2DeviceID
Identifies a specific AJA NTV2 device model number. The NTV2DeviceID is actually the PROM part number...
Definition: ntv2enums.h:20
This class is used to configure an NTV2Capture instance.
Declares the AJAThread class.
virtual AJAStatus SetupAudio(void)
Sets up everything I need for capturing audio.
virtual void SetupHostBuffers(void)
Sets up my circular buffers.
Describes a video frame for a given video standard or format and pixel format, including the total nu...
Instances of me capture frames in real time from a video signal provided to an input of an AJA device...
Definition: ntv2capture8k.h:19
std::vector< NTV2FrameData > NTV2FrameDataArray
A vector of NTV2FrameData elements.
virtual void StartConsumerThread(void)
Starts my frame consumer thread.
std::set< NTV2Channel > NTV2ChannelSet
A set of distinct NTV2Channel values.
This file contains some structures, constants, classes and functions that are used in some of the dem...
virtual void CaptureFrames(void)
Repeatedly captures frames using AutoCirculate (until global quit flag set).
virtual void GetACStatus(ULWord &outGoodFrames, ULWord &outDroppedFrames, ULWord &outBufferLevel)
Provides status information about my input (capture) process.
virtual AJAStatus SetupVideo(void)
Sets up everything I need for capturing video.
I am a circular frame buffer that simplifies implementing a type-safe producer/consumer model for pro...
virtual void StartProducerThread(void)
Starts my capture thread.