AJA NTV2 SDK  17.0.1.1246
NTV2 SDK 17.0.1.1246
ntv2capture4k.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  NTV2Capture4K (const CaptureConfig & inConfig);
29 
30  virtual ~NTV2Capture4K ();
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  ULWord mACOptions;
138 
139 }; // NTV2Capture4K
140 
141 #endif // _NTV2CAPTURE_H
NTV2TaskMode
enum NTV2EveryFrameTaskMode NTV2TaskMode
NTV2FormatDescriptor
Describes a video frame for a given video standard or format and pixel format, including the total nu...
Definition: ntv2formatdescriptor.h:41
NTV2Capture4K::SetupHostBuffers
virtual void SetupHostBuffers(void)
Sets up my circular buffers.
Definition: ntv2capture4k.cpp:257
NTV2Capture4K::Quit
virtual void Quit(void)
Gracefully stops me from running.
Definition: ntv2capture4k.cpp:50
NTV2DeviceID
NTV2DeviceID
Identifies a specific AJA NTV2 device model number. The NTV2DeviceID is actually the PROM part number...
Definition: ntv2enums.h:20
NTV2Capture4K::ConsumerThreadStatic
static void ConsumerThreadStatic(AJAThread *pThread, void *pContext)
This is the consumer thread's static callback function that gets called when the consumer thread runs...
Definition: ntv2capture4k.cpp:339
NTV2Capture4K::RouteInputSignal
virtual bool RouteInputSignal(void)
Sets up device routing for capture.
Definition: ntv2capture4k.cpp:300
NTV2Capture4K::ProducerThreadStatic
static void ProducerThreadStatic(AJAThread *pThread, void *pContext)
This is the capture thread's static callback function that gets called when the capture thread runs....
Definition: ntv2capture4k.cpp:393
AJAThread
Definition: thread.h:69
AJAStatus
AJAStatus
Definition: types.h:365
NTV2Capture4K::Init
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.
Definition: ntv2capture4k.cpp:71
ULWord
uint32_t ULWord
Definition: ajatypes.h:246
CaptureConfig
This class is used to configure an NTV2Capture instance.
Definition: ntv2democommon.h:265
NTV2Capture4K
Instances of me capture frames in real time from a video signal provided to an input of an AJA device...
Definition: ntv2capture4k.h:19
NTV2Capture4K::ConsumeFrames
virtual void ConsumeFrames(void)
Repeatedly consumes frames from the circular buffer (until global quit flag set).
Definition: ntv2capture4k.cpp:351
CNTV2Card
I interrogate and control an AJA video/audio capture/playout device.
Definition: ntv2card.h:262
NTV2ChannelSet
std::set< NTV2Channel > NTV2ChannelSet
A set of distinct NTV2Channel values.
Definition: ntv2publicinterface.h:3823
NTV2FrameDataArray
std::vector< NTV2FrameData > NTV2FrameDataArray
A vector of NTV2FrameData elements.
Definition: ntv2democommon.h:152
NTV2Capture4K::GetACStatus
virtual void GetACStatus(ULWord &outGoodFrames, ULWord &outDroppedFrames, ULWord &outBufferLevel)
Provides status information about my input (capture) process.
Definition: ntv2capture4k.cpp:483
NTV2Capture4K::~NTV2Capture4K
virtual ~NTV2Capture4K()
Definition: ntv2capture4k.cpp:38
NTV2Capture4K::Run
virtual AJAStatus Run(void)
Runs me.
Definition: ntv2capture4k.cpp:315
ntv2democommon.h
This file contains some structures, constants, classes and functions that are used in some of the dem...
NTV2Capture4K::StartConsumerThread
virtual void StartConsumerThread(void)
Starts my frame consumer thread.
Definition: ntv2capture4k.cpp:328
NTV2Capture4K::CaptureFrames
virtual void CaptureFrames(void)
Repeatedly captures frames using AutoCirculate (until global quit flag set).
Definition: ntv2capture4k.cpp:405
NTV2VideoFormat
enum _NTV2VideoFormat NTV2VideoFormat
Identifies a particular video format.
NTV2Capture4K::SetupVideo
virtual AJAStatus SetupVideo(void)
Sets up everything I need for capturing video.
Definition: ntv2capture4k.cpp:184
NTV2Capture4K::NTV2Capture4K
NTV2Capture4K(const CaptureConfig &inConfig)
Constructs me using the given settings.
Definition: ntv2capture4k.cpp:22
NTV2AudioSystem
NTV2AudioSystem
Used to identify an Audio System on an NTV2 device. See Audio System Operation for more information.
Definition: ntv2enums.h:3809
NTV2Capture4K::SetupAudio
virtual AJAStatus SetupAudio(void)
Sets up everything I need for capturing audio.
Definition: ntv2capture4k.cpp:228
thread.h
Declares the AJAThread class.
NTV2Capture4K::StartProducerThread
virtual void StartProducerThread(void)
Starts my capture thread.
Definition: ntv2capture4k.cpp:382
AJACircularBuffer< NTV2FrameData * >