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

◆ request_buffer_reset()

void MayaFlux::Nodes::Node::request_buffer_reset ( )

Requests a reset of the buffer state.

This method is called to signal that the buffer's processed state should be reset. It increments the reset counter, which is used to determine when it's safe to clear the processed state.

Definition at line 153 of file Node.cpp.

154{
155 uint32_t reset_count = m_buffer_reset_count.fetch_add(1, std::memory_order_acq_rel);
156 uint32_t buffer_count = m_buffer_count.load(std::memory_order_acquire);
157
158 if (reset_count + 1 == buffer_count || buffer_count <= 1) {
159 m_buffer_processed.store(false, std::memory_order_release);
160 m_buffer_reset_count.store(0, std::memory_order_release);
161 }
162}
std::atomic< bool > m_buffer_processed
Flag indicating whether the buffer has been processed This atomic flag is set when the buffer has bee...
Definition Node.hpp:625
std::atomic< uint32_t > m_buffer_reset_count
Counter tracking how many buffers have requested a reset.
Definition Node.hpp:634
std::atomic< uint32_t > m_buffer_count
Counter tracking how many buffers are using this node This counter is incremented when a buffer start...
Definition Node.hpp:618

References m_buffer_count, m_buffer_processed, and m_buffer_reset_count.