12 #ifndef ROC_AUDIO_FRAME_H_
13 #define ROC_AUDIO_FRAME_H_
void set_flags(unsigned flags)
Set flags.
packet::stream_timestamp_t duration() const
Get frame duration in terms of stream timestamps.
unsigned flags() const
Get flags.
bool is_raw() const
Check frame data is raw samples. Returns true if FlagAltFormat is not set.
bool has_duration() const
Check if duration was set.
size_t num_raw_samples() const
Get number of raw samples in frame, May be used only if is_raw() is true, otherwise use num_bytes().
void set_duration(packet::stream_timestamp_t duration)
Get frame duration in terms of stream timestamps.
Frame(sample_t *samples, size_t num_samples)
Construct frame from raw samples. Flags are set to zero.
void print() const
Print frame to stderr.
void set_capture_timestamp(core::nanoseconds_t capture_ts)
Set unix-epoch timestamp in ns of the 1st sample.
size_t num_bytes() const
Get number of bytes in frame.
sample_t * raw_samples() const
Get frame data as raw samples. May be used only if is_raw() is true, otherwise use bytes().
Frame(uint8_t *bytes, size_t num_bytes)
Construct frame from bytes. Flags are set to zero.
@ FlagNotComplete
Set if the frame is not fully filled with samples from packets. If this flag is set,...
@ FlagPacketDrops
Set if some late packets were dropped while the frame was being built. It's not necessarily that the ...
@ FlagNotBlank
Set if the frame has at least some samples from packets. If this flag is clear, frame is completely z...
@ FlagNotRaw
Set if the frame has format different from raw samples. If this flag is set, only bytes() can be used...
bool has_capture_timestamp() const
Check if capture timestamp is set.
uint8_t * bytes() const
Get frame data as bytes.
core::nanoseconds_t capture_timestamp() const
Get unix-epoch timestamp in ns of the 1st sample.
Base class for non-copyable objects.
float sample_t
Raw audio sample.
int64_t nanoseconds_t
Nanoseconds.
uint32_t stream_timestamp_t
Packet stream timestamp.
Various units used in packets.