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 Memory::SeqlockWriteGuard g(ac->m_data_lock);
104 auto& pd = ac->get_processed_data();
109 } else {
110 pd.resize(1);
112 }
113 }
114
115 const uint64_t write_head = ac->get_num_frames();
116
117 {
118 Memory::SeqlockWriteGuard g(ac->m_data_lock);
123 auto& vec = std::get<std::vector<double>>(ac->m_data[ch]);
124 vec.insert(vec.end(), tl_channels[ch].begin(), tl_channels[ch].end());
125 }
126 } else {
127 if (ac->m_data.empty())
128 ac->m_data.resize(1,
DataVariant(std::vector<double> {}));
129 auto& vec = std::get<std::vector<double>>(ac->m_data[0]);
130 vec.insert(vec.end(), tl_channels[0].begin(), tl_channels[0].end());
131 }
133 ac->setup_dimensions();
134 ac->invalidate_span_cache();
135 ac->m_double_extraction_dirty.store(true, std::memory_order_release);
136 }
137
140}
#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.