AJA NTV2 SDK  18.1.0.2439
NTV2 SDK 18.1.0.2439
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  CaptureConfig mConfig;
127  NTV2VideoFormat mVideoFormat;
128  NTV2FormatDesc mFormatDesc;
129  NTV2TaskMode mSavedTaskMode;
130  NTV2AudioSystem mAudioSystem;
131  NTV2FrameDataArray mHostBuffers;
132  FrameDataRingBuffer mAVCircularBuffer;
133  bool mGlobalQuit;
134 
135 }; // NTV2Capture
136 
137 #endif // _NTV2CAPTURE_H
NTV2AudioSystem
Used to identify an Audio System on an NTV2 device. See Audio System Operation for more information...
Definition: ntv2enums.h:3901
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: NTV2 Device Sharing.
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:236
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).
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:51
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:72
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:39