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

◆ enable_circular_buffer()

void MayaFlux::Kakshya::DynamicVideoStream::enable_circular_buffer ( uint64_t  capacity)

Keep only the most recent capacity frames.

Allocates the ring and discards any frames already held, so call it before appending. Use is_ring_mode and get_ring_capacity to query it.

Parameters
capacityNumber of frames to keep.

Definition at line 131 of file DynamicVideoStream.cpp.

132{
133 if (capacity == 0 || capacity > UINT32_MAX || m_width == 0 || m_height == 0) {
135 "DynamicVideoStream::enable_circular_buffer needs a capacity between 1 and {} and a non-empty frame size",
136 UINT32_MAX);
137 return;
138 }
139
140 setup_ring(capacity, static_cast<uint32_t>(capacity), m_width, m_height, m_format, m_frame_rate, 0);
141
142 m_total_source_frames = std::numeric_limits<uint64_t>::max();
143 m_write_head = 0;
145}
#define MF_ERROR(comp, ctx,...)
void setup_ring(uint64_t total_frames, uint32_t ring_capacity, uint32_t width, uint32_t height, ImageFormat format, double frame_rate, uint32_t refill_threshold, uint64_t reader_id=0)
Allocate m_data[0] as a ring of ring_capacity frames.
@ Configuration
Configuration and parameter updates.
@ Kakshya
Containers[Signalsource, Stream, File], Regions, DataProcessors.

References MayaFlux::Journal::Configuration, MayaFlux::Journal::Kakshya, MayaFlux::Kakshya::VideoStreamContainer::m_format, MayaFlux::Kakshya::VideoStreamContainer::m_frame_rate, MayaFlux::Kakshya::VideoStreamContainer::m_height, MayaFlux::Kakshya::VideoStreamContainer::m_total_source_frames, MayaFlux::Kakshya::VideoStreamContainer::m_width, m_write_head, MF_ERROR, publish_frame_count(), and MayaFlux::Kakshya::VideoStreamContainer::setup_ring().

Referenced by clear(), and DynamicVideoStream().

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