AJA NTV2 SDK
17.5.0.1492
NTV2 SDK 17.5.0.1492
|
Utility class for timecodes. More...
#include <timecode.h>
Public Member Functions | |
AJATimeCode () | |
AJATimeCode (uint32_t frame, bool bStdTcForHfr=true) | |
AJATimeCode (const std::string &str, const AJATimeBase &timeBase, bool bDropFrame, bool bStdTcForHfr=true) | |
AJATimeCode (const std::string &str, const AJATimeBase &timeBase) | |
AJATimeCode (const AJATimeCode &other) | |
virtual | ~AJATimeCode () |
void | QueryString (std::string &str, const AJATimeBase &timeBase, bool bDropFrame, bool bStdTcForHfr, AJATimecodeNotation notation=AJA_TIMECODE_LEGACY) |
void | QueryString (std::string &str, const AJATimeBase &timeBase, bool bDropFrame, AJATimecodeNotation notation=AJA_TIMECODE_LEGACY) |
void | QuerySMPTEString (char *pString, const AJATimeBase &timeBase, bool bDropFrame) |
uint32_t | QueryFrame (void) const |
bool | QueryStdTimecodeForHfr () |
void | QueryHmsf (uint32_t &h, uint32_t &m, uint32_t &s, uint32_t &f, const AJATimeBase &timeBase, bool bDropFrame) const |
void | Set (uint32_t frame) |
void | Set (const std::string &str, const AJATimeBase &timeBase) |
void | SetWithCleanup (const std::string &str, const AJATimeBase &timeBase, bool bDrop) |
void | Set (const std::string &str, const AJATimeBase &timeBase, bool bDropFrame) |
void | SetHmsf (uint32_t h, uint32_t m, uint32_t s, uint32_t f, const AJATimeBase &timeBase, bool bDropFrame, bool bStdTcForHfr, uint32_t addFrame) |
void | SetHmsf (uint32_t h, uint32_t m, uint32_t s, uint32_t f, const AJATimeBase &timeBase, bool bDropFrame) |
void | SetSMPTEString (const char *pBufr, const AJATimeBase &timeBase) |
void | SetRP188 (const uint32_t inDBB, const uint32_t inLo, const uint32_t inHi, const AJATimeBase &inTimeBase) |
void | QueryRP188 (uint32_t &outDBB, uint32_t &outLo, uint32_t &outHi, const AJATimeBase &timeBase, const bool bDrop) |
void | SetStdTimecodeForHfr (bool bStdTc) |
AJATimeCode & | operator= (const AJATimeCode &val) |
AJATimeCode & | operator+= (const AJATimeCode &val) |
AJATimeCode & | operator-= (const AJATimeCode &val) |
AJATimeCode & | operator+= (const int32_t val) |
AJATimeCode & | operator-= (const int32_t val) |
const AJATimeCode | operator+ (const AJATimeCode &val) const |
const AJATimeCode | operator+ (const int32_t val) const |
const AJATimeCode | operator- (const AJATimeCode &val) const |
const AJATimeCode | operator- (const int32_t val) const |
bool | operator== (const AJATimeCode &val) const |
bool | operator< (const AJATimeCode &val) const |
bool | operator< (const int32_t val) const |
bool | operator> (const AJATimeCode &val) const |
bool | operator> (const int32_t val) const |
bool | operator!= (const AJATimeCode &val) const |
void | QueryString (char *pStr, const AJATimeBase &tb, bool df, AJATimecodeNotation notation=AJA_TIMECODE_LEGACY) |
void | QueryRP188 (uint32_t *pDbb, uint32_t *pLo, uint32_t *pHi, const AJATimeBase &tb, bool drop) |
Static Public Member Functions | |
static uint32_t | CalcFrame (uint32_t h, uint32_t m, uint32_t s, uint32_t f, const AJATimeBase &timeBase, bool bDropFrame, bool bStdTcForHfr, uint32_t addFrame) |
static uint32_t | CalcHmsf (uint32_t &h, uint32_t &m, uint32_t &s, uint32_t &f, uint32_t frame, const AJATimeBase &timeBase, bool bDropFrame, bool bStdTcForHfr) |
static int | QuerySMPTEStringSize (void) |
static bool | QueryIsDropFrame (const std::string &str) |
static int | QueryStringSize (void) |
static bool | QueryIsRP188DropFrame (const uint32_t inDBB, const uint32_t inLo, const uint32_t inHi) |
Utility class for timecodes.
This is a storage and conversion class for timecodes.
Definition at line 28 of file timecode.h.
AJATimeCode::AJATimeCode | ( | ) |
Definition at line 44 of file timecode.cpp.
AJATimeCode::AJATimeCode | ( | uint32_t | frame, |
bool | bStdTcForHfr = true |
||
) |
Definition at line 50 of file timecode.cpp.
AJATimeCode::AJATimeCode | ( | const std::string & | str, |
const AJATimeBase & | timeBase, | ||
bool | bDropFrame, | ||
bool | bStdTcForHfr = true |
||
) |
Definition at line 56 of file timecode.cpp.
AJATimeCode::AJATimeCode | ( | const std::string & | str, |
const AJATimeBase & | timeBase | ||
) |
Definition at line 62 of file timecode.cpp.
AJATimeCode::AJATimeCode | ( | const AJATimeCode & | other | ) |
Definition at line 68 of file timecode.cpp.
|
virtual |
Definition at line 77 of file timecode.cpp.
|
static |
Calculate frame count given hmsf presentation.
[in] | h | specifies the hours value. |
[in] | m | specifies the minutes value. |
[in] | s | specifies the seconds value. |
[in] | f | specifies the frames value. |
[in] | timeBase | frame rate from which to calculate string. |
[in] | bDropFrame | true if using drop frame calculation. |
[in] | bStdTcForHfr | true to use standard (LFR) frame values (1/2 frame values for framerates above 30 fps, 1/4 for rates above 60) |
[in] | addFrame | number of frames to add when bStdTcForHfr=true (e.g given 60 fps, h=m=s=0 f=29 addFrame=1 -> return=59). |
Definition at line 107 of file timecode.cpp.
|
static |
Calculate hmsf values given frame count. Return add-frame remainder when using std timecode presentation
[out] | h | specifies the hours value. |
[out] | m | specifies the minutes value. |
[out] | s | specifies the seconds value. |
[out] | f | specifies the frames value. |
[in] | frame | frame count. |
[in] | timeBase | frame rate from which to calculate hmsf values. |
[in] | bDropFrame | true to use drop frame calculation. |
[in] | bStdTcForHfr | true to use standard (LFR) frame values (1/2 frame values for framerates above 30 fps, 1/4 for rates above 60 fps) |
Definition at line 170 of file timecode.cpp.
bool AJATimeCode::operator!= | ( | const AJATimeCode & | val | ) | const |
Definition at line 701 of file timecode.cpp.
const AJATimeCode AJATimeCode::operator+ | ( | const AJATimeCode & | val | ) | const |
Definition at line 747 of file timecode.cpp.
const AJATimeCode AJATimeCode::operator+ | ( | const int32_t | val | ) | const |
Definition at line 752 of file timecode.cpp.
AJATimeCode & AJATimeCode::operator+= | ( | const AJATimeCode & | val | ) |
Definition at line 709 of file timecode.cpp.
AJATimeCode & AJATimeCode::operator+= | ( | const int32_t | val | ) |
Definition at line 715 of file timecode.cpp.
const AJATimeCode AJATimeCode::operator- | ( | const AJATimeCode & | val | ) | const |
Definition at line 760 of file timecode.cpp.
const AJATimeCode AJATimeCode::operator- | ( | const int32_t | val | ) | const |
Definition at line 765 of file timecode.cpp.
AJATimeCode & AJATimeCode::operator-= | ( | const AJATimeCode & | val | ) |
Definition at line 724 of file timecode.cpp.
AJATimeCode & AJATimeCode::operator-= | ( | const int32_t | val | ) |
Definition at line 734 of file timecode.cpp.
bool AJATimeCode::operator< | ( | const AJATimeCode & | val | ) | const |
Definition at line 669 of file timecode.cpp.
bool AJATimeCode::operator< | ( | const int32_t | val | ) | const |
Definition at line 675 of file timecode.cpp.
AJATimeCode & AJATimeCode::operator= | ( | const AJATimeCode & | val | ) |
Definition at line 643 of file timecode.cpp.
bool AJATimeCode::operator== | ( | const AJATimeCode & | val | ) | const |
Definition at line 656 of file timecode.cpp.
bool AJATimeCode::operator> | ( | const AJATimeCode & | val | ) | const |
Definition at line 685 of file timecode.cpp.
bool AJATimeCode::operator> | ( | const int32_t | val | ) | const |
Definition at line 691 of file timecode.cpp.
uint32_t AJATimeCode::QueryFrame | ( | void | ) | const |
void AJATimeCode::QueryHmsf | ( | uint32_t & | h, |
uint32_t & | m, | ||
uint32_t & | s, | ||
uint32_t & | f, | ||
const AJATimeBase & | timeBase, | ||
bool | bDropFrame | ||
) | const |
Query hmsf values showing timecode for current frame count given the passed parameters.
[out] | h | specifies the hours value. |
[out] | m | specifies the minutes value. |
[out] | s | specifies the seconds value. |
[out] | f | specifies the frames value. |
[in] | timeBase | frame rate from which to calculate string. |
[in] | bDropFrame | drop frame value for string. |
Definition at line 292 of file timecode.cpp.
|
static |
Query string showing timecode for current frame count given the passed parameters.
[in] | str | string with timecode |
Definition at line 81 of file timecode.cpp.
|
static |
Query if rp188 data is drop frame or not
[in] | inDBB | Specifies the DBB bits of the RP188 struct. |
[in] | inLo | Specifies the lo-order 32-bit word of the RP188 struct. |
[in] | inHi | Specifies the hi-order 32-bit word of the RP188 struct. |
Definition at line 563 of file timecode.cpp.
void AJATimeCode::QueryRP188 | ( | uint32_t & | outDBB, |
uint32_t & | outLo, | ||
uint32_t & | outHi, | ||
const AJATimeBase & | timeBase, | ||
const bool | bDrop | ||
) |
Get RP188 register values using the given timebase, and drop frame.
[out] | outDBB | Receives the DBB component. |
[out] | outLo | Receives the low byte component. |
[out] | outHi | Receives the high byte component. |
[in] | timeBase | Specifies the AJATimeBase to use. |
[in] | bDrop | Specify true if forcing drop-frame; otherwise false. |
Definition at line 625 of file timecode.cpp.
void AJATimeCode::QueryRP188 | ( | uint32_t * | pDbb, |
uint32_t * | pLo, | ||
uint32_t * | pHi, | ||
const AJATimeBase & | tb, | ||
bool | drop | ||
) |
Definition at line 615 of file timecode.cpp.
void AJATimeCode::QuerySMPTEString | ( | char * | pString, |
const AJATimeBase & | timeBase, | ||
bool | bDropFrame | ||
) |
Query SMPTE string showing timecode for current frame count given the passed parameters.
[out] | pString | buffer in which to place string. |
[in] | timeBase | frame rate from which to calculate string. |
[in] | bDropFrame | drop frame value for string. |
Definition at line 401 of file timecode.cpp.
|
static |
Query SMPTE string byte count.
Definition at line 396 of file timecode.cpp.
|
inline |
Query HFR divide-by-two flag.
Definition at line 122 of file timecode.h.
void AJATimeCode::QueryString | ( | char * | pStr, |
const AJATimeBase & | tb, | ||
bool | df, | ||
AJATimecodeNotation | notation = AJA_TIMECODE_LEGACY |
||
) |
Definition at line 387 of file timecode.cpp.
void AJATimeCode::QueryString | ( | std::string & | str, |
const AJATimeBase & | timeBase, | ||
bool | bDropFrame, | ||
AJATimecodeNotation | notation = AJA_TIMECODE_LEGACY |
||
) |
Query string showing timecode for current frame count given the passed parameters.
[out] | str | string in which to place timecode. |
[in] | timeBase | frame rate from which to calculate string. |
[in] | bDropFrame | drop frame value for string. |
[in] | notation | specifies AJATimecodeNotation for timecode delimiters |
Definition at line 381 of file timecode.cpp.
void AJATimeCode::QueryString | ( | std::string & | str, |
const AJATimeBase & | timeBase, | ||
bool | bDropFrame, | ||
bool | bStdTcForHfr, | ||
AJATimecodeNotation | notation = AJA_TIMECODE_LEGACY |
||
) |
Query string showing timecode for current frame count given the passed parameters.
[out] | str | string in which to place timecode. |
[in] | timeBase | frame rate from which to calculate string. |
[in] | bDropFrame | drop frame value for string. |
[in] | bStdTcForHfr | true to use standard (LFR) frame values (1/2 frame values for framerates above 30 fps, 1/4 for rates above 60) |
[in] | notation | specifies AJATimecodeNotation for timecode delimiters |
Definition at line 299 of file timecode.cpp.
|
static |
Definition at line 87 of file timecode.cpp.
void AJATimeCode::Set | ( | const std::string & | str, |
const AJATimeBase & | timeBase | ||
) |
Set current frame number.
[in] | str | xx:xx:xx:xx style string representing new frame number. |
[in] | timeBase | frame rate associated with pString. |
Definition at line 489 of file timecode.cpp.
void AJATimeCode::Set | ( | const std::string & | str, |
const AJATimeBase & | timeBase, | ||
bool | bDropFrame | ||
) |
Set current frame number.
[in] | str | xx:xx:xx:xx style string representing new frame number. |
[in] | timeBase | frame rate associated with pString. |
[in] | bDropFrame | true if forcing dropframe, false otherwise. |
Definition at line 439 of file timecode.cpp.
void AJATimeCode::Set | ( | uint32_t | frame | ) |
Set current frame number.
[in] | frame | new frame number. |
Definition at line 420 of file timecode.cpp.
void AJATimeCode::SetHmsf | ( | uint32_t | h, |
uint32_t | m, | ||
uint32_t | s, | ||
uint32_t | f, | ||
const AJATimeBase & | timeBase, | ||
bool | bDropFrame | ||
) |
Definition at line 431 of file timecode.cpp.
void AJATimeCode::SetHmsf | ( | uint32_t | h, |
uint32_t | m, | ||
uint32_t | s, | ||
uint32_t | f, | ||
const AJATimeBase & | timeBase, | ||
bool | bDropFrame, | ||
bool | bStdTcForHfr, | ||
uint32_t | addFrame | ||
) |
Set current frame number.
[in] | h | specifies the hours value. |
[in] | m | specifies the minutes value. |
[in] | s | specifies the seconds value. |
[in] | f | specifies the frames value. |
[in] | timeBase | frame rate associated with hmsf. |
[in] | bDropFrame | true if forcing dropframe, false otherwise. |
[in] | bStdTcForHfr | true to use standard (LFR) frame values (1/2 frame values for framerates above 30 fps, 1/4 for rates above 60) |
[in] | addFrame | number of frames to add when using std TC presentation (e.g given 60 fps, 00:00:00.29 addFrame=0 => set:frame=58 .. 00:00:00:29 addFrame=1 => set:frame=59). |
Definition at line 425 of file timecode.cpp.
void AJATimeCode::SetRP188 | ( | const uint32_t | inDBB, |
const uint32_t | inLo, | ||
const uint32_t | inHi, | ||
const AJATimeBase & | inTimeBase | ||
) |
Set timecode via RP188 bytes.
[in] | inDBB | Specifies the DBB bits of the RP188 struct. |
[in] | inLo | Specifies the lo-order 32-bit word of the RP188 struct. |
[in] | inHi | Specifies the hi-order 32-bit word of the RP188 struct. |
[in] | inTimeBase | Specifies the time base to use. |
Definition at line 570 of file timecode.cpp.
void AJATimeCode::SetSMPTEString | ( | const char * | pBufr, |
const AJATimeBase & | timeBase | ||
) |
Set timecode via a SMPTE string.
[in] | pBufr | pointer to string. |
[in] | timeBase | time base associated with string. |
Definition at line 549 of file timecode.cpp.
|
inline |
Set HFR divide-by-two flag.
[in] | bStdTc | Set true when using standard TC notation for HFR (e.g 01:00:00#59 -> 01:00:00:29), set to true by default |
Definition at line 220 of file timecode.h.
void AJATimeCode::SetWithCleanup | ( | const std::string & | str, |
const AJATimeBase & | timeBase, | ||
bool | bDrop | ||
) |
Set current frame number. A variant which may have junk in the string.
[in] | str | xx:xx:xx:xx style string representing new frame number. |
[in] | timeBase | frame rate associated with pString. |
[in] | bDrop | true if drop frame |
Definition at line 495 of file timecode.cpp.