Process the current region or block of data.
Advances the read position if auto-advance is enabled.
116{
118 std::cerr << "ContiguousAccessProcessor not prepared" << '\n';
119 return;
120 }
121
123 if (!source_container || source_container.get() != container.get()) {
124 std::cerr << "Container mismatch or expired" << '\n';
125 return;
126 }
127
130
131 try {
133 std::vector<uint64_t> region_coords = { min_frame, 0 };
134
136
137 auto region_data = container->get_region_data(output_region);
138 auto& processed_data_vector = container->get_processed_data();
139
141 processed_data_vector.resize(1);
142 if (!region_data.empty()) {
144 }
145 } else {
146 uint64_t channels_to_process = std::min(
m_output_shape[1],
static_cast<uint64_t
>(region_data.size()));
147 processed_data_vector.resize(channels_to_process);
148
149 for (size_t ch = 0; ch < channels_to_process; ++ch) {
151 }
152 }
153
156
159 frames_to_advance,
163
164 if (auto stream = std::dynamic_pointer_cast<StreamContainer>(container)) {
166 }
167 }
168
170 } catch (const std::exception& e) {
171 std::cerr << "Error during processing: " << e.what() << '\n';
173 }
174
176}
std::vector< uint64_t > m_output_shape
std::chrono::steady_clock::time_point m_last_process_time
std::atomic< bool > m_is_processing
ContainerDataStructure m_structure
std::weak_ptr< SignalSourceContainer > m_source_container_weak
std::vector< uint64_t > m_current_position
@ ERROR
Container is in an error state and cannot proceed.
@ PROCESSED
Container has completed processing and results are available.
std::vector< uint64_t > advance_position(const std::vector< uint64_t > ¤t_positions, uint64_t frames_to_advance, const ContainerDataStructure &structure, bool looping_enabled, const Region &loop_region)
Advance current positions by a number of frames, with optional looping.
@ INTERLEAVED
Single DataVariant with interleaved data (LRLRLR for stereo)
void safe_copy_data_variant(const DataVariant &input, DataVariant &output)
Safely copy data from a DataVariant to another DataVariant, handling type conversion.
Region calculate_output_region(const std::vector< uint64_t > ¤t_pos, const std::vector< uint64_t > &output_shape)
Calculate output region bounds from current position and shape.
OrganizationStrategy organization