|
Gamp v0.0.7-54-gccdc599
Gamp: Graphics, Audio, Multimedia and Processing
|
Integer time frame in milliseconds, maybe specialized for texture/video, audio, . More...
#include <TimeFrameI.hpp>
Public Member Functions | |
| constexpr | TimeFrameI () noexcept |
| Ctor w/ zero duration and INVALID_PTS. | |
| constexpr | TimeFrameI (uint32_t pts, uint32_t duration) noexcept |
| Create a new instance. | |
| constexpr uint32_t | duration () const noexcept |
| Get this frame's duration in milliseconds. | |
| constexpr uint32_t | pts () const noexcept |
| Returns this frame's presentation timestamp (PTS) in milliseconds. | |
| void | setDuration (uint32_t duration) noexcept |
| Set this frame's duration in milliseconds. | |
| void | setPTS (uint32_t pts) noexcept |
| Set this frame's presentation timestamp (PTS) in milliseconds. | |
| std::string | toString () noexcept |
Static Public Attributes | |
| static constexpr uint32_t | END_OF_STREAM_PTS = std::numeric_limits<uint32_t>::max() - 1 |
| Constant marking the end of the stream PTS, i.e. | |
| static constexpr uint32_t | INVALID_PTS = std::numeric_limits<uint32_t>::max() |
| Constant marking an invalid (or undefined) PTS, i.e. | |
Protected Attributes | |
| uint32_t | m_duration |
| uint32_t | m_pts |
Integer time frame in milliseconds, maybe specialized for texture/video, audio, .
. animated content.
Type and value range has been chosen to suit embedded CPUs and characteristics of audio / video streaming and animations. Milliseconds of type integer with a maximum value of MAX_UINT32 - 2 or 4'294'967'293 ms will allow tracking time up 4'294'967.293 seconds or 49 days 17 hours 2 minutes and 43 seconds, see pts() and duration().
Milliseconds granularity is also more than enough to deal with A-V synchronization, where the threshold usually lies within 22ms.
Milliseconds granularity for displaying video frames might seem inaccurate for each single frame, i.e. 60Hz != 16ms, however, accumulated values diminish this error and vertical sync is achieved by build-in V-Sync of the video drivers.
Definition at line 47 of file TimeFrameI.hpp.
|
inlineconstexprnoexcept |
Ctor w/ zero duration and INVALID_PTS.
Definition at line 63 of file TimeFrameI.hpp.
|
inlineconstexprnoexcept |
Create a new instance.
| pts | frame pts in milliseconds, see pts() |
| duration | frame duration in milliseconds, see duration() |
Definition at line 74 of file TimeFrameI.hpp.
|
inlineconstexprnoexcept |
Returns this frame's presentation timestamp (PTS) in milliseconds.
The relative millisecond PTS since start of the presentation stored in integer covers a time span of 4'294'967'293 ms or 4'294'967 seconds or 49 days.
Definition at line 86 of file TimeFrameI.hpp.
|
inlinenoexcept |
Set this frame's presentation timestamp (PTS) in milliseconds.
Definition at line 92 of file TimeFrameI.hpp.
|
inlineconstexprnoexcept |
Get this frame's duration in milliseconds.
The duration stored in integer covers 4'294'967'293 ms or 4'294'967 seconds or 49 days.
Definition at line 101 of file TimeFrameI.hpp.
|
inlinenoexcept |
Set this frame's duration in milliseconds.
Definition at line 107 of file TimeFrameI.hpp.
|
inlinenoexcept |
Definition at line 109 of file TimeFrameI.hpp.
|
staticconstexpr |
Constant marking an invalid (or undefined) PTS, i.e.
MAX_UINT32 == 0xffffffff. Sync w/ native code.
Definition at line 50 of file TimeFrameI.hpp.
|
staticconstexpr |
Constant marking the end of the stream PTS, i.e.
MAX_UINT32 == 0xfffffffe. Sync w/ native code.
Definition at line 53 of file TimeFrameI.hpp.
|
protected |
Definition at line 56 of file TimeFrameI.hpp.
|
protected |
Definition at line 57 of file TimeFrameI.hpp.