Gamp v0.0.7-54-gccdc599
Gamp: Graphics, Audio, Multimedia and Processing
Loading...
Searching...
No Matches
gamp::av::TimeFrameI Class Reference

Integer time frame in milliseconds, maybe specialized for texture/video, audio, . More...

#include <TimeFrameI.hpp>

Inheritance diagram for gamp::av::TimeFrameI:
Collaboration diagram for gamp::av::TimeFrameI:

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ TimeFrameI() [1/2]

gamp::av::TimeFrameI::TimeFrameI ( )
inlineconstexprnoexcept

Ctor w/ zero duration and INVALID_PTS.

Definition at line 63 of file TimeFrameI.hpp.

◆ TimeFrameI() [2/2]

gamp::av::TimeFrameI::TimeFrameI ( uint32_t pts,
uint32_t duration )
inlineconstexprnoexcept

Create a new instance.

Parameters
ptsframe pts in milliseconds, see pts()
durationframe duration in milliseconds, see duration()
See also
pts()
duration()

Definition at line 74 of file TimeFrameI.hpp.

Member Function Documentation

◆ pts()

uint32_t gamp::av::TimeFrameI::pts ( ) const
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.

Here is the caller graph for this function:

◆ setPTS()

void gamp::av::TimeFrameI::setPTS ( uint32_t pts)
inlinenoexcept

Set this frame's presentation timestamp (PTS) in milliseconds.

See also
pts()

Definition at line 92 of file TimeFrameI.hpp.

◆ duration()

uint32_t gamp::av::TimeFrameI::duration ( ) const
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.

Here is the caller graph for this function:

◆ setDuration()

void gamp::av::TimeFrameI::setDuration ( uint32_t duration)
inlinenoexcept

Set this frame's duration in milliseconds.

See also
duration()

Definition at line 107 of file TimeFrameI.hpp.

◆ toString()

std::string gamp::av::TimeFrameI::toString ( )
inlinenoexcept

Definition at line 109 of file TimeFrameI.hpp.

Member Data Documentation

◆ INVALID_PTS

uint32_t gamp::av::TimeFrameI::INVALID_PTS = std::numeric_limits<uint32_t>::max()
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.

◆ END_OF_STREAM_PTS

uint32_t gamp::av::TimeFrameI::END_OF_STREAM_PTS = std::numeric_limits<uint32_t>::max() - 1
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.

◆ m_pts

uint32_t gamp::av::TimeFrameI::m_pts
protected

Definition at line 56 of file TimeFrameI.hpp.

◆ m_duration

uint32_t gamp::av::TimeFrameI::m_duration
protected

Definition at line 57 of file TimeFrameI.hpp.


The documentation for this class was generated from the following file: