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

◆ processing_function()

void MayaFlux::Buffers::StreamSliceProcessor::processing_function ( const std::shared_ptr< Buffer > &  buffer)
overridevirtual

The core processing function that must be implemented by derived classes.

Parameters
bufferBuffer to process

This method is where the actual transformation logic is implemented. It should contain the algorithmic details of how the buffer's data is transformed, analyzed, or processed. The implementation can utilize any backend capabilities available to the processor, including:

  • Parallel Processing: Using multi-threading or GPU compute for large datasets
  • Data Transformations: Applying mathematical operations, filters, or effects
  • Feature Extraction: Analyzing data characteristics for further processing

Derived classes must override this method to provide specific processing behavior.

Implements MayaFlux::Buffers::BufferProcessor.

Definition at line 110 of file StreamSliceProcessor.cpp.

111{
112 auto audio = std::dynamic_pointer_cast<AudioBuffer>(buffer);
113 if (!audio)
114 return;
115
116 const uint32_t ch = audio->get_channel_id();
117 auto& dst = audio->get_data();
118 std::ranges::fill(dst, 0.0);
119
120 for (auto& slot : m_slots) {
121 if (!slot.slice.active || !slot.slice.stream || !slot.proc)
122 continue;
123
124 slot.proc->process(slot.slice.stream);
125
126 const auto& pd = slot.slice.stream->get_dynamic_data(slot.proc->get_slot_index());
127 if (pd.empty())
128 continue;
129
130 const auto structure = slot.slice.stream->get_structure();
131 std::vector<double> tmp(dst.size(), 0.0);
132 Kakshya::extract_processed_data(pd, structure.organization, structure.get_channel_count(), ch, tmp);
133
134 for (size_t s = 0; s < dst.size(); ++s)
135 dst[s] += tmp[s];
136 }
137}
void extract_processed_data(const std::vector< DataVariant > &pd, OrganizationStrategy organization, uint64_t num_channels, uint32_t ch, std::span< double > output)
Extract one channel's samples from a processed dynamic data block.

References MayaFlux::Kakshya::extract_processed_data(), and m_slots.

+ Here is the call graph for this function: