AJA NTV2 SDK  18.0.0.2122
NTV2 SDK 18.0.0.2122
ntv2capture.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  NTV2Capture (const CaptureConfig & inConfig);
29 
30  virtual ~NTV2Capture ();
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 
136 }; // NTV2Capture
137 
138 #endif // _NTV2CAPTURE_H
NTV2AudioSystem
Used to identify an Audio System on an NTV2 device. See Audio System Operation for more information...
Definition: ntv2enums.h:3895
Instances of me capture frames in real time from a video signal provided to an input of an AJA device...
Definition: ntv2capture.h:19
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
enum _NTV2VideoFormat NTV2VideoFormat
Identifies a particular video format.
virtual AJAStatus SetupVideo(void)
Sets up everything I need for capturing video.
virtual AJAStatus SetupAudio(void)
Sets up everything I need for capturing audio.
uint32_t ULWord
Definition: ajatypes.h:223
virtual AJAStatus Run(void)
Runs me.
virtual bool RouteInputSignal(void)
Sets up device routing for capture.
virtual void GetACStatus(ULWord &outGoodFrames, ULWord &outDroppedFrames, ULWord &outBufferLevel)
Provides status information about my input (capture) process.
static void ConsumerThreadStatic(AJAThread *pThread, void *pContext)
This is the consumer thread's static callback function that gets called when the consumer thread runs...
virtual void CaptureFrames(void)
Repeatedly captures frames using AutoCirculate (until global quit flag set).
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 void StartProducerThread(void)
Starts my capture thread.
Describes a video frame for a given video standard or format and pixel format, including the total nu...
virtual void Quit(void)
Gracefully stops me from running.
Definition: ntv2capture.cpp:52
std::vector< NTV2FrameData > NTV2FrameDataArray
A vector of NTV2FrameData elements.
virtual void ConsumeFrames(void)
Repeatedly consumes frames from the circular buffer (until global quit flag set). ...
virtual void SetupHostBuffers(void)
Sets up my circular buffers.
static void ProducerThreadStatic(AJAThread *pThread, void *pContext)
This is the capture thread&#39;s static callback function that gets called when the capture thread runs...
virtual void StartConsumerThread(void)
Starts my frame consumer thread.
This file contains some structures, constants, classes and functions that are used in some of the dem...
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.
Definition: ntv2capture.cpp:73
NTV2Capture(const CaptureConfig &inConfig)
Constructs me using the given settings.
Definition: ntv2capture.cpp:25
I am a circular frame buffer that simplifies implementing a type-safe producer/consumer model for pro...
virtual ~NTV2Capture()
Definition: ntv2capture.cpp:40