MayaFlux 1.0.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 173 of file Node.cpp.

174{
175 uint32_t reset_count = m_buffer_reset_count.fetch_add(1, std::memory_order_acq_rel);
176 uint32_t buffer_count = m_buffer_count.load(std::memory_order_acquire);
177
178 if (reset_count + 1 == buffer_count || buffer_count <= 1) {
179 m_buffer_processed.store(false, std::memory_order_release);
180 m_buffer_reset_count.store(0, std::memory_order_release);
181 }
182}
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:788
std::atomic< uint32_t > m_buffer_reset_count
Counter tracking how many buffers have requested a reset.
Definition Node.hpp:797
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:781

References m_buffer_count, m_buffer_processed, and m_buffer_reset_count.