AJA NTV2 SDK  18.1.0.2262
NTV2 SDK 18.1.0.2262
ntv2streamgrabber.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 #ifndef NTV2STREAMGRABBER_H
9 #define NTV2STREAMGRABBER_H
10 
11 #include <QBasicTimer>
12 #include <QtCore>
13 #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
14  #include <QtWidgets>
15 #else
16  #include <QtGui>
17 #endif
18 #include <QThread>
19 #include <QtMultimedia>
20 #include "ntv2card.h"
21 #include "ntv2enums.h"
22 
23 #define STREAMPREVIEW_WIDGET_X (960)
24 #define STREAMPREVIEW_WIDGET_Y (540)
25 
26 
27 
34 class NTV2StreamGrabber : public QThread
35 {
36  Q_OBJECT
37 
38  // Instance Methods
39  public:
44  NTV2StreamGrabber (QObject * pInParentObject = NULL);
45 
46  virtual ~NTV2StreamGrabber ();
47 
52  void SetInputSource (const NTV2InputSource inInputSource);
53 
58  void SetDeviceIndex (const UWord inDeviceIndex);
59 
60  UWord GetDeviceIndex (void) const;
61 
62  void SetFixedReference(bool fixed) {mbFixedReference = fixed;}
63 
64  protected:
65 
66  signals:
73  void newFrame (const QImage &inImage, const bool inClear);
74 
79  void newStatusString (const QString & inStatus);
80 
81  private slots:
82 
83  protected:
84  virtual void run (void);
85 
86  bool SetupInput (void);
87  void StopStream (void);
88 
89  bool CheckForValidInput (void);
90 
93 
94  bool IsInput3Gb (const NTV2InputSource inputSource);
95 
96  // Instance Data
97  private:
98  bool mRestart;
99  bool mAbort;
100  bool mbFixedReference;
101  CNTV2Card mNTV2Card;
102  UWord mBoardNumber;
103  NTV2DeviceID mDeviceID;
104  NTV2Channel mChannel;
105  NTV2Channel mStream;
106  NTV2VideoFormat mCurrentVideoFormat;
107  NTV2LHIHDMIColorSpace mCurrentColorSpace;
108  NTV2VideoFormat mLastVideoFormat;
109  ULWord mDebounceCounter;
110  bool mFormatIsProgressive;
111  NTV2InputSource mInputSource;
112  NTV2FrameSize mFrameDimensions;
113  NTV2PixelFormat mFrameBufferFormat;
114  NTV2TaskMode mSavedTaskMode;
115  bool mDoMultiChannel;
116 
117 }; // class NTV2StreamGrabber
118 
119 
120 #endif // NTV2STREAMGRABBER_H
#define NULL
I interrogate and control an AJA video/audio capture/playout device.
Definition: ntv2card.h:28
NTV2FrameBufferFormat
Identifies a particular video frame buffer pixel format. See Device Frame Buffer Formats for details...
Definition: ntv2enums.h:221
NTV2TaskMode
Describes the task mode state. See also: NTV2 Device Sharing.
NTV2LHIHDMIColorSpace GetColorSpaceFromInputSource(void)
enum _NTV2VideoFormat NTV2VideoFormat
Identifies a particular video format.
bool IsInput3Gb(const NTV2InputSource inputSource)
uint32_t ULWord
Definition: ajatypes.h:236
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They&#39;re also commonly use...
Definition: ntv2enums.h:1359
void newFrame(const QImage &inImage, const bool inClear)
This is signaled (called) when a new frame has been captured and is available for display...
NTV2DeviceID
Identifies a specific AJA NTV2 device model number. The NTV2DeviceID is actually the PROM part number...
Definition: ntv2enums.h:20
Enumerations for controlling NTV2 devices.
NTV2VideoFormat GetVideoFormatFromInputSource(void)
virtual ~NTV2StreamGrabber()
My destructor.
bool SetupInput(void)
Configures my AJA device for capture.
NTV2InputSource
Identifies a specific video input source.
Definition: ntv2enums.h:1264
void SetDeviceIndex(const UWord inDeviceIndex)
Sets the AJA device to be used for capture.
void StopStream(void)
Stops capturing.
virtual void run(void)
My thread function.
void SetFixedReference(bool fixed)
Describes the horizontal and vertical size dimensions of a raster, bitmap, frame or image...
uint16_t UWord
Definition: ajatypes.h:234
void newStatusString(const QString &inStatus)
This is signaled (called) when my status string changes.
Declares the CNTV2Card class.
UWord GetDeviceIndex(void) const
void SetInputSource(const NTV2InputSource inInputSource)
Sets the input to be used for capture on the AJA device being used.
NTV2LHIHDMIColorSpace
Definition: ntv2enums.h:3681
A QThread that captures audio/video from NTV2-compatible AJA devices and uses Qt signals to emit ARGB...
NTV2StreamGrabber(QObject *pInParentObject=NULL)
Constructs me.