|
Gamp v0.0.7-54-gccdc599
Gamp: Graphics, Audio, Multimedia and Processing
|
Presentation Timestamp (PTS) with added System Clock Reference (SCR) via set(long, int) and its interpolation via get(long), as well as giving raw access via getLast().
More...
#include <PTS.hpp>
Public Types | |
| typedef jau::function< float()> | FloatValue |
| An external float value getter. | |
Public Member Functions | |
| PTS (FloatValue speed) noexcept | |
Create new instance, initializing pts with TimeFrameI#INVALID_PTS and system-clock timestamp with zero. | |
| PTS (FloatValue speed, uint64_t scr, uint32_t pts) noexcept | |
| Create new instance. | |
| constexpr_atomic uint32_t | diff (uint64_t currentMillis, const PTS &rhs) const noexcept |
Returns get(long) - rhs. | |
| constexpr_atomic uint32_t | diffLast (const PTS &rhs) const noexcept |
Returns getLast() - rhs. | |
| constexpr_atomic uint32_t | get (uint64_t currentMillis) const noexcept |
Returns the last() updated PTS, interpolated by scr() System Clock Reference (SCR) delta to given currentMillis and playback getSpeed(). | |
| uint32_t | getCurrent () const noexcept |
Returns get(long) passing Clock#currentMillis(). | |
| std::string | getLastTimeStr (bool addFractions) const noexcept |
Returns getLast() as time string representation via toTimeStr(long, boolean). | |
| std::string | getSCRTimeStr (bool addFractions) const noexcept |
Returns scr() as time string representation via toTimeStr(long, boolean). | |
| float | getSpeed () const noexcept |
| Returns the external playback speed. | |
| std::string | getTimeStr (uint64_t currentMillis, bool addFractions) |
Returns get(long) as time string representation via toTimeStr(long, boolean). | |
| constexpr_atomic bool | isEOS () const noexcept |
Returns true if getLast() equals to TimeFrameI#END_OF_STREAM_PTS, indicating end of stream (EOS). | |
| constexpr_atomic bool | isValid () const noexcept |
Returns true if getLast() is unequal to TimeFrameI#INVALID_PTS. | |
| constexpr_atomic uint32_t | last () const noexcept |
Returns the last updated PTS value via set(long, int) w/o System Clock Reference (SCR) interpolation. | |
| constexpr_atomic uint64_t | scr () const noexcept |
Returns the System Clock Reference (SCR) in milliseconds of last PTS update via set(long, int). | |
| void | set (const PTS &other) noexcept |
Updates the PTS value with values from other PTS instance. | |
| void | set (uint64_t scr, uint32_t pts) noexcept |
| Updates the PTS value with given System Clock Reference (SCR) in milliseconds. | |
| void | setPTS (uint32_t pts) noexcept |
Sets the PTS value, see set(long, int). | |
| void | setSCR (uint64_t currentMillis) noexcept |
Sets the System Clock Reference (SCR) in milliseconds of last PTS update, see set(long, int). | |
| std::string | toString () noexcept |
| std::string | toString (uint64_t currentMillis) noexcept |
| std::string | toTimeStr (uint64_t millis) |
| Returns a full time string representation 'HH:mm:ss.SSS'. | |
| std::string | toTimeStr (uint64_t millis, bool addFractions) const noexcept |
| Returns a time string representation '[HH:]mm:ss[.SSS]', dropping unused hour quantities and fractions of seconds optionally. | |
Static Public Member Functions | |
| static uint32_t | toMillis (const std::string &datestr) noexcept |
| Returns milliseconds from given string representation in '[H[H]:]m[m]:s[s][.S*]'. | |
Presentation Timestamp (PTS) with added System Clock Reference (SCR) via set(long, int) and its interpolation via get(long), as well as giving raw access via getLast().
The relative millisecond PTS since start of the presentation stored in uint32_t covers a time span of 4'294'967'293 ms or 4'294'967 seconds or 49 days.
| typedef jau::function<float()> gamp::av::PTS::FloatValue |
|
inlinenoexcept |
Create new instance, initializing pts with TimeFrameI#INVALID_PTS and system-clock timestamp with zero.
| speed | external FloatValue getter for playback speed. |
Definition at line 59 of file PTS.hpp.
|
inlinenoexcept |
Create new instance.
| speed | external FloatValue getter for playback speed. |
| scr | System Clock Reference (SCR) in milliseconds of taken pts value, i.e. Clock#currentMillis(). |
| pts | the presentation timestamp (PTS) in milliseconds |
|
inlinenoexcept |
Returns true if getLast() is unequal to TimeFrameI#INVALID_PTS.
|
inlinenoexcept |
Returns true if getLast() equals to TimeFrameI#END_OF_STREAM_PTS, indicating end of stream (EOS).
|
inlinenoexcept |
Returns the System Clock Reference (SCR) in milliseconds of last PTS update via set(long, int).
Definition at line 81 of file PTS.hpp.
|
inlinenoexcept |
Returns scr() as time string representation via toTimeStr(long, boolean).
|
inlinenoexcept |
Returns the last updated PTS value via set(long, int) w/o System Clock Reference (SCR) interpolation.
Definition at line 89 of file PTS.hpp.
|
inlinenoexcept |
Returns getLast() as time string representation via toTimeStr(long, boolean).
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Sets the PTS value, see set(long, int).
|
inlinenoexcept |
Sets the System Clock Reference (SCR) in milliseconds of last PTS update, see set(long, int).
|
inlinenoexcept |
|
inlinenoexcept |
Returns the last() updated PTS, interpolated by scr() System Clock Reference (SCR) delta to given currentMillis and playback getSpeed().
last_pts + (uint32_t) ( ( currentMillis - SCR ) * speed + 0.5f )
| currentMillis | current system clock in milliseconds, i.e. Clock#currentMillis(). |
Definition at line 131 of file PTS.hpp.
|
inlinenoexcept |
Returns get(long) passing Clock#currentMillis().
|
inline |
Returns get(long) as time string representation via toTimeStr(long, boolean).
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Returns a time string representation '[HH:]mm:ss[.SSS]', dropping unused hour quantities and fractions of seconds optionally.
| millis | complete time in milliseconds |
| addFractions | toggle for fractions of seconds |
Definition at line 163 of file PTS.hpp.
|
inline |
|
staticnoexcept |
Returns milliseconds from given string representation in '[H[H]:]m[m]:s[s][.S*]'.
| v | the timestamp string to parse. |
Definition at line 44 of file gamp_av_base.cpp.