AJA NTV2 SDK  17.1.1.1245
NTV2 SDK 17.1.1.1245
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 
109  CNTV2Card mNTV2Card;
110  UWord mBoardNumber;
111  NTV2DeviceID mDeviceID;
112  NTV2Channel mChannel;
113  NTV2Channel mStream;
114  NTV2VideoFormat mCurrentVideoFormat;
115  NTV2LHIHDMIColorSpace mCurrentColorSpace;
116  NTV2VideoFormat mLastVideoFormat;
117  ULWord mDebounceCounter;
118  bool mFormatIsProgressive;
119  NTV2InputSource mInputSource;
120  NTV2FrameDimensions mFrameDimensions;
121  NTV2FrameBufferFormat mFrameBufferFormat;
122  NTV2EveryFrameTaskMode mSavedTaskMode;
123  bool mDoMultiChannel;
124 
125 }; // class NTV2StreamGrabber
126 
127 
128 #endif // NTV2STREAMGRABBER_H
NTV2StreamGrabber::newStatusString
void newStatusString(const QString &inStatus)
This is signaled (called) when my status string changes.
NTV2FrameDimensions
Describes the horizontal and vertical size dimensions of a raster, bitmap, frame or image.
Definition: ntv2publicinterface.h:5658
NTV2LHIHDMIColorSpace
NTV2LHIHDMIColorSpace
Definition: ntv2enums.h:3597
types.h
Declares common types used in the ajabase library.
NULL
#define NULL
Definition: ntv2caption608types.h:19
NTV2Channel
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
Definition: ntv2enums.h:1305
ntv2task.h
Declares the CNTV2Task class (deprecated).
NTV2DeviceID
NTV2DeviceID
Identifies a specific AJA NTV2 device model number. The NTV2DeviceID is actually the PROM part number...
Definition: ntv2enums.h:20
NTV2FrameBufferFormat
NTV2FrameBufferFormat
Identifies a particular video frame buffer format. See Device Frame Buffer Formats for details.
Definition: ntv2enums.h:207
NTV2StreamGrabber::SetupInput
bool SetupInput(void)
Configures my AJA device for capture.
Definition: ntv2streamgrabber.cpp:354
NTV2StreamGrabber::run
virtual void run(void)
My thread function.
Definition: ntv2streamgrabber.cpp:99
NTV2StreamGrabber::GetColorSpaceFromInputSource
NTV2LHIHDMIColorSpace GetColorSpaceFromInputSource(void)
Definition: ntv2streamgrabber.cpp:534
process.h
Declares the AJAProcess class.
ULWord
uint32_t ULWord
Definition: ajatypes.h:253
NTV2StreamGrabber::SetFixedReference
void SetFixedReference(bool fixed)
Definition: ntv2streamgrabber.h:69
ntv2card.h
Declares the CNTV2Card class.
ntv2captiondecoder708.h
Declares the CNTV2CaptionDecoder708 class.
UWord
uint16_t UWord
Definition: ajatypes.h:251
ntv2enums.h
Enumerations for controlling NTV2 devices.
NTV2StreamGrabber::newFrame
void newFrame(const QImage &inImage, const bool inClear)
This is signaled (called) when a new frame has been captured and is available for display.
CNTV2Card
I interrogate and control an AJA video/audio capture/playout device.
Definition: ntv2card.h:28
NTV2StreamGrabber::GetDeviceIndex
UWord GetDeviceIndex(void) const
Definition: ntv2streamgrabber.cpp:90
NTV2InputSource
NTV2InputSource
Identifies a specific video input source.
Definition: ntv2enums.h:1221
NTV2StreamGrabber::SetInputSource
void SetInputSource(const NTV2InputSource inInputSource)
Sets the input to be used for capture on the AJA device being used.
Definition: ntv2streamgrabber.cpp:64
NTV2StreamGrabber
A QThread that captures audio/video from NTV2-compatible AJA devices and uses Qt signals to emit ARGB...
Definition: ntv2streamgrabber.h:41
NTV2StreamGrabber::~NTV2StreamGrabber
virtual ~NTV2StreamGrabber()
My destructor.
Definition: ntv2streamgrabber.cpp:53
NTV2StreamGrabber::NTV2StreamGrabber
NTV2StreamGrabber(QObject *pInParentObject=NULL)
Constructs me.
Definition: ntv2streamgrabber.cpp:31
NTV2StreamGrabber::GetVideoFormatFromInputSource
NTV2VideoFormat GetVideoFormatFromInputSource(void)
Definition: ntv2streamgrabber.cpp:513
NTV2VideoFormat
enum _NTV2VideoFormat NTV2VideoFormat
Identifies a particular video format.
NTV2EveryFrameTaskMode
NTV2EveryFrameTaskMode
Describes the task mode state. See also: Sharing AJA Devices With Other Applications.
Definition: ntv2publicinterface.h:4288
NTV2StreamGrabber::IsInput3Gb
bool IsInput3Gb(const NTV2InputSource inputSource)
Definition: ntv2streamgrabber.cpp:547
NTV2StreamGrabber::StopStream
void StopStream(void)
Stops capturing.
Definition: ntv2streamgrabber.cpp:447
NTV2StreamGrabber::CheckForValidInput
bool CheckForValidInput(void)
Definition: ntv2streamgrabber.cpp:457
ntv2captiondecoder608.h
Declares the CNTV2CaptionDecoder608 class.
NTV2StreamGrabber::SetDeviceIndex
void SetDeviceIndex(const UWord inDeviceIndex)
Sets the AJA device to be used for capture.
Definition: ntv2streamgrabber.cpp:78