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

Fills capture timestamps in rtp packets. More...

#include <timestamp_injector.h>

Inheritance diagram for roc::rtp::TimestampInjector:
Collaboration diagram for roc::rtp::TimestampInjector:

Public Member Functions

 TimestampInjector (packet::IReader &reader, const audio::SampleSpec &sample_spec)
 Initialize. More...
 
virtual ~TimestampInjector ()
 Virtual destructor. More...
 
virtual ROC_ATTR_NODISCARD status::StatusCode read (packet::PacketPtr &)
 Get packet with filled capture ts field. More...
 
void update_mapping (core::nanoseconds_t capture_ts, packet::stream_timestamp_t rtp_ts)
 Get a pair of a reference timestamps. More...
 

Detailed Description

Fills capture timestamps in rtp packets.

Remarks
Gets a pair of a reference unix-time stamp (in ns) and correspondant rtp timestamp, and approximates this dependency to a passing packet.

Definition at line 28 of file timestamp_injector.h.

Constructor & Destructor Documentation

◆ TimestampInjector()

roc::rtp::TimestampInjector::TimestampInjector ( packet::IReader reader,
const audio::SampleSpec sample_spec 
)

Initialize.

◆ ~TimestampInjector()

virtual roc::rtp::TimestampInjector::~TimestampInjector ( )
virtual

Virtual destructor.

Member Function Documentation

◆ read()

virtual ROC_ATTR_NODISCARD status::StatusCode roc::rtp::TimestampInjector::read ( packet::PacketPtr )
virtual

Get packet with filled capture ts field.

Remarks
If update_mapping has not been called yet, capture timestamp will be 0.

Implements roc::packet::IReader.

◆ update_mapping()

void roc::rtp::TimestampInjector::update_mapping ( core::nanoseconds_t  capture_ts,
packet::stream_timestamp_t  rtp_ts 
)

Get a pair of a reference timestamps.


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