15 #include "ajabase/persistence/persistence.h" 22 #if defined(MSWindows) 23 #define PATH_DELIMITER "\\" 25 #define PATH_DELIMITER "/" 42 static string makeHeader(ostringstream & oss,
const string & inName)
44 oss << setfill(
'=') << setw(96) <<
" " << inName <<
":" << setfill(
' ') << endl << endl;
64 const string sigStr(NTV2_4CC_AS_STRING(inAppSignature));
65 if (isprint(sigStr.at(0)) && isprint(sigStr.at(1)) && isprint(sigStr.at(2)) && isprint(sigStr.at(3)))
66 oss <<
"'" << sigStr <<
"'";
67 else if (inAppSignature)
68 oss <<
"0x" << hex << setw (8) << setfill (
'0') << inAppSignature << dec <<
" (" << inAppSignature <<
")";
77 #if defined (MSWindows) 87 #elif defined (AJALinux) 89 #elif defined (AJAMac) 108 static uint32_t gMaxSampleCount16 [] = { 16320, 65280, 32640, 130560, 0 };
109 static uint32_t gMaxSampleCount8 [] = { 32640, 130560, 65280, 261120, 0 };
110 static uint32_t gMaxSampleCount6 [] = { 87040, 174080, 87040, 348160, 0 };
112 switch (inChannelCount)
114 case 16:
return gMaxSampleCount16 [inBufferSize];
115 case 8:
return gMaxSampleCount8 [inBufferSize];
116 case 6:
return gMaxSampleCount6 [inBufferSize];
139 device.
GetMode(inChannel, result);
225 outChannelPairsPresent.clear();
226 switch (inAudioSource)
228 default:
return false;
250 outChannelPairsPresent.insert (chPair);
263 bool bBitFileInfoAvailable =
false;
265 if( bBitFileInfoAvailable )
268 if (outDateString.find(
".ncd") != string::npos)
270 outDateString = outDateString.substr(0, outDateString.find(
".ncd"));
271 outDateString +=
".bit ";
272 outDateString += bitFileInfo.
dateStr;
273 outDateString +=
" ";
274 outDateString += bitFileInfo.
timeStr;
276 else if (outDateString.find(
";") != string::npos)
278 outDateString = outDateString.substr(0, outDateString.find(
";"));
279 outDateString +=
".bit ";
280 outDateString += bitFileInfo.
dateStr;
281 outDateString +=
" ";
282 outDateString += bitFileInfo.
timeStr;
284 else if (outDateString.find(
".bit") != string::npos && outDateString !=
".bit")
287 outDateString +=
" ";
288 outDateString += bitFileInfo.
dateStr;
289 outDateString +=
" ";
290 outDateString += bitFileInfo.
timeStr;
294 outDateString =
"bad bitfile date string";
337 if (mPrependMap.find(section) != mPrependMap.end())
339 mPrependMap.at(section).insert(0,
"\n");
340 mPrependMap.at(section).insert(0, sectionData);
344 mPrependMap[section] = sectionData;
345 mPrependMap.at(section).append(
"\n");
351 if (mAppendMap.find(section) != mAppendMap.end())
353 mAppendMap.at(section).append(
"\n");
354 mAppendMap.at(section).append(sectionData);
358 mAppendMap[section] =
"\n";
359 mAppendMap.at(section).append(sectionData);
367 oss << sectionData <<
"\n";
368 mHeaderStr.append(oss.str());
375 oss << sectionData <<
"\n";
376 mFooterStr.append(oss.str());
384 #define LoggerSectionToFunctionMacro(_SectionEnum_, _SectionString_, _SectionMethod_) \ 385 if (mSections & _SectionEnum_) \ 387 makeHeader(oss, _SectionString_); \ 388 if (mPrependMap.find(_SectionEnum_) != mPrependMap.end()) \ 389 oss << mPrependMap.at(_SectionEnum_); \ 391 _SectionMethod_(oss); \ 393 if (mAppendMap.find(_SectionEnum_) != mAppendMap.end()) \ 394 oss << mAppendMap.at(_SectionEnum_); \ 400 vector<char> dateBufferLocal(128, 0);
401 vector<char> dateBufferUTC(128, 0);
405 struct tm *localTimeinfo;
406 localTimeinfo = localtime(reinterpret_cast<const time_t*>(&now));
407 strcpy(&dateBufferLocal[0],
"");
409 ::strftime(&dateBufferLocal[0], dateBufferLocal.size(),
"%B %d, %Y %I:%M:%S %p %Z (local)", localTimeinfo);
411 struct tm *utcTimeinfo;
412 utcTimeinfo = gmtime(reinterpret_cast<const time_t*>(&now));
413 strcpy(&dateBufferUTC[0],
"");
415 ::strftime(&dateBufferUTC[0], dateBufferUTC.size(),
"%Y-%m-%dT%H:%M:%SZ UTC", utcTimeinfo);
417 oss <<
"Begin NTV2 Support Log" <<
"\n" <<
419 "Generated: " << &dateBufferLocal[0] <<
420 " " << &dateBufferUTC[0] <<
"\n\n" << flush;
422 if (!mHeaderStr.empty())
436 if (!mFooterStr.empty())
438 oss << endl <<
"End NTV2 Support Log";
447 static inline string HEX0NStr (
const uint32_t inNum,
const uint16_t inWidth) {ostringstream oss; oss <<
HEX0N(inNum,inWidth);
return oss.str();}
448 static inline string xHEX0NStr(
const uint32_t inNum,
const uint16_t inWidth) {ostringstream oss; oss <<
xHEX0N(inNum,inWidth);
return oss.str();}
449 template <
typename T>
string DECStr (
const T inT) {ostringstream oss; oss <<
DEC(inT);
return oss.str();}
451 void CNTV2SupportLogger::FetchInfoLog (ostringstream & oss)
const 462 ULWord drvrType(0), dextType(0x44455854);
465 str =
"Kernel Extension ('KEXT')";
466 else if (drvrType == dextType)
467 str =
"DriverKit ('DEXT')";
470 oss <<
"(Unknown/Invalid " <<
xHEX0N(drvrType,8) <<
")";
474 #endif // defined(AJAMac) 488 string dateStr, timeStr, connType;
498 std::string urlString;
503 std::vector<std::string> sfpURLStings;
505 for (
int i = 0; i < numSFPs; i++)
524 if (ntv2Card.ReadMACAddresses(mac1, mac2))
534 ULWord dnaLo(0), dnaHi(0);
541 ntv2Card.ReadLicenseInfo(licenseInfo);
562 if (!connType.empty())
574 std::vector<std::pair<std::string, bool> > persistenceChecks;
575 persistenceChecks.push_back(std::pair<std::string, bool>(
"User Persistence Health",
false));
576 persistenceChecks.push_back(std::pair<std::string, bool>(
"System Persistence Health",
true));
577 std::vector<std::pair<std::string, bool> >::const_iterator it(persistenceChecks.begin());
579 std::string errMessage;
580 for (; it != persistenceChecks.end(); ++it)
582 std::string label(it->first);
583 bool shared(it->second);
584 AJAPersistence p(
"com.aja.devicesettings",
"Unknown",
"00000000", shared);
585 if (p.StorageHealthCheck(errCode, errMessage))
591 if (shared && errCode == -1)
602 void CNTV2SupportLogger::FetchRegisterLog (ostringstream & oss)
const 608 static const string sDashes (96,
'-');
613 deviceRegs.insert(regNum);
615 oss << endl << deviceRegs.size() <<
" Device Registers " << sDashes << endl << endl;
618 oss <<
"## NOTE: Driver failed to return one or more registers (those will be zero)" << endl;
622 const uint32_t regNum (regInfo.registerNumber);
624 const uint32_t
value (regInfo.registerValue);
627 <<
"Register Number: " << regNum << endl
628 <<
"Register Value: " <<
value <<
" : " <<
xHEX0N(value,8) << endl
634 oss << endl << virtualRegs.size() <<
" Virtual Registers " << sDashes << endl << endl;
636 oss <<
"## NOTE: Driver failed to return one or more virtual registers (those will be zero)" << endl;
640 const uint32_t regNum (regInfo.registerNumber);
642 const uint32_t
value (regInfo.registerValue);
645 <<
"VReg Number: " << setw(10) << regNum << endl
646 <<
"VReg Value: " <<
value <<
" : " <<
xHEX0N(value,8) << endl
652 void CNTV2SupportLogger::FetchAutoCirculateLog (ostringstream & oss)
const 661 static const string dashes (25,
'-');
693 bool multiFormatMode(
false);
696 if (!multiFormatMode)
699 oss <<
"MultiFormat Mode" << endl;
706 <<
"Chan/FrameStore State Start End Act FrmProc FrmDrop BufLvl Audio RP188 LTC FBFch FBOch Color VidPr Anc HDMIx Field VidFmt PixFmt" << endl
707 <<
"-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------" << endl;
715 << setw(12) << status[0]
716 << setw( 7) << status[1]
717 << setw( 6) << status[2]
719 << setw(10) << status[9]
720 << setw(10) << status[10]
721 << setw( 7) << status[11]
722 << setw( 9) << status[12]
723 << setw( 8) << status[13]
724 << setw( 8) << status[14]
725 << setw( 8) << status[15]
726 << setw( 8) << status[16]
727 << setw( 8) << status[17]
728 << setw( 8) << status[18]
729 << setw( 8) << status[19]
730 << setw( 8) << status[20]
731 << setw( 8) << status[21];
732 if (!status.IsStopped() ||
isEnabled(mDevice,chan))
737 oss << setw(12) <<
"---" 740 if (!status.IsStopped() && status.WithAudio())
742 ULWord audChlsPerSample(0);
751 const double bytesPerChannel (4.0);
752 const double channelsPerSample (
double(audChlsPerSample+0));
753 const double bytesPerFrame (samplesPerSecond * bytesPerChannel * channelsPerSample / framesPerSecond);
754 const ULWord maxVideoFrames (4UL * 1024UL * 1024UL /
ULWord(bytesPerFrame));
755 if (status.GetFrameCount() > maxVideoFrames)
756 oss <<
"## WARNING: " <<
DEC(status.GetFrameCount()) <<
" frames (" <<
DEC(status.GetStartFrame())
757 <<
" thru " <<
DEC(status.GetEndFrame()) <<
") exceeds " <<
DEC(maxVideoFrames)
758 <<
"-frame max audio buffer capacity" << endl;
764 oss << endl <<
"Device SDRAM Map (8MB frms):" << endl;
774 if (status.IsStopped())
778 if (it == perChannelTCs.end())
782 oss << endl << dashes <<
" " << (
NTV2_IS_INPUT_CROSSPOINT(status.acCrosspoint) ?
"Input " :
"Output ") <<
DEC(chan+1) <<
" Per-Frame Valid Timecodes:" << endl;
785 const uint16_t frameNum(i->first);
787 oss <<
"Frame " << frameNum <<
":" << endl;
788 for (uint16_t tcNdx(0); tcNdx < timecodes.size(); tcNdx++)
791 if (!tcVal.IsValid())
795 << setw(12) << tcStr << setw(0) <<
"\t" << tcVal << endl;
802 void CNTV2SupportLogger::FetchAudioLog (ostringstream & oss)
const 835 bool isEmbedderEnabled =
false;
837 UWord inChannelCount = isEmbedderEnabled ? maxNumChannels : 0;
840 for (
UWord audioChannel (0); audioChannel < inChannelCount; audioChannel++)
842 if (audioChannel & 1)
853 bool isNonPCM (
true);
864 oss <<
" (max)" << endl;
866 oss <<
" (" << maxNumChannels <<
" (max))" << endl;
867 oss <<
" Total Samples:\t[" <<
DEC0N(maxSamples,6) <<
"]" << endl
873 oss <<
"Write Head Position:\t[" <<
DEC0N(currentPosSampleNdx,6) <<
"]" << endl
878 <<
" Channels Present:\t" << channelPairsPresent << endl
879 <<
" Non-PCM Channels:\t" << nonPCMChannelPairs << endl;
883 oss <<
" Read Head Position:\t[" <<
DEC0N(currentPosSampleNdx,6) <<
"]" << endl;
885 oss <<
" Non-PCM Channels:\t" << nonPCMChannelPairs << endl;
887 oss <<
" Non-PCM Channels:\t" << (isNonPCM ?
"All Channel Pairs" :
"Normal") << endl;
893 void CNTV2SupportLogger::FetchRoutingLog (ostringstream & oss)
const 898 oss <<
"(NTV2InputCrosspointID <== NTV2OutputCrosspointID)" << endl;
899 router.
Print (oss,
false);
1025 fileInput.open(inLogFilePath.c_str());
1026 string lineContents;
1027 int i = 0, numLines = 0;
1029 string searchString;
1030 bool isCompatible =
false;
1032 while(getline(fileInput, lineContents))
1037 fileInput.seekg(0, ios::beg);
1038 while(getline(fileInput, lineContents) && i < size && !bForceLoad)
1040 searchString =
"Device: ";
1042 if (lineContents.find(searchString, 0) != string::npos)
1045 isCompatible =
true;
1059 getline(fileInput, lineContents);
1064 fileInput.seekg(0, ios::beg);
1068 searchString =
"Register Name: ";
1070 if (lineContents.find(searchString, 0) != string::npos)
1072 getline(fileInput, lineContents);
1073 getline(fileInput, lineContents);
1074 searchString =
"Register Value: ";
1075 size_t start = lineContents.find(searchString);
1076 if(start != string::npos)
1078 size_t end = lineContents.find(
" : ");
1079 stringstream registerValueString(lineContents.substr(start + searchString.length(),
end));
1080 uint32_t registerValue = 0;
1081 registerValueString >> registerValue;
1087 cout <<
"The format of the log file is not compatible with this option." << endl;
1110 if (!homePath.empty())
1112 oss << inPrefix <<
"_" << deviceName <<
"_" << ::time(&rawtime) <<
"." << inExtension;
1120 if (inFilePath.empty())
1128 ofstream ofs(inFilePath.c_str(), ofstream::out | ofstream::binary);
1130 {msgStrm <<
"## ERROR: Unable to open '" << inFilePath <<
"' for writing" << endl;
return false;}
1132 for (
ULWord frameNdx(0); frameNdx < numFrames; frameNdx++)
1135 {badDMAs.push_back(frameNdx);
continue;}
1136 if (!ofs.write(buffer, streamsize(buffer.
GetByteCount())).good())
1137 {badWrites.push_back(frameNdx);
continue;}
1138 goodFrames.push_back(frameNdx);
1140 if (!badDMAs.empty())
1142 msgStrm <<
"## ERROR: DMARead failed for " <<
DEC(badDMAs.size()) <<
" " <<
DEC(megs) <<
"MB frame(s): ";
1145 if (!badWrites.empty())
1147 msgStrm <<
"## ERROR: Write failures for " <<
DEC(badWrites.size()) <<
" " <<
DEC(megs) <<
"MB frame(s): ";
1150 msgStrm <<
"## NOTE: " <<
DEC(goodFrames.size()) <<
" x " <<
DEC(megs) <<
"MB frames from device '" NTV2RegisterNumber registerNum
std::string NTV2AudioBufferSizeToString(const NTV2AudioBufferSize inValue, const bool inForRetailDisplay=false)
Defines the KonaIP/IoIP registers.
Everything needed to call CNTV2Card::ReadRegister or CNTV2Card::WriteRegister functions.
#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: Sharing AJA Devices With Other Applications.
Obtain audio samples from the device AES inputs, if available.
bool AssessDevice(CNTV2Card &inDevice, const bool inIgnoreStoppedAudioBuffers=(0))
Assesses the given device.
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.
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.
bool NTV2DeviceHasLPProductCode(const NTV2DeviceID inDeviceID)
#define NTV2_IS_VALID_AUDIO_RATE(_x_)
static string appSignatureToString(const ULWord inAppSignature)
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.
static NTV2RegNumSet GetRegistersForClass(const std::string &inClassName)
bool IsValid(void) const
Answers true if I'm valid, or false if I'm not valid.
ULWord GetByteCount(void) const
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...
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.
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)
std::string packageNumber
static ULWord bytesToSamples(CNTV2Card &device, NTV2AudioSystem audioSystem, const ULWord inBytes)
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.
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...
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.
#define SAREK_LICENSE_PRESENT
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
virtual bool GetInputFrame(const NTV2Channel inChannel, ULWord &outValue)
Answers with the current input frame index number for the given FrameStore. This identifies which par...
the parser finished reading a JSON value
#define NTV2_IS_INPUT_CROSSPOINT(__x__)
#define kRegClass_Virtual
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 bool GetPackageInformation(PACKAGE_INFO_STRUCT &outPkgInfo)
Answers with the IP device's package information.
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 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...
static std::string GetDisplayValue(const uint32_t inRegNum, const uint32_t inRegValue, const NTV2DeviceID inDeviceID=DEVICE_ID_NOTFOUND)
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)
#define kRegSarekLicenseStatus
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)
std::string NTV2AudioSourceToString(const NTV2AudioSource inValue, const bool inCompactDisplay=false)
string DECStr(const T inT)
static std::string GetDisplayName(const uint32_t inRegNum)
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
#define SAREK_LICENSE_VALID
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)
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)