9 #include "ntv2captionrenderer.h" 10 #include "ntv2line21captioner.h" 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__) 35 static const NTV2Line21Attributes
kRedOnTransparentBG (NTV2_CC608_Red, NTV2_CC608_Blue, NTV2_CC608_Transparent);
36 static const NTV2Line21Attributes
kGreenOnTransparentBG (NTV2_CC608_Green, NTV2_CC608_Blue, NTV2_CC608_Transparent);
42 : mConfig (inConfigData),
52 mCaptionDataTally (0),
53 m608Channel (mConfig.fCaptionChannel),
54 m608Mode (NTV2_CC608_CapModeUnknown),
65 mHeadUpDisplayOn (
true),
71 CNTV2CaptionDecoder608::Create(m608Decoder);
72 CNTV2CaptionDecoder708::Create(m708DecoderAnc);
73 CNTV2CaptionDecoder708::Create(m708DecoderVanc);
74 NTV2_ASSERT (m608Decoder && m708DecoderAnc && m708DecoderVanc);
106 while (mCaptureThread.
Active())
109 while (mPlayoutThread.
Active())
125 cerr <<
"## ERROR: Device '" << mConfig.
fDeviceSpec <<
"' not found" << endl;
136 cerr <<
"## ERROR: '" << devStr <<
"' can't burn-in captions because at least 2 frame stores are required" << endl;
141 cerr <<
"## ERROR: '" << devStr <<
"' can't burn-in captions because device can only capture/ingest" << endl;
146 cerr <<
"## ERROR: '" << devStr <<
"' can't be used -- at least 1 SDI input and 1 SDI output required" << endl;
151 cerr <<
"## ERROR: '" << devStr <<
"' can't burn-in captions because a mixer/keyer widget is required" << endl;
156 cerr <<
"## ERROR: '" << devStr <<
"' can't burn-in captions because it can't do 8-bit RGB (with alpha)" << endl;
169 cerr <<
"## ERROR: Unable to acquire '" << devStr <<
"' because another app (pid " <<
appPID <<
") owns it" << endl;
180 cerr <<
"## WARNING: Enabling VANC because no Anc extractors" << endl;
195 {cerr <<
"## WARNING: SubscribeChangeNotification failed" << endl;
return AJA_STATUS_FAIL;}
200 #endif // defined(_DEBUG) 222 if (!frameData.fVideoBuffer.Allocate(captureBufferSize,
true))
235 #if defined(NTV2_BUFFER_LOCK) 236 frameData.LockAll(mDevice);
238 mCircularBuffer.
Add(&frameData);
249 #if defined(NTV2_BUFFER_LOCK) 250 for (
size_t ndx(0); ndx < mHostBuffers.size(); ndx++)
255 #endif // NTV2_BUFFER_LOCK 256 mHostBuffers.clear();
257 mCircularBuffer.
Clear();
265 bool isTransmit (
false);
274 {cerr <<
"## ERROR: Must specify at least input source or input channel" << endl;
return AJA_STATUS_FAIL;}
283 {cerr <<
"## ERROR: '" << deviceName <<
"' cannot grab captions from '" << inputName <<
"'" << endl;
return AJA_STATUS_FAIL;}
285 {cerr <<
"## ERROR: Input '" << inputName <<
"' not SDI" << endl;
return AJA_STATUS_FAIL;}
289 {cerr <<
"## ERROR: " << deviceName <<
" has no " << channelName <<
" input" << endl;
return AJA_STATUS_FAIL;}
292 mActiveSDIInputs.insert(sdiInput);
330 m608Decoder->SetDisplayChannel(m608Channel);
331 m708DecoderAnc->SetDisplayChannel(m608Channel);
332 m708DecoderVanc->SetDisplayChannel(m608Channel);
334 cerr <<
"## NOTE: Using " << deviceName <<
" " << (mConfig.
fUseVanc ?
"VANC" :
"AncExt") <<
" with spigot=" << inputName
363 UWord sdiOutput(mOutputChannel);
405 static const bool ShowRoutingProgress(
false);
407 mInputConnections.clear();
411 if (isRGBFBF && isRGBWire)
415 for (
size_t ndx(0); ndx < sdiInputs.size(); ndx++)
416 {
NTV2Channel frmSt(frameStores.at(ndx)), sdiIn(sdiInputs.at(ndx));
431 UWord(frameStores.size()*2));
433 for (
size_t ndx(0); ndx < sdiInputs.size(); ndx++)
434 {
NTV2Channel frmSt(frameStores.at(ndx/2)), tsiMux(tsiMuxes.at(ndx/2)), sdiIn(sdiInputs.at(ndx));
449 else if (isRGBFBF && !isRGBWire)
452 for (
size_t ndx(0); ndx < sdiInputs.size(); ndx++)
453 {
NTV2Channel frmSt(frameStores.at(ndx)), sdiIn(sdiInputs.at(ndx));
464 UWord(2*sdiInputs.size()));
466 UWord(frameStores.size()));
471 for (
size_t ndx(0); ndx < cscs.size(); ndx++)
472 {
NTV2Channel frmSt(frameStores.at(ndx/2)), sdiIn(sdiInputs.at(ndx/2)), tsiMux(tsiMuxes.at(ndx/2)),
484 else if (!isRGBFBF && isRGBWire)
488 for (
size_t ndx(0); ndx < sdiInputs.size(); ndx++)
489 {
NTV2Channel frmSt(frameStores.at(ndx)), csc(activeCSCs.at(ndx)), sdi(sdiInputs.at(ndx));
510 for (
size_t ndx(0); ndx < sdiInputs.size(); ndx++)
511 {
NTV2Channel frmSt(frameStores.at(ndx)), sdiIn(sdiInputs.at(ndx));
522 UWord(frameStores.size()));
523 cerr << (is4KHFR ?
"4KHFR" :
"") << endl <<
"FrameStores: " << ::
NTV2ChannelListToStr(frameStores) << endl
525 for (
size_t ndx(0); ndx < sdiInputs.size(); ndx++)
526 {
NTV2Channel frmSt(frameStores.at(is4KHFR ? ndx/2 : ndx)),
527 tsiMux(tsiMuxes.at(is4KHFR ? ndx/2 : ndx)),
528 sdiIn(sdiInputs.at(ndx));
555 set_difference (allSDIs.begin(), allSDIs.end(),
556 mActiveSDIInputs.begin(), mActiveSDIInputs.end(),
557 inserter(sdiOuts, sdiOuts.begin()));
564 for (
size_t sdiNdx(0); sdiNdx < sdiOutputs.size(); sdiNdx++)
566 const NTV2Channel sdiIn(sdiInputs.at(sdiNdx < sdiInputs.size() ? sdiNdx : sdiInputs.size()-1));
569 cerr <<
"Switching SDI " << (sdiOut+1) <<
" to output" << endl;
606 if (chan != sdiInputAsChan)
638 result = mCaptureThread.
Start();
650 NTV2CCGrabber * pApp (reinterpret_cast <NTV2CCGrabber *> (pContext));
659 ULWord xferTally(0), xferFails(0), noVideoTally(0), waitTally(0);
697 CAPWARN(
"VANC mode incompatible with 4K/UHD format");
739 mInputXferInfo.
SetBuffers (pCaptureData->VideoBuffer(), pCaptureData->VideoBufferSize(),
740 pCaptureData->AudioBuffer(), pCaptureData->AudioBufferSize(),
741 pCaptureData->AncBuffer(), pCaptureData->AncBufferSize(),
742 pCaptureData->AncBuffer2(), pCaptureData->AncBuffer2Size());
779 ULWord vpidDS1(0), vpidDS2(0);
784 const bool vfChanged(newVF != currentVF);
785 const bool vpidChgd(mVPIDInfoDS1.
GetVPID() != vpidDS1 || mVPIDInfoDS2.
GetVPID() != vpidDS2);
786 if (vfChanged || vpidChgd)
806 CAPWARN(
"FrameStore pixel format changed from '" 823 CAPNOTE(
"Thread completed, " <<
DEC(xferTally) <<
" of " <<
DEC(xferTally+xferFails) <<
" frms xferred, " 824 <<
DEC(waitTally) <<
" waits, " <<
DEC(noVideoTally) <<
" sig chgs");
831 ULWord numConsecutiveFrames(0), MIN_NUM_CONSECUTIVE_FRAMES(6);
833 NTV2Channel sdiConnector(*(mActiveSDIInputs.begin()));
851 if (++loopCount % 500 == 0)
852 CAPDBG(
"Waiting for valid video signal to appear at " 855 else if (numConsecutiveFrames == 0)
858 numConsecutiveFrames++;
860 else if (numConsecutiveFrames == MIN_NUM_CONSECUTIVE_FRAMES)
862 numConsecutiveFrames = 0;
866 numConsecutiveFrames = (lastVF == currVF) ? numConsecutiveFrames + 1 : 0;
873 {
ULWord vpidDS1(0), vpidDS2(0);
884 if (vfVPID != result && !mSquares)
891 ostringstream osserr;
895 osserr << mDevice.
GetModelName() <<
" can't handle TSI";
896 if (!osserr.str().empty())
914 mInputFrameStores.clear(); mInputFrameStores.insert(mConfig.
fInputChannel);
915 mActiveSDIInputs.clear(); mActiveSDIInputs.insert(sdiConnector);
922 mActiveCSCs = mActiveSDIInputs;
940 cerr << endl <<
"## NOTE: VANC frame geometry " << (mConfig.
fUseVanc ?
"enabled" :
"disabled") << endl;
983 CaptionData captionData708Anc, captionData708Vanc, captionData608Anc, captionData608Vanc, captionDataL21Anc, captionDataL21;
1010 CAPDBG(
DEC(diffs.size()) <<
" VANC/AncExt diff(s): " << lines.at(0));
1011 for (
size_t n(1);
n < lines.size();
n++)
1020 ULWord line21RowOffset(0);
1029 captionDataL21.bGotField1Data = CNTV2Line21Captioner::DecodeLine(pLine21, captionDataL21.f1_char1, captionDataL21.f1_char2);
1032 line21RowOffset+1));
1037 captionDataL21.bGotField2Data = CNTV2Line21Captioner::DecodeLine(pLine21, captionDataL21.f2_char1, captionDataL21.f2_char2);
1045 if (pkt608F1.GetPayloadData() && pkt608F1.GetPayloadByteCount() &&
AJA_SUCCESS(pkt608F1.ParsePayloadData()))
1046 pkt608F1.
GetCEA608Bytes (captionData608Anc.f1_char1, captionData608Anc.f1_char2, captionData608Anc.bGotField1Data);
1051 if (pkt608F2.GetPayloadData() && pkt608F2.GetPayloadByteCount() &&
AJA_SUCCESS(pkt608F2.ParsePayloadData()))
1052 pkt608F2.
GetCEA608Bytes(captionData608Anc.f2_char1, captionData608Anc.f2_char2, captionData608Anc.bGotField2Data);
1059 if (pkt608F1.GetPayloadData() && pkt608F1.GetPayloadByteCount() &&
AJA_SUCCESS(pkt608F1.ParsePayloadData()))
1060 pkt608F1.
GetCEA608Bytes (captionData608Vanc.f1_char1, captionData608Vanc.f1_char2, captionData608Vanc.bGotField1Data);
1065 if (pkt608F2.GetPayloadData() && pkt608F2.GetPayloadByteCount() &&
AJA_SUCCESS(pkt608F2.ParsePayloadData()))
1066 pkt608F2.
GetCEA608Bytes(captionData608Vanc.f2_char1, captionData608Vanc.f2_char2, captionData608Vanc.bGotField2Data);
1073 bool hasParityErrors (
false);
1074 if (vancCEA708DataIn.GetPayloadData() && vancCEA708DataIn.GetPayloadByteCount() &&
AJA_SUCCESS(vancCEA708DataIn.ParsePayloadData()))
1075 if (m708DecoderVanc->SetSMPTE334AncData (vancCEA708DataIn.GetPayloadData(), vancCEA708DataIn.GetPayloadByteCount()))
1076 if (m708DecoderVanc->ParseSMPTE334AncPacket(hasParityErrors))
1078 vector<UByte> svcBlk;
1079 size_t blkSize(0), byteCount(0);
1081 bool isExtendedSvc(
false);
1082 if (!hasParityErrors)
1083 captionData708Vanc = m708DecoderVanc->GetCC608CaptionData();
1084 if (m708DecoderVanc->GetNextServiceBlockInfoFromQueue (NTV2_CC708PrimaryCaptionServiceNum, blkSize, byteCount, svcNum, isExtendedSvc))
1085 m708DecoderVanc->GetNextServiceBlockFromQueue(NTV2_CC708PrimaryCaptionServiceNum, svcBlk);
1092 bool hasParityErrors (
false);
1093 if (ancCEA708DataIn.GetPayloadData() && ancCEA708DataIn.GetPayloadByteCount() &&
AJA_SUCCESS(ancCEA708DataIn.ParsePayloadData()))
1094 if (m708DecoderAnc->SetSMPTE334AncData (ancCEA708DataIn.GetPayloadData(), ancCEA708DataIn.GetPayloadByteCount()))
1095 if (m708DecoderAnc->ParseSMPTE334AncPacket(hasParityErrors))
1097 vector<UByte> svcBlk;
1098 size_t blkSize(0), byteCount(0);
1100 bool isExtendedSvc(
false);
1101 if (!hasParityErrors)
1102 captionData708Anc = m708DecoderAnc->GetCC608CaptionData();
1103 if (m708DecoderAnc->GetNextServiceBlockInfoFromQueue (NTV2_CC708PrimaryCaptionServiceNum, blkSize, byteCount, svcNum, isExtendedSvc))
1104 m708DecoderAnc->GetNextServiceBlockFromQueue(NTV2_CC708PrimaryCaptionServiceNum, svcBlk);
1111 if (
AJA_SUCCESS(ancEIA608DataIn.ParsePayloadData()))
1112 ancEIA608DataIn.
GetCEA608Bytes(captionDataL21Anc.f1_char1, captionDataL21Anc.f1_char2, captionDataL21Anc.bGotField1Data);
1117 ancEIA608F2.
GetCEA608Bytes(captionDataL21Anc.f2_char1, captionDataL21Anc.f2_char2, captionDataL21Anc.bGotField2Data);
1122 ostringstream ossCompare;
1123 const CaptionData * p608CaptionData(
AJA_NULL);
1126 const CaptionData * pL21CaptionData (
AJA_NULL);
1127 if (captionDataL21.HasData() && captionDataL21Anc.HasData())
1128 if (captionDataL21 != captionDataL21Anc)
1129 ossCompare <<
"L21Vanc != L21Anlg: " << captionDataL21 <<
" " << captionDataL21Anc << endl;
1130 if (captionDataL21.HasData())
1131 pL21CaptionData = &captionDataL21;
1132 else if (captionDataL21Anc.HasData())
1133 pL21CaptionData = &captionDataL21Anc;
1134 if (captionData608Anc.HasData() && pL21CaptionData)
1135 if (captionData608Anc != *pL21CaptionData)
1136 ossCompare <<
"608 != L21: " << captionData608Anc <<
" " << *pL21CaptionData << endl;
1137 if (captionData608Anc.HasData())
1138 p608CaptionData = &captionData608Anc;
1139 else if (pL21CaptionData)
1140 p608CaptionData = pL21CaptionData;
1144 if (captionData608Anc.HasData() && captionData708Anc.HasData())
1145 if (captionData608Anc != captionData708Anc)
1146 ossCompare <<
"608anc != 708anc: " << captionData608Anc <<
" " << captionData708Anc << endl;
1147 if (captionData608Vanc.HasData() && captionData708Vanc.HasData())
1148 if (captionData608Vanc != captionData708Vanc)
1149 ossCompare <<
"608vanc != 708vanc: " << captionData608Vanc <<
" " << captionData708Vanc << endl;
1150 if (captionData708Anc.HasData())
1151 p608CaptionData = &captionData708Anc;
1152 else if (captionData708Vanc.HasData())
1153 p608CaptionData = &captionData708Vanc;
1154 else if (captionData608Anc.HasData())
1155 p608CaptionData = &captionData608Anc;
1156 else if (captionData608Vanc.HasData())
1157 p608CaptionData = &captionData608Vanc;
1159 if (!ossCompare.str().empty())
1160 CAPDBG(
"CaptionData mis-compare(s): " << ossCompare.str());
1173 if (!p608CaptionData)
1179 m608Decoder->ProcessNew608FrameData(*p608CaptionData);
1181 DoCCOutput(inFrameNum, *p608CaptionData, inVideoFormat);
1189 const bool isFirstTime (mLastOutFrame == 0 && inFrameNum > mLastOutFrame);
1190 char char1(0), char2(0);
1191 const bool showField2 (IsField2Line21CaptionChannel(m608Channel));
1192 const bool gotData (showField2 ? inCCData.bGotField2Data : inCCData.bGotField1Data);
1199 char1 = (char(showField2 ? inCCData.f2_char1 : inCCData.f1_char1) & 0x7F);
1200 char2 = (char(showField2 ? inCCData.f2_char2 : inCCData.f1_char2) & 0x7F);
1201 if (char1 >=
' ' && char1 <=
'~')
1203 if (mLastOutStr !=
" " || char1 !=
' ')
1204 {cout << char1 << flush; mLastOutStr = string(1,char1);}
1205 if (char2 >=
' ' && char2 <=
'~')
1207 if (mLastOutStr !=
" " || char2 !=
' ')
1208 {cout << char2 << flush; mLastOutStr = string(1,char2);}
1211 else if (mLastOutStr !=
" ")
1212 {cout <<
" " << flush; mLastOutStr =
" ";}
1217 if (inFrameNum == (mLastOutFrame+1))
1219 mLastOutFrame = inFrameNum;
1223 const string currentScreen(m608Decoder->GetOnAirCharacters());
1224 if (currentScreen != mLastOutStr)
1225 cout << currentScreen << endl;
1226 mLastOutStr = currentScreen;
1227 mFirstOutFrame = mLastOutFrame = inFrameNum;
1232 uint16_t u16(uint16_t(uint16_t(showField2 ? inCCData.f2_char1 : inCCData.f1_char1) << 8) | uint16_t(showField2 ? inCCData.f2_char2 : inCCData.f1_char2));
1234 oss <<
Hex0N(u16,4);
1235 mLastOutStr.append(mLastOutStr.empty() ?
"\t" :
" ");
1236 mLastOutStr.append(oss.str());
1237 if (inFrameNum == (mLastOutFrame+1))
1239 mLastOutFrame = inFrameNum;
1244 cout <<
"Scenarist_SCC V1.0" << endl;
1250 cout << endl << tcStr <<
":" << mLastOutStr << endl;
1251 mFirstOutFrame = mLastOutFrame = inFrameNum;
1252 mLastOutStr.clear();
1256 if (inFrameNum % 60 == 0)
1258 CNTV2CaptionDecodeChannel608Ptr chDecoder (m608Decoder->Get608ChannelDecoder(m608Decoder->GetDisplayChannel()));
1261 const vector<uint32_t> stats (chDecoder->GetStats());
1264 for (
size_t num(0); num < stats.size(); num++)
1266 const string title(CNTV2CaptionDecodeChannel608::GetStatTitle(CaptionDecode608Stats(num)));
1271 ostringstream oss; oss <<
DEC(stats[num]);
1297 mDevice.
SetVideoFormat (inVideoFormat,
false,
false, mOutputChannel);
1306 cerr <<
"## NOTE: Caption burn-in using mixer/keyer " << (mixerNumber+1) <<
" on " << ::
NTV2ChannelToString(mOutputChannel)
1325 UWord connectFailures (0);
1350 if (
ULWord(chan) >= numVideoOutputs)
1354 if (chan == sdiInputAsChan)
1389 return connectFailures == 0;
1403 result = mPlayoutThread.
Start();
1415 NTV2CCGrabber * pApp (reinterpret_cast <NTV2CCGrabber *> (pContext));
1426 const string indicators [] = {
"/",
"-",
"\\",
"|",
""};
1438 const NTV2FormatDesc formatDesc (videoFormat, mPlayoutFBF, vancMode);
1442 UWord consecSyncErrs (0);
1444 static uint64_t frameTally (0);
1446 ULWord lastErrorTally (0);
1450 if (!hostBuffer.
Allocate(bufferSizeBytes,
true))
1451 {cerr <<
"## NOTE: Caption burn-in failed -- unable to allocate " << bufferSizeBytes <<
"-byte caption video buffer" << endl;
return;}
1459 pingPong = pingPong ? 0 : 1;
1462 while (!mGlobalQuit)
1469 m608Decoder->BurnCaptions (hostBuffer, formatDesc);
1470 m608Decoder->IdleFrame();
1472 if (mHeadUpDisplayOn)
1476 ? m708DecoderAnc->GetDisplayChannel()
1477 : m608Decoder->GetDisplayChannel()));
1478 oss << indicators [mCaptionDataTally % 4] <<
" " << strCaptionChan <<
" " << frameTally++ <<
" " 1481 const ULWord newErrorTally (mErrorTally);
1483 CNTV2CaptionRenderer::BurnString (oss.str(), color, hostBuffer, formatDesc, 7, 1);
1484 lastErrorTally = newErrorTally;
1486 if (!pFrameData->fTimecodes.empty())
1488 const NTV2_RP188 & tc (pFrameData->fTimecodes.begin()->second);
1489 if (tc.IsValid() && tc.fDBB &
BIT(16))
1500 pingPong = pingPong ? 0 : 1;
1501 visibleRgn.Fill(
ULWord(0));
1509 cerr <<
"## NOTE: Caption burn-in stopped due to video format change -- was " << strVideoFormat
1511 m608Decoder->Reset();
1512 m708DecoderAnc->Reset();
1513 m708DecoderVanc->Reset();
1518 bool mixerSyncOK (
false);
1522 else if (++consecSyncErrs > 60)
1523 {cerr <<
"#MXSYNC#"; consecSyncErrs = 0;}
1529 CAPNOTE(
"Thread completed, will exit");
1536 if (m608Channel != inNewChannel)
1538 m608Channel = inNewChannel;
1540 m608Decoder->SetDisplayChannel(m608Channel);
1542 m708DecoderAnc->SetDisplayChannel(m608Channel);
1543 if (m708DecoderVanc)
1544 m708DecoderVanc->SetDisplayChannel(m608Channel);
1545 cerr << endl <<
"## NOTE: Caption display channel changed to '" << ::NTV2Line21ChannelToStr(m608Channel) <<
"'" << endl;
1551 { (
void) inChangeInfo;
1552 mCaptionDataTally++;
1558 NTV2CCGrabber * pGrabber(reinterpret_cast<NTV2CCGrabber*>(pInstance));
1567 for (
unsigned enumVal(0); enumVal < NTV2_CC608_ChannelMax; )
1569 result += ::NTV2Line21ChannelToStr (NTV2Line21Channel(enumVal++));
1570 if (enumVal < NTV2_CC608_ChannelMax)
1571 result += inDelimiterStr;
1608 static const string gModeStrs[] = {
"stream",
"screen",
"scc",
"mcc",
"stats",
""};
1610 return gModeStrs[inMode];
1612 for (
unsigned ndx(0); ndx < 5; )
1614 result += gModeStrs[ndx];
1615 if (!(gModeStrs[++ndx].empty()))
1623 typedef pair<string,OutputMode> StringToOutputModePair;
1624 typedef map<string,OutputMode> StringToOutputModeMap;
1625 typedef StringToOutputModeMap::const_iterator StringToOutputModeConstIter;
1626 static StringToOutputModeMap sStringToOutputModeMap;
1627 static AJALock sStringToOutputModeMapLock;
1628 if (sStringToOutputModeMap.empty())
1630 AJAAutoLock autoLock(&sStringToOutputModeMapLock);
1635 sStringToOutputModeMap.insert(StringToOutputModePair(outputModeStr,om));
1638 string modeStr(inModeStr);
1640 StringToOutputModeConstIter iter(sStringToOutputModeMap.find(modeStr));
1659 static const string gSrcStrs[] = {
"default",
"line21",
"608vanc",
"708vanc",
"608anc",
"708anc",
""};
1661 return gSrcStrs[inDataSrc];
1663 for (
unsigned ndx(0); ndx < 6; )
1665 result += gSrcStrs[ndx];
1666 if (!gSrcStrs[++ndx].empty())
1674 typedef pair<string,CaptionDataSrc> StringToCaptionDataSrcPair;
1675 typedef map<string,CaptionDataSrc> StringToCaptionDataSrcMap;
1676 typedef StringToCaptionDataSrcMap::const_iterator StringToCaptionDataSrcConstIter;
1677 static StringToCaptionDataSrcMap sStringToCaptionDataSrcMap;
1678 static AJALock sStringToCaptionDataSrcMapLock;
1679 if (sStringToCaptionDataSrcMap.empty())
1681 AJAAutoLock autoLock(&sStringToCaptionDataSrcMapLock);
1686 sStringToCaptionDataSrcMap.insert(StringToCaptionDataSrcPair(captionDataSrcStr,cds));
1689 string cdsStr(inDataSrcStr);
1691 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.
virtual bool GetSDITransmitEnable(const NTV2Channel inChannel, bool &outEnabled)
Answers whether or not the specified SDI connector is currently acting as a transmitter (i...
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)
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.
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__)
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.
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)
static const NTV2Line21Attributes kRedOnTransparentBG(NTV2_CC608_Red, NTV2_CC608_Blue, NTV2_CC608_Transparent)
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
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__)
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 ...
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).
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.
virtual std::string GetDescription(void) const
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...
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.
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...
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.
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 ...
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...
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.
NTV2InputXptID GetCSCInputXptFromChannel(const NTV2Channel inCSC, const bool inIsKeyInput=false)
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...
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)
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)
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 SetVANCShiftMode(NTV2Channel inChannel, NTV2VANCDataShiftMode inMode)
Enables or disables the "VANC Shift Mode" feature for the given channel.
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...
uint16_t GetEndFrame(void) const
static const NTV2Line21Attributes kGreenOnTransparentBG(NTV2_CC608_Green, NTV2_CC608_Blue, NTV2_CC608_Transparent)
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 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.
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 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...
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)
Specifies channel or FrameStore 1 (or the first item).
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...
virtual bool AutoCirculateStart(const NTV2Channel inChannel, const ULWord64 inStartTime=0)
Starts AutoCirculate streaming for the specified channel that was previously initialized by CNTV2Card...
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 playback streaming, designating a contiguous block of frame buf...
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)
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
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)
std::vector< std::string > NTV2StringList
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 streaming, designating a contiguous block of frame buffe...
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 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)
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 SetVANCMode(const NTV2VANCMode inVancMode, const NTV2Channel inChannel=NTV2_CHANNEL1)
Sets the VANC mode for the given FrameStore.
virtual bool IsRGBSampling(void) const
virtual bool GetStreamingApplication(ULWord &outAppType, int32_t &outProcessID)
Answers with the four-CC type and process ID of the application that currently "owns" the AJA device ...
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.
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.