MayaFlux 0.5.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 167 of file Node.cpp.

168{
169 uint32_t reset_count = m_buffer_reset_count.fetch_add(1, std::memory_order_acq_rel);
170 uint32_t buffer_count = m_buffer_count.load(std::memory_order_acquire);
171
172 if (reset_count + 1 == buffer_count || buffer_count <= 1) {
173 m_buffer_processed.store(false, std::memory_order_release);
174 m_buffer_reset_count.store(0, std::memory_order_release);
175 }
176}
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:767
std::atomic< uint32_t > m_buffer_reset_count
Counter tracking how many buffers have requested a reset.
Definition Node.hpp:776
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:760

References m_buffer_count, m_buffer_processed, and m_buffer_reset_count.