Pull engine snapshot, write m_processed_data, append to m_data.
No-op if the backend service is unavailable or the snapshot is empty. Logs a trace-level message in those cases rather than erroring, since the first few calls during engine startup may arrive before any cycle has completed.
57{
59 return;
60
61 auto ac = std::dynamic_pointer_cast<AudioOutputContainer>(container);
62 if (!ac) {
64 "AudioOutputAccessProcessor requires an AudioOutputContainer");
66 return;
67 }
68
71 "AudioBackendService unavailable");
73 return;
74 }
75
79 "AudioOutputAccessProcessor: snapshot empty, no cycle completed yet");
81 return;
82 }
83
85
86 thread_local std::vector<std::vector<double>> tl_channels;
87
89 for (auto& ch : tl_channels)
91
96 }
97 }
98 } else {
99 tl_channels[0].assign(
snap.begin(),
snap.end());
100 }
101
102 {
103
104 std::unique_lock lock(ac->m_data_mutex);
105 auto& pd = ac->get_processed_data();
110 } else {
111 pd.resize(1);
113 }
114 }
115
116 const uint64_t write_head = ac->get_num_frames();
117
118 {
119 std::unique_lock lock(ac->m_data_mutex);
124 auto& vec = std::get<std::vector<double>>(ac->m_data[ch]);
125 vec.insert(vec.end(), tl_channels[ch].begin(), tl_channels[ch].end());
126 }
127 } else {
128 if (ac->m_data.empty())
129 ac->m_data.resize(1,
DataVariant(std::vector<double> {}));
130 auto& vec = std::get<std::vector<double>>(ac->m_data[0]);
131 vec.insert(vec.end(), tl_channels[0].begin(), tl_channels[0].end());
132 }
134 ac->setup_dimensions();
135 ac->invalidate_span_cache();
136 ac->m_double_extraction_dirty.store(true, std::memory_order_release);
137 }
138
141}
#define MF_RT_WARN(comp, ctx,...)
#define MF_RT_ERROR(comp, ctx,...)
std::atomic< bool > m_is_processing
Registry::Service::AudioBackendService * m_backend_service
OrganizationStrategy m_organization
@ ContainerProcessing
Container operations (Kakshya - file/stream/region processing)
@ Kakshya
Containers[Signalsource, Stream, File], Regions, DataProcessors.
@ PROCESSING
Container is actively being processed.
@ PROCESSED
Container has completed processing and results are available.
std::variant< std::vector< double >, std::vector< float >, std::vector< uint8_t >, std::vector< uint16_t >, std::vector< uint32_t >, std::vector< std::complex< float > >, std::vector< std::complex< double > >, std::vector< glm::vec2 >, std::vector< glm::vec3 >, std::vector< glm::vec4 >, std::vector< glm::mat4 > > DataVariant
Multi-type data storage for different precision needs.
@ PLANAR
Separate DataVariant per logical unit (LLL...RRR for stereo)
T snap(T x, T step) noexcept
Round x to the nearest multiple of step.
std::function< std::span< const double >()> get_output_snapshot
Returns a span over the last committed interleaved output buffer.