|
AJA NTV2 SDK
17.1.3.1410
NTV2 SDK 17.1.3.1410
|
Go to the documentation of this file.
39 #define AsSCCSource(__x__) reinterpret_cast<SCCSource&>(__x__)
40 #define AsUBytePtr(__x__) reinterpret_cast<UByte*>(__x__)
50 "The unanimous Declaration of the thirteen united States of America.\n"
51 "When in the Course of human events, it becomes necessary for one people to dissolve the political bands which have connected them with another, "
52 "and to assume among the powers of the earth, the separate and equal station to which the Laws of Nature and of Nature's God entitle them, a decent "
53 "respect to the opinions of mankind requires that they should declare the causes which impel them to the separation.\n"
54 "We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable Rights, "
55 "that among these are Life, Liberty and the pursuit of Happiness. That to secure these rights, Governments are instituted among Men, deriving their "
56 "just powers from the consent of the governed, That whenever any Form of Government becomes destructive of these ends, it is the Right of the People to alter or to abolish it, "
57 "and to institute new Government, laying its foundation on such principles and organizing its powers in such form, as to them shall seem most likely to effect their Safety and "
58 "Happiness. Prudence, indeed, will dictate that Governments long established should not be changed for light and transient causes; and accordingly all experience hath shewn, "
59 "that mankind are more disposed to suffer, while evils are sufferable, than to right themselves by abolishing the forms to which they are accustomed. "
60 "But when a long train of abuses and usurpations, pursuing invariably the same Object evinces a design to reduce them under absolute Despotism, it is their right, "
61 "it is their duty, to throw off such Government, and to provide new Guards for their future security. Such has been the patient sufferance of these Colonies; and such is now "
62 "the necessity which constrains them to alter their former Systems of Government. The history of the present King of Great Britain is a history of repeated injuries and "
63 "usurpations, all having in direct object the establishment of an absolute Tyranny over these States. To prove this, let Facts be submitted to a candid world.\n"
64 "He has refused his Assent to Laws, the most wholesome and necessary for the public good.\n"
65 "He has forbidden his Governors to pass Laws of immediate and pressing importance, unless suspended in their operation till his Assent should be obtained; "
66 "and when so suspended, he has utterly neglected to attend to them.\n"
67 "He has refused to pass other Laws for the accommodation of large districts of people, unless those people would relinquish the right of Representation in the Legislature, "
68 "a right inestimable to them and formidable to tyrants only.\n"
69 "He has called together legislative bodies at places unusual, uncomfortable, and distant from the depository of their public Records, for the sole purpose of fatiguing them "
70 "into compliance with his measures. \n"
71 "He has dissolved Representative Houses repeatedly, for opposing with manly firmness his invasions on the rights of the people.\n"
72 "He has refused for a long time, after such dissolutions, to cause others to be elected; whereby the Legislative powers, incapable of Annihilation, have returned to the People "
73 "at large for their exercise; the State remaining in the mean time exposed to all the dangers of invasion from without, and convulsions within.\n"
74 "He has endeavoured to prevent the population of these States; for that purpose obstructing the Laws for Naturalization of Foreigners; refusing to pass others to encourage "
75 "their migrations hither, and raising the conditions of new Appropriations of Lands.\n"
76 "He has obstructed the Administration of Justice, by refusing his Assent to Laws for establishing Judiciary powers.\n"
77 "He has made Judges dependent on his Will alone, for the tenure of their offices, and the amount and payment of their salaries.\n"
78 "He has erected a multitude of New Offices, and sent hither swarms of Officers to harrass our people, and eat out their substance.\n"
79 "He has kept among us, in times of peace, Standing Armies without the Consent of our legislatures.\n"
80 "He has affected to render the Military independent of and superior to the Civil power.\n"
81 "He has combined with others to subject us to a jurisdiction foreign to our constitution, and unacknowledged by our laws; "
82 "giving his Assent to their Acts of pretended Legislation:\n"
83 "For Quartering large bodies of armed troops among us:\n"
84 "For protecting them, by a mock Trial, from punishment for any Murders which they should commit on the Inhabitants of these States:\n"
85 "For cutting off our Trade with all parts of the world:\n"
86 "For imposing Taxes on us without our Consent:\n"
87 "For depriving us in many cases, of the benefits of Trial by Jury:\n"
88 "For transporting us beyond Seas to be tried for pretended offences.\n"
89 "For abolishing the free System of English Laws in a neighbouring Province, establishing therein an Arbitrary government, and enlarging its Boundaries so as to render it at "
90 "once an example and fit instrument for introducing the same absolute rule into these Colonies:\n"
91 "For taking away our Charters, abolishing our most valuable Laws, and altering fundamentally the Forms of our Governments:\n"
92 "For suspending our own Legislatures, and declaring themselves invested with power to legislate for us in all cases whatsoever.\n"
93 "He has abdicated Government here, by declaring us out of his Protection and waging War against us.\n"
94 "He has plundered our seas, ravaged our Coasts, burnt our towns, and destroyed the lives of our people.\n"
95 "He is at this time transporting large Armies of foreign Mercenaries to compleat the works of death, desolation and tyranny, already begun with circumstances of Cruelty & "
96 "perfidy scarcely paralleled in the most barbarous ages, and totally unworthy the Head of a civilized nation.\n"
97 "He has constrained our fellow Citizens taken Captive on the high Seas to bear Arms against their Country, to become the executioners of their friends and Brethren, "
98 "or to fall themselves by their Hands.\n"
99 "He has excited domestic insurrections amongst us, and has endeavoured to bring on the inhabitants of our frontiers, the merciless Indian Savages, whose known rule of warfare, "
100 "is an undistinguished destruction of all ages, sexes and conditions.\n"
101 "In every stage of these Oppressions We have Petitioned for Redress in the most humble terms: Our repeated Petitions have been answered only by repeated injury. "
102 "A Prince whose character is thus marked by every act which may define a Tyrant, is unfit to be the ruler of a free people.\n"
103 "Nor have We been wanting in attentions to our Brittish brethren. We have warned them from time to time of attempts by their legislature to extend an unwarrantable "
104 "jurisdiction over us. We have reminded them of the circumstances of our emigration and settlement here. We have appealed to their native justice and magnanimity, "
105 "and we have conjured them by the ties of our common kindred to disavow these usurpations, which, would inevitably interrupt our connections and correspondence. "
106 "They too have been deaf to the voice of justice and of consanguinity. We must, therefore, acquiesce in the necessity, which denounces our Separation, and hold them, "
107 "as we hold the rest of mankind, Enemies in War, in Peace Friends.\n"
108 "We, therefore, the Representatives of the united States of America, in General Congress, Assembled, appealing to the Supreme Judge of the world for the rectitude of "
109 "our intentions, do, in the Name, and by Authority of the good People of these Colonies, solemnly publish and declare, That these United Colonies are, and of Right ought "
110 "to be Free and Independent States; that they are Absolved from all Allegiance to the British Crown, and that all political connection between them and the State of Great "
111 "Britain, is and ought to be totally dissolved; and that as Free and Independent States, they have full Power to levy War, conclude Peace, contract Alliances, establish "
112 "Commerce, and to do all other Acts and Things which Independent States may of right do. And for the support of this Declaration, with a firm reliance on the protection of "
113 "divine Providence, we mutually pledge to each other our Lives, our Fortunes and our sacred Honor.");
120 #if defined (MEASURE_ACCURACY)
134 Speedometer (
const size_t inNumSamples = 20)
135 : mMaxNumSamples (inNumSamples),
138 mTimespanSamples.push_back (10);
146 virtual void Sample (
void)
148 if (mTimespanSamples.size () >= mMaxNumSamples)
149 mTimespanSamples.pop_front ();
151 mTimespanSamples.push_back (now - mWhenLastSampleCall);
152 mWhenLastSampleCall = now;
159 virtual double GetAvgMilliSecsBetweenSamples (
void)
const
162 for (SampleQueueConstIter iter (mTimespanSamples.begin ()); iter != mTimespanSamples.end (); ++iter)
164 return double (sum) / double (mTimespanSamples.size ());
170 virtual double GetAvgSamplesPerSecond (
void)
const
173 for (SampleQueueConstIter iter (mTimespanSamples.begin ()); iter != mTimespanSamples.end (); ++iter)
175 return double (mTimespanSamples.size ()) * 1000.0 / double (sum);
178 virtual inline double GetAvgSamplesPerMinute (
void)
const {
return GetAvgSamplesPerSecond () * 60.0;}
179 virtual inline size_t GetSampleCount (
void)
const {
return mTimespanSamples.size ();}
180 virtual inline uint64_t GetSampleCountTally (
void)
const {
return mSampleCallTally;}
183 typedef std::deque <uint64_t> SampleQueue;
184 typedef SampleQueue::const_iterator SampleQueueConstIter;
186 SampleQueue mTimespanSamples;
187 const size_t mMaxNumSamples;
188 uint64_t mWhenLastSampleCall;
189 uint64_t mSampleCallTally;
200 static ostream &
operator << (ostream & inOutStr,
const Speedometer & inObj)
202 const double samplesPerSecond (inObj.GetAvgSamplesPerSecond ());
203 const double samplesPerMinute (samplesPerSecond * 60.0);
204 return inOutStr << samplesPerMinute <<
" per min";
207 static uint64_t gWhenLastDisplay (0);
209 #endif // MEASURE_ACCURACY
213 static const string EndActions[] = {
"Quit",
"Repeat",
"Idle",
""};
215 string filesToPlay(
aja::join(fFilesToPlay,
"\n"));
216 if (filesToPlay.empty()) filesToPlay =
"<default>";
232 AJASystemInfo::append(result,
"Force RTP", fForceRTP ? (fForceRTP&2 ?
"MultiPkt" :
"UniPkt") :
"Normal");
243 result.push_back(*iter);
289 explicit CaptionSource (
const double inCharsPerMinute, istream * pInInputStream,
const string & inFilePath,
const bool inDeleteInputStream =
false)
290 : mpInputStream (pInInputStream),
291 mInputFilePath (inFilePath),
292 mCharsPerMinute (inCharsPerMinute),
293 mMaxRowCharWidth (32),
295 mDeleteInputStream (inDeleteInputStream),
297 mMilliSecsPerChar (0.0),
302 *mpInputStream >> std::noskipws;
303 mMilliSecsPerChar = 60000.0 / mCharsPerMinute;
313 if (mDeleteInputStream && mpInputStream)
315 delete mpInputStream;
318 #if defined (MEASURE_ACCURACY)
320 #endif // MEASURE_ACCURACY
330 static double milliSecsPerChar(mMilliSecsPerChar);
332 unsigned char rawBytes[5] = {0, 0, 0, 0, 0};
335 if (mpInputStream->tellg() == 0 && !mInputFilePath.empty())
336 PLNOTE(
"Starting caption file '" << mInputFilePath <<
"'");
338 *mpInputStream >> rawBytes[0];
339 if (mpInputStream->eof())
342 if (rawBytes[0] < 0x80)
345 resultChar = string (1,
char(rawBytes[0]));
347 else if (rawBytes[0] < 0xC0)
349 else if (rawBytes[0] < 0xE0)
355 resultChar = char(rawBytes[0]);
356 *mpInputStream >> rawBytes[1];
357 if (mpInputStream->eof())
359 resultChar += char(rawBytes[1]);
363 else if (rawBytes[0] < 0xF0)
365 resultChar = char(rawBytes[0]);
366 for (
unsigned ndx(1); ndx <= 2; ndx++)
374 *mpInputStream >> rawBytes[ndx];
375 if (mpInputStream->eof())
377 resultChar += char(rawBytes[ndx]);
379 if (!IsFinished())
NTV2_ASSERT(resultChar.length() == 3);
381 else if (rawBytes[0] < 0xF8)
383 resultChar = char(rawBytes[0]);
384 for (
unsigned ndx(1); ndx <= 3; ndx++)
392 *mpInputStream >> rawBytes[ndx];
393 if (mpInputStream->eof())
395 resultChar += char(rawBytes[ndx]);
397 if (!IsFinished())
NTV2_ASSERT(resultChar.length() == 4);
402 #if defined (MEASURE_ACCURACY)
403 if (!resultChar.empty ())
404 mCharSpeed.Sample ();
409 const double avg (mCharSpeed.GetAvgMilliSecsBetweenSamples ());
410 const double diff (avg - mMilliSecsPerChar);
411 milliSecsPerChar = milliSecsPerChar - diff;
412 if (milliSecsPerChar < 0.0)
413 milliSecsPerChar = mMilliSecsPerChar;
415 <<
" chars: " << mCharSpeed <<
" " << milliSecsPerChar <<
"ms/Char " << avg <<
"avg - "
416 << mMilliSecsPerChar <<
" => " << diff <<
"diff");
419 #endif // MEASURE_ACCURACY
437 string nextChar (GetNextCaptionCharacter ());
439 outLineBreak =
false;
440 while (!nextChar.empty ())
442 if (IsSpaceChar (nextChar) || IsControlChar (nextChar))
444 outLineBreak = (nextChar.at (0) ==
'\n' || nextChar.at (0) ==
'\r');
448 resultWord += nextChar;
449 if (IsWordBreakCharacter (nextChar))
452 nextChar = GetNextCaptionCharacter ();
475 string nextChar (GetNextCaptionCharacter ());
476 while (!nextChar.empty ())
478 if (nextChar.at (0) ==
'\n' || nextChar.at (0) ==
'\r')
481 resultRow += nextChar;
482 nextChar = GetNextCaptionCharacter ();
489 if (!mLeftoverRowText.empty ())
492 if (mLeftoverRowText.length () > mMaxRowCharWidth)
495 resultRow = mLeftoverRowText.substr (0, mMaxRowCharWidth);
496 mLeftoverRowText.erase (0, mMaxRowCharWidth);
501 resultRow = mLeftoverRowText;
502 mLeftoverRowText.clear ();
506 if (resultRow.length () == mMaxRowCharWidth)
511 bool lineBreak (
false);
512 string nextWord (GetNextCaptionWord (lineBreak));
513 if (nextWord.empty () && IsFinished ())
516 if (nextWord.empty () && !lineBreak)
520 if (!resultRow.empty () && nextWord.length () >= mMaxRowCharWidth)
522 mLeftoverRowText = nextWord;
527 if (nextWord.length () >= mMaxRowCharWidth)
529 resultRow = nextWord.substr (0, mMaxRowCharWidth);
530 nextWord.erase (0, mMaxRowCharWidth);
531 mLeftoverRowText = nextWord;
536 const size_t newLength ((resultRow.length () ? resultRow.length () + 1 : 0) + nextWord.length ());
537 if (newLength > mMaxRowCharWidth)
540 mLeftoverRowText = nextWord;
544 if (resultRow.empty ())
545 resultRow = nextWord;
547 resultRow +=
" " + nextWord;
548 if (inBreakLinesOnNewLineChars && lineBreak)
557 virtual inline bool IsPlainTextSource (
void)
const {
return true;}
558 virtual inline bool IsFinished (
void)
const {
return mFinished;}
559 virtual inline void SetFinished (
void) {mFinished =
true;}
560 virtual inline void SetCaptionChannel (
const NTV2Line21Channel inCCChannel) {mCaptionChannel = inCCChannel;}
561 virtual inline NTV2Line21Channel GetCaptionChannel (
void)
const {
return mCaptionChannel;}
570 virtual inline void SetTextMode (
const bool inIsTextMode) {mIsTextMode = inIsTextMode;}
580 istream * mpInputStream;
581 string mInputFilePath;
582 double mCharsPerMinute;
583 string mLeftoverRowText;
584 size_t mMaxRowCharWidth;
586 const bool mDeleteInputStream;
588 double mMilliSecsPerChar;
590 #if defined (MEASURE_ACCURACY)
591 Speedometer mCharSpeed;
592 #endif // MEASURE_ACCURACY
597 static bool IsWordBreakCharacter (
const string & inUTF8Char)
599 static const string wordBreakCharacters (
"!#$%&()*+,./:;<=>?@[\\]^_`{|}~. \t");
600 if (inUTF8Char.length () != 1)
602 return wordBreakCharacters.find (inUTF8Char) != string::npos;
605 static bool IsSpaceChar (
const string & inUTF8Char)
608 if (inUTF8Char.length () != 1)
610 const unsigned char c =
UByte(inUTF8Char[0]);
611 if (c == 0x09 || c == 0x0A || c == 0x0B || c == 0x0C || c == 0x0D || c == 0x20)
616 static bool IsControlChar (
const string & inUTF8Char)
619 if (inUTF8Char.length () != 1)
621 unsigned char c =
UByte(inUTF8Char[0]);
622 if ((c > 0x00 && c <
' ') || c == 0x7F)
633 explicit SCCSource (
const double inCharsPerMinute, istream * pInInputStream,
const string & inFilePath,
const bool inDeleteInputStream =
false);
637 virtual bool IsPlainTextSource (
void)
const {
return false;}
639 virtual string GetNextCaptionCharacter (
void) {
return string();}
640 virtual string GetNextCaptionWord (
bool & outLineBreak) {(
void) outLineBreak;
return string();}
641 virtual string GetNextCaptionRow (
const bool inBreakLines =
false) {(
void) inBreakLines;
return string();}
644 virtual inline SCCSource & operator = (
const SCCSource & inCaptionSource) {(
void) inCaptionSource;
return *
this;}
647 typedef std::vector<uint16_t> UWords;
648 typedef UWords::const_iterator UWordsConstIter;
649 typedef std::map<uint32_t,UWords> CCDataMap;
650 typedef CCDataMap::const_iterator CCDataMapConstIter;
652 CCDataMap mCCDataMap;
653 CCDataMapConstIter mCCDataMapIter;
654 size_t mLastCCDataWordNdx;
655 uint32_t mMaxFrameNum;
660 SCCSource::SCCSource (
const double inCharsPerMinute, istream * pInInputStream,
const string & inFilePath,
const bool inDeleteInputStream)
661 :
CaptionSource(inCharsPerMinute, pInInputStream, inFilePath, inDeleteInputStream),
662 mLastCCDataWordNdx (0),
666 while (!pInInputStream->fail())
669 std::getline(*pInInputStream, line);
672 lines.push_back(line);
675 if (iter == lines.end())
676 {
PLFAIL(
"No lines!");
return;}
677 if (iter->find(
"Scenarist_SCC") == string::npos)
678 {
PLFAIL(
"No 'Scenarist_SCC' heading!");
return;}
682 const bool isDropFrame (
true);
683 while (++iter != lines.end())
685 const string & line(*iter);
688 const size_t tabPos(line.find(
'\t'));
689 if (tabPos == string::npos)
697 string timecodeChunk(tabChunks.at(0));
700 if (tcPieces.size() < 4)
701 {
PLWARN(tcPieces.size() <<
" timecode components separated by ':' fewer than 4");
continue;}
702 const uint32_t tcComponents[4] = { uint32_t(
aja::stoul(tcPieces[0])), uint32_t(
aja::stoul(tcPieces[1])),
704 tc.
SetHmsf(tcComponents[0], tcComponents[1], tcComponents[2], tcComponents[3], timeBase, isDropFrame);
708 string ccDataChunk(tabChunks.at(1));
713 string ccDataWord(*it);
715 if (ccDataWord.find(
"0x") == string::npos && ccDataWord.find(
"0X") == string::npos)
716 ccDataWord =
"0x" + ccDataWord;
718 ccWords.push_back(ccWord);
722 CCDataMapConstIter iter(mCCDataMap.find(mMaxFrameNum));
723 if (iter != mCCDataMap.end())
724 PLWARN(
"Frame " << mMaxFrameNum <<
" already present, has " << iter->second.size() <<
" byte pairs");
726 mCCDataMap[mMaxFrameNum] = ccWords;
727 PLDBG(
"Frame " << tc.
QueryFrame() <<
" has " << ccWords.size() <<
" CC byte pairs");
728 mCCDataMapIter = mCCDataMap.begin();
729 mLastCCDataWordNdx = 0;
731 if (!mCCDataMap.empty())
732 PLINFO(
"SCC data frames " << mCCDataMap.begin()->first <<
" thru " << mMaxFrameNum <<
", size=" << mCCDataMap.size());
738 uint32_t playFrame(mMaxFrameNum ? inPlayFrame % (mMaxFrameNum + 1) : inPlayFrame);
741 if (mCCDataMapIter != mCCDataMap.end() && mLastCCDataWordNdx < mCCDataMapIter->second.size())
743 uint32_t CCFrame(mCCDataMapIter->first);
744 if (CCFrame > playFrame)
746 if (CCFrame == mMaxFrameNum)
750 const uint32_t delayFrames(CCFrame - playFrame);
751 PLINFO(
"CCFrame " <<
DEC(CCFrame) <<
" > playFrame " <<
DEC(playFrame) <<
"|" <<
DEC(inPlayFrame) <<
", delaying " <<
DEC(delayFrames) <<
" frames");
754 playFrame += delayFrames;
757 if (CCFrame <= playFrame)
759 PLINFO(
"CCFrame " <<
DEC(CCFrame) <<
" <= playFrame " <<
DEC(playFrame) <<
"|" <<
DEC(inPlayFrame) <<
": " << mCCDataMapIter->second);
762 const uint16_t ccWord(mCCDataMapIter->second.at(mLastCCDataWordNdx));
770 if (++mLastCCDataWordNdx >= mCCDataMapIter->second.size())
772 mLastCCDataWordNdx = 0;
774 if (mCCDataMapIter == mCCDataMap.end())
777 PLINFO(
"Finished at playFrame " <<
DEC(playFrame) <<
"|" <<
DEC(inPlayFrame));
781 }
while (mCCDataMapIter->first == CCFrame);
798 static istream * pStdIn (&cin);
799 static size_t nFilesToPlay (9999);
801 if (nFilesToPlay == 9999)
802 nFilesToPlay = inFilesToPlay.size();
804 if (nFilesToPlay == 0)
817 for (
size_t ndx(0); ndx < inFilesToPlay.size(); ndx++)
819 const string filePath(inFilesToPlay.at(ndx));
828 cerr <<
"## WARNING: Standard input ('-') can only be specified once" << endl;
832 ifstream * pFileStream (
new ifstream(filePath.c_str()));
834 if (pFileStream->is_open())
836 static const string scc(
".scc");
837 const size_t pos (filePath.rfind(scc));
838 if (pos == (filePath.length()-scc.length()))
842 PLINFO(
"Caption file '" << filePath <<
"' opened");
846 PLWARN(
"Cannot open caption file '" << filePath <<
"'");
847 cerr <<
"## WARNING: Cannot play '" << filePath <<
"'" << endl;
860 : mConfig (inConfigData),
862 mGeneratorThreads (),
867 mCaptionGeneratorQuit (
false),
868 mActiveFrameStores (),
874 mGeneratorThreads.push_back(
AJAThread());
896 mCaptionGeneratorQuit =
true;
897 while (!mGeneratorThreads.empty())
899 while (mGeneratorThreads.back().Active())
901 mGeneratorThreads.pop_back();
906 if (inQuitImmediately)
908 PLDBG(
"Quit immediate -- flushing");
909 m608Encoder->
Flush();
913 PLDBG(
"Quit non-immediate -- waiting for queue to drain");
923 while (mPlayThread.
Active())
932 UWord majorVersion (0), minorVersion (0), pointVersion (0), buildNumber (0);
935 if ((majorVersion == 12 && minorVersion >= 3) || (majorVersion >= 13) || (majorVersion == 0 && minorVersion == 0 && pointVersion == 0 && buildNumber == 0))
937 if (mDevice.
features().CanDoCustomAnc())
956 if (!mDevice.
features().CanDoPlayback())
963 cerr <<
"## ERROR: Cannot acquire '" << mDevice.
GetDisplayName() <<
"' because another app owns it" << endl;
975 for (
unsigned ndx(0); ndx < U32s.size(); ndx++)
976 if (U32s.at(ndx) ==
ULWord(mDeviceID))
979 U32s[ndx] =
ULWord(mDeviceID);
984 #endif // defined(_DEBUG)
988 else if (mDevice.
features().CanDoMultiFormat())
1011 cerr << mConfig << endl;
1012 #endif // defined(_DEBUG)
1030 cerr <<
"## ERROR: DrawTestPattern failed, formatDesc: " << formatDesc << endl;
1036 { ostringstream oss;
1037 oss << setw(32) << left << string(
"CCPlayer ") + strVideoFormat + string(formatDesc.IsVANC() ?
" VANC" :
"");
1040 { ostringstream oss;
1053 if (mDevice.
features().GetNumVideoOutputs() < 1)
1094 {cerr <<
"## ERROR: CCPlayer doesn't yet support UHD2/8K formats" << endl;
return AJA_STATUS_UNSUPPORTED;}
1096 cerr <<
"## WARNING: SD 625/PAL not supported -- but will insert CEA608 caption packets anyway" << endl;
1099 {cerr <<
"## ERROR: Cannot use VANC mode with UHD/4K/UHD2/8K formats" << endl;
return AJA_STATUS_UNSUPPORTED;}
1141 {cerr <<
"## ERROR: Routing thru CSC may corrupt VANC in frame buffer" << endl;
return AJA_STATUS_UNSUPPORTED;}
1148 <<
" -- Anc inserter requires both to match, output signal won't have captions" << endl;
1167 {cerr <<
"## ERROR: Cannot create 608 encoder" << endl;
return AJA_STATUS_MEMORY;}
1169 {cerr <<
"## ERROR: Cannot create 708 encoder" << endl;
return AJA_STATUS_MEMORY;}
1200 mConnections.clear();
1203 if (isRGBFBF != isRGBWire
1209 if (isRGBFBF && isRGBWire)
1212 for (
size_t ndx(0); ndx < sdiOutputs.size(); ndx++)
1213 {
NTV2Channel frmSt(frameStores.at(ndx)), sdiOut(sdiOutputs.at(ndx));
1228 for (
size_t ndx(0); ndx < sdiOutputs.size(); ndx++)
1229 {
NTV2Channel frmSt(frameStores.at(ndx/2)), tsiMux(tsiMuxes.at(ndx/2)), sdiOut(sdiOutputs.at(ndx));
1239 else if (isRGBFBF && !isRGBWire)
1242 for (
size_t ndx(0); ndx < sdiOutputs.size(); ndx++)
1243 {
NTV2Channel frmSt(frameStores.at(ndx)), sdiOut(sdiOutputs.at(ndx));
1262 for (
size_t ndx(0); ndx < cscs.size(); ndx++)
1263 {
NTV2Channel frmSt (frameStores.at(ndx/2)), tsiMux (tsiMuxes.at(ndx/2)),
1264 sdiOut (sdiOutputs.at(is4KHFR ? ndx : ndx/2)), csc (cscs.at(ndx));
1275 else if (!isRGBFBF && isRGBWire)
1278 for (
size_t ndx(0); ndx < sdiOutputs.size(); ndx++)
1279 {
NTV2Channel frmSt(frameStores.at(ndx)), sdiOut(sdiOutputs.at(ndx));
1295 for (
size_t ndx(0); ndx < sdiOutputs.size(); ndx++)
1296 {
NTV2Channel frmSt(frameStores.at(ndx/2)), tsiMux(tsiMuxes.at(ndx/2)), sdiOut(sdiOutputs.at(ndx));
1310 for (
size_t ndx(0); ndx < sdiOutputs.size(); ndx++)
1311 {
NTV2Channel frmSt(frameStores.at(ndx)), sdiOut(sdiOutputs.at(ndx));
1327 for (
size_t ndx(0); ndx < sdiOutputs.size(); ndx++)
1328 {
NTV2Channel frmSt(frameStores.at(is4KHFR ? ndx/2 : ndx)),
1329 tsiMux(tsiMuxes.at(is4KHFR ? ndx/2 : ndx)),
1330 sdiOut(sdiOutputs.at(ndx));
1418 UWord linesWanted (3);
1419 bool quitThisGenerator (
false);
1420 const UWord paintPopTopRow (9);
1421 const UWord paintPopMaxNumRows (15 - paintPopTopRow + 1);
1422 UWord lineTally (0);
1432 PLNOTE(
"Started " << ccChannelStr <<
" generator thread");
1435 while (!mCaptionGeneratorQuit)
1438 while (!mCaptionGeneratorQuit && !captionSources.empty())
1441 captionSources.pop_front();
1445 captionSource->SetCaptionChannel(inCCChannel);
1447 while (!mCaptionGeneratorQuit && !captionSource->IsFinished())
1453 if (captionSource->IsPlainTextSource())
1455 string str (captionSource->GetNextCaptionRow(newlinesMakeNewRows));
1458 for (
UWord lines(linesWanted - 1); lines; lines--)
1459 str +=
"\n" + captionSource->GetNextCaptionRow();
1462 cout << str << endl;
1463 PLDBG(ccChannelStr <<
" caption line " <<
DEC(lineTally+1) <<
": '" << str <<
"'");
1474 switch (captionMode)
1478 lineTally % paintPopMaxNumRows + paintPopTopRow,
1491 lineTally % paintPopMaxNumRows == 0,
1493 lineTally % paintPopMaxNumRows + paintPopTopRow,
1519 filesToPlay.clear();
1521 quitThisGenerator =
true;
1528 filesToPlay.clear();
1529 quitThisGenerator =
true;
1535 if (quitThisGenerator)
1541 m608Encoder->
Erase (inCCChannel);
1542 PLNOTE(ccChannelStr <<
" generator thread exit");
1557 mPlayThread.
Start();
1576 static const double gAmplitudes [16] = { 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40,
1577 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75,
1579 static const double gFrequencies [16] = { 150.00000000, 200.00000000, 266.66666667, 355.55555556, 474.07407407, 632.09876543,
1580 842.79835391, 1123.73113855, 1498.30818473, 1997.74424630, 2663.65899507, 3551.54532676,
1581 4735.39376902, 6313.85835869, 8418.47781159, 11224.63708211};
1583 static const uint16_t gF2LineNums608[] = { 573, 0, 273, 323, 0, 1000, 0, 573, 0, 0, 0 };
1584 static const uint16_t kF1PktLineNumCEA708(9), kF1PktLineNumCEA608(10);
1586 const uint16_t kF2PktLineNumCEA608 (gF2LineNums608[mVideoStandard]);
1592 const bool isInterlaced (!isProgressive);
1595 ULWord acOptionFlags (0);
1596 ULWord currentSample (0);
1598 ULWord numAudioChannels (0);
1614 numAudioChannels = mDevice.
features().GetMaxAudioChannels();
1616 numAudioChannels = 8;
1626 for (
UWord chan (0); chan < mDevice.
features().GetNumVideoOutputs(); chan++)
1631 if (mDevice.
features().GetNumHDMIAudioOutputChannels() == 8)
1643 PLNOTE(
"Playout thread started: 608F1PktLine=" <<
DEC(kF1PktLineNumCEA608) <<
" 608F2PktLine=" <<
DEC(kF2PktLineNumCEA608)
1644 <<
" 708F1PktLine=" <<
DEC(kF1PktLineNumCEA708) <<
" F2StartLine=" <<
DEC(F2StartLine));
1659 cerr <<
"## WARNING: SD video with '--noline21' option and '--no608' option won't produce captions" << endl;
1668 {cerr <<
"## ERROR: AutoCirculateInitForOutput failed" << endl; mPlayerQuit =
true;}
1671 while (!mPlayerQuit)
1706 ULWord line21RowOffset (0);
1716 ::memcpy (pLine21, pEncodedYUV8Line, bytesPerRow);
1720 else PLFAIL(
"GetWriteableRowAddress return NULL for SMPTE line 21, rowOffset=" <<
xHEX0N(line21RowOffset,8) <<
" " << formatDesc);
1729 ::memcpy (pLine21, pEncodedYUV8Line, bytesPerRow);
1733 else PLFAIL(
"GetWriteableRowAddress return NULL for SMPTE line 284, rowOffset=" <<
xHEX0N(line21RowOffset,8) <<
" " << formatDesc);
1763 char tcString[] = {
" "};
1777 for (
int num (0); num < 4; num++)
1787 if (mDevice.
features().GetNumLTCOutputs() > 1)
1820 PLNOTE(
"Playout thread exit");
1826 size_t & outTotMsgsEnq,
size_t & outTotBytesEnq,
1827 size_t & outTotMsgsDeq,
size_t & outTotBytesDeq,
1828 size_t & outMaxQueDepth,
size_t & outDroppedFrames)
const
1842 outMessagesQueued = outBytesQueued = outTotMsgsEnq = outTotBytesEnq = outTotMsgsDeq = outTotBytesDeq = outMaxQueDepth = 0;
virtual ~CaptionSource()
My destructor. If was told at construction time that I was to be responsible for deleting the input s...
I am an object that can inject text captions into an SDI output of an AJA device in real time....
virtual bool DrawTestPattern(const std::string &inTPName, const NTV2FormatDescriptor &inFormatDesc, NTV2Buffer &inBuffer)
Renders the given test pattern or color into a host raster buffer.
virtual bool SubscribeOutputVerticalEvent(const NTV2Channel inChannel)
Causes me to be notified when an output vertical blanking interrupt is generated for the given output...
virtual bool SetVANCMode(const NTV2VANCMode inVancMode, const NTV2Channel inChannel=NTV2_CHANNEL1)
Sets the VANC mode for the given FrameStore.
virtual AJAStatus SetCEA608Bytes(const uint8_t inByte1, const uint8_t inByte2)
Set the CEA608 payload bytes.
static const uint32_t kAppSignature(((((uint32_t)( 'C'))<< 24)|(((uint32_t)( 'C'))<< 16)|(((uint32_t)( 'P'))<< 8)|(((uint32_t)( 'L'))<< 0)))
unsigned long stoul(const std::string &str, std::size_t *idx, int base)
virtual string GetNextCaptionRow(const bool inBreakLinesOnNewLineChars=(0))
Returns the next "sentence" read from my input stream. I build the "sentence" by reading "words" usin...
virtual bool SetMultiFormatMode(const bool inEnable)
Enables or disables multi-format (per channel) device operation. If enabled, each device channel can ...
NTV2InputXptID GetSDIOutputInputXpt(const NTV2Channel inSDIOutput, const bool inIsDS2=false)
virtual size_t GetDequeueMessageTally(void) const
Returns the total number of messages that have been dequeued from me since I was instantiated.
@ NTV2_CC608_SemiTransparent
#define NTV2_IS_SD_VIDEO_FORMAT(__f__)
bool CanDoVideoFormat(const NTV2VideoFormat inVF)
Defines where the ancillary data can be found within a video stream.
@ DEVICE_ID_KONAIP_2110
See KONA IP.
virtual void SetAllowMultiRTPTransmit(const bool inAllow)
Determines if multiple RTP packets will be encoded for playout (via GetIPTransmitData)....
@ NTV2_AUDIO_LOOPBACK_OFF
Embeds silence (zeroes) into the data stream.
virtual bool DeviceAncExtractorIsAvailable(void)
virtual bool GetNextCaptionData(CaptionData &outCaptionData)
This high-level method is used to dequeue caption data for an entire frame.
CaptionSourceList::const_iterator CaptionSourceListConstIter
@ NTV2_REFERENCE_SFP1_PTP
Specifies the PTP source on SFP 1.
#define NTV2_FOURCC(_a_, _b_, _c_, _d_)
@ AJA_ThreadPriority_High
bool GetU32s(ULWordSequence &outU32s, const size_t inU32Offset=0, const size_t inMaxSize=32, const bool inByteSwap=false) const
Answers with my contents as a vector of unsigned 32-bit values.
UWord firstFrame(void) const
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.
AJARefPtr< CaptionSource > CaptionSourcePtr
virtual AJAStatus SetUpOutputVideo(void)
Sets up everything I need to play video.
virtual void PlayoutFrames(void)
Repeatedly plays frames (until time to quit).
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....
Declares a number of pixel format transcoder functions.
virtual size_t GetEnqueueMessageTally(void) const
Returns the total number of messages that have been enqueued onto me since I was instantiated.
virtual bool EnqueuePaintOnMessage(const std::string &inMessageStr, const bool inEraseFirst=false, const NTV2Line21Channel inChannel=NTV2_CC608_CC1, const UWord inRowNumber=0, const UWord inColumnNumber=0, const NTV2Line21Attrs &inDisplayAttribs=NTV2Line21Attrs())
Enqueues the given message for eventual "paint-on" display.
UByte f2_char1
Caption Byte 1 of Field 2.
Declares device capability functions.
Declares the constants used for sharing debug messages. These structures are used to gather debug mes...
CaptionChanGenMap::const_iterator CaptionChanGenMapCIter
std::string & strip(std::string &str, const std::string &ws)
Declares common types used in the ajabase library.
bool SetAudioBuffer(ULWord *pInAudioBuffer, const ULWord inAudioByteCount)
Sets my audio buffer for use in a subsequent call to CNTV2Card::AutoCirculateTransfer.
bool Is8BitFrameBufferFormat(const NTV2FrameBufferFormat fbFormat)
bool GetRP188Reg(RP188_STRUCT &outRP188) const
static NTV2ChannelList GetTSIMuxesForFrameStore(CNTV2Card &inDevice, const NTV2Channel in1stFrameStore, const UWord inCount)
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
A generic user-space buffer object that has an address and a length. Used most often to share an arbi...
bool fNewLinesAreNewRows
If true, newlines break caption rows; otherwise are treated as whitespace.
ULWord GetLastLine(const NTV2FieldID inRasterFieldID=NTV2_FIELD0) const
virtual void StartCaptionGeneratorThreads(void)
Starts my caption generator threads.
I am a reference-counted pointer template class. I am intended to be a proxy for an underlying object...
uint16_t fForceRTP
BIT(0):0=normal,1=forceRTP BIT(1):0=uniPkt,1=multiPkt BIT(2):0=normal,1=patchDeviceID.
std::string join(const std::vector< std::string > &parts, const std::string &delim)
void split(const std::string &str, const char delim, std::vector< std::string > &elems)
@ AtEndAction_Idle
Repeat the file list (must Ctrl-C to terminate)
ULWord GetByteCount(void) const
#define NTV2_ASSERT(_expr_)
#define IsLine21RollUpMode(_mode_)
NTV2FrameRate GetNTV2FrameRateFromVideoFormat(const NTV2VideoFormat inVideoFormat)
enum _AtEndAction_ AtEndAction
These are the actions that can be taken after the last file is "played".
static bool Create(CNTV2CaptionEncoder608Ptr &outEncoder)
Creates a new CNTV2CaptionEncoder608 instance.
Configures an NTV2CCPlayer instance.
NTV2Line21Mode fCaptionMode
The CEA-608 caption mode to use.
virtual AJAStatus Attach(AJAThreadFunction *pThreadFunction, void *pUserContext)
@ NTV2_CC608_CapModePaintOn
Paint-on caption mode.
virtual AJAStatus GetIPTransmitData(NTV2Buffer &F1Buffer, NTV2Buffer &F2Buffer, const bool inIsProgressive=true, const uint32_t inF2StartLine=0)
Explicitly encodes my AJAAncillaryData packets into the given buffers in RTP Anc Buffer Data Format ....
Declares the AJATime class.
static const string gBuiltInCaptions("IN CONGRESS, July 4, 1776.\n" "The unanimous Declaration of the thirteen united States of America.\n" "When in the Course of human events, it becomes necessary for one people to dissolve the political bands which have connected them with another, " "and to assume among the powers of the earth, the separate and equal station to which the Laws of Nature and of Nature's God entitle them, a decent " "respect to the opinions of mankind requires that they should declare the causes which impel them to the separation.\n" "We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable Rights, " "that among these are Life, Liberty and the pursuit of Happiness. That to secure these rights, Governments are instituted among Men, deriving their " "just powers from the consent of the governed, That whenever any Form of Government becomes destructive of these ends, it is the Right of the People to alter or to abolish it, " "and to institute new Government, laying its foundation on such principles and organizing its powers in such form, as to them shall seem most likely to effect their Safety and " "Happiness. Prudence, indeed, will dictate that Governments long established should not be changed for light and transient causes; and accordingly all experience hath shewn, " "that mankind are more disposed to suffer, while evils are sufferable, than to right themselves by abolishing the forms to which they are accustomed. " "But when a long train of abuses and usurpations, pursuing invariably the same Object evinces a design to reduce them under absolute Despotism, it is their right, " "it is their duty, to throw off such Government, and to provide new Guards for their future security. Such has been the patient sufferance of these Colonies; and such is now " "the necessity which constrains them to alter their former Systems of Government. The history of the present King of Great Britain is a history of repeated injuries and " "usurpations, all having in direct object the establishment of an absolute Tyranny over these States. To prove this, let Facts be submitted to a candid world.\n" "He has refused his Assent to Laws, the most wholesome and necessary for the public good.\n" "He has forbidden his Governors to pass Laws of immediate and pressing importance, unless suspended in their operation till his Assent should be obtained; " "and when so suspended, he has utterly neglected to attend to them.\n" "He has refused to pass other Laws for the accommodation of large districts of people, unless those people would relinquish the right of Representation in the Legislature, " "a right inestimable to them and formidable to tyrants only.\n" "He has called together legislative bodies at places unusual, uncomfortable, and distant from the depository of their public Records, for the sole purpose of fatiguing them " "into compliance with his measures. \n" "He has dissolved Representative Houses repeatedly, for opposing with manly firmness his invasions on the rights of the people.\n" "He has refused for a long time, after such dissolutions, to cause others to be elected; whereby the Legislative powers, incapable of Annihilation, have returned to the People " "at large for their exercise; the State remaining in the mean time exposed to all the dangers of invasion from without, and convulsions within.\n" "He has endeavoured to prevent the population of these States; for that purpose obstructing the Laws for Naturalization of Foreigners; refusing to pass others to encourage " "their migrations hither, and raising the conditions of new Appropriations of Lands.\n" "He has obstructed the Administration of Justice, by refusing his Assent to Laws for establishing Judiciary powers.\n" "He has made Judges dependent on his Will alone, for the tenure of their offices, and the amount and payment of their salaries.\n" "He has erected a multitude of New Offices, and sent hither swarms of Officers to harrass our people, and eat out their substance.\n" "He has kept among us, in times of peace, Standing Armies without the Consent of our legislatures.\n" "He has affected to render the Military independent of and superior to the Civil power.\n" "He has combined with others to subject us to a jurisdiction foreign to our constitution, and unacknowledged by our laws; " "giving his Assent to their Acts of pretended Legislation:\n" "For Quartering large bodies of armed troops among us:\n" "For protecting them, by a mock Trial, from punishment for any Murders which they should commit on the Inhabitants of these States:\n" "For cutting off our Trade with all parts of the world:\n" "For imposing Taxes on us without our Consent:\n" "For depriving us in many cases, of the benefits of Trial by Jury:\n" "For transporting us beyond Seas to be tried for pretended offences.\n" "For abolishing the free System of English Laws in a neighbouring Province, establishing therein an Arbitrary government, and enlarging its Boundaries so as to render it at " "once an example and fit instrument for introducing the same absolute rule into these Colonies:\n" "For taking away our Charters, abolishing our most valuable Laws, and altering fundamentally the Forms of our Governments:\n" "For suspending our own Legislatures, and declaring themselves invested with power to legislate for us in all cases whatsoever.\n" "He has abdicated Government here, by declaring us out of his Protection and waging War against us.\n" "He has plundered our seas, ravaged our Coasts, burnt our towns, and destroyed the lives of our people.\n" "He is at this time transporting large Armies of foreign Mercenaries to compleat the works of death, desolation and tyranny, already begun with circumstances of Cruelty & " "perfidy scarcely paralleled in the most barbarous ages, and totally unworthy the Head of a civilized nation.\n" "He has constrained our fellow Citizens taken Captive on the high Seas to bear Arms against their Country, to become the executioners of their friends and Brethren, " "or to fall themselves by their Hands.\n" "He has excited domestic insurrections amongst us, and has endeavoured to bring on the inhabitants of our frontiers, the merciless Indian Savages, whose known rule of warfare, " "is an undistinguished destruction of all ages, sexes and conditions.\n" "In every stage of these Oppressions We have Petitioned for Redress in the most humble terms: Our repeated Petitions have been answered only by repeated injury. " "A Prince whose character is thus marked by every act which may define a Tyrant, is unfit to be the ruler of a free people.\n" "Nor have We been wanting in attentions to our Brittish brethren. We have warned them from time to time of attempts by their legislature to extend an unwarrantable " "jurisdiction over us. We have reminded them of the circumstances of our emigration and settlement here. We have appealed to their native justice and magnanimity, " "and we have conjured them by the ties of our common kindred to disavow these usurpations, which, would inevitably interrupt our connections and correspondence. " "They too have been deaf to the voice of justice and of consanguinity. We must, therefore, acquiesce in the necessity, which denounces our Separation, and hold them, " "as we hold the rest of mankind, Enemies in War, in Peace Friends.\n" "We, therefore, the Representatives of the united States of America, in General Congress, Assembled, appealing to the Supreme Judge of the world for the rectitude of " "our intentions, do, in the Name, and by Authority of the good People of these Colonies, solemnly publish and declare, That these United Colonies are, and of Right ought " "to be Free and Independent States; that they are Absolved from all Allegiance to the British Crown, and that all political connection between them and the State of Great " "Britain, is and ought to be totally dissolved; and that as Free and Independent States, they have full Power to levy War, conclude Peace, contract Alliances, establish " "Commerce, and to do all other Acts and Things which Independent States may of right do. And for the support of this Declaration, with a firm reliance on the protection of " "divine Providence, we mutually pledge to each other our Lives, our Fortunes and our sacred Honor.")
Some default text to use if standard input isn't used.
static const uint32_t AUDIOBYTES_MAX_48K(201 *1024)
The maximum number of bytes of 48KHz audio that can be transferred for a single frame....
Declares the AJAAncillaryList class.
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...
ULWord GetProcessedFrameCount(void) const
NTV2ChannelList NTV2MakeChannelList(const NTV2Channel inFirstChannel, const UWord inNumChannels=1)
bool fSuppressTimecode
If true, suppress timecode; otherwise embed VITC/LTC.
@ NTV2_AUDIOSYSTEM_1
This identifies the first Audio System.
#define NTV2_IS_HFR_STANDARD(__s__)
NTV2Channel NTV2OutputDestinationToChannel(const NTV2OutputDestination inOutputDest)
Converts a given NTV2OutputDestination to its equivalent NTV2Channel value.
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...
Declares the NTV2TestPatternGen class.
virtual size_t GetQueuedMessageCount(const NTV2Line21Field inFieldNum=NTV2_CC608_Field1) const
Answers with the current depth of my queue (for the given CC608 field).
NTV2StringList fFilesToPlay
A list of zero or more strings containing paths to text files to be "played".
std::pair< NTV2InputXptID, NTV2OutputXptID > NTV2XptConnection
virtual bool ReleaseStreamForApplication(ULWord inApplicationType, int32_t inProcessID)
Releases exclusive use of the AJA device for the given process, permitting other processes to acquire...
Declares the AJATimeCode class.
#define NTV2_IS_VANCMODE_OFF(__v__)
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...
CaptionChanGenMap fCapChanGenConfigs
Caption channel generator configs.
NTV2Line21Channel fCaptionChannel
The caption channel to use.
bool PutU32s(const ULWordSequence &inU32s, const size_t inU32Offset=0, const bool inByteSwap=false)
Copies a vector of unsigned 32-bit values into me.
bool fDoMultiFormat
If true, enable device-sharing; otherwise take exclusive control of device.
virtual bool ApplySignalRoute(const CNTV2SignalRouter &inRouter, const bool inReplace=(0))
Applies the given routing table to the AJA device.
NTV2VANCMode fVancMode
VANC mode to use.
virtual bool SetAudioLoopBack(const NTV2AudioLoopBack inMode, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Enables or disables NTV2AudioLoopBack mode for the given NTV2AudioSystem.
@ NTV2_CHANNEL1
Specifies channel or Frame Store 1 (or the first item).
bool SetOutputTimeCode(const NTV2_RP188 &inTimecode, const NTV2TCIndex inTCIndex=NTV2_TCINDEX_SDI1)
Intended for playout, sets one element of my acOutputTimeCodes member.
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.
virtual bool SetSDITransmitEnable(const NTV2Channel inChannel, const bool inEnable)
Sets the specified bidirectional SDI connector to act as an input or an output.
#define AsSCCSource(__x__)
UByte f1_char2
Caption Byte 2 of Field 1.
static std::string Utf8ToCEA608String(const std::string &inUtf8Str, const NTV2Line21Channel inChannel=NTV2_CC608_CC1)
Converts the given UTF8-encoded string into a string that can be used in the CNTV2CaptionEncoder608's...
virtual bool SetVANCShiftMode(NTV2Channel inChannel, NTV2VANCDataShiftMode inMode)
Enables or disables the "VANC Shift Mode" feature for the given channel.
bool CanAcceptMoreOutputFrames(void) const
virtual size_t GetDequeueByteTally(void) const
Returns the total number of bytes (including command bytes) that have been dequeued from me since I w...
virtual AJAStatus SetUpBackgroundPatternBuffer(void)
Sets up my gray background field.
@ NTV2_FIELD0
Identifies the first field in time for an interlaced video frame, or the first and only field in a pr...
AJALabelValuePairs Get(void) const
bool CanDoOutputDestination(const NTV2OutputDestination inDest)
@ NTV2_FRAMERATE_2500
25 frames per second
I am an ordered collection of AJAAncillaryData instances which represent one or more SMPTE 291 data p...
@ NTV2_HDMIAudio8Channels
8 audio channels
NTV2FrameRate
Identifies a particular video frame rate.
virtual const UWord * GetSMPTE334Data(void) const
static void PlayThreadStatic(AJAThread *pThread, void *pContext)
This is the playout thread's static callback function that gets called when the playout thread runs....
virtual size_t GetHighestQueueDepth(void) const
Returns the highest queue depth – i.e., the maximum number of messages I held in either of my queues ...
virtual bool EnqueueCCDataToFrame(CNTV2CaptionEncoder608Ptr inEncoder, const uint32_t inFrameNum)
Enqueues next-available CC data into the given encoder for the given frame number.
#define NTV2_IS_4K_VIDEO_FORMAT(__f__)
bool IsProgressivePicture(const NTV2VideoFormat format)
@ NTV2_CHANNEL4
Specifies channel or Frame Store 4 (or the 4th item).
bool fDoTsiRouting
If true, enable TSI routing; otherwise route for square division (4K/8K)
@ NTV2_CHANNEL5
Specifies channel or Frame Store 5 (or the 5th item).
virtual void StartPlayoutThread(void)
Starts my playout thread.
virtual class DeviceCapabilities & features(void)
#define AUTOCIRCULATE_WITH_ANC
Use this to AutoCirculate with ancillary data.
virtual AJAStatus Init(void)
Initializes me and prepares me to Run.
std::ostream & operator<<(std::ostream &ioStrm, const CCPlayerConfig &inObj)
virtual size_t GetSMPTE334Size(void) const
virtual std::string GetDisplayName(void)
Answers with this device's display name.
@ NTV2_AUTOCIRCULATE_INVALID
Declares the AJAProcess class.
NTV2ACFrameRange fFrames
AutoCirculate frame count or range.
virtual bool SetHDMIOutAudioChannels(const NTV2HDMIAudioChannels inNewValue)
AtEndAction fEndAction
The action to take after the file list has finished playing.
static void Sleep(const int32_t inMilliseconds)
Suspends execution of the current thread for a given number of milliseconds.
bool fEmitStats
If true, show stats while playing; otherwise echo caption text being played.
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....
This class handles CEA-708 SMPTE 334 packets.
virtual bool EnableChannels(const NTV2ChannelSet &inChannels, const bool inDisableOthers=(0))
Enables the given FrameStore(s).
@ NTV2_VANCDATA_8BITSHIFT_ENABLE
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...
#define AJAAncDataHorizOffset_AnyVanc
VANC – Packet placed/found in any legal area of raster line after SAV, but before EAV.
@ NTV2_CC608_ChannelInvalid
Declares the CNTV2DeviceScanner class.
#define NTV2_IS_625_FORMAT(__f__)
@ AJAAncDataChannel_Y
The ancillary data is associated with the luminance (Y) channel of the video stream.
bool fSuppressAudio
If true, suppress audio; otherwise generate audio tone.
bool fSuppress608
If true, don't transmit CEA608 packets; otherwise include 608 packets.
virtual bool EnqueueRollUpMessage(const std::string &inMessageStr, const NTV2Line21Mode inRollMode=NTV2_CC608_CapModeRollUp4, const NTV2Line21Channel inChannel=NTV2_CC608_CC1, const UWord inRowNumber=NTV2_CC608_MaxRow, const UWord inColumnNumber=NTV2_CC608_MinCol, const NTV2Line21Attrs &inDisplayAttribs=NTV2Line21Attrs())
Enqueues the given message for eventual "roll up" display.
bool SetOutputTimeCodes(const NTV2TimeCodes &inValues)
Intended for playout, replaces the contents of my acOutputTimeCodes member.
static size_t SetDefaultPageSize(void)
NTV2TCIndex NTV2ChannelToTimecodeIndex(const NTV2Channel inChannel, const bool inEmbeddedLTC=false, const bool inIsF2=false)
Converts the given NTV2Channel value into the equivalent NTV2TCIndex value.
This class is used to configure a caption generator for a single caption channel.
#define IsLine21CaptionChannel(_chan_)
virtual bool SetSDIOutRGBLevelAConversion(const UWord inOutputSpigot, const bool inEnable)
Enables or disables an RGB-over-3G-level-A conversion at the SDI output widget (assuming the AJA devi...
#define IsValidLine21Channel(_chan_)
NTV2OutputXptID GetCSCOutputXptFromChannel(const NTV2Channel inCSC, const bool inIsKey=false, const bool inIsRGB=false)
const std::string & NTV2Line21ModeToStr(const NTV2Line21Mode inLine21Mode)
Converts the given NTV2Line21Mode value into a human-readable string.
virtual void ToString(std::string &outAllLabelsAndValues) const
Answers with a multi-line string that contains the complete host system info table.
virtual bool EnqueuePopOnMessage(const std::string &inMessageStr, const NTV2Line21Channel inChannel=NTV2_CC608_CC1, const UWord inRowNumber=0, const UWord inColumnNumber=0, const NTV2Line21Attrs &inDisplayAttribs=NTV2Line21Attrs())
Enqueues the given message for eventual "pop-on" display.
@ AtEndAction_Repeat
Terminate.
virtual string GetNextCaptionCharacter(void)
Returns the next character read from my input stream. If my text input stream has reached EOF,...
virtual bool UnsubscribeOutputVerticalEvent(const NTV2Channel inChannel)
Unregisters me so I'm no longer notified when an output VBI is signaled on the given output channel.
NTV2VideoFormat fVideoFormat
The video format to use.
virtual AJAStatus RouteOutputSignal(void)
Sets up signal routing for playout.
virtual bool AutoCirculateGetStatus(const NTV2Channel inChannel, AUTOCIRCULATE_STATUS &outStatus)
Returns the current AutoCirculate status for the given channel.
#define NTV2_IS_VANCMODE_ON(__v__)
@ NTV2_FBF_8BIT_YCBCR
See 8-Bit YCbCr Format.
@ NTV2_REFERENCE_FREERUN
Specifies the device's internal clock.
static bool Create(CNTV2CaptionEncoder708Ptr &outEncoder)
Creates a new CNTV2CaptionEncoder708 instance.
This object specifies the information that will be transferred to or from the AJA device in the CNTV2...
NTV2Channel fOutputChannel
The device channel to use.
Declares numerous NTV2 utility functions.
AJALabelValuePairs Get(const bool inCompact=(0)) const
Renders a human-readable representation of me.
static CaptionSourceList GetCaptionSources(const NTV2StringList &inFilesToPlay, const double inCharsPerMinute)
Creates and returns a list of CaptionSource instances to play from a given list of paths to text file...
std::string NTV2VideoFormatToString(const NTV2VideoFormat inValue, const bool inUseFrameRate=false)
bool fSuppressLine21
SD output only: if true, do not encode Line 21 waveform; otherwise encode Line 21 waveform.
void SetHmsf(uint32_t h, uint32_t m, uint32_t s, uint32_t f, const AJATimeBase &timeBase, bool bDropFrame)
bool SetVideoBuffer(ULWord *pInVideoBuffer, const ULWord inVideoByteCount)
Sets my video buffer for use in a subsequent call to CNTV2Card::AutoCirculateTransfer.
NTV2InputXptID GetCSCInputXptFromChannel(const NTV2Channel inCSC, const bool inIsKeyInput=false)
I interrogate and control an AJA video/audio capture/playout device.
@ NTV2_CC608_CapModeRollUp4
4-row roll-up from bottom
virtual AJAStatus AddAncillaryData(const AJAAncillaryList &inPackets)
Appends a copy of the given list's packets to me.
virtual bool IsDeviceReady(const bool inCheckValid=(0))
bool bGotField2Data
True if Field 2 bytes have been set; otherwise false.
virtual size_t GetQueuedByteCount(const NTV2Line21Field inFieldNum=NTV2_CC608_Field1) const
Answers with the total number of bytes (including command bytes) that are currently queued (for the g...
std::set< NTV2Channel > NTV2ChannelSet
A set of distinct NTV2Channel values.
NTV2Buffer acANCField2Buffer
The host "Field 2" ancillary data buffer. This field is owned by the client application,...
virtual bool SetTsiFrameEnable(const bool inIsEnabled, const NTV2Channel inChannel)
Enables or disables SMPTE 425 two-sample interleave (Tsi) frame mode on the device.
static istringstream gBuiltInStream(gBuiltInCaptions)
The global built-in caption data input stream.
NTV2Line21Channel fCapChannel
virtual bool SetEveryFrameServices(const NTV2EveryFrameTaskMode inMode)
Sets the device's task mode.
std::vector< std::string > NTV2StringList
virtual ~NTV2CCPlayer(void)
#define IsLine21TextChannel(_chan_)
#define NTV2_OUTPUT_DEST_IS_SDI(_dest_)
NTV2SmpteLineNumber GetSmpteLineNumber(const NTV2Standard inStandard)
For the given video standard, returns the SMPTE-designated line numbers for Field 1 and Field 2 that ...
AUTOCIRCULATE_TRANSFER_STATUS acTransferStatus
Contains status information that's valid after CNTV2Card::AutoCirculateTransfer returns,...
bool AddAudioTone(ULWord &outNumBytesWritten, NTV2Buffer &inAudioBuffer, ULWord &inOutCurrentSample, const ULWord inNumSamples, const double inSampleRate, const double inAmplitude, const double inFrequency, const ULWord inNumBits, const bool inByteSwap, const ULWord inNumChannels)
Fills the given buffer with 32-bit (ULWord) audio tone samples.
@ NTV2_DISABLE_TASKS
0: Disabled: Device is completely configured by controlling application(s) – no driver involvement.
static AJA_FrameRate GetAJAFrameRate(const NTV2FrameRate inFrameRate)
virtual size_t GetEnqueueByteTally(void) const
Returns the total number of bytes (including command bytes) that have been enqueued onto me since I w...
virtual bool RemoveConnections(const NTV2XptConnections &inConnections)
Removes the given widget routing connections from the AJA device.
virtual void Flush(const NTV2Line21Field inFieldNum=NTV2_CC608_Field1, const bool inAlsoInProgress=true)
Flushes all queued command bytes for the given CC608 field.
AJALabelValuePairs::const_iterator AJALabelValuePairsConstIter
static void SignalHandler(int inSignal)
The NTV2 test pattern generator.
virtual AJAStatus GetVANCTransmitData(NTV2Buffer &inFrameBuffer, const NTV2FormatDescriptor &inFormatDesc)
Writes my AJAAncillaryData objects into the given tall/taller frame buffer having the given raster/fo...
std::vector< NTV2Channel > NTV2ChannelList
An ordered sequence of NTV2Channel values.
void * GetHostPointer(void) const
@ NTV2_CC608_CapModeRollUp2
2-row roll-up from bottom
#define NTV2_IS_QUAD_QUAD_FORMAT(__f__)
virtual bool Set608CaptionData(const CaptionData &inCC608Data)
Sets the CEA-608 caption data in my private 608 data buffer.
Declares the CNTV2CaptionRenderer class.
virtual bool Erase(const NTV2Line21Channel inChannel=NTV2_CC608_CC1)
Clears captions on the given channel by emitting ENM (Erase Non-displayed Memory) and EOC (End Of Cap...
@ NTV2_FBF_10BIT_YCBCR
See 10-Bit YCbCr Format.
@ NTV2_VANCMODE_TALLER
This identifies the mode in which there are some + extra VANC lines in the frame buffer.
virtual AJAStatus GeneratePayloadData(void)
Generate the payload data from my "local" ancillary data.
bool fDoRGBOnWire
If true, produce RGB on the wire; otherwise output YUV.
Used to describe Start of Active Video (SAV) location and field dominance for a given NTV2Standard....
SCCSource(const double inCharsPerMinute, istream *pInInputStream, const string &inFilePath, const bool inDeleteInputStream=(0))
virtual AJAStatus SetLocationLineNumber(const uint16_t inLineNum)
Sets my ancillary data "location" frame line number.
const std::string & NTV2Line21ChannelToStr(const NTV2Line21Channel inLine21Channel, const bool inCompact=true)
Converts the given NTV2Line21Channel value into a human-readable string.
NTV2OutputDest fOutputDest
The desired output connector to use.
NTV2Line21Mode
The CEA-608 modes: pop-on, roll-up (2, 3 and 4-line), and paint-on.
@ NTV2_FRAMERATE_5994
Fractional rate of 60,000 frames per 1,001 seconds.
This file contains some structures, constants, classes and functions that are used in some of the dem...
Private include file for all ajabase sources.
#define AUTOCIRCULATE_WITH_RP188
Use this to AutoCirculate with RP188.
static void CaptionGeneratorThreadStatic(AJAThread *pThread, void *pContext)
This is the caption generator thread's static callback function that gets called when the caption gen...
UWord lastFrame(void) const
NTV2AutoCirculateState acState
Current AutoCirculate state after the transfer.
NTV2OutputXptID GetFrameBufferOutputXptFromChannel(const NTV2Channel inFrameStore, const bool inIsRGB=false, const bool inIs425=false)
const char * GetRP188CString() const
Declares the AJAAncillaryData_Cea608_Vanc class.
std::string NTV2FrameBufferFormatToString(const NTV2FrameBufferFormat inValue, const bool inForRetailDisplay=false)
std::string fDeviceSpec
The AJA device to use.
#define IsField1Line21CaptionChannel(_chan_)
Declares the enumeration constants used in the ajabase library.
NTV2OutputXptID GetTSIMuxOutputXptFromChannel(const NTV2Channel inTSIMuxer, const bool inLinkB=false, const bool inIsRGB=false)
std::map< NTV2TCIndex, NTV2_RP188 > NTV2TimeCodes
A mapping of NTV2TCIndex enum values to NTV2_RP188 structures.
NTV2Line21Channel
The CEA-608 caption channels: CC1 thru CC4, TX1 thru TX4, plus XDS.
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 ...
virtual AJAStatus GetTransmitData(NTV2Buffer &F1Buffer, NTV2Buffer &F2Buffer, const bool inIsProgressive=true, const uint32_t inF2StartLine=0)
Encodes my AJAAncillaryData packets into the given buffers in the default SDI Anc Buffer Data Format ...
NTV2ChannelSet NTV2MakeChannelSet(const NTV2Channel inFirstChannel, const UWord inNumChannels=1)
This struct replaces the old RP188_STRUCT.
@ NTV2_TCINDEX_LTC2
Analog LTC 2.
bool IsRGBFormat(const NTV2FrameBufferFormat format)
std::string fTestPatternName
The test pattern to use.
virtual bool EnqueueTextMessage(const std::string &inMessageStr, const bool inEraseFirst=false, const NTV2Line21Channel inChannel=NTV2_CC608_Text1)
Enqueues the given message for eventual reception and possible display on a receiver capable of displ...
uint32_t QueryFrame(void) const
@ NTV2_FRAMERATE_UNKNOWN
Represents an unknown or invalid frame rate.
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 ...
std::vector< uint32_t > ULWordSequence
An ordered sequence of ULWord (uint32_t) values.
ULWord GetDroppedFrameCount(void) const
ULWord GetAudioSamplesPerFrame(const NTV2FrameRate inFrameRate, const NTV2AudioRate inAudioRate, ULWord inCadenceFrame=0, bool inIsSMPTE372Enabled=false)
Returns the number of audio samples for a given video frame rate, audio sample rate,...
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...
@ NTV2_CC608_CapModeRollUp3
3-row roll-up from bottom
@ NTV2_TCINDEX_DEFAULT
The "default" timecode (mostly used by the AJA "Retail" service and Control Panel)
struct NTV2Line21Attributes NTV2Line21Attrs
A handy class that makes it easy to "bounce" an unsigned integer value between a minimum and maximum ...
#define AUTOCIRCULATE_WITH_LTC
Use this to AutoCirculate with analog LTC.
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 ...
virtual bool SetSDIOutputDS2AudioSystem(const NTV2Channel inSDIOutputConnector, const NTV2AudioSystem inAudioSystem)
Sets the Audio System that will supply audio for the given SDI output's audio embedder for Data Strea...
CaptionSource(const double inCharsPerMinute, istream *pInInputStream, const string &inFilePath, const bool inDeleteInputStream=(0))
My only constructor.
Declares the CRP188 class. See SMPTE RP188 standard for details.
virtual void Quit(const bool inQuitImmediately=(0))
Stops me.
virtual void GenerateCaptions(const NTV2Line21Channel inCCChannel)
This is the thread function that produces caption messages for a given caption channel.
@ NTV2_AudioChannel1_8
This selects audio channels 1 thru 8.
virtual AJAStatus Run(void)
Runs me.
virtual NTV2DeviceID GetDeviceID(void)
virtual bool GetDriverVersionComponents(UWord &outMajor, UWord &outMinor, UWord &outPoint, UWord &outBuild)
Answers with the individual version components of this device's driver.
#define NTV2_IS_QUAD_FRAME_FORMAT(__f__)
virtual bool GetEveryFrameServices(NTV2EveryFrameTaskMode &outMode)
Retrieves the device's current "retail service" task mode.
bool fSuppress708
If true, don't transmit CEA708 packets; otherwise include 708 packets.
static const double gFrequencies[]
virtual bool GetFrameRate(NTV2FrameRate &outValue, NTV2Channel inChannel=NTV2_CHANNEL1)
Returns the AJA device's currently configured frame rate via its "value" parameter.
NTV2StringList::const_iterator NTV2StringListConstIter
NTV2Buffer acOutputTimeCodes
Intended for playout, this is an ordered sequence of NTV2_RP188 values to send to the device....
This class handles VANC-based CEA-608 caption data packets (not "analog" Line 21).
#define NTV2_IS_4K_4096_VIDEO_FORMAT(__f__)
std::string NTV2ChannelToString(const NTV2Channel inValue, const bool inForRetailDisplay=false)
virtual bool SetHDMIOutAudioSource8Channel(const NTV2Audio8ChannelSelect inNewValue, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Changes the HDMI output's 8-channel audio source.
NTV2Standard GetNTV2StandardFromVideoFormat(const NTV2VideoFormat inVideoFormat)
NTV2PixelFormat fPixelFormat
The pixel format to use.
Declares the AJAAncillaryData_Cea708 class.
bool Fill(const T &inValue)
Fills me with the given scalar value.
virtual AJAStatus SetPriority(AJAThreadPriority priority)
virtual bool AutoCirculateStart(const NTV2Channel inChannel, const ULWord64 inStartTime=0)
Starts AutoCirculating the specified channel that was previously initialized by CNTV2Card::AutoCircul...
bool bGotField1Data
True if Field 1 bytes have been set; otherwise false.
CapGenStartInfo(NTV2CCPlayer *pPlayer, const NTV2Line21Channel inCapChan)
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...
NTV2InputXptID GetDLOutInputXptFromChannel(const NTV2Channel inDLOutWidget)
CEA-608 Character Attributes.
@ AJAAncDataSpace_VANC
Ancillary data found between SAV and EAV (.
This structure encapsulates all possible CEA-608 caption data bytes that may be associated with a giv...
static TimecodeFormat NTV2FrameRate2TimecodeFormat(const NTV2FrameRate inFrameRate)
@ NTV2_FRAMERATE_5000
50 frames per second
virtual AJAStatus SetFromSMPTE334(const uint16_t *pInData, const uint32_t inNumWords, const AJAAncDataLoc &inLocInfo)
Copies payload data from an external 16-bit source into local payload memory.
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 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 AJAStatus Start()
static std::string StripFormatString(const std::string &inStr)
#define AJA_RETAIL_DEFAULT
std::string to_string(bool val)
double fCharsPerMinute
The rate at which caption characters get enqueued, in characters per minute.
UByte f2_char2
Caption Byte 2 of Field 2.
Instances of me can encode two ASCII characters into a "line 21" closed-captioning waveform....
virtual void GetStatus(size_t &outMessagesQueued, size_t &outBytesQueued, size_t &outTotMsgsEnq, size_t &outTotBytesEnq, size_t &outTotMsgsDeq, size_t &outTotBytesDeq, size_t &outMaxQueDepth, size_t &outDroppedFrames) const
Returns status information from my caption encoder.
std::vector< AJALabelValuePair > AJALabelValuePairs
An ordered sequence of label/value pairs.
#define xHEX0N(__x__, __n__)
NTV2AudioSystem
Used to identify an Audio System on an NTV2 device. See Audio System Operation for more information.
#define AJA_FAILURE(_status_)
virtual bool MakeSMPTE334AncPacket(const NTV2FrameRate inFrameRate, const NTV2Line21Field inVideoField)
Generates a SMPTE-334 Ancillary data packet.
virtual void SetTextMode(const bool inIsTextMode)
Sets my text mode. If I'm in text mode, I don't do any word breaking or line/row truncation.
@ NTV2_TCINDEX_LTC1
Analog LTC 1.
bool firstFieldTop
True if the first field on the wire is the top-most field in the raster (field dominance)
virtual UByte * EncodeLine(const UByte inByte1, const UByte inByte2)
Encodes the two given characters as an EIA-608-compliant "line 21" waveform into my private line data...
bool CanDoFrameBufferFormat(const NTV2PixelFormat inPF)
std::string NTV2FrameRateToString(const NTV2FrameRate inValue, const bool inForRetailDisplay=false)
@ NTV2_CC608_CapModePopOn
Pop-on caption mode.
NTV2AudioSystem NTV2ChannelToAudioSystem(const NTV2Channel inChannel)
Converts the given NTV2Channel value into its equivalent NTV2AudioSystem.
Defines the AJARefPtr template class.
NTV2Buffer acANCBuffer
The host ancillary data buffer. This field is owned by the client application, and thus is responsibl...
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...
NTV2InputXptID GetTSIMuxInputXptFromChannel(const NTV2Channel inTSIMuxer, const bool inLinkB=false)
@ AJAAncDataLink_A
The ancillary data is associated with Link A of the video stream.
@ DEVICE_ID_NOTFOUND
Invalid or "not found".
AJALabelValuePairs Get(const bool inCompact=(0)) const
UByte f1_char1
Caption Byte 1 of Field 1.
NTV2TestPatternGen & setVANCToLegalBlack(const bool inClearVANC)
Changes my "clear VANC lines to legal black" setting.
static const double gAmplitudes[]
virtual bool SetSDIOutLevelAtoLevelBConversion(const UWord inOutputSpigot, const bool inEnable)
Enables or disables 3G level A to 3G level B conversion at the SDI output widget (assuming the AJA de...
std::string NTV2Line21AttributesToStr(const NTV2Line21Attributes inLine21Attributes)
Converts the given NTV2Line21Attributes value into a human-readable string.
@ NTV2_FIELD1
Identifies the last (second) field in time for an interlaced video frame.
bool ConvertLine_2vuy_to_v210(const UByte *pInSrcLine_2vuy, ULWord *pOutDstLine_v210, const ULWord inNumPixels)
Converts a single 8-bit YCbCr '2vuy' raster line to 10-bit YCbCr 'v210' (from NTV2_FBF_8BIT_YCBCR to ...
virtual bool EnqueueCaptionData(const CaptionData &inCaptionData)
This is a low-level method that enqueues the given CaptionData for eventual transmission.
#define NTV2_IS_PROGRESSIVE_STANDARD(__s__)
@ NTV2_OEM_TASKS
2: OEM: Device is configured by controlling application(s), with minimal driver involvement.
NTV2OutputXptID GetDLOutOutputXptFromChannel(const NTV2Channel inDLOutput, const bool inIsLinkB=false)
static uint64_t GetSystemMilliseconds(void)
Returns the current value of the host's high-resolution clock, in milliseconds.
bool Set(const void *pInUserPointer, const size_t inByteCount)
Sets (or resets) me from a client-supplied address and size.
virtual string GetNextCaptionWord(bool &outLineBreak)
Returns the next "word" read from my input stream. If my text input stream has reached EOF,...
deque< CaptionSourcePtr > CaptionSourceList
I am an ordered sequence of CaptionSources.
Utility class for timecodes.
virtual bool SetAudioRate(const NTV2AudioRate inRate, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Sets the NTV2AudioRate for the given Audio System.
NTV2CCPlayer(const CCPlayerConfig &inConfigData)
Constructs me using the given configuration settings.
std::string NTV2OutputDestinationToString(const NTV2OutputDestination inValue, const bool inForRetailDisplay=false)
@ NTV2_AUDIOSYSTEM_INVALID