AJA NTV2 SDK  17.0.1.1246
NTV2 SDK 17.0.1.1246
NTV2StreamGrabber Class Reference

A QThread that captures audio/video from NTV2-compatible AJA devices and uses Qt signals to emit ARGB video frames. To simplify things, I assume the input signal is YCbCr, and the input goes through a color space converter (CSC) to an ARGB FrameStore. I can also output 2 channels of Audio to the host audio system using Qt's QAudioOutput device. More...

#include <ntv2streamgrabber.h>

Inheritance diagram for NTV2StreamGrabber:
[legend]
Collaboration diagram for NTV2StreamGrabber:
[legend]

Signals

void newFrame (const QImage &inImage, const bool inClear)
 This is signaled (called) when a new frame has been captured and is available for display. More...
 
void newStatusString (const QString &inStatus)
 This is signaled (called) when my status string changes. More...
 
void captionScreenChanged (const ushort *pInScreen)
 This is signaled (called) when my caption screen buffer changes. More...
 

Public Member Functions

 NTV2StreamGrabber (QObject *pInParentObject=NULL)
 Constructs me. More...
 
virtual ~NTV2StreamGrabber ()
 My destructor. More...
 
void SetInputSource (const NTV2InputSource inInputSource)
 Sets the input to be used for capture on the AJA device being used. More...
 
void SetWithAudio (const bool inWithAudio)
 Enables or disables host audio playback. More...
 
void SetDeviceIndex (const UWord inDeviceIndex)
 Sets the AJA device to be used for capture. More...
 
void SetTimeCodeSource (const NTV2TCIndex inTCSource)
 
UWord GetDeviceIndex (void) const
 
void CheckFor4kInput (const bool inCheckFor4K)
 Enables or disables checking for 4K/UHD video (on devices that supported 4K/UHD). More...
 
void SetDeinterlaceNonProgressiveVideo (const bool inDeinterlace)
 Enables or disables deinterlacing of non-progressive video. More...
 
void SetFixedReference (bool fixed)
 

Protected Member Functions

void ClearCaptionBuffer (const bool inSignalClients=false)
 
void GrabCaptions (void)
 Performs caption data extraction & decoding. More...
 
virtual void run (void)
 My thread function. More...
 
bool SetupInput (void)
 Configures my AJA device for capture. More...
 
void StopAutoCirculate (void)
 Stops capturing. More...
 
void SetupAudio (void)
 Performs audio configuration. More...
 
void OutputAudio (ULWord *pInOutAudioBuffer, const ULWord inNumValidBytes)
 Writes audio samples for channels 1 and 2 that are in the given audio buffer to my QAudioOutput device, which should play out on the host. More...
 
bool CheckForValidInput (void)
 
NTV2VideoFormat GetVideoFormatFromInputSource (void)
 
NTV2LHIHDMIColorSpace GetColorSpaceFromInputSource (void)
 
bool IsInput3Gb (const NTV2InputSource inputSource)
 

Detailed Description

A QThread that captures audio/video from NTV2-compatible AJA devices and uses Qt signals to emit ARGB video frames. To simplify things, I assume the input signal is YCbCr, and the input goes through a color space converter (CSC) to an ARGB FrameStore. I can also output 2 channels of Audio to the host audio system using Qt's QAudioOutput device.

Definition at line 42 of file ntv2streamgrabber.h.

Constructor & Destructor Documentation

◆ NTV2StreamGrabber()

NTV2StreamGrabber::NTV2StreamGrabber ( QObject *  pInParentObject = NULL)

Constructs me.

Parameters
[in]pInParentObjectOptionally specifies my parent object. Defaults to NULL (no parent).

Definition at line 31 of file ntv2streamgrabber.cpp.

◆ ~NTV2StreamGrabber()

NTV2StreamGrabber::~NTV2StreamGrabber ( )
virtual

My destructor.

Definition at line 63 of file ntv2streamgrabber.cpp.

Member Function Documentation

◆ captionScreenChanged

void NTV2StreamGrabber::captionScreenChanged ( const ushort *  pInScreen)
signal

This is signaled (called) when my caption screen buffer changes.

Parameters
[in]pInScreenPoints to the (screen) array of Utf16 characters.

◆ CheckFor4kInput()

void NTV2StreamGrabber::CheckFor4kInput ( const bool  inCheckFor4K)
inline

Enables or disables checking for 4K/UHD video (on devices that supported 4K/UHD).

Parameters
[in]inCheckFor4KIf true, enables checking for 4K/UHD video; otherwise disables it.

Definition at line 82 of file ntv2streamgrabber.h.

◆ CheckForValidInput()

bool NTV2StreamGrabber::CheckForValidInput ( void  )
protected

Definition at line 747 of file ntv2streamgrabber.cpp.

◆ ClearCaptionBuffer()

void NTV2StreamGrabber::ClearCaptionBuffer ( const bool  inSignalClients = false)
protected

Definition at line 163 of file ntv2streamgrabber.cpp.

◆ GetColorSpaceFromInputSource()

