28 #define AsConstUBytePtr(__p__) reinterpret_cast<const UByte*>(__p__) 29 #define AsConstULWordPtr(__p__) reinterpret_cast<const ULWord*>(__p__) 30 #define AsULWordPtr(__p__) reinterpret_cast<ULWord*>(__p__) 31 #define AsUBytePtr(__p__) reinterpret_cast<UByte*>(__p__) 42 : mConfig (inConfigData),
53 mCaptionDataTally (0),
54 m608Channel (mConfig.fCaptionChannel),
66 mHeadUpDisplayOn (
true),
75 NTV2_ASSERT (m608Decoder && m708DecoderAnc && m708DecoderVanc);
107 while (mCaptureThread.
Active())
110 while (mPlayoutThread.
Active())
137 cerr <<
"## ERROR: Device '" << deviceStr <<
"' can't burn-in captions because at least 2 frame stores are required" << endl;
142 cerr <<
"## ERROR: Device '" << deviceStr <<
"' can't burn-in captions because device can only capture/ingest" << endl;
147 cerr <<
"## ERROR: Device '" << deviceStr <<
"' can't be used -- at least 1 SDI input and 1 SDI output required" << endl;
152 cerr <<
"## ERROR: Device '" << deviceStr <<
"' can't burn-in captions because a mixer/keyer widget is required" << endl;
157 cerr <<
"## ERROR: Device '" << deviceStr <<
"' can't burn-in captions because it can't do 8-bit RGB (with alpha)" << endl;
165 {cerr <<
"## ERROR: Cannot acquire -- device busy" << endl;
return AJA_STATUS_BUSY;}
176 cerr <<
"## WARNING: Enabling VANC because no Anc extractors" << endl;
191 {cerr <<
"## WARNING: SubscribeChangeNotification failed" << endl;
return AJA_STATUS_FAIL;}
193 cerr << mConfig << endl;
194 #endif // defined(_DEBUG) 216 if (!frameData.fVideoBuffer.Allocate(captureBufferSize,
true))
229 #if defined(NTV2_BUFFER_LOCK) 230 frameData.LockAll(mDevice);
232 mCircularBuffer.
Add(&frameData);
243 #if defined(NTV2_BUFFER_LOCK) 244 for (
size_t ndx(0); ndx < mHostBuffers.size(); ndx++)
249 #endif // NTV2_BUFFER_LOCK 250 mHostBuffers.clear();
251 mCircularBuffer.
Clear();
259 bool isTransmit (
false);
268 {cerr <<
"## ERROR: Must specify at least input source or input channel" << endl;
return AJA_STATUS_FAIL;}
277 {cerr <<
"## ERROR: '" << deviceName <<
"' cannot grab captions from '" << inputName <<
"'" << endl;
return AJA_STATUS_FAIL;}
279 {cerr <<
"## ERROR: Input '" << inputName <<
"' not SDI" << endl;
return AJA_STATUS_FAIL;}
283 {cerr <<
"## ERROR: " << deviceName <<
" has no " << channelName <<
" input" << endl;
return AJA_STATUS_FAIL;}
286 mActiveSDIInputs.insert(sdiInput);
328 cerr <<
"## NOTE: Using " << deviceName <<
" " << (mConfig.
fUseVanc ?
"VANC" :
"AncExt") <<
" with spigot=" << inputName
357 UWord sdiOutput(mOutputChannel);
399 static const bool ShowRoutingProgress(
false);
401 mInputConnections.clear();
405 if (isRGBFBF && isRGBWire)
409 for (
size_t ndx(0); ndx < sdiInputs.size(); ndx++)
410 {
NTV2Channel frmSt(frameStores.at(ndx)), sdiIn(sdiInputs.at(ndx));
425 UWord(frameStores.size()*2));
427 for (
size_t ndx(0); ndx < sdiInputs.size(); ndx++)
428 {
NTV2Channel frmSt(frameStores.at(ndx/2)), tsiMux(tsiMuxes.at(ndx/2)), sdiIn(sdiInputs.at(ndx));
443 else if (isRGBFBF && !isRGBWire)
446 for (
size_t ndx(0); ndx < sdiInputs.size(); ndx++)
447 {
NTV2Channel frmSt(frameStores.at(ndx)), sdiIn(sdiInputs.at(ndx));
458 UWord(2*sdiInputs.size()));
460 UWord(frameStores.size()));
465 for (
size_t ndx(0); ndx < cscs.size(); ndx++)
466 {
NTV2Channel frmSt(frameStores.at(ndx/2)), sdiIn(sdiInputs.at(ndx/2)), tsiMux(tsiMuxes.at(ndx/2)),
478 else if (!isRGBFBF && isRGBWire)
482 for (
size_t ndx(0); ndx < sdiInputs.size(); ndx++)
483 {
NTV2Channel frmSt(frameStores.at(ndx)), csc(activeCSCs.at(ndx)), sdi(sdiInputs.at(ndx));
504 for (
size_t ndx(0); ndx < sdiInputs.size(); ndx++)
505 {
NTV2Channel frmSt(frameStores.at(ndx)), sdiIn(sdiInputs.at(ndx));
516 UWord(frameStores.size()));
517 cerr << (is4KHFR ?
"4KHFR" :
"") << endl <<
"FrameStores: " << ::
NTV2ChannelListToStr(frameStores) << endl
519 for (
size_t ndx(0); ndx < sdiInputs.size(); ndx++)
520 {
NTV2Channel frmSt(frameStores.at(is4KHFR ? ndx/2 : ndx)),
521 tsiMux(tsiMuxes.at(is4KHFR ? ndx/2 : ndx)),
522 sdiIn(sdiInputs.at(ndx));
549 set_difference (allSDIs.begin(), allSDIs.end(),
550 mActiveSDIInputs.begin(), mActiveSDIInputs.end(),
551 inserter(sdiOuts, sdiOuts.begin()));
558 for (
size_t sdiNdx(0); sdiNdx < sdiOutputs.size(); sdiNdx++)
560 const NTV2Channel sdiIn(sdiInputs.at(sdiNdx < sdiInputs.size() ? sdiNdx : sdiInputs.size()-1));
563 cerr <<
"Switching SDI " << (sdiOut+1) <<
" to output" << endl;
600 if (chan != sdiInputAsChan)
632 result = mCaptureThread.
Start();
644 NTV2CCGrabber * pApp (reinterpret_cast <NTV2CCGrabber *> (pContext));
653 ULWord xferTally(0), xferFails(0), noVideoTally(0), waitTally(0);
691 CAPWARN(
"VANC mode incompatible with 4K/UHD format");
733 mInputXferInfo.
SetBuffers (pCaptureData->VideoBuffer(), pCaptureData->VideoBufferSize(),
734 pCaptureData->AudioBuffer(), pCaptureData->AudioBufferSize(),
735 pCaptureData->AncBuffer(), pCaptureData->AncBufferSize(),
736 pCaptureData->AncBuffer2(), pCaptureData->AncBuffer2Size());
773 ULWord vpidDS1(0), vpidDS2(0);
778 const bool vfChanged(newVF != currentVF);
779 const bool vpidChgd(mVPIDInfoDS1.
GetVPID() != vpidDS1 || mVPIDInfoDS2.
GetVPID() != vpidDS2);
780 if (vfChanged || vpidChgd)
800 CAPWARN(
"FrameStore pixel format changed from '" 817 CAPNOTE(
"Thread completed, " <<
DEC(xferTally) <<
" of " <<
DEC(xferTally+xferFails) <<
" frms xferred, " 818 <<
DEC(waitTally) <<
" waits, " <<
DEC(noVideoTally) <<
" sig chgs");
825 ULWord numConsecutiveFrames(0), MIN_NUM_CONSECUTIVE_FRAMES(6);
827 NTV2Channel sdiConnector(*(mActiveSDIInputs.begin()));
845 if (++loopCount % 500 == 0)
846 CAPDBG(
"Waiting for valid video signal to appear at " 849 else if (numConsecutiveFrames == 0)
852 numConsecutiveFrames++;
854 else if (numConsecutiveFrames == MIN_NUM_CONSECUTIVE_FRAMES)
856 numConsecutiveFrames = 0;
860 numConsecutiveFrames = (lastVF == currVF) ? numConsecutiveFrames + 1 : 0;
867 {
ULWord vpidDS1(0), vpidDS2(0);
878 if (vfVPID != result && !mSquares)
885 ostringstream osserr;
889 osserr << mDevice.
GetModelName() <<
" can't handle TSI";
890 if (!osserr.str().empty())
908 mInputFrameStores.clear(); mInputFrameStores.insert(mConfig.
fInputChannel);
909 mActiveSDIInputs.clear(); mActiveSDIInputs.insert(sdiConnector);
916 mActiveCSCs = mActiveSDIInputs;
934 cerr << endl <<
"## NOTE: VANC frame geometry " << (mConfig.
fUseVanc ?
"enabled" :
"disabled") << endl;
977 CaptionData captionData708Anc, captionData708Vanc, captionData608Anc, captionData608Vanc, captionDataL21Anc, captionDataL21;
1004 CAPDBG(
DEC(diffs.size()) <<
" VANC/AncExt diff(s): " << lines.at(0));
1005 for (
size_t n(1);
n < lines.size();
n++)
1014 ULWord line21RowOffset(0);
1026 line21RowOffset+1));
1039 if (pkt608F1.GetPayloadData() && pkt608F1.GetPayloadByteCount() &&
AJA_SUCCESS(pkt608F1.ParsePayloadData()))
1045 if (pkt608F2.GetPayloadData() && pkt608F2.GetPayloadByteCount() &&
AJA_SUCCESS(pkt608F2.ParsePayloadData()))
1053 if (pkt608F1.GetPayloadData() && pkt608F1.GetPayloadByteCount() &&
AJA_SUCCESS(pkt608F1.ParsePayloadData()))
1059 if (pkt608F2.GetPayloadData() && pkt608F2.GetPayloadByteCount() &&
AJA_SUCCESS(pkt608F2.ParsePayloadData()))
1067 bool hasParityErrors (
false);
1068 if (vancCEA708DataIn.GetPayloadData() && vancCEA708DataIn.GetPayloadByteCount() &&
AJA_SUCCESS(vancCEA708DataIn.ParsePayloadData()))
1069 if (m708DecoderVanc->
SetSMPTE334AncData (vancCEA708DataIn.GetPayloadData(), vancCEA708DataIn.GetPayloadByteCount()))
1072 vector<UByte> svcBlk;
1073 size_t blkSize(0), byteCount(0);
1075 bool isExtendedSvc(
false);
1076 if (!hasParityErrors)
1086 bool hasParityErrors (
false);
1087 if (ancCEA708DataIn.GetPayloadData() && ancCEA708DataIn.GetPayloadByteCount() &&
AJA_SUCCESS(ancCEA708DataIn.ParsePayloadData()))
1088 if (m708DecoderAnc->
SetSMPTE334AncData (ancCEA708DataIn.GetPayloadData(), ancCEA708DataIn.GetPayloadByteCount()))
1091 vector<UByte> svcBlk;
1092 size_t blkSize(0), byteCount(0);
1094 bool isExtendedSvc(
false);
1095 if (!hasParityErrors)
1105 if (
AJA_SUCCESS(ancEIA608DataIn.ParsePayloadData()))
1116 ostringstream ossCompare;
1122 if (captionDataL21 != captionDataL21Anc)
1123 ossCompare <<
"L21Vanc != L21Anlg: " << captionDataL21 <<
" " << captionDataL21Anc << endl;
1125 pL21CaptionData = &captionDataL21;
1126 else if (captionDataL21Anc.
HasData())
1127 pL21CaptionData = &captionDataL21Anc;
1128 if (captionData608Anc.
HasData() && pL21CaptionData)
1129 if (captionData608Anc != *pL21CaptionData)
1130 ossCompare <<
"608 != L21: " << captionData608Anc <<
" " << *pL21CaptionData << endl;
1131 if (captionData608Anc.
HasData())
1132 p608CaptionData = &captionData608Anc;
1133 else if (pL21CaptionData)
1134 p608CaptionData = pL21CaptionData;
1139 if (captionData608Anc != captionData708Anc)
1140 ossCompare <<
"608anc != 708anc: " << captionData608Anc <<
" " << captionData708Anc << endl;
1141 if (captionData608Vanc.
HasData() && captionData708Vanc.
HasData())
1142 if (captionData608Vanc != captionData708Vanc)
1143 ossCompare <<
"608vanc != 708vanc: " << captionData608Vanc <<
" " << captionData708Vanc << endl;
1144 if (captionData708Anc.
HasData())
1145 p608CaptionData = &captionData708Anc;
1146 else if (captionData708Vanc.
HasData())
1147 p608CaptionData = &captionData708Vanc;
1148 else if (captionData608Anc.
HasData())
1149 p608CaptionData = &captionData608Anc;
1150 else if (captionData608Vanc.
HasData())
1151 p608CaptionData = &captionData608Vanc;
1153 if (!ossCompare.str().empty())
1154 CAPDBG(
"CaptionData mis-compare(s): " << ossCompare.str());
1167 if (!p608CaptionData)
1175 DoCCOutput(inFrameNum, *p608CaptionData, inVideoFormat);
1183 const bool isFirstTime (mLastOutFrame == 0 && inFrameNum > mLastOutFrame);
1184 char char1(0), char2(0);
1195 if (char1 >=
' ' && char1 <=
'~')
1197 if (mLastOutStr !=
" " || char1 !=
' ')
1198 {cout << char1 << flush; mLastOutStr = string(1,char1);}
1199 if (char2 >=
' ' && char2 <=
'~')
1201 if (mLastOutStr !=
" " || char2 !=
' ')
1202 {cout << char2 << flush; mLastOutStr = string(1,char2);}
1205 else if (mLastOutStr !=
" ")
1206 {cout <<
" " << flush; mLastOutStr =
" ";}
1211 if (inFrameNum == (mLastOutFrame+1))
1213 mLastOutFrame = inFrameNum;
1218 if (currentScreen != mLastOutStr)
1219 cout << currentScreen << endl;
1220 mLastOutStr = currentScreen;
1221 mFirstOutFrame = mLastOutFrame = inFrameNum;
1228 oss <<
Hex0N(u16,4);
1229 mLastOutStr.append(mLastOutStr.empty() ?
"\t" :
" ");
1230 mLastOutStr.append(oss.str());
1231 if (inFrameNum == (mLastOutFrame+1))
1233 mLastOutFrame = inFrameNum;
1238 cout <<
"Scenarist_SCC V1.0" << endl;
1244 cout << endl << tcStr <<
":" << mLastOutStr << endl;
1245 mFirstOutFrame = mLastOutFrame = inFrameNum;
1246 mLastOutStr.clear();
1250 if (inFrameNum % 60 == 0)
1255 const vector<uint32_t> stats (chDecoder->GetStats());
1258 for (
size_t num(0); num < stats.size(); num++)
1265 ostringstream oss; oss <<
DEC(stats[num]);
1291 mDevice.
SetVideoFormat (inVideoFormat,
false,
false, mOutputChannel);
1300 cerr <<
"## NOTE: Caption burn-in using mixer/keyer " << (mixerNumber+1) <<
" on " << ::
NTV2ChannelToString(mOutputChannel)
1319 UWord connectFailures (0);
1344 if (
ULWord(chan) >= numVideoOutputs)
1348 if (chan == sdiInputAsChan)
1383 return connectFailures == 0;
1397 result = mPlayoutThread.
Start();
1409 NTV2CCGrabber * pApp (reinterpret_cast <NTV2CCGrabber *> (pContext));
1420 const string indicators [] = {
"/",
"-",
"\\",
"|",
""};
1432 const NTV2FormatDesc formatDesc (videoFormat, mPlayoutFBF, vancMode);
1436 UWord consecSyncErrs (0);
1438 static uint64_t frameTally (0);
1440 ULWord lastErrorTally (0);
1444 if (!hostBuffer.
Allocate(bufferSizeBytes,
true))
1445 {cerr <<
"## NOTE: Caption burn-in failed -- unable to allocate " << bufferSizeBytes <<
"-byte caption video buffer" << endl;
return;}
1453 pingPong = pingPong ? 0 : 1;
1456 while (!mGlobalQuit)
1466 if (mHeadUpDisplayOn)
1472 oss << indicators [mCaptionDataTally % 4] <<
" " << strCaptionChan <<
" " << frameTally++ <<
" " 1475 const ULWord newErrorTally (mErrorTally);
1478 lastErrorTally = newErrorTally;
1480 if (!pFrameData->fTimecodes.empty())
1482 const NTV2_RP188 & tc (pFrameData->fTimecodes.begin()->second);
1483 if (tc.IsValid() && tc.fDBB &
BIT(16))
1494 pingPong = pingPong ? 0 : 1;
1495 visibleRgn.Fill(
ULWord(0));
1503 cerr <<
"## NOTE: Caption burn-in stopped due to video format change -- was " << strVideoFormat
1505 m608Decoder->
Reset();
1506 m708DecoderAnc->
Reset();
1507 m708DecoderVanc->
Reset();
1512 bool mixerSyncOK (
false);
1516 else if (++consecSyncErrs > 60)
1517 {cerr <<
"#MXSYNC#"; consecSyncErrs = 0;}
1523 CAPNOTE(
"Thread completed, will exit");
1530 if (m608Channel != inNewChannel)
1532 m608Channel = inNewChannel;
1537 if (m708DecoderVanc)
1539 cerr << endl <<
"## NOTE: Caption display channel changed to '" <<
::NTV2Line21ChannelToStr(m608Channel) <<
"'" << endl;
1545 { (
void) inChangeInfo;
1546 mCaptionDataTally++;
1552 NTV2CCGrabber * pGrabber(reinterpret_cast<NTV2CCGrabber*>(pInstance));
1565 result += inDelimiterStr;
1602 static const string gModeStrs[] = {
"stream",
"screen",
"scc",
"mcc",
"stats",
""};
1604 return gModeStrs[inMode];
1606 for (
unsigned ndx(0); ndx < 5; )
1608 result += gModeStrs[ndx];
1609 if (!(gModeStrs[++ndx].empty()))
1617 typedef pair<string,OutputMode> StringToOutputModePair;
1618 typedef map<string,OutputMode> StringToOutputModeMap;
1619 typedef StringToOutputModeMap::const_iterator StringToOutputModeConstIter;
1620 static StringToOutputModeMap sStringToOutputModeMap;
1621 static AJALock sStringToOutputModeMapLock;
1622 if (sStringToOutputModeMap.empty())
1624 AJAAutoLock autoLock(&sStringToOutputModeMapLock);
1629 sStringToOutputModeMap.insert(StringToOutputModePair(outputModeStr,om));
1632 string modeStr(inModeStr);
1634 StringToOutputModeConstIter iter(sStringToOutputModeMap.find(modeStr));
1653 static const string gSrcStrs[] = {
"default",
"line21",
"608vanc",
"708vanc",
"608anc",
"708anc",
""};
1655 return gSrcStrs[inDataSrc];
1657 for (
unsigned ndx(0); ndx < 6; )
1659 result += gSrcStrs[ndx];
1660 if (!gSrcStrs[++ndx].empty())
1668 typedef pair<string,CaptionDataSrc> StringToCaptionDataSrcPair;
1669 typedef map<string,CaptionDataSrc> StringToCaptionDataSrcMap;
1670 typedef StringToCaptionDataSrcMap::const_iterator StringToCaptionDataSrcConstIter;
1671 static StringToCaptionDataSrcMap sStringToCaptionDataSrcMap;
1672 static AJALock sStringToCaptionDataSrcMapLock;
1673 if (sStringToCaptionDataSrcMap.empty())
1675 AJAAutoLock autoLock(&sStringToCaptionDataSrcMapLock);
1680 sStringToCaptionDataSrcMap.insert(StringToCaptionDataSrcPair(captionDataSrcStr,cds));
1683 string cdsStr(inDataSrcStr);
1685 StringToCaptionDataSrcConstIter iter(sStringToCaptionDataSrcMap.find(cdsStr));
NTV2Channel NTV2InputSourceToChannel(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2Channel value.
static const NTV2WidgetID g12GSDIOutputs[]
This class handles "analog" (Line 21) based CEA-608 caption data packets.
#define NTV2_IS_SD_VIDEO_FORMAT(__f__)
#define NTV2_IS_VANCMODE_TALLER(__v__)
Passes only foreground video + key to the Mixer output.
NTV2FrameRate GetNTV2FrameRateFromVideoFormat(const NTV2VideoFormat inVideoFormat)
virtual void SetCaptionDisplayChannel(const NTV2Line21Channel inNewChannel)
Changes the caption channel I'm displaying.
CEA708 (SMPTE 334) HD Closed Captioning.
#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 bool UnsubscribeChangeNotification(NTV2Caption608Changed *pInCallback, void *pInUserData=0)
Unsubscribes a prior change notification subscription.
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 SetSMPTE334AncData(const AJAAncillaryData_Cea708 &inPacket)
Copies the given SMPTE 334 CDP data from the given ancillary data packet into my private CDP buffer...
static const uint32_t MAX_ACCUM_FRAME_COUNT(30)
bool CanDo12gRouting(void)
Declares a number of pixel format transcoder functions.
std::string NTV2ChannelSetToStr(const NTV2ChannelSet &inObj, const bool inCompact=true)
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...
Declares common types used in the ajabase library.
virtual bool SetAudioLoopBack(const NTV2AudioLoopBack inMode, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Enables or disables NTV2AudioLoopBack mode for the given NTV2AudioSystem.
Declares the AJAMemory class.
virtual bool RouteOutputSignal(const NTV2VideoFormat inVideoFormat)
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.
static const NTV2WidgetID g3GSDIOutputs[]
CaptionDataSrc fCaptionSrc
Caption data source (Line21? 608 VANC? 608 Anc? etc)
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...
virtual bool ReleaseStreamForApplication(ULWord inApplicationType, int32_t inProcessID)
Releases exclusive use of the AJA device for the given process, permitting other processes to acquire...
bool Is8BitFrameBufferFormat(const NTV2FrameBufferFormat fbFormat)
This identifies the invalid (unspecified, uninitialized) VANC mode.
AJAStatus Add(FrameDataPtr pInFrameData)
Appends a new frame buffer to me, increasing my frame storage capacity by one frame.
static const ULWord kAppSignature((((uint32_t)( 'C'))<< 24)|(((uint32_t)( 'C'))<< 16)|(((uint32_t)( 'G'))<< 8)|(((uint32_t)( 'R'))<< 0))
NTV2FrameBufferFormat
Identifies a particular video frame buffer pixel format. See Device Frame Buffer Formats for details...
virtual bool SetMixerMode(const UWord inWhichMixer, const NTV2MixerKeyerMode inMode)
Sets the mode for the given mixer/keyer.
#define IsField2Line21CaptionChannel(_chan_)
bool SetBuffers(ULWord *pInVideoBuffer, const ULWord inVideoByteCount, ULWord *pInAudioBuffer, const ULWord inAudioByteCount, ULWord *pInANCBuffer, const ULWord inANCByteCount, ULWord *pInANCF2Buffer=NULL, const ULWord inANCF2ByteCount=0)
Sets my buffers for use in a subsequent call to CNTV2Card::AutoCirculateTransfer. ...
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...
bool fDoMultiFormat
If true, use multi-format/multi-channel mode, if device supports it; otherwise normal mode...
#define AsULWordPtr(__p__)
UByte f1_char1
Caption Byte 1 of Field 1.
virtual bool IsDeviceReady(const bool inCheckValid=(0))
enum _NTV2VideoFormat NTV2VideoFormat
Identifies a particular video format.
bool fUseVanc
If true, use Vanc, even if the device supports Anc insertion.
Declares the AJAAncillaryData_Cea608_line21 class.
#define AsUBytePtr(__p__)
#define NTV2_IS_FBF_PLANAR(__s__)
#define AJA_FAILURE(_status_)
static void Caption608ChangedStatic(void *pInstance, const NTV2Caption608ChangeInfo &inChangeInfo)
This static function gets called whenever 608 captioning changes.
static NTV2ChannelList GetTSIMuxesForFrameStore(CNTV2Card &inDevice, const NTV2Channel in1stFrameStore, const UWord inCount)
NTV2EmbeddedAudioInput NTV2InputSourceToEmbeddedAudioInput(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2EmbeddedAudioInput value.
NTV2InputSource NTV2ChannelToInputSource(const NTV2Channel inChannel, const NTV2IOKinds inKinds=NTV2_IOKINDS_SDI)
virtual bool DMAWriteFrame(const ULWord inFrameNumber, const ULWord *pInFrameBuffer, const ULWord inByteCount)
Transfers a single frame from the host to the AJA device.
virtual NTV2VideoFormat WaitForStableInputSignal(void)
Wait for a stable input signal, and return it.
virtual bool ReadSDIInVPID(const NTV2Channel inSDIInput, ULWord &outValueA, ULWord &outValueB)
virtual bool GetMixerSyncStatus(const UWord inWhichMixer, bool &outIsSyncOK)
Returns the current sync state of the given mixer/keyer.
UByte f2_char2
Caption Byte 2 of Field 2.
LWord acStartFrame
First frame to circulate. FIXFIXFIX Why is this signed? CHANGE TO ULWord??
virtual bool GetVPIDValidA(const NTV2Channel inChannel)
std::vector< AJALabelValuePair > AJALabelValuePairs
An ordered sequence of label/value pairs.
void Clear(void)
Clears my frame collection, their locks, everything.
NTV2InputXptID GetDLOutInputXptFromChannel(const NTV2Channel inDLOutWidget)
#define NTV2_IS_4K_VIDEO_FORMAT(__f__)
NTV2Buffer acVideoBuffer
The host video buffer. This field is owned by the client application, and thus is responsible for all...
virtual AJAStatus SetPriority(AJAThreadPriority priority)
virtual CNTV2VPID & MakeInvalid(void)
NTV2OutputXptID GetTSIMuxOutputXptFromChannel(const NTV2Channel inTSIMuxer, const bool inLinkB=false, const bool inIsRGB=false)
FrameDataPtr StartConsumeNextBuffer(void)
The thread that's responsible for processing incoming frames – the consumer – calls this function t...
#define NTV2_FOURCC(_a_, _b_, _c_, _d_)
Obtain audio samples from the audio that's embedded in the video HANC.
bool fBurnCaptions
If true, burn-in captions on 2nd channel.
const char * GetRP188CString() const
virtual CaptionData GetCC608CaptionData(void)
Pops the next CC608 data.
I am a reference-counted pointer template class. I am intended to be a proxy for an underlying object...
NTV2InputXptID GetDLInInputXptFromChannel(const NTV2Channel inChannel, const bool inLinkB=false)
virtual bool SetMixerBGInputControl(const UWord inWhichMixer, const NTV2MixerKeyerInputControl inInputControl)
Sets the background input control value for the given mixer/keyer.
static void CaptureThreadStatic(AJAThread *pThread, void *pContext)
This is the capture thread's static callback function that gets called when the capture thread runs...
Declares the AJAAncillaryData_Cea608_Vanc class.
I can decode captions from frames captured from an AJA device in real time. I can optionally play the...
virtual bool IsCaptureThreadRunning(void) const
Returns true if my capture thread is currently running.
virtual AJAStatus Run(void)
Runs me.
virtual bool SetAudioRate(const NTV2AudioRate inRate, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Sets the NTV2AudioRate for the given Audio System.
virtual AJAStatus Start()
virtual bool EnableInputInterrupt(const NTV2Channel channel=NTV2_CHANNEL1)
Allows the CNTV2Card instance to wait for and respond to input vertical blanking interrupts originati...
This class is used to configure an NTV2CCGrabber instance.
#define NTV2_IS_HFR_STANDARD(__s__)
virtual bool SubscribeInputVerticalEvent(const NTV2Channel inChannel=NTV2_CHANNEL1)
Causes me to be notified when an input vertical blanking interrupt occurs on the given input channel...
void EndConsumeNextBuffer(void)
The consumer thread calls this function to signal that it has finished processing the frame it obtain...
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.
Embeds SDI input source audio into the data stream.
NTV2OutputXptID GetDLOutOutputXptFromChannel(const NTV2Channel inDLOutput, const bool inIsLinkB=false)
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
virtual class DeviceCapabilities & features(void)
bool CanDoInputSource(const NTV2InputSource inSrc)
std::ostream & operator<<(std::ostream &ioStrm, const CCGrabberConfig &inObj)
virtual bool SetMultiFormatMode(const bool inEnable)
Enables or disables multi-format (per channel) device operation. If enabled, each device channel can ...
Unknown or invalid caption mode.
bool CanDoCustomAnc(void)
virtual void ToggleVANC(void)
Toggles the use of VANC. (Debug, experimental)
virtual void PlayFrames(void)
Repeatedly updates captions (until global quit flag set).
#define NTV2_ASSERT(_expr_)
virtual bool ClearRouting(void)
Removes all existing signal path connections between any and all widgets on the AJA device...
virtual AJAStatus GetCEA608Bytes(uint8_t &outByte1, uint8_t &outByte2, bool &outIsValid) const
Answers with the CEA608 payload bytes.
This struct replaces the old RP188_STRUCT.
NTV2FrameBufferFormat NTV2PixelFormat
An alias for NTV2FrameBufferFormat.
static void PlayThreadStatic(AJAThread *pThread, void *pContext)
This is the playout thread's static callback function that gets called when the playout thread runs...
ULWord GetNumVideoChannels(void)
#define NTV2_AUDIOSIZE_MAX
NTV2Channel fInputChannel
The device channel to use.
UWord GetNumAudioSystems(void)
NTV2ChannelList NTV2MakeChannelList(const NTV2Channel inFirstChannel, const UWord inNumChannels=1)
bool Fill(const T &inValue)
Fills me with the given scalar value.
virtual bool GetTaskMode(NTV2TaskMode &outMode)
Retrieves the device's current task mode.
virtual AJAStatus SetupInputVideo(void)
Sets up everything I need for capturing video.
virtual bool SetAudioSystemInputSource(const NTV2AudioSystem inAudioSystem, const NTV2AudioSource inAudioSource, const NTV2EmbeddedAudioInput inEmbeddedInput)
Sets the audio source for the given NTV2AudioSystem on the device.
std::string NTV2InputSourceToString(const NTV2InputSource inValue, const bool inForRetailDisplay=false)
virtual AJAStatus SetupAudio(void)
Sets up audio for capture (and playout, if burning captions).
static bool Create(CNTV2CaptionDecoder708Ptr &outDecoder)
Creates a new CNTV2CaptionEncoder708 instance.
static std::string GetStatTitle(const CaptionDecode608Stats inStat)
virtual CNTV2CaptionDecodeChannel608Ptr Get608ChannelDecoder(const NTV2Line21Channel inChannel) const
NTV2FrameBufferFormat acFrameBufferFormat
Specifies the frame buffer format to change to. Ignored if AUTOCIRCULATE_WITH_FBFCHANGE option is not...
virtual bool SetOutputFrame(const NTV2Channel inChannel, const ULWord inValue)
Sets the output frame index number for the given FrameStore. This identifies which frame in device SD...
virtual bool EnableChannels(const NTV2ChannelSet &inChannels, const bool inDisableOthers=(0))
Enables the given FrameStore(s).
NTV2Standard
Identifies a particular video standard.
0: Disabled (never recommended): device configured exclusively by client application(s).
Playout (output) mode, which reads from device SDRAM.
static AJAStatus SetFromVANCData(const NTV2Buffer &inFrameBuffer, const NTV2FormatDescriptor &inFormatDesc, AJAAncillaryList &outPackets, const uint32_t inFrameNum=0)
Returns all packets found in the VANC lines of the given NTV2 frame buffer.
NTV2DeviceID
Identifies a specific AJA NTV2 device model number. The NTV2DeviceID is actually the PROM part number...
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...
enum _CaptionDecode608Stats CaptionDecode608Stats
The currently supported caption decoder stats.
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.
virtual void Reset(void)
Flushes me, clearing all in-progress data.
static bool GetFirstDeviceFromArgument(const std::string &inArgument, CNTV2Card &outDevice)
Rescans the host, and returns an open CNTV2Card instance for the AJA device that matches a command li...
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.
NTV2ReferenceSource
These enum values identify a specific source for the device's (output) reference clock.
static bool BurnString(const std::string &inString, const NTV2Line21Attrs &inAttribs, NTV2Buffer &inFB, const NTV2FormatDesc &inFBDescriptor, const UWord inRowNum=15, const UWord inColumnNum=1)
Blits the contents of the given UTF-8 encoded string into the given host buffer using the given displ...
bool HasBiDirectionalSDI(void)
const AUTOCIRCULATE_TRANSFER_STATUS & GetTransferStatus(void) const
Returns a constant reference to my AUTOCIRCULATE_TRANSFER_STATUS.
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 AcquireStreamForApplication(ULWord inApplicationType, int32_t inProcessID)
Reserves exclusive use of the AJA device for a given process, preventing other processes on the host ...
CEA-608 Character Attributes.
Utility class for timecodes.
ULWord GetProcessedFrameCount(void) const
#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.
void SetAbortFlag(const bool *pAbortFlag)
Tells me the boolean variable I should monitor such that when it gets set to "true" will cause any th...
virtual NTV2Line21Channel GetDisplayChannel(void) const
Answers with the caption channel that I'm currently focused on (or that I'm currently "burning" into ...
NTV2CCGrabber(const CCGrabberConfig &inConfigData)
Constructs me using the given configuration settings.
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.
virtual bool SubscribeChangeNotification(NTV2Caption608Changed *pInCallback, void *pInUserData=0)
Subscribes to change notifications.
NTV2InputXptID GetCSCInputXptFromChannel(const NTV2Channel inCSC, const bool inIsKeyInput=false)
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. ...
virtual void Switch608Source(void)
Switches/rotates –608src.
static void Sleep(const int32_t inMilliseconds)
Suspends execution of the current thread for a given number of milliseconds.
#define IS_VALID_OutputMode(_x_)
void split(const std::string &str, const char delim, std::vector< std::string > &elems)
bool IsStopped(void) const
2: OEM (recommended): device configured by client application(s) with some driver involvement...
NTV2Line21Channel fCaptionChannel
Caption channel to monitor (defaults to CC1)
virtual bool SetDisplayChannel(const NTV2Line21Channel inChannel)
Changes the caption channel that I'm focused on (or that I'm currently "burning" into video)...
bool bGotField1Data
True if Field 1 bytes have been set; otherwise false.
static AJAStatus SetFromDeviceAncBuffers(const NTV2Buffer &inF1AncBuffer, const NTV2Buffer &inF2AncBuffer, AJAAncillaryList &outPackets, const uint32_t inFrameNum=0)
Returns all ancillary data packets found in the given F1 and F2 ancillary data buffers.
NTV2InputXptID GetFrameStoreInputXptFromChannel(const NTV2Channel inFrameStore, const bool inIsBInput=false)
std::vector< std::string > NTV2StringList
virtual void IdleFrame(void)
Call this once per video frame when I'm doing display "burn-in", whether there is new caption data to...
NTV2InputXptID GetMixerBGInputXpt(const NTV2Channel inChannel, const bool inIsKey=false)
virtual bool ApplySignalRoute(const CNTV2SignalRouter &inRouter, const bool inReplace=(0))
Applies the given routing table to the AJA device.
virtual bool SetSDIOutputAudioSystem(const NTV2Channel inSDIOutputConnector, const NTV2AudioSystem inAudioSystem)
Sets the device's NTV2AudioSystem that will provide audio for the given SDI output's audio embedder...
virtual void SwitchPixelFormat(void)
Switches/rotates –pixelFormat.
std::string NTV2VideoFormatToString(const NTV2VideoFormat inValue, const bool inUseFrameRate=false)
See 8-Bit ARGB, RGBA, ABGR Formats.
Embeds silence (zeroes) into the data stream.
virtual bool ProcessNew608FrameData(const CaptionData &inCC608Data)
Notifies me that new frame data has arrived. Clients should call this method once per video frame wit...
virtual bool SetVANCShiftMode(NTV2Channel inChannel, NTV2VANCDataShiftMode inMode)
Enables or disables the "VANC Shift Mode" feature for the given channel.
Declares the CNTV2CaptionRenderer class.
virtual AJAStatus SetupOutputVideo(const NTV2VideoFormat inVideoFormat)
Sets up everything I need for capturing video.
virtual bool SetTsiFrameEnable(const bool inIsEnabled, const NTV2Channel inChannel)
Enables or disables SMPTE 425 two-sample interleave (Tsi) frame mode on the device.
Specifies channel or FrameStore 8 (or the 8th item).
virtual void ReleaseHostBuffers(void)
Releases my circular buffers.
#define AsConstUBytePtr(__p__)
This class handles VANC-based CEA-608 caption data packets (not "analog" Line 21).
#define AsConstULWordPtr(__p__)
#define AUTOCIRCULATE_WITH_ANC
Use this to AutoCirculate with ancillary data.
Specifies channel or FrameStore 2 (or the 2nd item).
virtual NTV2DeviceID GetDeviceID(void)
static std::string OutputModeToString(const OutputMode inMode)
std::string NTV2TCIndexToString(const NTV2TCIndex inValue, const bool inCompactDisplay=false)
ULWord GetVideoWriteSize(const NTV2VideoFormat inVideoFormat, const NTV2FrameBufferFormat inFBFormat, const NTV2VANCMode inVancMode=NTV2_VANCMODE_OFF)
Identical to the GetVideoActiveSize function, except rounds the result up to the nearest 4K page size...
virtual std::string CompareWithInfo(const AJAAncillaryList &inCompareList, const bool inIgnoreLocation=true, const bool inIgnoreChecksum=true) const
Compares me with another list and returns a std::string that contains a human-readable explanation of...
NTV2OutputXptID GetDLInOutputXptFromChannel(const NTV2Channel inDLInput)
UWord GetNumFrameStores(void)
#define NTV2_IS_VANCMODE_ON(__v__)
enum _CaptionDataSrc CaptionDataSrc
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__)
virtual void CaptureFrames(void)
Repeatedly captures frames using AutoCirculate (until global quit flag set).
Describes a user-space buffer on the host computer. I have an address and a length, plus some optional attributes (allocated by SDK?, page-aligned? etc.).
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).
virtual bool SetMixerVancOutputFromForeground(const UWord inWhichMixer, const bool inFromForegroundSource=(!(0)))
Sets the VANC source for the given mixer/keyer to the foreground video (or not). See the SDI Ancillar...
Declares the CNTV2Line21Captioner class.
virtual bool UnsubscribeInputVerticalEvent(const NTV2Channel inChannel=NTV2_CHANNEL1)
Unregisters me so I'm no longer notified when an input VBI is signaled on the given input channel...
uint16_t GetEndFrame(void) const
virtual std::string GetModelName(void)
Answers with this device's model name.
std::string NTV2DeviceIDToString(const NTV2DeviceID inValue, const bool inForRetailDisplay=false)
virtual AJAStatus StartCaptureThread(void)
Starts my capture thread.
virtual void SetOutputStandards(const NTV2VideoFormat inVideoFormat)
Sets the device output standard based on the given video format.
bool IsRGBFormat(const NTV2FrameBufferFormat format)
virtual AJAStatus SetupHostBuffers(const NTV2VideoFormat inVideoFormat)
Sets up my circular buffers.
std::string & strip(std::string &str, const std::string &ws)
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 bool ParseSMPTE334AncPacket(bool &outHasParityErrors)
Parses the current frame's SMPTE 334 Ancillary packet and extracts the 608 and 708 caption data from ...
virtual bool SetDisplayChannel(const NTV2Line21Channel inChan)
Setsthe caption channel I'm currently focused on (i.e. that I'm currently "burning" into video)...
virtual uint32_t CountAncillaryDataWithType(const AJAAncDataType inMatchType) const
Answers with the number of AJAAncillaryData objects having the given type.
NTV2InputSource fInputSource
The device input connector to use.
static AJALabelValuePairs & append(AJALabelValuePairs &inOutTable, const std::string &inLabel, const std::string &inValue=std::string())
A convenience function that appends the given label and value strings to the provided AJALabelValuePa...
virtual void DoCCOutput(const uint32_t inFrameNum, const CaptionData &inCCData, const NTV2VideoFormat inVideoFormat)
Outputs CC data.
NTV2InputXptID GetTSIMuxInputXptFromChannel(const NTV2Channel inTSIMuxer, const bool inLinkB=false)
virtual AJAStatus StartPlayThread(void)
Starts my playout thread.
virtual bool SetMixerFGInputControl(const UWord inWhichMixer, const NTV2MixerKeyerInputControl inInputControl)
Sets the foreground input control value for the given mixer/keyer.
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.
std::set< NTV2Channel > NTV2ChannelSet
A set of distinct NTV2Channel values.
void EndProduceNextBuffer(void)
The producer thread calls this function to signal that it has finished populating the frame it obtain...
This identifies the first Audio System.
static const NTV2Line21Attributes kRedOnTransparentBG(NTV2_CC608_Red, NTV2_CC608_Blue, NTV2_CC608_Transparent)
virtual bool WaitForOutputVerticalInterrupt(const NTV2Channel inChannel=NTV2_CHANNEL1, UWord inRepeatCount=1)
Efficiently sleeps the calling thread/process until the next one or more field (interlaced video) or ...
#define NTV2_IS_VALID_INPUT_SOURCE(_inpSrc_)
virtual void SwitchOutput(void)
Switches/rotates –output mode.
static const size_t CIRCULAR_BUFFER_SIZE(10)
Number of NTV2FrameData's in our ring.
virtual std::string GetOnAirCharacters(const UWord inRowNumber=0) const
Retrieves all "on-air" characters either for all rows, or a specific row.
virtual CNTV2VPID & SetVPID(const ULWord inData)
virtual bool GetReference(NTV2ReferenceSource &outRefSource)
Answers with the device's current clock reference source.
virtual bool DisableChannels(const NTV2ChannelSet &inChannels)
Disables the given FrameStore(s).
virtual AJAStatus Attach(AJAThreadFunction *pThreadFunction, void *pUserContext)
virtual bool RouteInputSignal(const NTV2VideoFormat inVideoFormat)
FrameDataPtr StartProduceNextBuffer(void)
The thread that's responsible for providing frames – the producer – calls this function to populate...
NTV2OutputCrosspointID
Identifies a widget output, a signal source, that potentially can drive another widget's input (ident...
static bool DecodeLine(const UByte *pLineData, UByte &outChar1, UByte &outChar2)
Decodes the supplied line of 8-bit uncompressed ('2vuy') data and, if successful, returns the two 8-b...
This structure encapsulates all possible CEA-608 caption data bytes that may be associated with a giv...
bool GetInputTimeCodes(NTV2TimeCodeList &outValues) const
Intended for capture, answers with the timecodes captured in my acTransferStatus member's acFrameStam...
Header file for NTV2CCGrabber demonstration class.
#define NTV2_IS_VANCMODE_TALL(__v__)
virtual AJAStatus ParseAllAncillaryData(void)
Sends a "ParsePayloadData" command to all of my AJAAncillaryData objects.
This is returned from the CNTV2Card::AutoCirculateGetStatus function.
NTV2OutputXptID GetFrameStoreOutputXptFromChannel(const NTV2Channel inFrameStore, const bool inIsRGB=false, const bool inIs425=false)
bool UnlockAll(CNTV2Card &inDevice)
void QueryString(std::string &str, const AJATimeBase &timeBase, bool bDropFrame, bool bStdTcForHfr, AJATimecodeNotation notation=AJA_TIMECODE_LEGACY)
virtual size_t GetNextServiceBlockFromQueue(const size_t svcIndex, std::vector< UByte > &outData)
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...
bool CanDoFrameBufferFormat(const NTV2PixelFormat inPF)
virtual bool AutoCirculateInitForOutput(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 playout, designating a contiguous block of frame buffers on the...
std::string NTV2ReferenceSourceToString(const NTV2ReferenceSource inValue, const bool inForRetailDisplay=false)
NTV2ACFrameRange fFrames
AutoCirculate frame count or range.
#define xHEX0N(__x__, __n__)
virtual bool SetEnableVANCData(const bool inVANCenabled, const bool inTallerVANC, const NTV2Standard inStandard, const NTV2FrameGeometry inGeometry, const NTV2Channel inChannel=NTV2_CHANNEL1)
NTV2VANCMode
These enum values identify the available VANC modes.
static CaptionDataSrc StringToCaptionDataSrc(const std::string &inDataSrcStr)
bool CanDoWidget(const NTV2WidgetID inWgtID)
const std::string & NTV2Line21ChannelToStr(const NTV2Line21Channel inLine21Channel, const bool inCompact=true)
Converts the given NTV2Line21Channel value into a human-readable string.
static OutputMode StringToOutputMode(const std::string &inModeStr)
NTV2PixelFormat fPixelFormat
Pixel format to use.
NTV2InputXptID GetMixerFGInputXpt(const NTV2Channel inChannel, const bool inIsKey=false)
#define NTV2_IS_VALID_AUDIO_SYSTEM(__x__)
std::string NTV2FrameBufferFormatToString(const NTV2FrameBufferFormat inValue, const bool inForRetailDisplay=false)
static AJA_FrameRate GetAJAFrameRate(const NTV2FrameRate inFrameRate)
enum _OutputMode OutputMode
static const NTV2WidgetID gSDIOutputs[]
I encapsulate the video, audio and anc host buffers used in the AutoCirculate demos. I'm a more modern version of the AVDataBuffer.
NTV2AudioSystem NTV2ChannelToAudioSystem(const NTV2Channel inChannel)
Converts the given NTV2Channel value into its equivalent NTV2AudioSystem.
NTV2OutputXptID GetMixerOutputXptFromChannel(const NTV2Channel inChannel, const bool inIsKey=false)
bool HasAvailableInputFrame(void) const
Specifies channel or FrameStore 4 (or the 4th item).
static std::string GetLegalCaptionDataSources(void)
std::pair< NTV2InputXptID, NTV2OutputXptID > NTV2XptConnection
NTV2ChannelSet NTV2MakeChannelSet(const NTV2Channel inFirstChannel, const UWord inNumChannels=1)
#define IS_VALID_CaptionDataSrc(_x_)
Specifies channel or FrameStore 5 (or the 5th item).
virtual bool IsStandardTwoSampleInterleave(void) const
NTV2Standard GetNTV2StandardFromVideoFormat(const NTV2VideoFormat inVideoFormat)
virtual void Quit(void)
Gracefully stops me from running.
virtual void ExtractClosedCaptionData(const uint32_t inFrameCount, const NTV2VideoFormat inVideoFormat)
Extracts closed-caption data, if present, and emits it on a character-by-character basis to the stand...
NTV2TCIndex fTimecodeSource
Timecode source to use (if any)
CEA608 SD Closed Captioning (SMPTE 334 VANC packet)
std::vector< NTV2Channel > NTV2ChannelList
An ordered sequence of NTV2Channel values.
bool IsRunning(void) const
virtual bool BurnCaptions(NTV2Buffer &inFB, const NTV2FormatDesc &inFD)
Blits all of my current caption channel's "on-air" captions into the given host buffer with the corre...
AJALabelValuePairs Get(const bool inCompact=(0)) const
AJALabelValuePairs Get(const bool inCompact=(0)) const
std::string fDeviceSpec
The AJA device to use.
void * GetHostPointer(void) const
bool ConvertLine_v210_to_2vuy(const ULWord *pInSrcLine_v210, UByte *pOutDstLine_2vuy, const ULWord inNumPixels)
Converts a single 10-bit YCbCr 'v210' raster line to 8-bit YCbCr '2vuy'.
static std::string StripFormatString(const std::string &inStr)
static size_t SetDefaultPageSize(void)
std::map< NTV2InputXptID, NTV2OutputXptID > NTV2XptConnections
NTV2OutputXptID GetSDIInputOutputXptFromChannel(const NTV2Channel inSDIInput, const bool inIsDS2=false)
ULWord GetCapturedAncByteCount(const bool inField2=false) const
OutputMode fOutputMode
Desired output (captionStream, Screen etc)
static std::string GetLegalOutputModes(void)
Specifies channel or FrameStore 6 (or the 6th item).
UWord GetMaxAudioChannels(void)
bool CanDoVideoFormat(const NTV2VideoFormat inVF)
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 ...
bool HasCrosspointConnectROM(void)
#define AUTOCIRCULATE_WITH_RP188
Use this to AutoCirculate with RP188.
std::string NTV2ChannelToString(const NTV2Channel inValue, const bool inForRetailDisplay=false)
UWord GetNumVideoOutputs(void)
Specifies channel or FrameStore 7 (or the 7th item).
virtual ULWord GetVPID(void) const
#define NTV2_INPUT_SOURCE_IS_SDI(_inpSrc_)
virtual NTV2Line21Channel GetDisplayChannel(void) const
Answers with the caption channel that I'm currently focused on (or that I'm currently "burning" into ...
virtual NTV2VideoFormat GetVideoFormat(void) const
std::string & lower(std::string &str)
Declares the AJAAncillaryList class.
void * GetHostAddress(const ULWord inByteOffset, const bool inFromEnd=false) const
std::string NTV2ChannelListToStr(const NTV2ChannelList &inObj, const bool inCompact=true)
NTV2Line21Channel
The CEA-608 caption channels: CC1 thru CC4, TX1 thru TX4, plus XDS.
const int NTV2_CC708PrimaryCaptionServiceNum
virtual void CaptioningChanged(const NTV2Caption608ChangeInfo &inChangeInfo)
This function gets called whenever caption changes occur.
virtual bool SetSDIOutputStandard(const UWord inOutputSpigot, const NTV2Standard inValue)
Sets the SDI output spigot's video standard.
NTV2Buffer acANCBuffer
The host ancillary data buffer. This field is owned by the client application, and thus is responsibl...
NTV2InputXptID GetSDIOutputInputXpt(const NTV2Channel inSDIOutput, const bool inIsDS2=false)
#define Hex0N(__x__, __n__)
static std::string GetLine21ChannelNames(std::string inDelimiter=", ")
Returns a string containing a concatenation of human-readable names of every available NTV2Line21Chan...
Declares the AJAAncillaryData_Cea708 class.
virtual bool GetNextServiceBlockInfoFromQueue(const size_t svcIndex, size_t &outBlockSize, size_t &outDataSize, int &outServiceNum, bool &outIsExtended) const
virtual bool SetVANCMode(const NTV2VANCMode inVancMode, const NTV2Channel inChannel=NTV2_CHANNEL1)
Sets the VANC mode for the given FrameStore.
virtual bool IsRGBSampling(void) const
CEA608 SD Closed Captioning ("Line 21" waveform)
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...
virtual bool IsValid(void) const
virtual void ToString(std::string &outAllLabelsAndValues) const
Answers with a multi-line string that contains the complete host system info table.
static const NTV2Line21Attributes kGreenOnTransparentBG(NTV2_CC608_Green, NTV2_CC608_Blue, NTV2_CC608_Transparent)
This identifies the "tall" mode in which there are some VANC lines in the frame buffer.
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)
This identifies the mode in which there are no VANC lines in the frame buffer.
Specifies channel or FrameStore 3 (or the 3rd item).
NTV2ReferenceSource NTV2InputSourceToReferenceSource(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2ReferenceSource value.
UWord GetNumVideoInputs(void)
static const UWord gMixerNums[]
static std::string CaptionDataSrcToString(const CaptionDataSrc inDataSrc)
virtual bool EnableChannel(const NTV2Channel inChannel)
Enables the given FrameStore.