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

Audio frame. More...

#include <frame.h>

Inheritance diagram for roc::audio::Frame:
Collaboration diagram for roc::audio::Frame:

Public Types

enum  { FlagNonblank = (1 << 0) , FlagIncomplete = (1 << 1) , FlagDrops = (1 << 2) }
 Frame flags. More...
 

Public Member Functions

 Frame (sample_t *samples, size_t num_samples)
 Construct frame from samples. More...
 
void set_flags (unsigned flags)
 Set flags. More...
 
unsigned flags () const
 Get flags. More...
 
sample_tsamples () const
 Get frame data. More...
 
size_t num_samples () const
 Get frame data size. More...
 
core::nanoseconds_t capture_timestamp () const
 Get unix-epoch timestamp in ns of the 1st sample. More...
 
void set_capture_timestamp (core::nanoseconds_t capture_ts)
 Set unix-epoch timestamp in ns of the 1st sample. More...
 
void print () const
 Print frame to stderr. More...
 

Detailed Description

Audio frame.

Definition at line 25 of file frame.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Frame flags.

Enumerator
FlagNonblank 

Set if the frame has at least some samples from packets. If this flag is clear, frame is completely zero because of lack of packets.

FlagIncomplete 

Set if the frame is not fully filled with samples from packets. If this flag is set, frame is partially zero because of lack of packets.

FlagDrops 

Set if some late packets were dropped while the frame was being built. It's not necessarty that the frame itself is blank or incomplete.

Definition at line 33 of file frame.h.

Constructor & Destructor Documentation

◆ Frame()

roc::audio::Frame::Frame ( sample_t samples,
size_t  num_samples 
)

Construct frame from samples.

Remarks
The pointer is saved in the frame, no copying is performed.

Member Function Documentation

◆ capture_timestamp()

core::nanoseconds_t roc::audio::Frame::capture_timestamp ( ) const

Get unix-epoch timestamp in ns of the 1st sample.

◆ flags()

unsigned roc::audio::Frame::flags ( ) const

Get flags.

◆ num_samples()

size_t roc::audio::Frame::num_samples ( ) const

Get frame data size.

◆ print()

void roc::audio::Frame::print ( ) const

Print frame to stderr.

◆ samples()

sample_t* roc::audio::Frame::samples ( ) const

Get frame data.

◆ set_capture_timestamp()

void roc::audio::Frame::set_capture_timestamp ( core::nanoseconds_t  capture_ts)

Set unix-epoch timestamp in ns of the 1st sample.

◆ set_flags()

void roc::audio::Frame::set_flags ( unsigned  flags)

Set flags.


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