11 #if defined (INCLUDE_AJACC) 17 #define NTV2_NUM_IMAGES (10) 20 #define FGFAIL(_expr_) AJA_sERROR (AJA_DebugUnit_DemoCapture, AJAFUNC << ": " << _expr_) 21 #define FGWARN(_expr_) AJA_sWARNING(AJA_DebugUnit_DemoCapture, AJAFUNC << ": " << _expr_) 22 #define FGDBG(_expr_) AJA_sDEBUG (AJA_DebugUnit_DemoCapture, AJAFUNC << ": " << _expr_) 23 #define FGNOTE(_expr_) AJA_sNOTICE (AJA_DebugUnit_DemoCapture, AJAFUNC << ": " << _expr_) 24 #define FGINFO(_expr_) AJA_sINFO (AJA_DebugUnit_DemoCapture, AJAFUNC << ": " << _expr_) 35 mbFixedReference (
false),
45 mFormatIsProgressive (
true),
48 mDoMultiChannel (
false),
52 mNumAudioChannels (0),
76 if (inInputSource != mInputSource)
80 mInputSource = inInputSource;
90 if (inDeviceIndex != mBoardNumber)
93 mBoardNumber = inDeviceIndex;
102 if (inTCIndex != mTimeCodeSource)
105 mTimeCodeSource = inTCIndex;
115 const UWord result (mBoardNumber);
121 #if defined (INCLUDE_AJACC) 123 static const UWord gTest [15][32] =
126 {{0x250C, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014,
127 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2510},
128 {0x007C, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E,
129 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x007C},
130 {0x007C, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005D,
131 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x007C},
132 {0x007C, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x0020, 0x00E1, 0x00E9, 0x00ED,
133 0x00F3, 0x00FA, 0x00E7, 0x00F7, 0x00D1, 0x00E1, 0x00F1, 0x2588, 0x00AE, 0x00B0, 0x00BD, 0x00BF, 0x2122, 0x00A2, 0x00A3, 0x007C},
134 {0x007C, 0x266A, 0x00E0, 0x00A0, 0x00E8, 0x00E2, 0x00EA, 0x00EE, 0x00F4, 0x00FB, 0x00C1, 0x00C9, 0x00D3, 0x00DA, 0x00DC, 0x00FC,
135 0x2018, 0x00A1, 0x002A, 0x2019, 0x2014, 0x00A9, 0x2120, 0x2022, 0x201C, 0x201D, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x007C},
136 {0x007C, 0x00C0, 0x00C2, 0x00C7, 0x00C8, 0x00CA, 0x00CB, 0x00EB, 0x00CE, 0x00CF, 0x00EF, 0x00D4, 0x00D9, 0x00F9, 0x00DB, 0x00AB,
137 0x00BB, 0x0020, 0x0020, 0x00C3, 0x00E3, 0x00CD, 0x00CC, 0x00EC, 0x00D2, 0x00F2, 0x00D5, 0x00F5, 0x007B, 0x007D, 0x005C, 0x007C},
138 {0x007C, 0x005E, 0x005F, 0x007C, 0x007E, 0x0020, 0x0020, 0x00C4, 0x00E4, 0x00D6, 0x00F6, 0x00DF, 0x00A5, 0x00A4, 0x007C, 0x00C5,
139 0x00E5, 0x00D8, 0x00F8, 0x00C4, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x007C},
140 {0x007C, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020,
141 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x007C},
142 {0x007C, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E,
143 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x007C},
144 {0x007C, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005D,
145 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x007C},
146 {0x007C, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x0020, 0x00E1, 0x00E9, 0x00ED,
147 0x00F3, 0x00FA, 0x00E7, 0x00F7, 0x00D1, 0x00E1, 0x00F1, 0x2588, 0x00AE, 0x00B0, 0x00BD, 0x00BF, 0x2122, 0x00A2, 0x00A3, 0x007C},
148 {0x007C, 0x266A, 0x00E0, 0x00A0, 0x00E8, 0x00E2, 0x00EA, 0x00EE, 0x00F4, 0x00FB, 0x00C1, 0x00C9, 0x00D3, 0x00DA, 0x00DC, 0x00FC,
149 0x2018, 0x00A1, 0x002A, 0x2019, 0x2014, 0x00A9, 0x2120, 0x2022, 0x201C, 0x201D, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x007C},
150 {0x007C, 0x00C0, 0x00C2, 0x00C7, 0x00C8, 0x00CA, 0x00CB, 0x00EB, 0x00CE, 0x00CF, 0x00EF, 0x00D4, 0x00D9, 0x00F9, 0x00DB, 0x00AB,
151 0x00BB, 0x0020, 0x0020, 0x00C3, 0x00E3, 0x00CD, 0x00CC, 0x00EC, 0x00D2, 0x00F2, 0x00D5, 0x00F5, 0x007B, 0x007D, 0x005C, 0x007C},
152 {0x007C, 0x005E, 0x005F, 0x007C, 0x007E, 0x0020, 0x0020, 0x00C4, 0x00E4, 0x00D6, 0x00F6, 0x00DF, 0x00A5, 0x00A4, 0x007C, 0x00C5,
153 0x00E5, 0x00D8, 0x00F8, 0x00C4, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x007C},
154 {0x2514, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014,
155 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2014, 0x2518}};
157 #endif // defined (INCLUDE_AJACC) 162 #if defined (INCLUDE_AJACC) 165 mScreenBuffer [row-1][col-1] = 0x0020;
169 (
void) inNotifyClients;
176 #if defined (INCLUDE_AJACC) 182 bool gotCaptionPacket (
false);
196 if (ancCEA708DataIn.GetPayloadData () && ancCEA708DataIn.GetPayloadByteCount ())
197 gotCaptionPacket = m708Decoder ? m708Decoder->SetSMPTE334AncData (ancCEA708DataIn.GetPayloadData (), ancCEA708DataIn.GetPayloadByteCount ()) :
false;
203 if (ancCEA608DataIn.GetPayloadData () && ancCEA608DataIn.GetPayloadByteCount ())
204 gotCaptionPacket = m708Decoder ? m708Decoder->SetSMPTE334AncData (ancCEA608DataIn.GetPayloadData (), ancCEA608DataIn.GetPayloadByteCount ()) :
false;
210 if (
AJA_SUCCESS (ancEIA608DataIn.ParsePayloadData ()))
212 gotCaptionPacket =
true;
218 if (
AJA_SUCCESS (ancEIA608DataIn.ParsePayloadData ()))
220 gotCaptionPacket =
true;
226 if (gotCaptionPacket && m708Decoder && m708Decoder->ParseSMPTE334AncPacket ())
227 captionData = m708Decoder->GetCC608CaptionData ();
234 m608Decoder->ProcessNew608FrameData (captionData);
238 #endif // defined (INCLUDE_AJACC) 242 void NTV2FrameGrabber::changeCaptionChannel (
int inNewCaptionChannelId)
244 #if defined (INCLUDE_AJACC) 245 const NTV2Line21Channel chosenCaptionChannel (static_cast <NTV2Line21Channel> (inNewCaptionChannelId));
252 m608Decoder->SubscribeChangeNotification (Caption608Changed,
this);
253 m608Decoder->SetDisplayChannel (chosenCaptionChannel);
259 else if (m608Decoder)
264 else if (m608Decoder->GetDisplayChannel () != chosenCaptionChannel)
265 m608Decoder->SetDisplayChannel (chosenCaptionChannel);
269 (
void) inNewCaptionChannelId;
270 #endif // defined (INCLUDE_AJACC) 278 ULWord framesCaptured (0);
286 if (mNTV2Card.
Open(mBoardNumber))
302 bool waitForInput =
false;
303 for (
unsigned offset(0); offset < 8; offset++)
332 currentImage->load (
":/resources/splash.png");
334 emit
newFrame (*currentImage,
true);
345 if (!mDoMultiChannel)
355 if (mNTV2Card.
Open(mBoardNumber))
362 currentImage->fill(Qt::lightGray);
363 QString status (QString(
"%1 is busy").arg(mNTV2Card.
GetDisplayName().c_str()));
383 currentImage->fill(Qt::lightGray);
384 QString status (QString(
"%1 is not ready").arg(mNTV2Card.
GetDisplayName().c_str()));
393 currentImage->fill(qRgba(40, 40, 40, 255));
394 QString status (QString(
"%1 is output-only device").arg(mNTV2Card.
GetDisplayName().c_str()));
403 currentImage->fill(qRgba(40, 40, 40, 255));
404 QString status (QString(
"%1 has no CSCs, won't work for this demo").arg(mNTV2Card.
GetDisplayName().c_str()));
420 mAudioDevice = mAudioOutput->start();
430 images[i] =
new QImage (mFrameDimensions.
width(), mFrameDimensions.
height(), QImage::Format_RGB32);
452 currentImage->fill(qRgba(40, 40, 40, 255));
467 #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) 468 mTransferStruct.
SetVideoBuffer (reinterpret_cast<PULWord>(currentImage->bits()),
ULWord(currentImage->sizeInBytes()));
470 mTransferStruct.
SetVideoBuffer (reinterpret_cast<PULWord>(currentImage->bits()),
ULWord(currentImage->byteCount()));
473 if (!mFormatIsProgressive && mDeinterlace)
477 if (currentImage->height() == int(mFrameDimensions.
height()) && currentImage->width() == int(mFrameDimensions.
width()))
478 for (
ULWord line (0); line < mFrameDimensions.
height(); line += 2)
479 ::memcpy (currentImage->scanLine (
int(line) + 1), currentImage->scanLine(
int(line)), mFrameDimensions.
width() * 4);
485 CRP188 tc (tcValues.at(mTimeCodeSource));
486 if (!tcValues.at (mTimeCodeSource).IsValid())
492 tc.GetRP188Str (mTimeCode);
496 outString.append (
" ");
498 outString.append (
" ");
499 outString.append (mTimeCode.c_str());
503 emit
newFrame (*currentImage, (framesCaptured == 0) ?
true :
false);
517 if (!mDoMultiChannel)
545 bool waitForInput(
false);
547 for (
unsigned offset(0); offset < 4; offset++)
569 mNTV2Card.
SetVideoFormat (mCurrentVideoFormat,
false,
false, mChannel);
575 FGDBG(
"mInputSource=" << mChannel <<
" mCurrentVideoFormat=" << vfString.toStdString()
576 <<
" wdth=" << mFrameDimensions.
width() <<
" hght=" << mFrameDimensions.
height());
579 if (!mbFixedReference)
587 bool is6g(
false), is12g(
false);
599 else for (
unsigned offset(0); offset < 4; offset++)
621 if (!mbFixedReference)
631 if (!mbFixedReference)
742 FGWARN(
"Bad mInputSource value " <<
DEC(mInputSource));
755 bool tsiEnable(
false);
757 for (
ULWord i(0); i < (tsiEnable ? 2 : mNumChannels); i++)
772 mCurrentVideoFormat = videoFormat;
776 if ((mCurrentVideoFormat != videoFormat) || (mCurrentColorSpace != colorSpace))
778 if (mDebounceCounter == 0)
781 mLastVideoFormat = videoFormat;
784 else if (mDebounceCounter == 6)
788 mCurrentVideoFormat = videoFormat;
789 mDebounceCounter = 0;
793 if (mLastVideoFormat == videoFormat)
796 mDebounceCounter = 0;
816 bool is6g (
false), is12g(
false);
827 switch (mInputSource)
838 if (videoFormatNext == videoFormat)
841 if (videoFormatNext == videoFormat)
844 if (videoFormatNext == videoFormat)
913 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) 914 mFormat.setSampleRate(48000);
915 mFormat.setChannelCount(2);
916 mFormat.setSampleSize(16);
917 mFormat.setCodec(
"audio/pcm");
918 mFormat.setByteOrder(QAudioFormat::LittleEndian);
919 mFormat.setSampleType(QAudioFormat::SignedInt);
921 mFormat.setSampleRate(48000);
922 mFormat.setChannelCount(2);
923 mFormat.setSampleFormat(QAudioFormat::Int16);
926 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) 927 QAudioDeviceInfo audioDeviceInfo (QAudioDeviceInfo::defaultOutputDevice());
928 if (audioDeviceInfo.isFormatSupported(mFormat))
929 mAudioOutput =
new QAudioOutput (mFormat,
AJA_NULL);
931 QAudioDevice deviceInfo (QMediaDevices::defaultAudioOutput());
932 if (deviceInfo.isFormatSupported(mFormat))
933 mAudioOutput =
new QAudioSink(deviceInfo, mFormat,
AJA_NULL);
940 const ULWord nBytesPerAJASample (4);
941 unsigned channel (0);
942 UWord qtSampleNdx (0);
943 const ULWord totalSamples (inNumValidBytes / mNumAudioChannels);
944 const ULWord totalAjaSamples (inNumValidBytes / nBytesPerAJASample);
945 UWord * pQtAudioBuffer (reinterpret_cast<UWord*>(pInOutBuffer));
953 for (
unsigned ajaSampleNdx(0); ajaSampleNdx < totalAjaSamples; ajaSampleNdx++)
957 pQtAudioBuffer [qtSampleNdx] = pInOutBuffer [ajaSampleNdx] >> 16;
962 if (channel == mNumAudioChannels)
967 mAudioDevice->write (reinterpret_cast<const char*>(pQtAudioBuffer), totalSamples);
972 #if defined (INCLUDE_AJACC) 977 pFG->caption608Changed (inChangeInfo);
983 bool changed (
false);
987 ushort utf16Char (m608Decoder ? m608Decoder->GetOnAirUTF16CharacterWithAttributes (row, col, attrs) : 0x0020);
990 if (utf16Char != mScreenBuffer [row-1][col-1])
992 mScreenBuffer [row-1][col-1] = utf16Char;
999 #endif // defined (INCLUDE_AJACC) NTV2Channel NTV2InputSourceToChannel(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2Channel value.
This class handles "analog" (Line 21) based CEA-608 caption data packets.
virtual bool ReleaseStreamForApplicationWithReference(ULWord inApplicationType, int32_t inProcessID)
A reference-counted version of CNTV2DriverInterface::ReleaseStreamForApplication useful for process g...
const UWord NTV2_CC608_MinCol(1)
The minimum column index number (located at the left edge of the screen).
void SetRP188(ULWord ulFrms, ULWord ulSecs, ULWord ulMins, ULWord ulHrs, NTV2FrameRate frameRate, const bool bDropFrame=false, const bool bSMPTE372=false)
#define AJA_SUCCESS(_status_)
virtual bool SetTaskMode(const NTV2TaskMode inMode)
Sets the device's task mode.
UByte f2_char1
Caption Byte 1 of Field 2.
virtual void run(void)
My thread function.
virtual AJAStatus AddReceivedAncillaryData(const NTV2Buffer &inReceivedData, const uint32_t inFrameNum=0)
Parse "raw" ancillary data bytes received from hardware (ingest) – see SDI Anc Buffer Data Format –...
Identifies the 5th SDI video input.
virtual bool GetSDITransmitEnable(const NTV2Channel inChannel, bool &outEnabled)
Answers whether or not the specified SDI connector is currently acting as a transmitter (i...
virtual bool SetHDMIV2Mode(const NTV2HDMIV2Mode inMode)
Sets HDMI V2 mode for the device.
bool CanDo12gRouting(void)
The AutoCirculate channel is running.
bool Allocate(const size_t inByteCount, const bool inPageAligned=false)
Allocates (or re-allocates) my user-space storage using the given byte count. I assume full responsib...
Identifies SMPTE HD 1080p.
This class is used to respond to dynamic events that occur during CEA-608 caption decoding...
UByte f1_char2
Caption Byte 2 of Field 1.
Specifies the device's internal clock.
virtual bool SetReference(const NTV2ReferenceSource inRefSource, const bool inKeepFramePulseSelect=(0))
Sets the device's clock reference source. See Video Output Clocking & Synchronization for more inform...
NTV2TimecodeIndex NTV2InputSourceToTimecodeIndex(const NTV2InputSource inInputSource, const bool inEmbeddedLTC=false)
Converts a given NTV2InputSource to its equivalent NTV2TimecodeIndex value.
This identifies the invalid (unspecified, uninitialized) VANC mode.
virtual bool SetVideoFormat(const NTV2VideoFormat inVideoFormat, const bool inIsAJARetail=(!(0)), const bool inKeepVancSettings=(0), const NTV2Channel inChannel=NTV2_CHANNEL1)
Configures the AJA device to handle a specific video format.
virtual bool Set4kSquaresEnable(const bool inIsEnabled, const NTV2Channel inChannel)
Enables or disables SMPTE 425 "2K quadrants" mode for the given FrameStore bank on the device...
Obtain audio samples from the device HDMI input, if available.
UByte f1_char1
Caption Byte 1 of Field 1.
virtual bool IsDeviceReady(const bool inCheckValid=(0))
enum _NTV2VideoFormat NTV2VideoFormat
Identifies a particular video format.
Declares the AJAAncillaryData_Cea608_line21 class.
Header file for the NTV2FrameGrabber class.
NTV2EmbeddedAudioInput NTV2InputSourceToEmbeddedAudioInput(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2EmbeddedAudioInput value.
ULWord GetByteCount(void) const
Capture (input) mode, which writes into device SDRAM.
UByte f2_char2
Caption Byte 2 of Field 2.
virtual bool Close(void)
Closes me, releasing host resources that may have been allocated in a previous Open call...
#define NTV2_IS_4K_VIDEO_FORMAT(__f__)
virtual bool GetSDIInput3GbPresent(bool &outValue, const NTV2Channel channel)
virtual bool Open(const UWord inDeviceIndex)
Opens a local/physical AJA device so it can be monitored/controlled.
Obtain audio samples from the audio that's embedded in the video HANC.
FRAME_STAMP acFrameStamp
Frame stamp for the transferred frame.
void SetInputSource(const NTV2InputSource inInputSource)
Sets the input to be used for capture on the AJA device being used.
bool CanDoHDMIQuadRasterConversion(void)
void SetTimeCodeSource(const NTV2TCIndex inTCSource)
virtual bool SetAudioRate(const NTV2AudioRate inRate, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Sets the NTV2AudioRate for the given Audio System.
void ClearCaptionBuffer(const bool inSignalClients=(0))
virtual bool AutoCirculateGetStatus(const NTV2Channel inChannel, AUTOCIRCULATE_STATUS &outStatus)
Returns the current AutoCirculate status for the given channel.
virtual bool SetFrameBufferFormat(NTV2Channel inChannel, NTV2FrameBufferFormat inNewFormat, bool inIsAJARetail=(!(0)), NTV2HDRXferChars inXferChars=NTV2_VPID_TC_SDR_TV, NTV2HDRColorimetry inColorimetry=NTV2_VPID_Color_Rec709, NTV2HDRLuminance inLuminance=NTV2_VPID_Luminance_YCbCr)
Sets the frame buffer format for the given FrameStore on the AJA device.
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
virtual class DeviceCapabilities & features(void)
virtual bool SetMultiFormatMode(const bool inEnable)
Enables or disables multi-format (per channel) device operation. If enabled, each device channel can ...
virtual bool GetHDMIInputColor(NTV2LHIHDMIColorSpace &outValue, const NTV2Channel inHDMIInput=NTV2_CHANNEL1)
Answers with the current colorspace for the given HDMI input.
virtual bool GetSDIInput12GPresent(bool &outValue, const NTV2Channel channel)
bool CanDoCustomAnc(void)
#define QTPREVIEW_WIDGET_Y
bool IsProgressivePicture(const NTV2VideoFormat format)
#define NTV2_ASSERT(_expr_)
bool GetInputTimeCodes(NTV2TimeCodeList &outValues) const
Returns all RP188 timecodes associated with the frame in NTV2TCIndex order.
Obtain audio samples from the device analog input(s), if available.
ULWord height(void) const
#define NTV2_AUDIOSIZE_MAX
NTV2TCIndex
These enum values are indexes into the capture/playout AutoCirculate timecode arrays.
virtual bool GetTaskMode(NTV2TaskMode &outMode)
Retrieves the device's current task mode.
virtual bool SetAudioSystemInputSource(const NTV2AudioSystem inAudioSystem, const NTV2AudioSource inAudioSource, const NTV2EmbeddedAudioInput inEmbeddedInput)
Sets the audio source for the given NTV2AudioSystem on the device.
AutoCirculate Frame Range.
std::string NTV2InputSourceToString(const NTV2InputSource inValue, const bool inForRetailDisplay=false)
NTV2OutputXptID GetInputSourceOutputXpt(const NTV2InputSource inInputSource, const bool inIsSDI_DS2=false, const bool inIsHDMI_RGB=false, const UWord inHDMI_Quadrant=0)
static bool Create(CNTV2CaptionDecoder708Ptr &outDecoder)
Creates a new CNTV2CaptionEncoder708 instance.
virtual bool SetLTCInputEnable(const bool inEnable)
Enables or disables the ability for the device to read analog LTC on the reference input connector...
bool IsInput3Gb(const NTV2InputSource inputSource)
NTV2Standard
Identifies a particular video standard.
Playout (output) mode, which reads from device SDRAM.
virtual std::string GetDescription(void) const
virtual bool SetMode(const NTV2Channel inChannel, const NTV2Mode inNewValue, const bool inIsRetail=(!(0)))
Determines if a given FrameStore on the AJA device will be used to capture or playout video...
UWord GetDeviceIndex(void) const
virtual bool IsOpen(void) const
#define AJAAncillaryDataType_Cea608_Vanc
bool bGotField2Data
True if Field 2 bytes have been set; otherwise false.
virtual bool SetSDITransmitEnable(const NTV2Channel inChannel, const bool inEnable)
Sets the specified bidirectional SDI connector to act as an input or an output.
bool HasBiDirectionalSDI(void)
#define NTV2_INPUT_SOURCE_IS_HDMI(_inpSrc_)
virtual bool AutoCirculateTransfer(const NTV2Channel inChannel, AUTOCIRCULATE_TRANSFER &transferInfo)
Transfers all or part of a frame as specified in the given AUTOCIRCULATE_TRANSFER object to/from the ...
virtual bool SetRP188SourceFilter(const NTV2Channel inSDIInput, const UWord inFilterValue)
Sets the RP188 DBB filter for the given SDI input.
CEA-608 Character Attributes.
#define NTV2_IS_HD_VIDEO_FORMAT(__f__)
virtual bool GetVANCMode(NTV2VANCMode &outVancMode, const NTV2Channel inChannel=NTV2_CHANNEL1)
Retrieves the current VANC mode for the given FrameStore.
virtual std::string GetDisplayName(void)
Answers with this device's display name.
virtual AJAAncillaryData * GetAncillaryDataWithType(const AJAAncDataType inMatchType, const uint32_t inIndex=0) const
Answers with the AJAAncillaryData object having the given type and index.
static bool Create(CNTV2CaptionDecoder608Ptr &outEncoder)
Creates a new CNTV2CaptionEncoder608 instance.
NTV2InputXptID GetCSCInputXptFromChannel(const NTV2Channel inCSC, const bool inIsKeyInput=false)
NTV2AutoCirculateState acState
Current AutoCirculate state.
virtual NTV2VideoFormat GetInputVideoFormat(const NTV2InputSource inVideoSource=NTV2_INPUTSOURCE_SDI1, const bool inIsProgressive=(0))
Returns the video format of the signal that is present on the given input source. ...
static void Sleep(const int32_t inMilliseconds)
Suspends execution of the current thread for a given number of milliseconds.
const UWord NTV2_CC608_MaxCol(32)
The maximum column index number (located at the right edge of the screen).
2: OEM (recommended): device configured by client application(s) with some driver involvement...
bool bGotField1Data
True if Field 1 bytes have been set; otherwise false.
NTV2InputXptID GetFrameStoreInputXptFromChannel(const NTV2Channel inFrameStore, const bool inIsBInput=false)
ULWord acAudioTransferSize
Number of bytes captured into the audio buffer.
NTV2InputSource GetNTV2InputSourceForIndex(const ULWord inIndex0, const NTV2IOKinds inKinds=NTV2_IOKINDS_SDI)
ULWord GetIndexForNTV2InputSource(const NTV2InputSource inValue)
std::string NTV2VideoFormatToString(const NTV2VideoFormat inValue, const bool inUseFrameRate=false)
See 8-Bit ARGB, RGBA, ABGR Formats.
virtual bool AcquireStreamForApplicationWithReference(ULWord inApplicationType, int32_t inProcessID)
A reference-counted version of CNTV2DriverInterface::AcquireStreamForApplication useful for process g...
void SetDeviceIndex(const UWord inDeviceIndex)
Sets the AJA device to be used for capture.
virtual bool SetTsiFrameEnable(const bool inIsEnabled, const NTV2Channel inChannel)
Enables or disables SMPTE 425 two-sample interleave (Tsi) frame mode on the device.
NTV2VideoFormat GetVideoFormatFromInputSource(void)
#define AUTOCIRCULATE_WITH_ANC
Use this to AutoCirculate with ancillary data.
Specifies channel or FrameStore 2 (or the 2nd item).
virtual NTV2DeviceID GetDeviceID(void)
virtual bool GetSDIInput6GPresent(bool &outValue, const NTV2Channel channel)
void GrabCaptions(void)
Performs caption data extraction & decoding.
const UWord NTV2_CC608_MinRow(1)
The minimum row index number (located at the top of the screen).
virtual bool AutoCirculateStop(const NTV2Channel inChannel, const bool inAbort=(0))
Stops AutoCirculate for the given channel, and releases the on-device frame buffers that were allocat...
#define NTV2_IS_VALID_CHANNEL(__x__)
void newFrame(const QImage &inImage, const bool inClear)
This is signaled (called) when a new frame has been captured and is available for display...
virtual bool Connect(const NTV2InputCrosspointID inInputXpt, const NTV2OutputCrosspointID inOutputXpt, const bool inValidate=(0))
Connects the given widget signal input (sink) to the given widget signal output (source).
NTV2InputSource
Identifies a specific video input source.
A QThread that captures audio/video from NTV2-compatible AJA devices and uses Qt signals to emit ARGB...
bool CheckForValidInput(void)
#define IsValidLine21Channel(_chan_)
virtual bool SetAudioBufferSize(const NTV2AudioBufferSize inValue, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Changes the size of the audio buffer that is used for a given Audio System in the AJA device...
virtual uint32_t CountAncillaryDataWithType(const AJAAncDataType inMatchType) const
Answers with the number of AJAAncillaryData objects having the given type.
bool SetupInput(void)
Configures my AJA device for capture.
NTV2Buffer acANCField2Buffer
The host "Field 2" ancillary data buffer. This field is owned by the client application, and thus is responsible for allocating and/or freeing it. If the pointer is NULL or the size is zero, no "Field 2" ancillary data will be transferred. Use the AUTOCIRCULATE_TRANSFER::SetAncBuffers method to set or reset this field.
This identifies the first Audio System.
void SetupAudio(void)
Performs audio configuration.
NTV2LHIHDMIColorSpace GetColorSpaceFromInputSource(void)
#define NTV2_IS_VALID_INPUT_SOURCE(_inpSrc_)
static const ULWord kDemoAppSignature((((uint32_t)( 'D'))<< 24)|(((uint32_t)( 'E'))<< 16)|(((uint32_t)( 'M'))<< 8)|(((uint32_t)( 'O'))<< 0))
Declares numerous NTV2 utility functions.
ULWord acBufferLevel
Number of buffered frames in driver ready to capture or play.
This structure encapsulates all possible CEA-608 caption data bytes that may be associated with a giv...
static bool Get4KInputFormat(NTV2VideoFormat &inOutVideoFormat)
Given a video format, if all 4 inputs are the same and promotable to 4K, this function does the promo...
Specifies the Analog In 1 connector.
ULWord GetHDMIVersion(void)
virtual AJAStatus ParseAllAncillaryData(void)
Sends a "ParsePayloadData" command to all of my AJAAncillaryData objects.
This is returned from the CNTV2Card::AutoCirculateGetStatus function.
std::vector< NTV2_RP188 > NTV2TimeCodeList
An ordered sequence of zero or more NTV2_RP188 structures. An NTV2TCIndex enum value can be used as a...
void StopAutoCirculate(void)
Stops capturing.
Specifies channel or FrameStore 1 (or the first item).
virtual bool AutoCirculateStart(const NTV2Channel inChannel, const ULWord64 inStartTime=0)
Starts AutoCirculating the specified channel that was previously initialized by CNTV2Card::AutoCircul...
void captionScreenChanged(const ushort *pInScreen)
This is signaled (called) when my caption screen buffer changes.
AUTOCIRCULATE_TRANSFER_STATUS acTransferStatus
Contains status information that's valid after CNTV2Card::AutoCirculateTransfer returns, including the driver buffer level, number of frames processed or dropped, audio and anc transfer byte counts, and a complete FRAME_STAMP that has even more detailed clocking information.
void newStatusString(const QString &inStatus)
This is signaled (called) when my status string changes.
NTV2VANCMode
These enum values identify the available VANC modes.
virtual bool SetSDIInLevelBtoLevelAConversion(const NTV2ChannelSet &inSDIInputs, const bool inEnable)
Enables or disables 3G level B to 3G level A conversion at the SDI input(s).
#define NTV2_INPUT_SOURCE_IS_ANALOG(_inpSrc_)
NTV2AudioSource
This enum value determines/states where an audio system will obtain its audio samples.
NTV2AudioSystem NTV2ChannelToAudioSystem(const NTV2Channel inChannel)
Converts the given NTV2Channel value into its equivalent NTV2AudioSystem.
NTV2FrameGrabber(QObject *pInParentObject=NULL)
Constructs me.
Specifies channel or FrameStore 4 (or the 4th item).
This file contains some structures, constants, classes and functions that are used in some of the dem...
Specifies channel or FrameStore 5 (or the 5th item).
Identifies the first analog video input.
NTV2Standard GetNTV2StandardFromVideoFormat(const NTV2VideoFormat inVideoFormat)
#define NTV2_IS_VALID_VIDEO_FORMAT(__f__)
void * GetHostPointer(void) const
#define AJAAncillaryDataType_Cea708
NTV2OutputXptID GetSDIInputOutputXptFromChannel(const NTV2Channel inSDIInput, const bool inIsDS2=false)
#define QTPREVIEW_WIDGET_X
const UWord NTV2_CC608_MaxRow(15)
The maximum permissible row index number (located at the bottom of the screen).
NTV2Buffer acAudioBuffer
The host audio buffer. This field is owned by the client application, and thus is responsible for all...
UWord GetMaxAudioChannels(void)
I am the principal class that stores a single SMPTE-291 SDI ancillary data packet OR the digitized co...
virtual bool AutoCirculateInitForInput(const NTV2Channel inChannel, const UWord inFrameCount=7, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_INVALID, const ULWord inOptionFlags=0, const UByte inNumChannels=1, const UWord inStartFrameNumber=0, const UWord inEndFrameNumber=0)
Prepares for subsequent AutoCirculate ingest, designating a contiguous block of frame buffers on the ...
#define AUTOCIRCULATE_WITH_RP188
Use this to AutoCirculate with RP188.
#define NTV2_INPUT_SOURCE_IS_SDI(_inpSrc_)
Declares the AJAAncillaryList class.
NTV2FrameSize & set(const ULWord inWidth, const ULWord inHeight)
Sets my dimension values.
NTV2Line21Channel
The CEA-608 caption channels: CC1 thru CC4, TX1 thru TX4, plus XDS.
#define AJAAncillaryDataType_Cea608_Line21
virtual bool GetTsiFrameEnable(bool &outIsEnabled, const NTV2Channel inChannel)
Returns the current SMPTE 425 two-sample-interleave frame mode on the device, whether it's enabled or...
NTV2Buffer acANCBuffer
The host ancillary data buffer. This field is owned by the client application, and thus is responsibl...
Identifies the 1st SDI video input.
virtual bool SetNumberAudioChannels(const ULWord inNumChannels, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Sets the number of audio channels to be concurrently captured or played for a given Audio System on t...
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 devic...
NTV2OutputXptID GetCSCOutputXptFromChannel(const NTV2Channel inCSC, const bool inIsKey=false, const bool inIsRGB=false)
virtual bool WaitForInputVerticalInterrupt(const NTV2Channel inChannel=NTV2_CHANNEL1, UWord inRepeatCount=1)
Efficiently sleeps the calling thread/process until the next one or more field (interlaced video) or ...
I am an ordered collection of AJAAncillaryData instances which represent one or more SMPTE 291 data p...
bool CanDoMultiFormat(void)
virtual ~NTV2FrameGrabber()
My destructor.
bool SetVideoBuffer(ULWord *pInVideoBuffer, const ULWord inVideoByteCount)
Sets my video buffer for use in a subsequent call to CNTV2Card::AutoCirculateTransfer.
Specifies channel or FrameStore 3 (or the 3rd item).
NTV2ReferenceSource NTV2InputSourceToReferenceSource(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2ReferenceSource value.
virtual bool EnableChannel(const NTV2Channel inChannel)
Enables the given FrameStore.