14 #include "ajabase/persistence/persistence.h" 21 #if defined(MSWindows) 22 #define PATH_DELIMITER "\\" 24 #define PATH_DELIMITER "/" 41 static string makeHeader(ostringstream & oss,
const string & inName)
43 oss << setfill(
'=') << setw(96) <<
" " << inName <<
":" << setfill(
' ') << endl << endl;
63 #if defined (MSWindows) 73 #elif defined (AJALinux) 75 #elif defined (AJAMac) 94 static uint32_t gMaxSampleCount16 [] = { 16320, 65280, 32640, 130560, 0 };
95 static uint32_t gMaxSampleCount8 [] = { 32640, 130560, 65280, 261120, 0 };
96 static uint32_t gMaxSampleCount6 [] = { 87040, 174080, 87040, 348160, 0 };
98 switch (inChannelCount)
100 case 16:
return gMaxSampleCount16 [inBufferSize];
101 case 8:
return gMaxSampleCount8 [inBufferSize];
102 case 6:
return gMaxSampleCount6 [inBufferSize];
125 device.
GetMode(inChannel, result);
211 outChannelPairsPresent.clear();
212 switch (inAudioSource)
214 default:
return false;
236 outChannelPairsPresent.insert (chPair);
249 bool bBitFileInfoAvailable =
false;
251 if( bBitFileInfoAvailable )
254 if (outDateString.find(
".ncd") != string::npos)
256 outDateString = outDateString.substr(0, outDateString.find(
".ncd"));
257 outDateString +=
".bit ";
258 outDateString += bitFileInfo.
dateStr;
259 outDateString +=
" ";
260 outDateString += bitFileInfo.
timeStr;
262 else if (outDateString.find(
";") != string::npos)
264 outDateString = outDateString.substr(0, outDateString.find(
";"));
265 outDateString +=
".bit ";
266 outDateString += bitFileInfo.
dateStr;
267 outDateString +=
" ";
268 outDateString += bitFileInfo.
timeStr;
270 else if (outDateString.find(
".bit") != string::npos && outDateString !=
".bit")
273 outDateString +=
" ";
274 outDateString += bitFileInfo.
dateStr;
275 outDateString +=
" ";
276 outDateString += bitFileInfo.
timeStr;
280 outDateString =
"bad bitfile date string";
323 if (mPrependMap.find(section) != mPrependMap.end())
325 mPrependMap.at(section).insert(0,
"\n");
326 mPrependMap.at(section).insert(0, sectionData);
330 mPrependMap[section] = sectionData;
331 mPrependMap.at(section).append(
"\n");
337 if (mAppendMap.find(section) != mAppendMap.end())
339 mAppendMap.at(section).append(
"\n");
340 mAppendMap.at(section).append(sectionData);
344 mAppendMap[section] =
"\n";
345 mAppendMap.at(section).append(sectionData);
353 oss << sectionData <<
"\n";
354 mHeaderStr.append(oss.str());
361 oss << sectionData <<
"\n";
362 mFooterStr.append(oss.str());
370 #define LoggerSectionToFunctionMacro(_SectionEnum_, _SectionString_, _SectionMethod_) \ 371 if (mSections & _SectionEnum_) \ 373 makeHeader(oss, _SectionString_); \ 374 if (mPrependMap.find(_SectionEnum_) != mPrependMap.end()) \ 375 oss << mPrependMap.at(_SectionEnum_); \ 377 _SectionMethod_(oss); \ 379 if (mAppendMap.find(_SectionEnum_) != mAppendMap.end()) \ 380 oss << mAppendMap.at(_SectionEnum_); \ 386 vector<char> dateBufferLocal(128, 0);
387 vector<char> dateBufferUTC(128, 0);
391 struct tm *localTimeinfo;
392 localTimeinfo = localtime(reinterpret_cast<const time_t*>(&now));
393 strcpy(&dateBufferLocal[0],
"");
395 ::strftime(&dateBufferLocal[0], dateBufferLocal.size(),
"%B %d, %Y %I:%M:%S %p %Z (local)", localTimeinfo);
397 struct tm *utcTimeinfo;
398 utcTimeinfo = gmtime(reinterpret_cast<const time_t*>(&now));
399 strcpy(&dateBufferUTC[0],
"");
401 ::strftime(&dateBufferUTC[0], dateBufferUTC.size(),
"%Y-%m-%dT%H:%M:%SZ UTC", utcTimeinfo);
403 oss <<
"Begin NTV2 Support Log" <<
"\n" <<
405 "Generated: " << &dateBufferLocal[0] <<
406 " " << &dateBufferUTC[0] <<
"\n\n" << flush;
408 if (!mHeaderStr.empty())
422 if (!mFooterStr.empty())
424 oss << endl <<
"End NTV2 Support Log";
433 static inline string HEX0NStr (
const uint32_t inNum,
const uint16_t inWidth) {ostringstream oss; oss <<
HEX0N(inNum,inWidth);
return oss.str();}
434 static inline string xHEX0NStr(
const uint32_t inNum,
const uint16_t inWidth) {ostringstream oss; oss <<
xHEX0N(inNum,inWidth);
return oss.str();}
435 template <
typename T>
string DECStr (
const T inT) {ostringstream oss; oss <<
DEC(inT);
return oss.str();}
437 void CNTV2SupportLogger::FetchInfoLog (ostringstream & oss)
const 448 ULWord drvrType(0), dextType(0x44455854);
451 str =
"Kernel Extension ('KEXT')";
452 else if (drvrType == dextType)
453 str =
"DriverKit ('DEXT')";
456 oss <<
"(Unknown/Invalid " <<
xHEX0N(drvrType,8) <<
")";
460 #endif // defined(AJAMac) 474 string dateStr, timeStr, connType;
484 std::string urlString;
489 std::vector<std::string> sfpURLStings;
491 for (
int i = 0; i < numSFPs; i++)
499 PACKAGE_INFO_STRUCT pkgInfo;
500 if (mDevice.GetPackageInformation(pkgInfo))
510 if (ntv2Card.ReadMACAddresses(mac1, mac2))
517 mDevice.
ReadRegister((kRegSarekFwCfg + SAREK_REGS), cfg);
518 if (cfg & SAREK_2022_2)
520 ULWord dnaLo(0), dnaHi(0);
521 if (ntv2Card.ReadRegister(kRegSarekDNALow + SAREK_REGS, dnaLo))
522 if (ntv2Card.ReadRegister(kRegSarekDNAHi + SAREK_REGS, dnaHi))
527 ntv2Card.ReadLicenseInfo(licenseInfo);
530 if (cfg & SAREK_2022_2)
533 ntv2Card.ReadRegister(kRegSarekLicenseStatus + SAREK_REGS, licenseStatus);
534 AJASystemInfo::append(infoTable,
"License Present", licenseStatus & SAREK_LICENSE_PRESENT ?
"Yes" :
"No");
535 AJASystemInfo::append(infoTable,
"License Status", licenseStatus & SAREK_LICENSE_VALID ?
"License is valid" :
"License NOT valid");
539 #endif // IP10G purge 542 if (!connType.empty())
561 std::vector<std::pair<std::string, bool> > persistenceChecks;
562 persistenceChecks.push_back(std::pair<std::string, bool>(
"User Persistence Health",
false));
563 persistenceChecks.push_back(std::pair<std::string, bool>(
"System Persistence Health",
true));
564 std::vector<std::pair<std::string, bool> >::const_iterator it(persistenceChecks.begin());
566 std::string errMessage;
567 for (; it != persistenceChecks.end(); ++it)
569 std::string label(it->first);
570 bool shared(it->second);
571 AJAPersistence p(
"com.aja.devicesettings",
"Unknown",
"00000000", shared);
572 if (p.StorageHealthCheck(errCode, errMessage))
578 if (shared && errCode == -1)
603 void CNTV2SupportLogger::FetchRegisterLog (ostringstream & oss)
const 608 static const string sDashes (96,
'-');
611 oss << endl << deviceRegs.size() <<
" Device Registers " << sDashes << endl << endl;
614 oss <<
"## NOTE: Driver failed to return one or more registers (those will be zero)" << endl;
618 it->PrintLog(oss, deviceID);
623 void CNTV2SupportLogger::FetchAutoCirculateLog (ostringstream & oss)
const 632 static const string dashes (25,
'-');
664 bool multiFormatMode(
false);
667 if (!multiFormatMode)
670 oss <<
"MultiFormat Mode" << endl;
677 <<
"Chan/FrameStore State Start End Act FrmProc FrmDrop BufLvl Audio RP188 LTC FBFch FBOch Color VidPr Anc HDMIx Field VidFmt PixFmt" << endl
678 <<
"-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------" << endl;
686 << setw(12) << status[0]
687 << setw( 7) << status[1]
688 << setw( 6) << status[2]
690 << setw(10) << status[9]
691 << setw(10) << status[10]
692 << setw( 7) << status[11]
693 << setw( 9) << status[12]
694 << setw( 8) << status[13]
695 << setw( 8) << status[14]
696 << setw( 8) << status[15]
697 << setw( 8) << status[16]
698 << setw( 8) << status[17]
699 << setw( 8) << status[18]
700 << setw( 8) << status[19]
701 << setw( 8) << status[20]
702 << setw( 8) << status[21];
703 if (!status.IsStopped() ||
isEnabled(mDevice,chan))
708 oss << setw(12) <<
"---" 711 if (!status.IsStopped() && status.WithAudio())
713 ULWord audChlsPerSample(0);
722 const double bytesPerChannel (4.0);
723 const double channelsPerSample (
double(audChlsPerSample+0));
724 const double bytesPerFrame (samplesPerSecond * bytesPerChannel * channelsPerSample / framesPerSecond);
725 const ULWord maxVideoFrames (4UL * 1024UL * 1024UL /
ULWord(bytesPerFrame));
726 if (status.GetFrameCount() > maxVideoFrames)
727 oss <<
"## WARNING: " <<
DEC(status.GetFrameCount()) <<
" frames (" <<
DEC(status.GetStartFrame())
728 <<
" thru " <<
DEC(status.GetEndFrame()) <<
") exceeds " <<
DEC(maxVideoFrames)
729 <<
"-frame max audio buffer capacity" << endl;
735 oss << endl <<
"Device SDRAM Map (8MB frms):" << endl;
745 if (status.IsStopped())
749 if (it == perChannelTCs.end())
753 oss << endl << dashes <<
" " << (
NTV2_IS_INPUT_CROSSPOINT(status.acCrosspoint) ?
"Input " :
"Output ") <<
DEC(chan+1) <<
" Per-Frame Valid Timecodes:" << endl;
756 const uint16_t frameNum(i->first);
758 oss <<
"Frame " << frameNum <<
":" << endl;
759 for (uint16_t tcNdx(0); tcNdx < timecodes.size(); tcNdx++)
762 if (!tcVal.IsValid())
766 << setw(12) << tcStr << setw(0) <<
"\t" << tcVal << endl;
773 void CNTV2SupportLogger::FetchAudioLog (ostringstream & oss)
const 806 bool isEmbedderEnabled =
false;
808 UWord inChannelCount = isEmbedderEnabled ? maxNumChannels : 0;
811 for (
UWord audioChannel (0); audioChannel < inChannelCount; audioChannel++)
813 if (audioChannel & 1)
824 bool isNonPCM (
true);
835 oss <<
" (max)" << endl;
837 oss <<
" (" << maxNumChannels <<
" (max))" << endl;
838 oss <<
" Total Samples:\t[" <<
DEC0N(maxSamples,6) <<
"]" << endl
844 oss <<
"Write Head Position:\t[" <<
DEC0N(currentPosSampleNdx,6) <<
"]" << endl
849 <<
" Channels Present:\t" << channelPairsPresent << endl
850 <<
" Non-PCM Channels:\t" << nonPCMChannelPairs << endl;
854 oss <<
" Read Head Position:\t[" <<
DEC0N(currentPosSampleNdx,6) <<
"]" << endl;
856 oss <<
" Non-PCM Channels:\t" << nonPCMChannelPairs << endl;
858 oss <<
" Non-PCM Channels:\t" << (isNonPCM ?
"All Channel Pairs" :
"Normal") << endl;
864 void CNTV2SupportLogger::FetchRoutingLog (ostringstream & oss)
const 869 oss <<
"(NTV2InputCrosspointID <== NTV2OutputCrosspointID)" << endl;
870 router.
Print (oss,
false);
996 fileInput.open(inLogFilePath.c_str());
998 int i = 0, numLines = 0;
1000 string searchString;
1001 bool isCompatible =
false;
1003 while(getline(fileInput, lineContents))
1008 fileInput.seekg(0, ios::beg);
1009 while(getline(fileInput, lineContents) && i < size && !bForceLoad)
1011 searchString =
"Device: ";
1013 if (lineContents.find(searchString, 0) != string::npos)
1016 isCompatible =
true;
1030 getline(fileInput, lineContents);
1035 fileInput.seekg(0, ios::beg);
1039 searchString =
"Register Name: ";
1041 if (lineContents.find(searchString, 0) != string::npos)
1043 getline(fileInput, lineContents);
1044 getline(fileInput, lineContents);
1045 searchString =
"Register Value: ";
1046 size_t start = lineContents.find(searchString);
1047 if(start != string::npos)
1049 size_t end = lineContents.find(
" : ");
1050 stringstream registerValueString(lineContents.substr(start + searchString.length(),
end));
1051 uint32_t registerValue = 0;
1052 registerValueString >> registerValue;
1058 cout <<
"The format of the log file is not compatible with this option." << endl;
1081 if (!homePath.empty())
1083 oss << inPrefix <<
"_" << deviceName <<
"_" << ::time(&rawtime) <<
"." << inExtension;
1091 if (inFilePath.empty())
1099 ofstream ofs(inFilePath.c_str(), ofstream::out | ofstream::binary);
1101 {msgStrm <<
"## ERROR: Unable to open '" << inFilePath <<
"' for writing" << endl;
return false;}
1103 for (
ULWord frameNdx(0); frameNdx < numFrames; frameNdx++)
1106 {badDMAs.push_back(frameNdx);
continue;}
1107 if (!ofs.write(buffer, streamsize(buffer.
GetByteCount())).good())
1108 {badWrites.push_back(frameNdx);
continue;}
1109 goodFrames.push_back(frameNdx);
1111 if (!badDMAs.empty())
1113 msgStrm <<
"## ERROR: DMARead failed for " <<
DEC(badDMAs.size()) <<
" " <<
DEC(megs) <<
"MB frame(s): ";
1116 if (!badWrites.empty())
1118 msgStrm <<
"## ERROR: Write failures for " <<
DEC(badWrites.size()) <<
" " <<
DEC(megs) <<
"MB frame(s): ";
1121 msgStrm <<
"## NOTE: " <<
DEC(goodFrames.size()) <<
" x " <<
DEC(megs) <<
"MB frames from device '" NTV2RegisterNumber registerNum
std::string NTV2AudioBufferSizeToString(const NTV2AudioBufferSize inValue, const bool inForRetailDisplay=false)
#define NTV2_IS_INPUT_MODE(__mode__)
std::string NTV2AudioSystemToString(const NTV2AudioSystem inValue, const bool inCompactDisplay=false)
virtual bool IsSupported(const NTV2BoolParamID inParamID)
NTV2AudioSystem
Used to identify an Audio System on an NTV2 device. See Audio System Operation for more information...
bool IsOutput(void) const
virtual bool GetLPTunnelConfigurationURLString(std::string &outURLString)
map< NTV2Channel, FrameToTCList > ChannelToPerFrameTCList
virtual bool GetMultiFormatMode(bool &outIsEnabled)
Answers if the device is operating in multiple-format per channel (independent channel) mode or not...
virtual bool GetAudioLoopBack(NTV2AudioLoopBack &outMode, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Answers if NTV2AudioLoopBack mode is currently on or off for the given NTV2AudioSystem.
std::string NTV2ModeToString(const NTV2Mode inValue, const bool inCompactDisplay=false)
virtual bool GetVideoFormat(NTV2VideoFormat &outValue, NTV2Channel inChannel=NTV2_CHANNEL1)
virtual bool GetDetectedAESChannelPairs(NTV2AudioChannelPairs &outDetectedChannelPairs)
Answers which AES/EBU audio channel pairs are present on the device.
virtual ~CNTV2SupportLogger()
My default destructor.
NTV2AudioBufferSize
Represents the size of the audio buffer used by a device audio system for storing captured samples or...
static ULWord getNumAudioChannels(CNTV2Card &device, NTV2AudioSystem audioSystem)
#define DEC0N(__x__, __n__)
bool NTV2DeviceCanDoPCMControl(const NTV2DeviceID inDeviceID)
static string HEX0NStr(const uint32_t inNum, const uint16_t inWidth)
I interrogate and control an AJA video/audio capture/playout device.
NTV2FrameBufferFormat
Identifies a particular video frame buffer pixel format. See Device Frame Buffer Formats for details...
NTV2TaskMode
Describes the task mode state. See also: NTV2 Device Sharing.
Obtain audio samples from the device AES inputs, if available.
bool AssessDevice(CNTV2Card &inDevice, const bool inIgnoreStoppedAudioBuffers=(0))
Assesses the given device.
NTV2StringSet::const_iterator NTV2StringSetConstIter
Obtain audio samples from the device HDMI input, if available.
ULWord NTV2DeviceGetActiveMemorySize(const NTV2DeviceID inDeviceID)
virtual UWord GetIndexNumber(void) const
enum _NTV2VideoFormat NTV2VideoFormat
Identifies a particular video format.
size_t GetByteCount(void) const
Audits an NTV2 device's SDRAM utilization, and can report contiguous regions of SDRAM, whether unused/free, those being read/written by AutoCirculate, those being read/written by non-AutoCirculating FrameStores, those that are in conflict (AutoCirculate, FrameStore and/or Audio collisions), plus invalid/out-of-bounds regions being accessed.
Declares the CNTV2SupportLogger class.
#define NTV2_IS_VALID_AUDIO_RATE(_x_)
static std::string InventLogFilePathAndName(CNTV2Card &inDevice, std::string inPrefix="aja_supportlog", std::string inExtension="log")
virtual bool GetAudioSystemInputSource(const NTV2AudioSystem inAudioSystem, NTV2AudioSource &outAudioSource, NTV2EmbeddedAudioInput &outEmbeddedSource)
Answers with the device's current NTV2AudioSource (and also possibly its NTV2EmbeddedAudioInput) for ...
bool NTV2DeviceCanDoMultiFormat(const NTV2DeviceID inDeviceID)
virtual bool GetAudioRate(NTV2AudioRate &outRate, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Returns the current NTV2AudioRate for the given Audio System.
bool IsValid(void) const
Answers true if I'm valid, or false if I'm not valid.
virtual bool GetOutputFrame(const NTV2Channel inChannel, ULWord &outValue)
Answers with the current output frame number for the given FrameStore (expressed as an NTV2Channel)...
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...
#define NTV2_IS_VALID_AUDIO_BUFFER_SIZE(_x_)
static bool isEnabled(CNTV2Card &device, const NTV2Channel inChannel)
std::vector< AJALabelValuePair > AJALabelValuePairs
An ordered sequence of label/value pairs.
char designNameStr[(100)]
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 ...
static ULWord getCurrentPositionSamples(CNTV2Card &device, NTV2AudioSystem audioSystem, NTV2Mode mode)
Obtain audio samples from the audio that's embedded in the video HANC.
static ULWord readCurrentAudioPosition(CNTV2Card &device, NTV2AudioSystem audioSystem, NTV2Mode mode)
#define NTV2_AUDIO_SOURCE_IS_EMBEDDED(_x_)
FrameToTCList::const_iterator FrameToTCListConstIter
static string makeHeader(ostringstream &oss, const string &inName)
virtual std::string GetConnectionType(void) const
virtual bool GetFrameBufferSize(const NTV2Channel inChannel, NTV2Framesize &outValue)
Answers with the frame size currently being used on the device.
Generates a standard support log (register log) for any NTV2 device attached to the host...
NTV2HDMIAudioChannels
Indicates or specifies the HDMI audio channel count.
NTV2SupportLoggerSections
map< NTV2Channel, AUTOCIRCULATE_STATUS > ChannelToACStatus
virtual bool AutoCirculateGetStatus(const NTV2Channel inChannel, AUTOCIRCULATE_STATUS &outStatus)
Returns the current AutoCirculate status for the given channel.
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
virtual NTV2Dictionary ConnectParams(void) const
pair< NTV2Channel, FrameToTCList > ChannelToPerFrameTCListPair
This class is a collection of widget input-to-output connections that can be applied all-at-once to a...
virtual class DeviceCapabilities & features(void)
ChannelToPerFrameTCList::const_iterator ChannelToPerFrameTCListConstIter
std::set< NTV2AudioChannelPair > NTV2AudioChannelPairs
A set of distinct NTV2AudioChannelPair values.
static bool DumpDeviceSDRAM(CNTV2Card &inDevice, const std::string &inFilePath, std::ostream &msgStream)
CNTV2SupportLogger(CNTV2Card &card, NTV2SupportLoggerSections sections=NTV2_SupportLoggerSectionsAll)
Construct from CNTV2Card instance.
virtual bool GetInstalledBitfileInfo(ULWord &outNumBytes, std::string &outDateStr, std::string &outTimeStr)
Returns the bitfile size and time/date stamp from the header of the bitfile that's currently installe...
bool GetInputTimeCodes(NTV2TimeCodeList &outValues) const
Returns all RP188 timecodes associated with the frame in NTV2TCIndex order.
virtual bool LoadFromLog(const std::string &inLogFilePath, const bool bForceLoad)
Obtain audio samples from the device analog input(s), if available.
NTV2RegWritesConstIter NTV2RegisterReadsConstIter
This struct replaces the old RP188_STRUCT.
virtual NTV2VideoFormat GetHDMIInputVideoFormat(NTV2Channel inHDMIInput=NTV2_CHANNEL1)
pair< NTV2Channel, AUTOCIRCULATE_STATUS > ChannelToACStatusPair
virtual bool IsRemote(void) const
virtual bool GetTaskMode(NTV2TaskMode &outMode)
Retrieves the device's current task mode.
#define kIncludeOtherRegs_None
virtual void PrependToSection(uint32_t section, const std::string §ionData)
Prepends arbitrary string data to my support log, ahead of a given section.
NTV2FrameRate
Identifies a particular video frame rate.
virtual std::string GetPCIFPGAVersionString(void)
0: Disabled (never recommended): device configured exclusively by client application(s).
Playout (output) mode, which reads from device SDRAM.
virtual std::string GetDescription(void) const
NTV2DeviceID
Identifies a specific AJA NTV2 device model number. The NTV2DeviceID is actually the PROM part number...
static NTV2VideoFormat getVideoFormat(CNTV2Card &device, const NTV2Channel inChannel)
virtual bool IsOpen(void) const
static string pidToString(const uint32_t inPID)
std::string to_string(bool val)
static ULWord bytesToSamples(CNTV2Card &device, NTV2AudioSystem audioSystem, const ULWord inBytes)
std::set< std::string > NTV2StringSet
std::string NTV2TaskModeToString(const NTV2TaskMode inValue, const bool inCompactDisplay=false)
virtual bool ReadRegisters(NTV2RegisterReads &inOutValues)
Reads the register(s) specified by the given NTV2RegInfo sequence.
virtual bool GetSerialNumberString(std::string &outSerialNumberString)
Answers with a string that contains my human-readable serial number.
bool HasLPProductCode(void)
virtual std::string GetDisplayName(void)
Answers with this device's display name.
Declares the CRP188 class. See SMPTE RP188 standard for details.
NTV2AudioLoopBack
This enum value determines/states if an audio output embedder will embed silence (zeroes) or de-embed...
void clear(void)
Removes all of my key/value pairs.
std::vector< ULWord > NTV2ULWordVector
An ordered sequence of ULWords.
std::string NTV2GetVersionString(const bool inDetailed=false)
This selects audio channels 1 and 2 (Group 1 channels 1 and 2)
virtual NTV2VideoFormat GetAnalogInputVideoFormat(void)
Returns the video format of the signal that is present on the device's analog video input...
ULWord NTV2FramesizeToByteCount(const NTV2Framesize inFrameSize)
Converts the given NTV2Framesize value into an exact byte count.
bool IsStopped(void) const
NTV2RegisterNumberSet NTV2RegNumSet
A set of distinct NTV2RegisterNumbers.
NTV2AudioChannelPair
Identifies a pair of audio channels.
virtual std::string ToString(void) const
virtual std::string GetDriverVersionString(void)
Answers with this device's driver's version as a human-readable string.
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...
static uint32_t maxSampleCountForNTV2AudioBufferSize(const NTV2AudioBufferSize inBufferSize, const uint16_t inChannelCount)
NTV2RegWrites NTV2RegisterReads
static std::string FourCCToString(const ULWord in4CC, const char nonPrintable='?')
virtual bool GetInputFrame(const NTV2Channel inChannel, ULWord &outValue)
Answers with the current input frame index number for the given FrameStore. This identifies which par...
#define NTV2_IS_INPUT_CROSSPOINT(__x__)
std::string NTV2VideoFormatToString(const NTV2VideoFormat inValue, const bool inUseFrameRate=false)
Embeds silence (zeroes) into the data stream.
virtual bool GetLPExternalConfigurationURLString(std::string &outURLString)
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...
bool NTV2DeviceCanDoPCMDetection(const NTV2DeviceID inDeviceID)
virtual NTV2DeviceID GetDeviceID(void)
std::string NTV2TCIndexToString(const NTV2TCIndex inValue, const bool inCompactDisplay=false)
virtual bool GetDetectedAudioChannelPairs(const NTV2AudioSystem inAudioSystem, NTV2AudioChannelPairs &outDetectedChannelPairs)
Answers which audio channel pairs are present in the given Audio System's input stream.
Declares the CNTV2DeviceScanner class.
#define kIncludeOtherRegs_XptROM
#define LoggerSectionToFunctionMacro(_SectionEnum_, _SectionString_, _SectionMethod_)
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...
NTV2Framesize
Kona2/Xena2 specific enums.
virtual bool GetRouting(CNTV2SignalRouter &outRouting)
Answers with the current signal routing between any and all widgets on the AJA device.
UWord NTV2DeviceGetNumAudioSystems(const NTV2DeviceID inDeviceID)
Describes a user-space buffer on the host computer. I have an address and a length, plus some optional attributes (allocated by SDK?, page-aligned? etc.).
virtual bool DriverGetBitFileInformation(BITFILE_INFO_STRUCT &outBitFileInfo, const NTV2BitFileType inBitFileType=NTV2_VideoProcBitFile)
defined(NTV2_DEPRECATE_17_2)
NTV2Mode
Used to identify the mode of a widget_framestore, or the direction of an AutoCirculate stream: either...
uint16_t GetEndFrame(void) const
virtual int GetSFPConfigurationURLStrings(std::vector< std::string > &sfpURLStrings)
std::string NTV2DeviceIDToString(const NTV2DeviceID inValue, const bool inForRetailDisplay=false)
static NTV2Channel findActiveACChannel(CNTV2Card &device, NTV2AudioSystem audioSystem, AUTOCIRCULATE_STATUS &outStatus)
True if device has a crosspoint connection ROM (New in SDK 17.0)
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...
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...
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 bool GetHDMIInputAudioChannels(NTV2HDMIAudioChannels &outValue, const NTV2Channel inHDMIInput=NTV2_CHANNEL1)
Answers with the current number of audio channels being received on the given HDMI input...
#define NTV2_IS_VALID_EMBEDDED_AUDIO_INPUT(_x_)
static AJALabelValuePairs & append(AJALabelValuePairs &inOutTable, const std::string &inLabel, const std::string &inValue=std::string())
A convenience function that appends the given label and value strings to the provided AJALabelValuePa...
virtual bool GetFrameBufferFormat(NTV2Channel inChannel, NTV2FrameBufferFormat &outValue)
Returns the current frame buffer format for the given FrameStore on the AJA device.
virtual NTV2VideoFormat GetAnalogCompositeInputVideoFormat(void)
Returns the video format of the signal that is present on the device's composite video input...
This identifies the first Audio System.
virtual bool WaitForOutputVerticalInterrupt(const NTV2Channel inChannel=NTV2_CHANNEL1, UWord inRepeatCount=1)
Efficiently sleeps the calling thread/process until the next one or more field (interlaced video) or ...
const registerToLoadString registerToLoadStrings[]
virtual std::ostream & Print(std::ostream &inOutStream, const bool inForRetailDisplay=false) const
Prints me in a human-readable format to the given output stream.
double GetAudioSamplesPerSecond(const NTV2AudioRate inAudioRate)
Returns the audio sample rate as a number of audio samples per second.
Declares the AJASystemInfo class.
This is returned from the CNTV2Card::AutoCirculateGetStatus function.
std::vector< NTV2_RP188 > NTV2TimeCodeList
An ordered sequence of zero or more NTV2_RP188 structures. An NTV2TCIndex enum value can be used as a...
std::string NTV2AudioRateToString(const NTV2AudioRate inValue, const bool inForRetailDisplay=false)
ostream & operator<<(ostream &outStream, const CNTV2SupportLogger &inData)
static ULWord getMaxNumSamples(CNTV2Card &device, NTV2AudioSystem audioSystem)
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 bool detectInputChannelPairs(CNTV2Card &device, const NTV2AudioSource inAudioSource, const NTV2EmbeddedAudioInput inEmbeddedSource, NTV2AudioChannelPairs &outChannelPairsPresent)
Specifies channel or FrameStore 1 (or the first item).
#define xHEX0N(__x__, __n__)
static NTV2RegNumSet GetRegistersForDevice(const NTV2DeviceID inDeviceID, const int inOtherRegsToInclude=0)
A simple (not thread-safe) set of key/value pairs. (New in SDK 16.3)
std::string NTV2AudioSourceToString(const NTV2AudioSource inValue, const bool inCompactDisplay=false)
string DECStr(const T inT)
static std::string GetDeviceRefName(CNTV2Card &inDevice)
#define NTV2_IS_SUPPORTED_NTV2FrameRate(__r__)
virtual bool GetSDIOutputAudioEnabled(const NTV2Channel inSDIOutput, bool &outIsEnabled)
Answers with the current state of the audio output embedder for the given SDI output connector (speci...
virtual bool GetFrameRate(NTV2FrameRate &outValue, NTV2Channel inChannel=NTV2_CHANNEL1)
Returns the AJA device's currently configured frame rate via its "value" parameter.
std::string NTV2FrameBufferFormatToString(const NTV2FrameBufferFormat inValue, const bool inForRetailDisplay=false)
virtual bool IsChannelEnabled(const NTV2Channel inChannel, bool &outEnabled)
Answers whether or not the given FrameStore is enabled.
Declares the CNTV2KonaFlashProgram class.
NTV2AudioSource
This enum value determines/states where an audio system will obtain its audio samples.
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 ...
virtual void AddFooter(const std::string §ionName, const std::string §ionData)
Adds footer text to my log.
virtual AJAStatus GetLabelValuePairs(AJALabelValuePairs &outTable, bool clearTable=false) const
Generates a "table" of label/value pairs that contains the complete host system info table...
#define NTV2_IS_OUTPUT_MODE(__mode__)
Private include file for all ajabase sources.
This class/object reports information about the current and/or requested AutoCirculate frame...
virtual bool DMAReadFrame(const ULWord inFrameNumber, ULWord *pOutFrameBuffer, const ULWord inByteCount)
Transfers a single frame from the AJA device to the host.
#define NTV2_IS_VALID_VIDEO_FORMAT(__f__)
virtual AJAStatus GetValue(const AJASystemInfoTag inTag, std::string &outValue) const
Answers with the host system info value string for the given AJASystemInfoTag.
ULWord NTV2DeviceGetNumVideoChannels(const NTV2DeviceID inDeviceID)
std::string NTV2AudioLoopBackToString(const NTV2AudioLoopBack inValue, const bool inForRetailDisplay=false)
const char * NTV2DeviceIDString(const NTV2DeviceID id)
std::ostream & DumpBlocks(std::ostream &oss) const
Dumps all 8MB blocks/frames and their tags, if any, into the given stream.
virtual void AppendToSection(uint32_t section, const std::string §ionData)
Appends arbitrary string data to my support log, after a given section.
#define HEX0N(__x__, __n__)
static string xHEX0NStr(const uint32_t inNum, const uint16_t inWidth)
std::string NTV2ChannelToString(const NTV2Channel inValue, const bool inForRetailDisplay=false)
static bool getBitfileDate(CNTV2Card &device, string &outDateString, NTV2XilinxFPGA whichFPGA)
map< uint16_t, NTV2TimeCodeList > FrameToTCList
std::string NTV2EmbeddedAudioInputToString(const NTV2EmbeddedAudioInput inValue, const bool inCompactDisplay=false)
UWord NTV2DeviceGetMaxAudioChannels(const NTV2DeviceID inDeviceID)
NTV2AudioSystem GetAudioSystem(void) const
pair< uint16_t, NTV2TimeCodeList > FrameToTCListPair
NTV2RegisterReads FromRegNumSet(const NTV2RegNumSet &inRegNumSet)
This selects audio channels 9 and 10 (Group 3 channels 1 and 2)
static NTV2PixelFormat getPixelFormat(CNTV2Card &device, const NTV2Channel inChannel)
NTV2Crosspoint acCrosspoint
The crosspoint (channel number with direction)
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 ...
NTV2EmbeddedAudioInput
This enum value determines/states which SDI video input will be used to supply audio samples to an au...
virtual void ToString(std::string &outAllLabelsAndValues) const
Answers with a multi-line string that contains the complete host system info table.
static string getActiveFrameStr(CNTV2Card &device, const NTV2Channel inChannel)
static ULWord getActiveFrame(CNTV2Card &device, const NTV2Channel inChannel)
ChannelToACStatus::const_iterator ChannelToACStatusConstIter
uint16_t GetStartFrame(void) const
virtual std::string GetHostName(void) const
Declares device capability functions.
This selects audio channels 3 and 4 (Group 1 channels 3 and 4)
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 ...
static NTV2Mode getMode(CNTV2Card &device, const NTV2Channel inChannel)
#define kIncludeOtherRegs_VRegs
virtual bool GetMode(const NTV2Channel inChannel, NTV2Mode &outValue)
Answers with the current NTV2Mode of the given FrameStore on the AJA device.
enum NTV2TCIndex NTV2TimecodeIndex
Declares the CNTV2RegisterExpert class.
ULWord GetScaleFromFrameRate(const NTV2FrameRate inFrameRate)
virtual void AddHeader(const std::string §ionName, const std::string §ionData)
Adds header text to my log.
static string timecodeToString(const NTV2_RP188 &inRP188)