MayaFlux 0.3.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 163 of file AudioSubsystem.cpp.

164{
165 m_callback_active.fetch_add(1, std::memory_order_acquire);
166 if (m_handle == nullptr) {
168 "Invalid processing handle");
169 m_callback_active.fetch_sub(1, std::memory_order_release);
170 return 1;
171 }
172
173 if (!m_is_running.load(std::memory_order_acquire)) {
174 if (input_buffer) {
175 auto total_samples = static_cast<uint32_t>(num_frames * m_stream_info.input.channels);
176 std::memset(input_buffer, 0, total_samples * sizeof(double));
177 }
178 m_callback_active.fetch_sub(1, std::memory_order_release);
179 return 0;
180 }
181
182 m_handle->buffers.process_input(input_buffer, m_stream_info.input.channels, num_frames);
183
184 m_callback_active.fetch_sub(1, std::memory_order_release);
185 return 0;
186}
#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: