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

◆ process_input()

int MayaFlux::Core::AudioSubsystem::process_input ( double *  input_buffer,
unsigned int  num_frames 
)

Processes input data from audio interface.

Parameters
input_bufferPointer to interleaved input data
num_framesNumber of frames to process
Returns
Status code (0 for success)

Handles incoming audio data from the audio interface, converting from interleaved format and routing to appropriate buffer channels for processing.

Definition at line 157 of file AudioSubsystem.cpp.

158{
159 m_callback_active.fetch_add(1, std::memory_order_acquire);
160 if (m_handle == nullptr) {
162 "Invalid processing handle");
163 m_callback_active.fetch_sub(1, std::memory_order_release);
164 return 1;
165 }
166
167 if (!m_is_running.load(std::memory_order_acquire)) {
168 if (input_buffer) {
169 auto total_samples = static_cast<uint32_t>(num_frames * m_stream_info.input.channels);
170 std::memset(input_buffer, 0, total_samples * sizeof(double));
171 }
172 m_callback_active.fetch_sub(1, std::memory_order_release);
173 return 0;
174 }
175
176 m_handle->buffers.process_input(input_buffer, m_stream_info.input.channels, num_frames);
177
178 m_callback_active.fetch_sub(1, std::memory_order_release);
179 return 0;
180}
#define MF_RT_ERROR(comp, ctx,...)
std::atomic< int > m_callback_active
Active callback counter.
std::atomic< bool > m_is_running
Subsystem running state.
GlobalStreamInfo m_stream_info
Audio stream configuration.
SubsystemProcessingHandle * m_handle
Reference to processing handle.
void process_input(double *input_data, uint32_t num_channels, uint32_t num_frames)
@brienf Process Input from backend into buffer manager
BufferProcessingHandle buffers
Buffer processing interface.
@ AudioCallback
Audio callback thread - strictest real-time requirements.
@ Core
Core engine, backend, subsystems.
uint32_t channels
Number of discrete channels in this set.
ChannelConfig input
Configuration for input signal channels (disabled by default)

References MayaFlux::Journal::AudioCallback, MayaFlux::Core::SubsystemProcessingHandle::buffers, MayaFlux::Core::GlobalStreamInfo::ChannelConfig::channels, MayaFlux::Journal::Core, MayaFlux::Core::GlobalStreamInfo::input, m_callback_active, m_handle, m_is_running, m_stream_info, MF_RT_ERROR, and MayaFlux::Core::BufferProcessingHandle::process_input().

Referenced by process_audio(), and register_callbacks().

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