|
AJA NTV2 SDK
17.0.1.1246
NTV2 SDK 17.0.1.1246
|
Go to the documentation of this file.
15 #include "ajabase/persistence/persistence.h"
22 #if defined(MSWindows)
23 #define PATH_DELIMITER "\\"
25 #define PATH_DELIMITER "/"
40 #define AsMacDriverInterface(_x_) reinterpret_cast<CNTV2MacDriverInterface*>(&(_x_))
41 #define AsDriverInterface(_x_) reinterpret_cast<CNTV2DriverInterface*>(&(_x_))
43 static string makeHeader(ostringstream & oss,
const string & inName)
45 oss << setfill(
'=') << setw(96) <<
" " << inName <<
":" << setfill(
' ') << endl << endl;
65 const string sigStr(NTV2_4CC_AS_STRING(inAppSignature));
66 if (isprint(sigStr.at(0)) && isprint(sigStr.at(1)) && isprint(sigStr.at(2)) && isprint(sigStr.at(3)))
67 oss <<
"'" << sigStr <<
"'";
68 else if (inAppSignature)
69 oss <<
"0x" << hex << setw (8) << setfill (
'0') << inAppSignature << dec <<
" (" << inAppSignature <<
")";
78 #if defined (MSWindows)
88 #elif defined (AJALinux)
90 #elif defined (AJAMac)
109 static uint32_t gMaxSampleCount16 [] = { 16320, 65280, 32640, 130560, 0 };
110 static uint32_t gMaxSampleCount8 [] = { 32640, 130560, 65280, 261120, 0 };
111 static uint32_t gMaxSampleCount6 [] = { 87040, 174080, 87040, 348160, 0 };
113 switch (inChannelCount)
115 case 16:
return gMaxSampleCount16 [inBufferSize];
116 case 8:
return gMaxSampleCount8 [inBufferSize];
117 case 6:
return gMaxSampleCount6 [inBufferSize];
140 device.
GetMode(inChannel, result);
226 outChannelPairsPresent.clear();
227 switch (inAudioSource)
229 default:
return false;
251 outChannelPairsPresent.insert (chPair);
264 bool bBitFileInfoAvailable =
false;
266 if( bBitFileInfoAvailable )
269 if (outDateString.find(
".ncd") != string::npos)
271 outDateString = outDateString.substr(0, outDateString.find(
".ncd"));
272 outDateString +=
".bit ";
273 outDateString += bitFileInfo.
dateStr;
274 outDateString +=
" ";
275 outDateString += bitFileInfo.
timeStr;
277 else if (outDateString.find(
";") != string::npos)
279 outDateString = outDateString.substr(0, outDateString.find(
";"));
280 outDateString +=
".bit ";
281 outDateString += bitFileInfo.
dateStr;
282 outDateString +=
" ";
283 outDateString += bitFileInfo.
timeStr;
285 else if (outDateString.find(
".bit") != string::npos && outDateString !=
".bit")
288 outDateString +=
" ";
289 outDateString += bitFileInfo.
dateStr;
290 outDateString +=
" ";
291 outDateString += bitFileInfo.
timeStr;
295 outDateString =
"bad bitfile date string";
338 if (mPrependMap.find(section) != mPrependMap.end())
340 mPrependMap.at(section).insert(0,
"\n");
341 mPrependMap.at(section).insert(0, sectionData);
345 mPrependMap[section] = sectionData;
346 mPrependMap.at(section).append(
"\n");
352 if (mAppendMap.find(section) != mAppendMap.end())
354 mAppendMap.at(section).append(
"\n");
355 mAppendMap.at(section).append(sectionData);
359 mAppendMap[section] =
"\n";
360 mAppendMap.at(section).append(sectionData);
368 oss << sectionData <<
"\n";
369 mHeaderStr.append(oss.str());
376 oss << sectionData <<
"\n";
377 mFooterStr.append(oss.str());
385 #define LoggerSectionToFunctionMacro(_SectionEnum_, _SectionString_, _SectionMethod_) \
386 if (mSections & _SectionEnum_) \
388 makeHeader(oss, _SectionString_); \
389 if (mPrependMap.find(_SectionEnum_) != mPrependMap.end()) \
390 oss << mPrependMap.at(_SectionEnum_); \
392 _SectionMethod_(oss); \
394 if (mAppendMap.find(_SectionEnum_) != mAppendMap.end()) \
395 oss << mAppendMap.at(_SectionEnum_); \
401 vector<char> dateBufferLocal(128, 0);
402 vector<char> dateBufferUTC(128, 0);
406 struct tm *localTimeinfo;
407 localTimeinfo = localtime(
reinterpret_cast<const time_t*
>(&now));
408 strcpy(&dateBufferLocal[0],
"");
410 ::strftime(&dateBufferLocal[0], dateBufferLocal.size(),
"%B %d, %Y %I:%M:%S %p %Z (local)", localTimeinfo);
412 struct tm *utcTimeinfo;
413 utcTimeinfo = gmtime(
reinterpret_cast<const time_t*
>(&now));
414 strcpy(&dateBufferUTC[0],
"");
416 ::strftime(&dateBufferUTC[0], dateBufferUTC.size(),
"%Y-%m-%dT%H:%M:%SZ UTC", utcTimeinfo);
418 oss <<
"Begin NTV2 Support Log" <<
"\n" <<
420 "Generated: " << &dateBufferLocal[0] <<
421 " " << &dateBufferUTC[0] <<
"\n\n" << flush;
423 if (!mHeaderStr.empty())
429 if (mDevice.IsOpen())
437 if (!mFooterStr.empty())
439 oss << endl <<
"End NTV2 Support Log";
448 static inline string HEX0NStr (
const uint32_t inNum,
const uint16_t inWidth) {ostringstream oss; oss <<
HEX0N(inNum,inWidth);
return oss.str();}
449 static inline string xHEX0NStr(
const uint32_t inNum,
const uint16_t inWidth) {ostringstream oss; oss <<
xHEX0N(inNum,inWidth);
return oss.str();}
450 template <
class T>
string DECStr (
const T & inT) {ostringstream oss; oss <<
DEC(inT);
return oss.str();}
452 void CNTV2SupportLogger::FetchInfoLog (ostringstream & oss)
const
459 if (mDevice.IsOpen())
463 ULWord drvrType(0), dextType(0x44455854);
466 str =
"Kernel Extension ('KEXT')";
467 else if (drvrType == dextType)
468 str =
"DriverKit ('DEXT')";
471 oss <<
"(Unknown/Invalid " <<
xHEX0N(drvrType,8) <<
")";
475 #endif // defined(AJAMac)
479 if (mDevice.IsOpen())
489 string dateStr, timeStr, connType;
496 if (mDevice.IsIPDevice())
509 if (ntv2Card.ReadMACAddresses(mac1, mac2))
519 ULWord dnaLo(0), dnaHi(0);
526 ntv2Card.ReadLicenseInfo(licenseInfo);
538 if (mDevice.IsRemote())
540 if (!mDevice.GetHostName().empty())
547 if (!connType.empty())
559 std::vector<std::pair<std::string, bool> > persistenceChecks;
560 persistenceChecks.push_back(std::pair<std::string, bool>(
"User Persistence Health",
false));
561 persistenceChecks.push_back(std::pair<std::string, bool>(
"System Persistence Health",
true));
562 std::vector<std::pair<std::string, bool> >::const_iterator it(persistenceChecks.begin());
564 std::string errMessage;
565 for (; it != persistenceChecks.end(); ++it)
567 std::string label(it->first);
568 bool shared(it->second);
569 AJAPersistence p(
"com.aja.devicesettings",
"Unknown",
"00000000", shared);
570 if (p.StorageHealthCheck(errCode, errMessage))
576 if (shared && errCode == -1)
587 void CNTV2SupportLogger::FetchRegisterLog (ostringstream & oss)
const
593 static const string sDashes (96,
'-');
598 deviceRegs.insert(regNum);
600 oss << endl << deviceRegs.size() <<
" Device Registers " << sDashes << endl << endl;
603 oss <<
"## NOTE: Driver failed to return one or more registers (those will be zero)" << endl;
607 const uint32_t regNum (regInfo.registerNumber);
609 const uint32_t value (regInfo.registerValue);
612 <<
"Register Number: " << regNum << endl
613 <<
"Register Value: " << value <<
" : " <<
xHEX0N(value,8) << endl
619 oss << endl << virtualRegs.size() <<
" Virtual Registers " << sDashes << endl << endl;
621 oss <<
"## NOTE: Driver failed to return one or more virtual registers (those will be zero)" << endl;
625 const uint32_t regNum (regInfo.registerNumber);
627 const uint32_t value (regInfo.registerValue);
630 <<
"VReg Number: " << setw(10) << regNum << endl
631 <<
"VReg Value: " << value <<
" : " <<
xHEX0N(value,8) << endl
637 void CNTV2SupportLogger::FetchAutoCirculateLog (ostringstream & oss)
const
646 static const string dashes (25,
'-');
678 bool multiFormatMode(
false);
681 if (!multiFormatMode)
684 oss <<
"MultiFormat Mode" << endl;
691 <<
"Chan/FrameStore State Start End Act FrmProc FrmDrop BufLvl Audio RP188 LTC FBFch FBOch Color VidPr Anc HDMIx Field VidFmt PixFmt" << endl
692 <<
"-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------" << endl;
700 << setw(12) << status[0]
701 << setw( 7) << status[1]
702 << setw( 6) << status[2]
704 << setw(10) << status[9]
705 << setw(10) << status[10]
706 << setw( 7) << status[11]
707 << setw( 9) << status[12]
708 << setw( 8) << status[13]
709 << setw( 8) << status[14]
710 << setw( 8) << status[15]
711 << setw( 8) << status[16]
712 << setw( 8) << status[17]
713 << setw( 8) << status[18]
714 << setw( 8) << status[19]
715 << setw( 8) << status[20]
716 << setw( 8) << status[21];
717 if (!status.IsStopped() ||
isEnabled(mDevice,chan))
722 oss << setw(12) <<
"---"
725 if (!status.IsStopped() && status.WithAudio())
727 ULWord audChlsPerSample(0);
736 const double bytesPerChannel (4.0);
737 const double channelsPerSample (
double(audChlsPerSample+0));
738 const double bytesPerFrame (samplesPerSecond * bytesPerChannel * channelsPerSample / framesPerSecond);
739 const ULWord maxVideoFrames (4UL * 1024UL * 1024UL /
ULWord(bytesPerFrame));
740 if (status.GetFrameCount() > maxVideoFrames)
741 oss <<
"## WARNING: " <<
DEC(status.GetFrameCount()) <<
" frames (" <<
DEC(status.GetStartFrame())
742 <<
" thru " <<
DEC(status.GetEndFrame()) <<
") exceeds " <<
DEC(maxVideoFrames)
743 <<
"-frame max audio buffer capacity" << endl;
749 oss << endl <<
"Device SDRAM Map (8MB frms):" << endl;
759 if (status.IsStopped())
763 if (it == perChannelTCs.end())
767 oss << endl << dashes <<
" " << (
NTV2_IS_INPUT_CROSSPOINT(status.acCrosspoint) ?
"Input " :
"Output ") <<
DEC(chan+1) <<
" Per-Frame Valid Timecodes:" << endl;
770 const uint16_t frameNum(i->first);
772 oss <<
"Frame " << frameNum <<
":" << endl;
773 for (uint16_t tcNdx(0); tcNdx < timecodes.size(); tcNdx++)
776 if (!tcVal.IsValid())
780 << setw(12) << tcStr << setw(0) <<
"\t" << tcVal << endl;
787 void CNTV2SupportLogger::FetchAudioLog (ostringstream & oss)
const
820 bool isEmbedderEnabled =
false;
822 UWord inChannelCount = isEmbedderEnabled ? maxNumChannels : 0;
825 for (
UWord audioChannel (0); audioChannel < inChannelCount; audioChannel++)
827 if (audioChannel & 1)
838 bool isNonPCM (
true);
849 oss <<
" (max)" << endl;
851 oss <<
" (" << maxNumChannels <<
" (max))" << endl;
852 oss <<
" Total Samples:\t[" <<
DEC0N(maxSamples,6) <<
"]" << endl
858 oss <<
"Write Head Position:\t[" <<
DEC0N(currentPosSampleNdx,6) <<
"]" << endl
863 <<
" Channels Present:\t" << channelPairsPresent << endl
864 <<
" Non-PCM Channels:\t" << nonPCMChannelPairs << endl;
868 oss <<
" Read Head Position:\t[" <<
DEC0N(currentPosSampleNdx,6) <<
"]" << endl;
870 oss <<
" Non-PCM Channels:\t" << nonPCMChannelPairs << endl;
872 oss <<
" Non-PCM Channels:\t" << (isNonPCM ?
"All Channel Pairs" :
"Normal") << endl;
878 void CNTV2SupportLogger::FetchRoutingLog (ostringstream & oss)
const
883 oss <<
"(NTV2InputCrosspointID <== NTV2OutputCrosspointID)" << endl;
884 router.
Print (oss,
false);
1009 fileInput.open(inLogFilePath.c_str());
1010 string lineContents;
1011 int i = 0, numLines = 0;
1013 string searchString;
1014 bool isCompatible =
false;
1016 while(getline(fileInput, lineContents))
1021 fileInput.seekg(0, ios::beg);
1022 while(getline(fileInput, lineContents) && i < size && !bForceLoad)
1024 searchString =
"Device: ";
1026 if (lineContents.find(searchString, 0) != string::npos)
1029 isCompatible =
true;
1043 getline(fileInput, lineContents);
1048 fileInput.seekg(0, ios::beg);
1052 searchString =
"Register Name: ";
1054 if (lineContents.find(searchString, 0) != string::npos)
1056 getline(fileInput, lineContents);
1057 getline(fileInput, lineContents);
1058 searchString =
"Register Value: ";
1059 size_t start = lineContents.find(searchString);
1060 if(start != string::npos)
1062 size_t end = lineContents.find(
" : ");
1063 stringstream registerValueString(lineContents.substr(start + searchString.length(), end));
1064 uint32_t registerValue = 0;
1065 registerValueString >> registerValue;
1071 cout <<
"The format of the log file is not compatible with this option." << endl;
1094 if (!homePath.empty())
1096 oss << inPrefix <<
"_" << deviceName <<
"_" << ::time(&rawtime) <<
"." << inExtension;
1102 if (!inDevice.IsOpen())
1104 if (inFilePath.empty())
1112 ofstream ofs(inFilePath.c_str(), ofstream::out | ofstream::binary);
1114 {msgStrm <<
"## ERROR: Unable to open '" << inFilePath <<
"' for writing" << endl;
return false;}
1116 for (
ULWord frameNdx(0); frameNdx < numFrames; frameNdx++)
1119 {badDMAs.push_back(frameNdx);
continue;}
1120 if (!ofs.write(buffer, streamsize(buffer.
GetByteCount())).good())
1121 {badWrites.push_back(frameNdx);
continue;}
1122 goodFrames.push_back(frameNdx);
1124 if (!badDMAs.empty())
1126 msgStrm <<
"## ERROR: DMARead failed for " <<
DEC(badDMAs.size()) <<
" " <<
DEC(megs) <<
"MB frame(s): ";
1129 if (!badWrites.empty())
1131 msgStrm <<
"## ERROR: Write failures for " <<
DEC(badWrites.size()) <<
" " <<
DEC(megs) <<
"MB frame(s): ";
1134 msgStrm <<
"## NOTE: " <<
DEC(goodFrames.size()) <<
" x " <<
DEC(megs) <<
"MB frames from device '"
ULWord GetScaleFromFrameRate(const NTV2FrameRate inFrameRate)
std::ostream & NTV2PrintULWordVector(const NTV2ULWordVector &inObj, std::ostream &inOutStream=std::cout)
Streams a human-readable dump of the given NTV2ULWordVector into the specified output stream.
static bool DumpDeviceSDRAM(CNTV2Card &inDevice, const std::string &inFilePath, std::ostream &msgStream)
#define kRegSarekLicenseStatus
@ NTV2_SupportLoggerSectionRouting
#define kRegClass_Virtual
static ULWord readCurrentAudioPosition(CNTV2Card &device, NTV2AudioSystem audioSystem, NTV2Mode mode)
static string xHEX0NStr(const uint32_t inNum, const uint16_t inWidth)
virtual bool GetInputAudioChannelPairsWithPCM(const NTV2Channel inSDIInputConnector, NTV2AudioChannelPairs &outChannelPairs)
For the given SDI input (specified as a channel number), returns the set of audio channel pairs that ...
Declares the AJASystemInfo class.
@ NTV2_AUDIO_LOOPBACK_OFF
Embeds silence (zeroes) into the data stream.
@ kRegOutputTimingControlch6
virtual bool ReadRegisters(NTV2RegisterReads &inOutValues)
Reads the register(s) specified by the given NTV2RegInfo sequence.
static NTV2RegNumSet GetRegistersForDevice(const NTV2DeviceID inDeviceID, const int inOtherRegsToInclude=0)
Declares the CNTV2SupportLogger class.
#define NTV2_AUDIO_SOURCE_IS_EMBEDDED(_x_)
NTV2Crosspoint acCrosspoint
The crosspoint (channel number with direction)
static string appSignatureToString(const ULWord inAppSignature)
FrameToTCList::const_iterator FrameToTCListConstIter
static string makeHeader(ostringstream &oss, const string &inName)
@ kRegInvalidValidXptROMRegister
virtual bool GetAudioSystemInputSource(const NTV2AudioSystem inAudioSystem, NTV2AudioSource &outAudioSource, NTV2EmbeddedAudioInput &outEmbeddedSource)
Answers with the device's current NTV2AudioSource (and also possibly its NTV2EmbeddedAudioInput) for ...
Declares device capability functions.
virtual bool ReadRegister(const ULWord inRegNum, ULWord &outValue, const ULWord inMask=0xFFFFFFFF, const ULWord inShift=0)
Reads all or part of the 32-bit contents of a specific register (real or virtual) on the AJA device....
@ kDeviceHasXptConnectROM
True if device has a crosspoint connection ROM (New in SDK 17.0)
@ kRegOutputTimingControlch7
static string timecodeToString(const NTV2_RP188 &inRP188)
NTV2Channel
These enum values are mostly used to identify a specific Frame Store. They're also commonly used to i...
A generic user-space buffer object that has an address and a length. Used most often to share an arbi...
ULWord GetByteCount(void) const
#define SAREK_LICENSE_PRESENT
std::string NTV2AudioBufferSizeToString(const NTV2AudioBufferSize inValue, const bool inForRetailDisplay=false)
enum NTV2TCIndex NTV2TimecodeIndex
virtual bool GetAudioBufferSize(NTV2AudioBufferSize &outSize, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Retrieves the size of the input or output audio buffer being used for a given Audio System on the AJA...
static string HEX0NStr(const uint32_t inNum, const uint16_t inWidth)
@ NTV2_EMBEDDED_AUDIO_INPUT_VIDEO_1
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 ...
Generates a standard support log (register log) for any NTV2 device attached to the host....
ULWord NTV2DeviceGetActiveMemorySize(const NTV2DeviceID inDeviceID)
virtual bool GetPackageInformation(PACKAGE_INFO_STRUCT &outPkgInfo)
Answers with the IP device's package information.
pair< NTV2Channel, AUTOCIRCULATE_STATUS > ChannelToACStatusPair
@ kRegOutputTimingControlch3
virtual void PrependToSection(uint32_t section, const std::string §ionData)
Prepends arbitrary string data to my support log, ahead of a given section.
virtual NTV2VideoFormat GetAnalogInputVideoFormat(void)
Returns the video format of the signal that is present on the device's analog video input.
char designNameStr[(100)]
NTV2HDMIAudioChannels
Indicates or specifies the HDMI audio channel count.
@ NTV2_AUDIOSYSTEM_1
This identifies the first Audio System.
bool NTV2DeviceCanDoMultiFormat(const NTV2DeviceID inDeviceID)
virtual bool GetFrameBufferSize(const NTV2Channel inChannel, NTV2Framesize &outValue)
Answers with the frame size currently being used on the device.
#define NTV2_IS_VALID_AUDIO_BUFFER_SIZE(_x_)
NTV2DeviceID
Identifies a specific AJA NTV2 device model number. The NTV2DeviceID is actually the PROM part number...
#define DEC0N(__x__, __n__)
virtual bool GetInputFrame(const NTV2Channel inChannel, ULWord &outValue)
Answers with the current input frame index number for the given FrameStore. This identifies which par...
static ULWord getNumAudioChannels(CNTV2Card &device, NTV2AudioSystem audioSystem)
NTV2FrameBufferFormat
Identifies a particular video frame buffer format. See Device Frame Buffer Formats for details.
virtual void AddHeader(const std::string §ionName, const std::string §ionData)
Adds header text to my log.
virtual bool GetInstalledBitfileInfo(ULWord &outNumBytes, std::string &outDateStr, std::string &outTimeStr)
Returns the size and time/date stamp of the device's currently-installed firmware.
#define SAREK_LICENSE_VALID
std::string packageNumber
static ULWord getCurrentPositionSamples(CNTV2Card &device, NTV2AudioSystem audioSystem, NTV2Mode mode)
virtual bool GetMultiFormatMode(bool &outIsEnabled)
Answers if the device is operating in multiple-format per channel (independent channel) mode or not....
@ NTV2_INVALID_HDMI_AUDIO_CHANNELS
std::string AsString(void) const
@ NTV2_CHANNEL1
Specifies channel or Frame Store 1 (or the first item).
virtual bool GetFrameBufferFormat(NTV2Channel inChannel, NTV2FrameBufferFormat &outValue)
Returns the current frame buffer format for the given FrameStore on the AJA device.
Audits an NTV2 device's SDRAM utilization, and can report contiguous regions of SDRAM,...
#define NTV2_IS_VALID_AUDIO_RATE(_x_)
@ NTV2_HDMIAudio8Channels
8 audio channels
map< NTV2Channel, AUTOCIRCULATE_STATUS > ChannelToACStatus
NTV2FrameRate
Identifies a particular video frame rate.
ULWord NTV2FramesizeToByteCount(const NTV2Framesize inFrameSize)
Converts the given NTV2Framesize value into an exact byte count.
This is returned by the CNTV2Card::AutoCirculateGetFrameStamp function, and is also embedded in the A...
Defines the KonaIP/IoIP registers.
static string pidToString(const uint32_t inPID)
NTV2RegisterNumberSet NTV2RegNumSet
A set of distinct NTV2RegisterNumbers.
virtual ~CNTV2SupportLogger()
My default destructor.
static NTV2VideoFormat getVideoFormat(CNTV2Card &device, const NTV2Channel inChannel)
pair< NTV2Channel, FrameToTCList > ChannelToPerFrameTCListPair
virtual bool GetDetectedAudioChannelPairs(const NTV2AudioSystem inAudioSystem, NTV2AudioChannelPairs &outDetectedChannelPairs)
Answers which audio channel pairs are present in the given Audio System's input stream.
virtual bool IsSupported(const NTV2BoolParamID inParamID)
@ kRegOutputTimingControlch5
static bool isEnabled(CNTV2Card &device, const NTV2Channel inChannel)
@ NTV2_AudioChannel9_10
This selects audio channels 9 and 10 (Group 3 channels 1 and 2)
virtual std::string GetDisplayName(void)
Answers with this device's display name.
std::ostream & DumpBlocks(std::ostream &oss) const
Dumps all 8MB blocks/frames and their tags, if any, into the given stream.
std::string NTV2TCIndexToString(const NTV2TCIndex inValue, const bool inCompactDisplay=false)
virtual bool GetOutputFrame(const NTV2Channel inChannel, ULWord &outValue)
Answers with the current output frame number for the given FrameStore (expressed as an NTV2Channel).
virtual bool AutoCirculateGetFrameStamp(const NTV2Channel inChannel, const ULWord inFrameNumber, FRAME_STAMP &outFrameInfo)
Returns precise timing information for the given frame and channel that's currently AutoCirculating.
ChannelToPerFrameTCList::const_iterator ChannelToPerFrameTCListConstIter
virtual bool GetNumberAudioChannels(ULWord &outNumChannels, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Returns the current number of audio channels being captured or played by a given Audio System on the ...
virtual std::string GetPCIFPGAVersionString(void)
virtual bool GetVideoFormat(NTV2VideoFormat &outValue, NTV2Channel inChannel=NTV2_CHANNEL1)
@ NTV2_SupportLoggerSectionRegisters
virtual AJAStatus GetValue(const AJASystemInfoTag inTag, std::string &outValue) const
Answers with the host system info value string for the given AJASystemInfoTag.
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 LoggerSectionToFunctionMacro(_SectionEnum_, _SectionString_, _SectionMethod_)
This is returned from the CNTV2Card::AutoCirculateGetStatus function.
Declares the CNTV2DeviceScanner class.
static std::string GetDisplayName(const uint32_t inRegNum)
std::set< NTV2AudioChannelPair > NTV2AudioChannelPairs
A set of distinct NTV2AudioChannelPair values.
#define NTV2_IS_INPUT_CROSSPOINT(__x__)
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 ...
static NTV2Channel findActiveACChannel(CNTV2Card &device, NTV2AudioSystem audioSystem, AUTOCIRCULATE_STATUS &outStatus)
bool GetInputTimeCodes(NTV2TimeCodeList &outValues) const
Returns all RP188 timecodes associated with the frame in NTV2TCIndex order.
NTV2Mode
Used to identify the mode of a Frame Store, or the direction of an AutoCirculate stream: either Captu...
virtual bool GetInputAudioChannelPairsWithoutPCM(const NTV2Channel inSDIInputConnector, NTV2AudioChannelPairs &outChannelPairs)
For the given SDI input (specified as a channel number), returns the set of audio channel pairs that ...
std::string NTV2DeviceIDToString(const NTV2DeviceID inValue, const bool inForRetailDisplay=false)
static ULWord bytesToSamples(CNTV2Card &device, NTV2AudioSystem audioSystem, const ULWord inBytes)
virtual void ToString(std::string &outAllLabelsAndValues) const
Answers with a multi-line string that contains the complete host system info table.
NTV2RegisterNumber registerNum
NTV2RegWritesConstIter NTV2RegisterReadsConstIter
#define NTV2_IS_VALID_EMBEDDED_AUDIO_INPUT(_x_)
@ NTV2_AudioChannel3_4
This selects audio channels 3 and 4 (Group 1 channels 3 and 4)
virtual bool ReadAudioLastIn(ULWord &outValue, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
For the given Audio System, answers with the byte offset to the last byte of the latest chunk of 4-by...
virtual bool GetSerialNumberString(std::string &outSerialNumberString)
Answers with a string that contains my human-readable serial number.
virtual AJAStatus GetLabelValuePairs(AJALabelValuePairs &outTable, bool clearTable=false) const
Generates a "table" of label/value pairs that contains the complete host system info table.
virtual bool ReadAudioLastOut(ULWord &outValue, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
For the given Audio System, answers with the byte offset of the tail end of the last chunk of audio s...
NTV2AudioChannelPair
Identifies a pair of audio channels.
virtual bool GetAudioOutputEmbedderState(const NTV2Channel inSDIOutputConnector, bool &outIsEnabled)
Answers with the current state of the audio output embedder for the given SDI output connector (speci...
NTV2RegWrites NTV2RegisterReads
virtual bool AutoCirculateGetStatus(const NTV2Channel inChannel, AUTOCIRCULATE_STATUS &outStatus)
Returns the current AutoCirculate status for the given channel.
@ kRegOutputTimingControlch8
NTV2Framesize
Kona2/Xena2 specific enums.
std::string NTV2TaskModeToString(const NTV2EveryFrameTaskMode inValue, const bool inCompactDisplay=false)
virtual NTV2VideoFormat GetAnalogCompositeInputVideoFormat(void)
Returns the video format of the signal that is present on the device's composite video input.
virtual bool GetHDMIInputAudioChannels(NTV2HDMIAudioChannels &outValue, const NTV2Channel inChannel=NTV2_CHANNEL1)
Answers with the current number of audio channels being received on the given HDMI input.
std::string NTV2VideoFormatToString(const NTV2VideoFormat inValue, const bool inUseFrameRate=false)
virtual bool DMAReadFrame(const ULWord inFrameNumber, ULWord *pOutFrameBuffer, const ULWord inByteCount)
Transfers a single frame from the AJA device to the host.
I interrogate and control an AJA video/audio capture/playout device.
ostream & operator<<(ostream &outStream, const CNTV2SupportLogger &inData)
bool IsStopped(void) const
string DECStr(const T &inT)
std::vector< ULWord > NTV2ULWordVector
An ordered sequence of ULWords.
NTV2AudioLoopBack
This enum value determines/states if an audio output embedder will embed silence (zeroes) or de-embed...
std::string NTV2GetVersionString(const bool inDetailed=false)
@ kRegOutputTimingControlch4
#define AsMacDriverInterface(_x_)
This class is a collection of widget input-to-output connections that can be applied all-at-once to a...
uint16_t GetEndFrame(void) const
@ NTV2_SupportLoggerSectionAutoCirculate
static std::string GetDeviceRefName(CNTV2Card &inDevice)
std::string NTV2AudioSourceToString(const NTV2AudioSource inValue, const bool inCompactDisplay=false)
virtual bool GetMode(const NTV2Channel inChannel, NTV2Mode &outValue)
Answers with the current NTV2Mode of the given FrameStore on the AJA device.
@ NTV2_DISABLE_TASKS
0: Disabled: Device is completely configured by controlling application(s) – no driver involvement.
const registerToLoadString registerToLoadStrings[]
static uint32_t maxSampleCountForNTV2AudioBufferSize(const NTV2AudioBufferSize inBufferSize, const uint16_t inChannelCount)
virtual std::string GetDriverVersionString(void)
Answers with this device's driver's version as a human-readable string.
UWord NTV2DeviceGetNumAudioSystems(const NTV2DeviceID inDeviceID)
virtual std::string GetDescription(void) const
static ULWord getMaxNumSamples(CNTV2Card &device, NTV2AudioSystem audioSystem)
virtual bool GetRouting(CNTV2SignalRouter &outRouting)
Answers with the current signal routing between any and all widgets on the AJA device.
@ kRegOutputTimingControlch2
bool NTV2DeviceCanDoPCMDetection(const NTV2DeviceID inDeviceID)
@ NTV2_AUDIO_AES
Obtain audio samples from the device AES inputs, if available.
virtual NTV2VideoFormat GetHDMIInputVideoFormat(NTV2Channel inHDMIInput=NTV2_CHANNEL1)
@ NTV2_AUDIO_HDMI
Obtain audio samples from the device HDMI input, if available.
static NTV2RegNumSet GetRegistersForClass(const std::string &inClassName)
static bool detectInputChannelPairs(CNTV2Card &device, const NTV2AudioSource inAudioSource, const NTV2EmbeddedAudioInput inEmbeddedSource, NTV2AudioChannelPairs &outChannelPairsPresent)
static std::string InventLogFilePathAndName(CNTV2Card &inDevice, std::string inPrefix="aja_supportlog", std::string inExtension="log")
const char * NTV2DeviceIDString(const NTV2DeviceID id)
virtual bool GetAudioLoopBack(NTV2AudioLoopBack &outMode, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Answers if NTV2AudioLoopBack mode is currently on or off for the given NTV2AudioSystem.
Private include file for all ajabase sources.
virtual bool GetDetectedAESChannelPairs(NTV2AudioChannelPairs &outDetectedChannelPairs)
Answers which AES/EBU audio channel pairs are present on the device.
#define HEX0N(__x__, __n__)
Declares the CNTV2KonaFlashProgram class.
bool IsValid(void) const
Answers true if I'm valid, or false if I'm not valid.
std::string NTV2FrameBufferFormatToString(const NTV2FrameBufferFormat inValue, const bool inForRetailDisplay=false)
virtual std::ostream & Print(std::ostream &inOutStream, const bool inForRetailDisplay=false) const
Prints me in a human-readable format to the given output stream.
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 ...
This struct replaces the old RP188_STRUCT.
@ kRegFirstValidXptROMRegister
@ NTV2_AUDIO_EMBEDDED
Obtain audio samples from the audio that's embedded in the video HANC.
pair< uint16_t, NTV2TimeCodeList > FrameToTCListPair
uint16_t GetStartFrame(void) const
@ AJA_SystemInfoTag_Path_UserHome
enum _NTV2VideoFormat NTV2VideoFormat
Identifies a particular video format.
NTV2RegisterReads FromRegNumSet(const NTV2RegNumSet &inRegNumSet)
ULWord NTV2DeviceGetNumVideoChannels(const NTV2DeviceID inDeviceID)
static string getActiveFrameStr(CNTV2Card &device, const NTV2Channel inChannel)
ChannelToACStatus::const_iterator ChannelToACStatusConstIter
std::vector< NTV2_RP188 > NTV2TimeCodeList
An ordered sequence of zero or more NTV2_RP188 structures. An NTV2TCIndex enum value can be used as a...
virtual bool IsChannelEnabled(const NTV2Channel inChannel, bool &outEnabled)
Answers whether or not the given FrameStore is enabled.
Declares the CRP188 class. See SMPTE RP188 standard for details.
std::string NTV2AudioLoopBackToString(const NTV2AudioLoopBack inValue, const bool inForRetailDisplay=false)
NTV2EveryFrameTaskMode
Describes the task mode state. See also: Sharing AJA Devices With Other Applications.
static ULWord getActiveFrame(CNTV2Card &device, const NTV2Channel inChannel)
virtual NTV2DeviceID GetDeviceID(void)
virtual bool GetEveryFrameServices(NTV2EveryFrameTaskMode &outMode)
Retrieves the device's current "retail service" task mode.
virtual bool GetAudioRate(NTV2AudioRate &outRate, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Returns the current NTV2AudioRate for the given Audio System.
CNTV2SupportLogger(CNTV2Card &card, NTV2SupportLoggerSections sections=NTV2_SupportLoggerSectionsAll)
Construct from CNTV2Card instance.
virtual bool GetFrameRate(NTV2FrameRate &outValue, NTV2Channel inChannel=NTV2_CHANNEL1)
Returns the AJA device's currently configured frame rate via its "value" parameter.
double GetAudioSamplesPerSecond(const NTV2AudioRate inAudioRate)
Returns the audio sample rate as a number of audio samples per second.
@ NTV2_MODE_INVALID
The invalid mode.
std::string NTV2ChannelToString(const NTV2Channel inValue, const bool inForRetailDisplay=false)
std::string NTV2AudioRateToString(const NTV2AudioRate inValue, const bool inForRetailDisplay=false)
std::string NTV2EmbeddedAudioInputToString(const NTV2EmbeddedAudioInput inValue, const bool inCompactDisplay=false)
@ NTV2_AUDIO_ANALOG
Obtain audio samples from the device analog input(s), if available.
virtual bool LoadFromLog(const std::string &inLogFilePath, const bool bForceLoad)
#define NTV2_IS_INPUT_MODE(__mode__)
std::string to_string(bool val)
NTV2EmbeddedAudioInput
This enum value determines/states which SDI video input will be used to supply audio samples to an au...
std::vector< AJALabelValuePair > AJALabelValuePairs
An ordered sequence of label/value pairs.
#define xHEX0N(__x__, __n__)
@ kRegOutputTimingControl
virtual void AddFooter(const std::string §ionName, const std::string §ionData)
Adds footer text to my log.
NTV2AudioSystem
Used to identify an Audio System on an NTV2 device. See Audio System Operation for more information.
@ NTV2_AUDIO_RATE_INVALID
#define NTV2_IS_SUPPORTED_NTV2FrameRate(__r__)
@ NTV2_AudioChannel1_2
This selects audio channels 1 and 2 (Group 1 channels 1 and 2)
@ NTV2_SupportLoggerSectionInfo
@ NTV2_MODE_DISPLAY
Playout (output) mode, which reads from device SDRAM.
std::string NTV2ModeToString(const NTV2Mode inValue, const bool inCompactDisplay=false)
map< NTV2Channel, FrameToTCList > ChannelToPerFrameTCList
NTV2AudioSource
This enum value determines/states where an audio system will obtain its audio samples.
Declares the CNTV2RegisterExpert class.
virtual bool WriteRegister(const ULWord inRegNum, const ULWord inValue, const ULWord inMask=0xFFFFFFFF, const ULWord inShift=0)
Updates or replaces all or part of the 32-bit contents of a specific register (real or virtual) on th...
static NTV2Mode getMode(CNTV2Card &device, const NTV2Channel inChannel)
@ NTV2_SupportLoggerSectionAudio
bool AssessDevice(CNTV2Card &inDevice, const bool inIgnoreStoppedAudioBuffers=false)
Assesses the given device.
map< uint16_t, NTV2TimeCodeList > FrameToTCList
#define NTV2_IS_OUTPUT_MODE(__mode__)
virtual bool DriverGetBitFileInformation(BITFILE_INFO_STRUCT &outBitFileInfo, const NTV2BitFileType inBitFileType=NTV2_VideoProcBitFile)
Answers with the currently-installed bitfile information.
bool NTV2DeviceCanDoPCMControl(const NTV2DeviceID inDeviceID)
NTV2AudioBufferSize
Represents the size of the audio buffer used by a device audio system for storing captured samples or...
static std::string GetDisplayValue(const uint32_t inRegNum, const uint32_t inRegValue, const NTV2DeviceID inDeviceID=DEVICE_ID_NOTFOUND)
static bool getBitfileDate(CNTV2Card &device, string &outDateString, NTV2XilinxFPGA whichFPGA)
UWord NTV2DeviceGetMaxAudioChannels(const NTV2DeviceID inDeviceID)
Everything needed to call CNTV2Card::ReadRegister or CNTV2Card::WriteRegister functions.
#define NTV2_IS_VALID_VIDEO_FORMAT(__f__)
virtual void AppendToSection(uint32_t section, const std::string §ionData)
Appends arbitrary string data to my support log, after a given section.
NTV2SupportLoggerSections
NTV2AudioSystem GetAudioSystem(void) const
bool IsOutput(void) const
static NTV2PixelFormat getPixelFormat(CNTV2Card &device, const NTV2Channel inChannel)
std::string NTV2AudioSystemToString(const NTV2AudioSystem inValue, const bool inCompactDisplay=false)
virtual std::string ToString(void) const