Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
roc::rtp::TimestampExtractor Class Reference

Remembers a recent pair of capture timestamp and rtp ts. More...

#include <timestamp_extractor.h>

Inheritance diagram for roc::rtp::TimestampExtractor:
Collaboration diagram for roc::rtp::TimestampExtractor:

Public Member Functions

 TimestampExtractor (packet::IWriter &writer, const audio::SampleSpec &sample_spec)
 Initialize. More...
 
virtual ~TimestampExtractor ()
 Destroy. More...
 
virtual ROC_ATTR_NODISCARD status::StatusCode write (const packet::PacketPtr &pkt)
 Passes pkt downstream and remembers its capture and rtp timestamps. More...
 
bool has_mapping ()
 Check if mapping already available. More...
 
packet::stream_timestamp_t get_mapping (core::nanoseconds_t capture_ts)
 Get rtp timestamp mapped to given capture timestamp. More...
 

Detailed Description

Remembers a recent pair of capture timestamp and rtp ts.

Definition at line 27 of file timestamp_extractor.h.

Constructor & Destructor Documentation

◆ TimestampExtractor()

roc::rtp::TimestampExtractor::TimestampExtractor ( packet::IWriter writer,
const audio::SampleSpec sample_spec 
)

Initialize.

◆ ~TimestampExtractor()

virtual roc::rtp::TimestampExtractor::~TimestampExtractor ( )
virtual

Destroy.

Member Function Documentation

◆ get_mapping()

packet::stream_timestamp_t roc::rtp::TimestampExtractor::get_mapping ( core::nanoseconds_t  capture_ts)

Get rtp timestamp mapped to given capture timestamp.

Precondition
has_mapping() should return true, otherwise it will panic.

◆ has_mapping()

bool roc::rtp::TimestampExtractor::has_mapping ( )

Check if mapping already available.

◆ write()

virtual ROC_ATTR_NODISCARD status::StatusCode roc::rtp::TimestampExtractor::write ( const packet::PacketPtr pkt)
virtual

Passes pkt downstream and remembers its capture and rtp timestamps.

Implements roc::packet::IWriter.


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