MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ ensure_capacity()

void MayaFlux::Kakshya::DynamicSoundStream::ensure_capacity ( uint64_t  required_frames)

Pre-allocate capacity for the specified number of frames.

Essential for real-time scenarios where allocation delays are unacceptable.

Parameters
required_framesMinimum number of frames the container should hold

Definition at line 308 of file DynamicSoundStream.cpp.

309{
310 if (uint64_t current_frames = get_total_elements() / get_num_channels();
311 required_frames > current_frames) {
312 expand_to(required_frames);
313 }
314}
uint64_t get_total_elements() const override
Get the total number of elements in the container.

References expand_to(), MayaFlux::Kakshya::SoundStreamContainer::get_num_channels(), and MayaFlux::Kakshya::SoundStreamContainer::get_total_elements().

Referenced by enable_circular_buffer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: