|
AJA NTV2 SDK
17.1.3.1410
NTV2 SDK 17.1.3.1410
|
Go to the documentation of this file.
164 if ( (hours >= 24) || (minutes >= 60) || (seconds >= 60) )
167 uint32_t framesPerSecond = 0;
176 default: framesPerSecond = 0;
break;
179 if (frames >= framesPerSecond)
186 bool bOddFrame = (frames % 2 == 1 ?
true :
false);
193 (uint8_t)(minutes / 10), (uint8_t)(minutes % 10),
194 (uint8_t)(seconds / 10), (uint8_t)(seconds % 10),
195 (uint8_t)(frames / 10), (uint8_t)(frames % 10) );
203 uint8_t hourTens, hourUnits, minuteTens, minuteUnits, secondTens, secondUnits, frameTens, frameUnits;
204 GetTimeDigits(hourTens, hourUnits, minuteTens, minuteUnits, secondTens, secondUnits, frameTens, frameUnits);
206 hours = (hourTens * 10) + hourUnits;
207 minutes = (minuteTens * 10) + minuteUnits;
208 seconds = (secondTens * 10) + secondUnits;
209 frames = (frameTens * 10) + frameUnits;
214 bool bFieldID =
false;
217 frames = (frames * 2) + (bFieldID ? 1 : 0);
226 uint32_t hours, minutes, seconds, frames;
227 inTimecode.
QueryHmsf (hours, minutes, seconds, frames, inTimeBase, inIsDropFrame);
229 SetTime (tcFmt, hours, minutes, seconds, frames);
239 uint32_t hours, minutes, seconds, frames;
240 GetTime(tcFmt, hours, minutes, seconds, frames);
242 bool bDropFrame =
false;
245 outTimecode.
SetHmsf(hours, minutes, seconds, frames, inTimeBase, bDropFrame);
516 if ((bgFlag & 0x04) != 0)
521 if ((bgFlag & 0x02) != 0)
526 if ((bgFlag & 0x01) != 0)
537 if ((bgFlag & 0x04) != 0)
542 if ((bgFlag & 0x02) != 0)
547 if ((bgFlag & 0x01) != 0)
558 if ((bgFlag & 0x04) != 0)
563 if ((bgFlag & 0x02) != 0)
568 if ((bgFlag & 0x01) != 0)
585 uint8_t bf2, bf1, bf0;
616 outBGFlag = (bf2 << 2) + (bf1 << 1) + bf0;
625 int64_t rate, duration;
627 double frameRate = (double)rate / (
double)duration;
630 if (frameRate < 24.5)
632 else if (frameRate < 28.0)
634 else if (frameRate < 35.0)
636 else if (frameRate < 49.0)
638 else if (frameRate < 55.0)
652 bool bFieldIdFlag, bColorFrameFlag, bDropFrameFlag;
654 uint8_t binaryGroupFlag;
664 <<
"Base Timecode Info:" << endl
665 <<
"Time: " << dec << setw(1) << (uint32_t)timeDigits[
kTcHourTens] << setw(1) << (uint32_t)timeDigits[
kTcHourUnits]
669 <<
"Field ID Flag: " << (bFieldIdFlag ?
"f1" :
"f0") << endl
670 <<
"Drop Frame Flag: " << (bDropFrameFlag ?
"Drop" :
"Non-drop") << endl
671 <<
"Color Frame: " << (bColorFrameFlag ?
"On" :
"Off") << endl
672 <<
"Binary Group: " << hex << setw(1) << uint16_t(binaryGroup[
kBg8]) << setw(1) << uint16_t(binaryGroup[
kBg7])
673 <<
":" << setw(1) << uint16_t(binaryGroup[
kBg6]) << setw(1) << uint16_t(binaryGroup[
kBg5])
674 <<
":" << setw(1) << uint16_t(binaryGroup[
kBg4]) << setw(1) << uint16_t(binaryGroup[
kBg3])
675 <<
":" << setw(1) << uint16_t(binaryGroup[
kBg2]) << setw(1) << uint16_t(binaryGroup[
kBg1]) << endl
676 <<
"BG Flag: " << uint16_t(binaryGroupFlag);
virtual AJAStatus SetBinaryGroupFlag(const uint8_t inBGFlag, const AJAAncillaryData_Timecode_Format inFormat=AJAAncillaryData_Timecode_Format_Unknown)
Sets my binary group flag (3 bits).
This is the base class for the AJAAncillaryData_Timecode_ATC and AJAAncillaryData_Timecode_VITC class...
@ AJAAncillaryData_Timecode_Format_30fps
virtual AJAStatus SetColorFrameFlag(bool bFlag, AJAAncillaryData_Timecode_Format tcFmt=AJAAncillaryData_Timecode_Format_Unknown)
Sets my color frame flag.
@ AJAAncDataType_Unknown
Includes data that is valid, but we don't recognize.
virtual AJAStatus SetDropFrameFlag(bool bFlag, AJAAncillaryData_Timecode_Format tcFmt=AJAAncillaryData_Timecode_Format_Unknown)
Sets my drop frame flag.
void GetFrameRate(int64_t &frameTimeScale, int64_t &frameDuration) const
virtual std::string TimecodeString(void) const
virtual AJAStatus SetTimeDigits(const uint8_t inHourTens, const uint8_t inHourOnes, const uint8_t inMinTens, const uint8_t inMinOnes, const uint8_t inSecsTens, const uint8_t inSecsOnes, const uint8_t inFrameTens, const uint8_t inFrameOnes)
Sets my timecode "time" using discrete BCD digits.
AJAAncDataType
Identifies the ancillary data types that are known to this module.
virtual AJAStatus SetTime(const AJAAncillaryData_Timecode_Format inFormat, const uint32_t inHours, const uint32_t inMinutes, const uint32_t inSeconds, const uint32_t inFrames)
Sets my timecode "time" with hours, minutes, seconds, frames (in decimal, not BCD digits).
virtual AJAStatus SetFieldIdFlag(bool bFlag, AJAAncillaryData_Timecode_Format tcFmt=AJAAncillaryData_Timecode_Format_Unknown)
Sets my FieldID flag.
virtual AJAStatus GetTimeDigits(uint8_t &outHourTens, uint8_t &outHourOnes, uint8_t &outMinTens, uint8_t &outMinOnes, uint8_t &outSecsTens, uint8_t &outSecsOnes, uint8_t &outFrameTens, uint8_t &outFrameOnes) const
Answers with my current timecode "time" as discrete BCD digits.
static AJAAncillaryData_Timecode_Format GetTimecodeFormatFromTimeBase(const AJATimeBase &inTimeBase)
Get the timecode format that matches the input timebase.
virtual AJAStatus GetDropFrameFlag(bool &bFlag, AJAAncillaryData_Timecode_Format tcFmt=AJAAncillaryData_Timecode_Format_Unknown) const
virtual AJAStatus SetBinaryGroupHexValue(uint8_t digitNum, uint8_t hexValue, uint8_t mask=0x0f)
Sets my raw "Binary Group" hex values.
virtual AJAStatus GetBinaryGroupHexValue(uint8_t digitNum, uint8_t &hexValue, uint8_t mask=0x0f) const
virtual AJAStatus GetColorFrameFlag(bool &bFlag, AJAAncillaryData_Timecode_Format tcFmt=AJAAncillaryData_Timecode_Format_Unknown) const
AJAAncillaryData_Timecode()
virtual AJAStatus SetTimeHexValue(const uint8_t inDigitNum, const uint8_t inHexValue, const uint8_t inMask=0x0f)
Sets my raw "time" hex values.
virtual std::ostream & Print(std::ostream &inOutStream, const bool inDetailed=false) const
Streams a human-readable representation of me to the given output stream.
virtual void Clear(void)
Frees my allocated memory, if any, and resets my members to their default values.
I am the principal class that stores a single SMPTE-291 SDI ancillary data packet OR the digitized co...
virtual AJAStatus SetBinaryGroups(uint8_t bg8, uint8_t bg7, uint8_t bg6, uint8_t bg5, uint8_t bg4, uint8_t bg3, uint8_t bg2, uint8_t bg1)
Sets my binary group values.
virtual AJAStatus GetBinaryGroupFlag(uint8_t &outBGFlag, const AJAAncillaryData_Timecode_Format inFormat=AJAAncillaryData_Timecode_Format_Unknown) const
Answers with my current binary group flag (3 bits).
@ AJAAncillaryData_Timecode_Format_48fps
AJAAncDataCoding m_coding
Analog or digital data.
uint8_t m_binaryGroup[kNumBinaryGroups]
void SetHmsf(uint32_t h, uint32_t m, uint32_t s, uint32_t f, const AJATimeBase &timeBase, bool bDropFrame)
virtual AJAStatus GetTimecode(AJATimeCode &outTimecode, const AJATimeBase &inTimeBase) const
Answers with my timecode "time" as an AJATimeCode.
virtual AJAStatus SetTimecode(const AJATimeCode &inTimecode, const AJATimeBase &inTimeBase, const bool inIsDropFrame)
Sets my timecode "time" from an AJATimeCode.
@ AJAAncillaryData_Timecode_Format_Unknown
virtual AJAStatus GetTime(const AJAAncillaryData_Timecode_Format inFormat, uint32_t &outHours, uint32_t &outMinutes, uint32_t &outSeconds, uint32_t &outFrames) const
Answers with my current timecode "time" as individual hour, minute, second, and frame components (in ...
AJAAncillaryData_Timecode & operator=(const AJAAncillaryData_Timecode &inRHS)
Assignment operator – replaces my contents with the right-hand-side value.
virtual std::ostream & Print(std::ostream &inOutStream, const bool inDetailed=false) const
Streams a human-readable representation of me to the given output stream.
bool m_rcvDataValid
This is set true (or not) by ParsePayloadData()
virtual AJAStatus GetBinaryGroups(uint8_t &bg8, uint8_t &bg7, uint8_t &bg6, uint8_t &bg5, uint8_t &bg4, uint8_t &bg3, uint8_t &bg2, uint8_t &bg1) const
Declares the AJAAncillaryData_Timecode class.
virtual std::string IDAsString(void) const
virtual AJAStatus GetTimeHexValue(uint8_t inDigitNum, uint8_t &outHexValue, uint8_t inMask=0x0f) const
Answers with my current raw "time" hex values.
void QueryHmsf(uint32_t &h, uint32_t &m, uint32_t &s, uint32_t &f, const AJATimeBase &timeBase, bool bDropFrame) const
static AJAAncDataType RecognizeThisAncillaryData(const AJAAncillaryData *pInAncData)
virtual void Clear(void)
Frees my allocated memory, if any, and resets my members to their default values.
AJAAncillaryData & operator=(const AJAAncillaryData &inRHS)
AJAAncillaryData_Timecode_Format
const std::string & AJAAncDataCodingToString(const AJAAncDataCoding inValue, const bool inCompact=true)
virtual AJAStatus GetFieldIdFlag(bool &bFlag, AJAAncillaryData_Timecode_Format tcFmt=AJAAncillaryData_Timecode_Format_Unknown) const
@ AJAAncillaryData_Timecode_Format_50fps
uint8_t m_timeDigits[kNumTimeDigits]
virtual AJAStatus ParsePayloadData(void)
Parses out (interprets) the "local" ancillary data from my payload data.
@ AJAAncillaryData_Timecode_Format_24fps
@ AJAAncillaryData_Timecode_Format_25fps
@ AJAAncillaryData_Timecode_Format_60fps
Utility class for timecodes.