MayaFlux 0.4.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 183 of file AudioSubsystem.cpp.

184{
185 m_callback_active.fetch_add(1, std::memory_order_acquire);
186 if (m_handle == nullptr) {
188 "Invalid processing handle");
189 m_callback_active.fetch_sub(1, std::memory_order_release);
190 return 1;
191 }
192
193 if (!m_is_running.load(std::memory_order_acquire)) {
194 if (input_buffer) {
195 auto total_samples = static_cast<uint32_t>(num_frames * m_stream_info.input.channels);
196 std::memset(input_buffer, 0, total_samples * sizeof(double));
197 }
198 m_callback_active.fetch_sub(1, std::memory_order_release);
199 return 0;
200 }
201
202 m_handle->buffers.process_input(input_buffer, m_stream_info.input.channels, num_frames);
203
204 m_callback_active.fetch_sub(1, std::memory_order_release);
205 return 0;
206}
#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: