AJA NTV2 SDK  17.5.0.1242
NTV2 SDK 17.5.0.1242
NTV2FrameGrabber 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 <ntv2framegrabber.h>

Inheritance diagram for NTV2FrameGrabber:
[legend]
Collaboration diagram for NTV2FrameGrabber:
[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

 NTV2FrameGrabber (QObject *pInParentObject=NULL)
 Constructs me. More...
 
virtual ~NTV2FrameGrabber ()
 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=(0))
 
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 46 of file ntv2framegrabber.h.

Constructor & Destructor Documentation

◆ NTV2FrameGrabber()

NTV2FrameGrabber::NTV2FrameGrabber ( QObject *  pInParentObject = NULL)

Constructs me.

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

Definition at line 29 of file ntv2framegrabber.cpp.

◆ ~NTV2FrameGrabber()

NTV2FrameGrabber::~NTV2FrameGrabber ( )
virtual

My destructor.

Definition at line 60 of file ntv2framegrabber.cpp.

Member Function Documentation

◆ captionScreenChanged

void NTV2FrameGrabber::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 NTV2FrameGrabber::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 86 of file ntv2framegrabber.h.

◆ CheckForValidInput()

bool NTV2FrameGrabber::CheckForValidInput ( void  )
protected

Definition at line 757 of file ntv2framegrabber.cpp.

◆ ClearCaptionBuffer()

void NTV2FrameGrabber::ClearCaptionBuffer ( const bool  inSignalClients = (0))
protected

Definition at line 160 of file ntv2framegrabber.cpp.

◆ GetColorSpaceFromInputSource()

NTV2LHIHDMIColorSpace NTV2FrameGrabber::GetColorSpaceFromInputSource ( void  )
protected

Definition at line 856 of file ntv2framegrabber.cpp.

◆ GetDeviceIndex()

UWord NTV2FrameGrabber::GetDeviceIndex ( void  ) const

Definition at line 112 of file ntv2framegrabber.cpp.

◆ GetVideoFormatFromInputSource()

NTV2VideoFormat NTV2FrameGrabber::GetVideoFormatFromInputSource ( void  )
protected

Definition at line 798 of file ntv2framegrabber.cpp.

◆ GrabCaptions()

void NTV2FrameGrabber::GrabCaptions ( void  )
protected

Performs caption data extraction & decoding.

Definition at line 174 of file ntv2framegrabber.cpp.

◆ IsInput3Gb()

bool NTV2FrameGrabber::IsInput3Gb ( const NTV2InputSource  inputSource)
protected

Definition at line 868 of file ntv2framegrabber.cpp.

◆ newFrame

void NTV2FrameGrabber::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 NTV2FrameGrabber::newStatusString ( const QString &  inStatus)
signal

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

Parameters
[in]inStatusThe QString containing the status message.

◆ OutputAudio()

void NTV2FrameGrabber::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 930 of file ntv2framegrabber.cpp.

◆ run()

void NTV2FrameGrabber::run ( void  )
protectedvirtual

My thread function.

Definition at line 274 of file ntv2framegrabber.cpp.

◆ SetDeinterlaceNonProgressiveVideo()

void NTV2FrameGrabber::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 92 of file ntv2framegrabber.h.

◆ SetDeviceIndex()

void NTV2FrameGrabber::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 88 of file ntv2framegrabber.cpp.

◆ SetFixedReference()

void NTV2FrameGrabber::SetFixedReference ( bool  fixed)
inline

Definition at line 96 of file ntv2framegrabber.h.

◆ SetInputSource()

void NTV2FrameGrabber::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 74 of file ntv2framegrabber.cpp.

◆ SetTimeCodeSource()

void NTV2FrameGrabber::SetTimeCodeSource ( const NTV2TCIndex  inTCSource)

Definition at line 100 of file ntv2framegrabber.cpp.

◆ SetupAudio()

void NTV2FrameGrabber::SetupAudio ( void  )
protected

Performs audio configuration.

Definition at line 876 of file ntv2framegrabber.cpp.

◆ SetupInput()

bool NTV2FrameGrabber::SetupInput ( void  )
protected

Configures my AJA device for capture.

Definition at line 526 of file ntv2framegrabber.cpp.

◆ SetWithAudio()

void NTV2FrameGrabber::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 70 of file ntv2framegrabber.h.

◆ StopAutoCirculate()

void NTV2FrameGrabber::StopAutoCirculate ( void  )
protected

Stops capturing.

Definition at line 741 of file ntv2framegrabber.cpp.


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