AJA NTV2 SDK  18.0.0.2122
NTV2 SDK 18.0.0.2122
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 #include "ntv2task.h"
23 #include "ajabase/common/types.h"
24 #include "ajabase/system/process.h"
25 #if defined (INCLUDE_AJACC)
28 #endif // INCLUDE_AJACC
29 
30 #define STREAMPREVIEW_WIDGET_X (960)
31 #define STREAMPREVIEW_WIDGET_Y (540)
32 
33 
34 
41 class NTV2StreamGrabber : public QThread
42 {
43  Q_OBJECT
44 
45  // Instance Methods
46  public:
51  NTV2StreamGrabber (QObject * pInParentObject = NULL);
52 
53  virtual ~NTV2StreamGrabber ();
54 
59  void SetInputSource (const NTV2InputSource inInputSource);
60 
65  void SetDeviceIndex (const UWord inDeviceIndex);
66 
67  UWord GetDeviceIndex (void) const;
68 
69  void SetFixedReference(bool fixed) {mbFixedReference = fixed;}
70 
71  protected:
72 
73  signals:
80  void newFrame (const QImage &inImage, const bool inClear);
81 
86  void newStatusString (const QString & inStatus);
87 
88  private slots:
89 
90  protected:
91  virtual void run (void);
92 
93  bool SetupInput (void);
94  void StopStream (void);
95 
96  bool CheckForValidInput (void);
97 
100 
101  bool IsInput3Gb (const NTV2InputSource inputSource);
102 
103  // Instance Data
104  private:
105  bool mRestart;
106  bool mAbort;
107  bool mbFixedReference;
108  CNTV2Card mNTV2Card;
109  UWord mBoardNumber;
110  NTV2DeviceID mDeviceID;
111  NTV2Channel mChannel;
112  NTV2Channel mStream;
113  NTV2VideoFormat mCurrentVideoFormat;
114  NTV2LHIHDMIColorSpace mCurrentColorSpace;
115  NTV2VideoFormat mLastVideoFormat;
116  ULWord mDebounceCounter;
117  bool mFormatIsProgressive;
118  NTV2InputSource mInputSource;
119  NTV2FrameSize mFrameDimensions;
120  NTV2PixelFormat mFrameBufferFormat;
121  NTV2TaskMode mSavedTaskMode;
122  bool mDoMultiChannel;
123 
124 }; // class NTV2StreamGrabber
125 
126 
127 #endif // NTV2STREAMGRABBER_H
Declares common types used in the ajabase library.
#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:219
NTV2TaskMode
Describes the task mode state. See also: Sharing AJA Devices With Other Applications.
NTV2LHIHDMIColorSpace GetColorSpaceFromInputSource(void)
enum _NTV2VideoFormat NTV2VideoFormat
Identifies a particular video format.
bool IsInput3Gb(const NTV2InputSource inputSource)
uint32_t ULWord
Definition: ajatypes.h:223
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They&#39;re also commonly use...
Definition: ntv2enums.h:1357
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)
Declares the CNTV2CaptionDecoder708 class.
virtual ~NTV2StreamGrabber()
My destructor.
bool SetupInput(void)
Configures my AJA device for capture.
Declares the AJAProcess class.
NTV2InputSource
Identifies a specific video input source.
Definition: ntv2enums.h:1262
Declares the CNTV2Task class (deprecated).
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:221
void newStatusString(const QString &inStatus)
This is signaled (called) when my status string changes.
Declares the CNTV2Card class.
UWord GetDeviceIndex(void) const
Declares the CNTV2CaptionDecoder608 class.
void SetInputSource(const NTV2InputSource inInputSource)
Sets the input to be used for capture on the AJA device being used.
NTV2LHIHDMIColorSpace
Definition: ntv2enums.h:3678
A QThread that captures audio/video from NTV2-compatible AJA devices and uses Qt signals to emit ARGB...
NTV2StreamGrabber(QObject *pInParentObject=NULL)
Constructs me.