NTV2LHIHDMIColorSpace NTV2StreamGrabber::GetColorSpaceFromInputSource ( void  )
protected

Definition at line 848 of file ntv2streamgrabber.cpp.

◆ GetDeviceIndex()

UWord NTV2StreamGrabber::GetDeviceIndex ( void  ) const

Definition at line 115 of file ntv2streamgrabber.cpp.

◆ GetVideoFormatFromInputSource()

NTV2VideoFormat NTV2StreamGrabber::GetVideoFormatFromInputSource ( void  )
protected

Definition at line 803 of file ntv2streamgrabber.cpp.

◆ GrabCaptions()

void NTV2StreamGrabber::GrabCaptions ( void  )
protected

Performs caption data extraction & decoding.

Definition at line 177 of file ntv2streamgrabber.cpp.

◆ IsInput3Gb()

bool NTV2StreamGrabber::IsInput3Gb ( const NTV2InputSource  inputSource)
protected

Definition at line 861 of file ntv2streamgrabber.cpp.

◆ newFrame

void NTV2StreamGrabber::newFrame ( const QImage &  inImage,
const bool  inClear 
)
signal

This is signaled (called) when a new frame has been captured and is available for display.

Parameters
[in]inImageA QImage that contains the frame image.
[in]inClearTrue if a redraw should take place – i.e., if the frame is the first of a valid video stream, or if there is currently no valid video.

◆ newStatusString

void NTV2StreamGrabber::newStatusString ( const QString &  inStatus)
signal

This is signaled (called) when my status string changes.

Parameters
[in]inStatusThe QString containing the status message.

◆ OutputAudio()

void NTV2StreamGrabber::OutputAudio ( ULWord pInOutAudioBuffer,
const ULWord  inNumValidBytes 
)
protected

Writes audio samples for channels 1 and 2 that are in the given audio buffer to my QAudioOutput device, which should play out on the host.

Parameters
pInOutAudioBufferSpecifies a valid, non-NULL pointer to a buffer containing the audio samples that were captured from my AJA device for a single frame. This is not a 'const' pointer because the buffer content will be changed. On entry, the buffer will contain 6, 8 or 16 channels of 4-byte (32-bit) audio samples: 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF... On exit, the buffer will contain unsigned 2-byte (16-bit) samples in LRLRLRLR order, which is what Qt's QAudioOutput object is expecting. (The least significant 16 bits of each sample from the AJA device are discarded.)
inNumValidBytesSpecifies the number of valid bytes that are in the audio buffer.

Definition at line 912 of file ntv2streamgrabber.cpp.

◆ run()

void NTV2StreamGrabber::run ( void  )
protectedvirtual

My thread function.

Definition at line 277 of file ntv2streamgrabber.cpp.

◆ SetDeinterlaceNonProgressiveVideo()

void NTV2StreamGrabber::SetDeinterlaceNonProgressiveVideo ( const bool  inDeinterlace)
inline

Enables or disables deinterlacing of non-progressive video.

Parameters
[in]inDeinterlaceIf true, enables deinterlacing of non-progressive video; otherwise disables it.

Definition at line 88 of file ntv2streamgrabber.h.

◆ SetDeviceIndex()

void NTV2StreamGrabber::SetDeviceIndex ( const UWord  inDeviceIndex)

Sets the AJA device to be used for capture.

Parameters
[in]inDeviceIndexSpecifies the zero-based index number of the device to be used.

Definition at line 91 of file ntv2streamgrabber.cpp.

◆ SetFixedReference()

void NTV2StreamGrabber::SetFixedReference ( bool  fixed)
inline

Definition at line 92 of file ntv2streamgrabber.h.

◆ SetInputSource()

void NTV2StreamGrabber::SetInputSource ( const NTV2InputSource  inInputSource)

Sets the input to be used for capture on the AJA device being used.

Parameters
[in]inInputSourceSpecifies the input source to be used.

Definition at line 77 of file ntv2streamgrabber.cpp.

◆ SetTimeCodeSource()

void NTV2StreamGrabber::SetTimeCodeSource ( const NTV2TCIndex  inTCSource)

Definition at line 103 of file ntv2streamgrabber.cpp.

◆ SetupAudio()

void NTV2StreamGrabber::SetupAudio ( void  )
protected

Performs audio configuration.

Definition at line 871 of file ntv2streamgrabber.cpp.

◆ SetupInput()

bool NTV2StreamGrabber::SetupInput ( void  )
protected

Configures my AJA device for capture.

Definition at line 487 of file ntv2streamgrabber.cpp.

◆ SetWithAudio()

void NTV2StreamGrabber::SetWithAudio ( const bool  inWithAudio)
inline

Enables or disables host audio playback.

Parameters
[in]inWithAudioIf true, enables host audio playback; otherwise disables it.

Definition at line 66 of file ntv2streamgrabber.h.

◆ StopAutoCirculate()

void NTV2StreamGrabber::StopAutoCirculate ( void  )
protected

Stops capturing.

Definition at line 731 of file ntv2streamgrabber.cpp.


The documentation for this class was generated from the following files: