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

Frame factory. More...

#include <frame_factory.h>

Inheritance diagram for roc::audio::FrameFactory:
Collaboration diagram for roc::audio::FrameFactory:

Public Member Functions

 FrameFactory (core::IArena &arena, size_t buffer_size)
 Initialize with default pools. buffer_size defines number of bytes in frame buffer. More...
 
 FrameFactory (core::IPool &buffer_pool)
 Initialize with custom pools. buffer_pool is a pool of core::Buffer objects. More...
 
size_t byte_buffer_size () const
 Get number of bytes in byte buffer. More...
 
core::Slice< uint8_t > new_byte_buffer ()
 Allocate byte buffer. More...
 
size_t raw_buffer_size () const
 Get number of samples in raw sample buffer. More...
 
core::Slice< sample_tnew_raw_buffer ()
 Allocate raw sample buffer. More...
 

Detailed Description

Frame factory.

Allows allocating frames and frame buffers (byte buffers of appropriate size that should be attached to frame to hold payload).

Serves several purposes:

  • implements convenient and type-safe wrapper on top of memory pools
  • combines two related pools (frame pool and buffer pool) in one class
  • detaches pipeline logic from memory management interface, so that it can change independently without affecting every pipeline element

Definition at line 38 of file frame_factory.h.

Constructor & Destructor Documentation

◆ FrameFactory() [1/2]

roc::audio::FrameFactory::FrameFactory ( core::IArena arena,
size_t  buffer_size 
)

Initialize with default pools. buffer_size defines number of bytes in frame buffer.

◆ FrameFactory() [2/2]

roc::audio::FrameFactory::FrameFactory ( core::IPool buffer_pool)

Initialize with custom pools. buffer_pool is a pool of core::Buffer objects.

Member Function Documentation

◆ byte_buffer_size()

size_t roc::audio::FrameFactory::byte_buffer_size ( ) const

Get number of bytes in byte buffer.

◆ new_byte_buffer()

core::Slice<uint8_t> roc::audio::FrameFactory::new_byte_buffer ( )

Allocate byte buffer.

◆ new_raw_buffer()

core::Slice<sample_t> roc::audio::FrameFactory::new_raw_buffer ( )

Allocate raw sample buffer.

◆ raw_buffer_size()

size_t roc::audio::FrameFactory::raw_buffer_size ( ) const

Get number of samples in raw sample buffer.


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