MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
BufferOperation.cpp
Go to the documentation of this file.
1#include "BufferOperation.hpp"
2
12
15
16namespace MayaFlux::Kriya {
17
18namespace {
19
20 std::shared_ptr<Kakshya::DynamicVideoStream> make_ring(
21 const std::shared_ptr<Buffers::VideoContainerBuffer>& source,
22 uint64_t ring_frames)
23 {
24 const uint64_t frames = ring_frames > 0 ? ring_frames : 3ULL * Vruta::s_registered_frame_rate;
25
26 return std::make_shared<Kakshya::DynamicVideoStream>(Kakshya::VideoStreamSpec {
27 .width = source->get_width(),
28 .height = source->get_height(),
29 .format = source->get_format(),
30 .frame_rate = static_cast<double>(Vruta::s_registered_frame_rate),
31 .ring_frames = frames });
32 }
33
34 Buffers::ProcessingToken capture_token(const BufferCapture& capture)
35 {
36 if (capture.get_audio_buffer()) {
38 }
39 if (capture.get_graphics_buffer()) {
41 }
42 throw std::invalid_argument("Capture operation requires a source buffer");
43 }
44
45}
46
48 const std::shared_ptr<Buffers::BufferManager>& buffer_manager,
49 uint32_t input_channel,
51 uint32_t cycle_count)
52{
53 auto input_buffer = std::make_shared<Buffers::AudioBuffer>(input_channel);
54 buffer_manager->register_input_listener(input_buffer, input_channel);
55 buffer_manager->add_buffer(input_buffer, Buffers::ProcessingToken::AUDIO_BACKEND, input_channel);
56
57 BufferCapture capture(input_buffer, mode, cycle_count);
58 if (mode == BufferCapture::CaptureMode::ACCUMULATE && cycle_count == 0) {
59 capture.as_circular(4096);
60 }
61
62 return { BufferOperation::OpType::CAPTURE, std::move(capture) };
63}
64
66 const std::shared_ptr<Buffers::BufferManager>& buffer_manager,
67 uint32_t input_channel)
68{
69 auto input_buffer = std::make_shared<Buffers::AudioBuffer>(input_channel);
70 buffer_manager->register_input_listener(input_buffer, input_channel);
71 buffer_manager->add_buffer(input_buffer, Buffers::ProcessingToken::AUDIO_BACKEND, input_channel);
72 return CaptureBuilder(input_buffer);
73}
74
76 const std::shared_ptr<IO::IOManager>& io_manager,
77 const IO::CameraConfig& config,
79 uint32_t cycle_count,
80 std::optional<Portal::Graphics::RenderConfig> render)
81{
82 auto camera = io_manager->open_camera(config);
83 if (!camera) {
85 std::source_location::current(), "Failed to open camera");
86 }
87
88 auto buffer = io_manager->hook_camera_to_buffer(camera);
89 if (!buffer) {
91 std::source_location::current(), "Failed to hook camera to graphics buffer");
92 }
93
94 if (render) {
96 }
97
98 return { OpType::CAPTURE, BufferCapture(buffer, mode, cycle_count) };
99}
100
102 const std::shared_ptr<IO::IOManager>& io_manager,
103 const IO::CameraConfig& config,
104 std::optional<Portal::Graphics::RenderConfig> render)
105{
106 auto camera = io_manager->open_camera(config);
107 if (!camera) {
108 error<std::runtime_error>(Journal::Component::Kriya, Journal::Context::AsyncIO,
109 std::source_location::current(), "Failed to open camera");
110 }
111
112 auto buffer = io_manager->hook_camera_to_buffer(camera);
113 if (!buffer) {
114 error<std::runtime_error>(Journal::Component::Kriya, Journal::Context::AsyncIO,
115 std::source_location::current(), "Failed to hook camera to graphics buffer");
116 }
117
118 if (render) {
120 }
121
122 return CaptureBuilder(buffer);
123}
124
126 const std::shared_ptr<IO::IOManager>& io_manager,
127 const std::string& filepath,
128 uint32_t channel,
129 uint32_t cycle_count)
130{
131 auto file_container = io_manager->load_audio(filepath);
132 if (!file_container) {
133 error<std::runtime_error>(Journal::Component::Kriya, Journal::Context::AsyncIO, std::source_location::current(),
134 "Failed to load audio file: {}", filepath);
135 }
136
137 auto file_buffer = std::make_shared<Buffers::SoundFileBridge>(channel, file_container);
138 file_buffer->setup_processors(Buffers::ProcessingToken::AUDIO_BACKEND);
139
140 BufferCapture capture(file_buffer,
142 cycle_count);
143
145
146 return { BufferOperation::OpType::CAPTURE, std::move(capture) };
147}
148
150 const std::shared_ptr<IO::IOManager>& io_manager,
151 const std::string& filepath,
152 IO::VideoLoadConfig config,
153 uint32_t cycle_count,
154 std::optional<Portal::Graphics::RenderConfig> render)
155{
156 auto [video, audio] = io_manager->load_video(filepath, config);
157 if (!video) {
158 error<std::runtime_error>(Journal::Component::Kriya, Journal::Context::AsyncIO,
159 std::source_location::current(), "Failed to load video file: {}", filepath);
160 }
161
162 auto buffer = io_manager->hook_video_container_to_buffer(video);
163 if (!buffer) {
164 error<std::runtime_error>(Journal::Component::Kriya, Journal::Context::AsyncIO,
165 std::source_location::current(), "Failed to hook video file to graphics buffer: {}", filepath);
166 }
167
168 if (render) {
170 }
171
172 return {
175 };
176}
177
179 const std::shared_ptr<IO::IOManager>& io_manager,
180 const std::string& filepath,
181 uint32_t channel)
182{
183 auto file_container = io_manager->load_audio(filepath);
184 if (!file_container) {
185 error<std::runtime_error>(Journal::Component::Kriya, Journal::Context::AsyncIO, std::source_location::current(),
186 "Failed to load audio file: {}", filepath);
187 }
188
189 auto file_buffer = std::make_shared<Buffers::SoundFileBridge>(channel, file_container);
190 file_buffer->setup_processors(Buffers::ProcessingToken::AUDIO_BACKEND);
191
192 return CaptureBuilder(file_buffer).on_capture_processing();
193}
194
196 const std::shared_ptr<IO::IOManager>& io_manager,
197 const std::string& filepath,
198 IO::VideoLoadConfig config,
199 std::optional<Portal::Graphics::RenderConfig> render)
200{
201 auto [video, audio] = io_manager->load_video(filepath, config);
202 if (!video) {
203 error<std::runtime_error>(Journal::Component::Kriya, Journal::Context::AsyncIO,
204 std::source_location::current(), "Failed to load video file: {}", filepath);
205 }
206
207 auto buffer = io_manager->hook_video_container_to_buffer(video);
208 if (!buffer) {
209 error<std::runtime_error>(Journal::Component::Kriya, Journal::Context::AsyncIO,
210 std::source_location::current(), "Failed to hook video file to graphics buffer: {}", filepath);
211 }
212
213 if (render) {
215 }
216
217 return CaptureBuilder(buffer);
218}
219
221 const std::shared_ptr<IO::IOManager>& io_manager,
222 const std::string& filepath,
223 std::shared_ptr<Kakshya::DynamicSoundStream> target_stream,
224 uint32_t cycle_count)
225{
226 auto file_container = io_manager->load_audio(filepath);
227 if (!file_container) {
228 error<std::runtime_error>(Journal::Component::Kriya, Journal::Context::AsyncIO, std::source_location::current(),
229 "Failed to load audio file: {}", filepath);
230 }
231
232 auto temp_buffer = std::make_shared<Buffers::SoundFileBridge>(0, file_container);
233 temp_buffer->setup_processors(Buffers::ProcessingToken::AUDIO_BACKEND);
234
236 op.m_source_audio_stream = temp_buffer->get_capture_stream();
237 op.m_target_audio_stream = std::move(target_stream);
238 op.m_load_length = cycle_count;
239 return op;
240}
241
243 const std::shared_ptr<IO::IOManager>& io_manager,
244 const std::string& filepath,
245 std::shared_ptr<Kakshya::DynamicVideoStream> target_stream,
246 IO::VideoLoadConfig config,
247 uint32_t cycle_count,
248 std::optional<Portal::Graphics::RenderConfig> render)
249{
250 auto [video, audio] = io_manager->load_video(filepath, config);
251 if (!video) {
252 error<std::runtime_error>(Journal::Component::Kriya, Journal::Context::AsyncIO,
253 std::source_location::current(), "Failed to load video file: {}", filepath);
254 }
255
256 if (render) {
257 auto buffer = io_manager->hook_video_container_to_buffer(video);
258 if (!buffer) {
259 error<std::runtime_error>(Journal::Component::Kriya, Journal::Context::AsyncIO,
260 std::source_location::current(), "Failed to hook video file to graphics buffer: {}", filepath);
261 }
263 }
264
266 op.m_source_graphics_stream = std::move(video);
267 op.m_target_graphics_stream = std::move(target_stream);
268 op.m_load_length = cycle_count;
269 return op;
270}
271
273 const std::shared_ptr<IO::IOManager>& io_manager,
274 const IO::CameraConfig& config,
275 uint64_t ring_frames,
276 std::optional<Portal::Graphics::RenderConfig> live,
277 std::optional<Portal::Graphics::RenderConfig> display)
278{
279 auto camera = io_manager->open_camera(config);
280 if (!camera) {
281 error<std::runtime_error>(Journal::Component::Kriya, Journal::Context::AsyncIO,
282 std::source_location::current(), "Failed to open camera");
283 }
284
285 return capture_to_stream(io_manager, camera, ring_frames, std::move(live), std::move(display));
286}
287
289 const std::shared_ptr<IO::IOManager>& io_manager,
290 const std::shared_ptr<Kakshya::VideoStreamContainer>& container,
291 uint64_t ring_frames,
292 std::optional<Portal::Graphics::RenderConfig> live,
293 std::optional<Portal::Graphics::RenderConfig> display)
294{
295 if (!container) {
296 error<std::runtime_error>(Journal::Component::Kriya, Journal::Context::AsyncIO,
297 std::source_location::current(), "capture_to_stream: null video container");
298 }
299
300 std::shared_ptr<Buffers::VideoContainerBuffer> buffer;
301 if (const auto camera = std::dynamic_pointer_cast<Kakshya::CameraContainer>(container)) {
302 buffer = io_manager->get_camera_buffer(camera);
303 if (!buffer) {
304 buffer = io_manager->hook_camera_to_buffer(camera);
305 }
306 } else {
307 buffer = io_manager->get_video_buffer(container);
308 if (!buffer) {
309 buffer = io_manager->hook_video_container_to_buffer(container);
310 }
311 }
312
313 if (!buffer) {
314 error<std::runtime_error>(Journal::Component::Kriya, Journal::Context::AsyncIO,
315 std::source_location::current(), "Failed to hook video container to graphics buffer");
316 }
317
318 if (live) {
320 }
321
324 op.m_target_graphics_stream = make_ring(buffer, ring_frames);
325 op.m_render = std::move(display);
326 return op;
327}
328
330 const std::shared_ptr<IO::IOManager>& io_manager,
331 const std::string& filepath,
332 IO::VideoLoadConfig config,
333 uint64_t ring_frames,
334 std::optional<Portal::Graphics::RenderConfig> live,
335 std::optional<Portal::Graphics::RenderConfig> display)
336{
337 auto [video, audio] = io_manager->load_video(filepath, config);
338 if (!video) {
339 error<std::runtime_error>(Journal::Component::Kriya, Journal::Context::AsyncIO,
340 std::source_location::current(), "Failed to load video file: {}", filepath);
341 }
342
343 return capture_to_stream(io_manager, video, ring_frames, std::move(live), std::move(display));
344}
345
348{
350 op.m_transformer = std::move(transformer);
351 return op;
352}
353
354BufferOperation BufferOperation::route_to_buffer(std::shared_ptr<Buffers::AudioBuffer> target)
355{
357 op.m_target_audio_buffer = std::move(target);
358 return op;
359}
360
361BufferOperation BufferOperation::route_to_buffer(std::shared_ptr<Buffers::VKBuffer> target)
362{
364 op.m_target_graphics_buffer = std::move(target);
365 return op;
366}
367
369 std::shared_ptr<Buffers::TextureArrayBuffer> target, uint32_t layer)
370{
371 BufferOperation op = route_to_buffer(std::static_pointer_cast<Buffers::VKBuffer>(std::move(target)));
372 op.m_target_layer = layer;
373 return op;
374}
375
377 std::shared_ptr<Buffers::TextureArrayBuffer> target,
378 std::vector<std::shared_ptr<Core::VKImage>> images)
379{
380 BufferOperation op = route_to_buffer(std::static_pointer_cast<Buffers::VKBuffer>(std::move(target)));
381 op.m_source_images = std::move(images);
382 return op;
383}
384
385BufferOperation BufferOperation::route_to_container(std::shared_ptr<Kakshya::DynamicSoundStream> target, uint32_t channel)
386{
388 op.m_target_audio_stream = std::move(target);
389 op.m_target_audio_channel = channel;
390 return op;
391}
392
394 std::shared_ptr<Kakshya::DynamicVideoStream> target,
395 std::optional<Portal::Graphics::RenderConfig> render)
396{
398 op.m_target_graphics_stream = std::move(target);
399 op.m_render = std::move(render);
400 return op;
401}
402
403BufferOperation BufferOperation::load_from_container(std::shared_ptr<Kakshya::DynamicSoundStream> source,
404 std::shared_ptr<Buffers::AudioBuffer> target,
405 uint64_t start_frame,
406 uint32_t length)
407{
409 op.m_source_audio_stream = std::move(source);
410 op.m_target_audio_buffer = std::move(target);
411 op.m_start_frame = start_frame;
413 return op;
414}
415
417 std::shared_ptr<Kakshya::DynamicVideoStream> source,
418 std::shared_ptr<Buffers::VKBuffer> target,
419 uint64_t start_frame,
420 uint32_t length)
421{
423 op.m_source_graphics_stream = std::move(source);
424 op.m_target_graphics_buffer = std::move(target);
425 op.m_start_frame = start_frame;
427 return op;
428}
429
430BufferOperation BufferOperation::when(std::function<bool(uint32_t)> condition,
432{
434 op.m_condition = std::move(condition);
435 return op;
436}
437
440{
442 op.m_dispatch_handler = std::move(handler);
443 return op;
444}
445
446BufferOperation BufferOperation::fuse_data(std::vector<std::shared_ptr<Buffers::AudioBuffer>> sources,
447 TransformVectorFunction fusion_func,
448 std::shared_ptr<Buffers::AudioBuffer> target)
449{
451 op.m_source_audio_buffers = std::move(sources);
452 op.m_fusion_function = std::move(fusion_func);
453 op.m_target_audio_buffer = std::move(target);
454 return op;
455}
456
458 std::vector<std::shared_ptr<Buffers::VKBuffer>> sources,
459 TransformVectorFunction fusion_func,
460 std::shared_ptr<Buffers::VKBuffer> target)
461{
463 op.m_source_graphics_buffers = std::move(sources);
464 op.m_fusion_function = std::move(fusion_func);
465 op.m_target_graphics_buffer = std::move(target);
466 return op;
467}
468
469BufferOperation BufferOperation::fuse_containers(std::vector<std::shared_ptr<Kakshya::DynamicSoundStream>> sources,
470 TransformVectorFunction fusion_func,
471 std::shared_ptr<Kakshya::DynamicSoundStream> target)
472{
474 op.m_source_audio_streams = std::move(sources);
475 op.m_fusion_function = std::move(fusion_func);
476 op.m_target_audio_stream = std::move(target);
477 return op;
478}
479
481 std::vector<std::shared_ptr<Kakshya::DynamicVideoStream>> sources,
482 TransformVectorFunction fusion_func,
483 std::shared_ptr<Kakshya::DynamicVideoStream> target)
484{
486 op.m_source_graphics_streams = std::move(sources);
487 op.m_fusion_function = std::move(fusion_func);
488 op.m_target_graphics_stream = std::move(target);
489 return op;
490}
491
493 std::shared_ptr<Buffers::AudioBuffer> buffer,
495{
497 op.m_target_audio_buffer = std::move(buffer);
498 op.m_audio_buffer_modifier = std::move(modifier);
499 return op;
500}
501
503 std::shared_ptr<Buffers::VKBuffer> buffer,
505{
507 op.m_target_graphics_buffer = std::move(buffer);
508 op.m_graphics_buffer_modifier = std::move(modifier);
509 return op;
510}
511
512CaptureBuilder BufferOperation::capture_from(std::shared_ptr<Buffers::AudioBuffer> buffer)
513{
514 return CaptureBuilder(std::move(buffer));
515}
516
518 std::shared_ptr<Buffers::VKBuffer> buffer,
519 std::optional<Portal::Graphics::RenderConfig> render)
520{
521 if (render) {
523 }
524
525 return CaptureBuilder(std::move(buffer));
526}
527
529{
530 return CaptureBuilder(nullptr);
531}
532
534{
535 m_priority = priority;
536 return *this;
537}
538
540{
541 m_token = token;
542 return *this;
543}
544
546{
548 return *this;
549}
550
552{
553 m_tag = tag;
554 return *this;
555}
556
558{
559 if (m_type == OpType::MODIFY) {
561 } else if (m_type == OpType::CAPTURE) {
563 }
564 return *this;
565}
566
572
574{
575 m_is_streaming = true;
576 return *this;
577}
578
580 : m_type(type)
581 , m_capture(std::move(capture))
582 , m_token(capture_token(m_capture))
583 , m_tag(m_capture.get_tag())
584{
585}
586
588 : m_type(type)
589 , m_token(token)
590{
591}
592
594{
596 return true;
597 }
599 return false;
600 }
601
602 switch (op.get_type()) {
604 return true;
606 return op.is_streaming();
607 default:
608 return false;
609 }
610}
611
638
639}
uint64_t length
Definition Composite.cpp:11
std::shared_ptr< NetworkGeometryBuffer > buffer
uint32_t mode
vk::PhysicalDeviceType type
Definition VKDevice.cpp:126
size_t count
uint32_t height
BufferCapture & for_cycles(uint32_t count)
Set the number of times to execute this capture operation.
Definition Capture.cpp:44
CaptureMode
Defines the data capture and retention strategy.
Definition Capture.hpp:61
@ TRANSIENT
Single cycle capture (default) - data expires after 1 cycle.
@ ACCUMULATE
Accumulate over multiple cycles in container.
Flexible data capture interface for buffer-based processing pipelines.
Definition Capture.hpp:55
std::function< bool(uint32_t)> m_condition
Buffers::GraphicsProcessingFunction m_graphics_buffer_modifier
static BufferOperation route_to_container(std::shared_ptr< Kakshya::DynamicSoundStream > target, uint32_t channel=0)
Create a routing operation to DynamicSoundStream destination.
static CaptureBuilder capture_input_from(const std::shared_ptr< Buffers::BufferManager > &buffer_manager, uint32_t input_channel)
Create CaptureBuilder for input channel with fluent configuration.
BufferOperation & for_cycles(uint32_t count)
BufferOperation(OpType type, BufferCapture capture)
std::vector< std::shared_ptr< Buffers::AudioBuffer > > m_source_audio_buffers
static BufferOperation transform(TransformationFunction transformer, Buffers::ProcessingToken token=Buffers::ProcessingToken::AUDIO_BACKEND)
Create a transform operation with custom transformation function.
std::vector< std::shared_ptr< Buffers::VKBuffer > > m_source_graphics_buffers
std::shared_ptr< Kakshya::DynamicVideoStream > m_target_graphics_stream
Buffers::AudioProcessingFunction m_audio_buffer_modifier
BufferOperation & as_process_phase()
Hint that this operation should execute in process phase.
static bool is_capture_phase_operation(const BufferOperation &op)
std::shared_ptr< Buffers::VKBuffer > m_source_graphics_buffer
static BufferOperation capture_to_stream(const std::shared_ptr< IO::IOManager > &io_manager, const IO::CameraConfig &config, uint64_t ring_frames=0, std::optional< Portal::Graphics::RenderConfig > live=std::nullopt, std::optional< Portal::Graphics::RenderConfig > display=std::nullopt)
Capture a camera straight into a dynamic video stream it creates.
static BufferOperation capture(BufferCapture capture)
Create a capture operation using BufferCapture configuration.
BufferOperation & with_tag(const std::string &tag)
Assign identification tag.
static BufferOperation load_from_container(std::shared_ptr< Kakshya::DynamicSoundStream > source, std::shared_ptr< Buffers::AudioBuffer > target, uint64_t start_frame=0, uint32_t length=0)
Create a load operation from container to buffer.
BufferOperation & every_n_cycles(uint32_t n)
Set cycle interval for periodic execution.
static BufferOperation fuse_containers(std::vector< std::shared_ptr< Kakshya::DynamicSoundStream > > sources, TransformVectorFunction fusion_func, std::shared_ptr< Kakshya::DynamicSoundStream > target)
Create a fusion operation for multiple DynamicSoundStream sources.
std::shared_ptr< Buffers::AudioBuffer > m_target_audio_buffer
static CaptureBuilder capture_camera_from(const std::shared_ptr< IO::IOManager > &io_manager, const IO::CameraConfig &config, std::optional< Portal::Graphics::RenderConfig > render=std::nullopt)
Open a camera and return its capture builder.
std::shared_ptr< Kakshya::VideoStreamContainer > m_source_graphics_stream
static BufferOperation capture_file(const std::shared_ptr< IO::IOManager > &io_manager, const std::string &filepath, uint32_t channel=0, uint32_t cycle_count=0)
Create a file capture operation that reads from file and stores in stream.
static BufferOperation file_to_stream(const std::shared_ptr< IO::IOManager > &io_manager, const std::string &filepath, std::shared_ptr< Kakshya::DynamicSoundStream > target_stream, uint32_t cycle_count=0)
Create operation to route file data to DynamicSoundStream.
bool is_streaming() const
Check if this operation is a streaming operation.
static BufferOperation route_to_buffer(std::shared_ptr< Buffers::AudioBuffer > target)
Create a routing operation to AudioBuffer destination.
TransformVectorFunction m_fusion_function
static BufferOperation capture_camera(const std::shared_ptr< IO::IOManager > &io_manager, const IO::CameraConfig &config, BufferCapture::CaptureMode mode=BufferCapture::CaptureMode::TRANSIENT, uint32_t cycle_count=1, std::optional< Portal::Graphics::RenderConfig > render=std::nullopt)
Open and capture a camera through IOManager.
std::vector< std::shared_ptr< Core::VKImage > > m_source_images
BufferOperation & with_priority(uint8_t priority)
Set execution priority for scheduler ordering.
static CaptureBuilder capture_from(std::shared_ptr< Buffers::AudioBuffer > buffer)
Create a CaptureBuilder for fluent capture configuration.
BufferOperation & on_token(Buffers::ProcessingToken token)
Set processing token for execution context.
OpType get_type() const
Getters for internal state (read-only)
Buffers::ProcessingToken m_token
static BufferOperation dispatch_to(OperationFunction handler, Buffers::ProcessingToken token=Buffers::ProcessingToken::AUDIO_BACKEND)
Create a dispatch operation for external processing.
static BufferOperation capture_input(const std::shared_ptr< Buffers::BufferManager > &buffer_manager, uint32_t input_channel, BufferCapture::CaptureMode mode=BufferCapture::CaptureMode::ACCUMULATE, uint32_t cycle_count=0)
Create capture operation from input channel using convenience API.
static BufferOperation when(std::function< bool(uint32_t)> condition, Buffers::ProcessingToken token=Buffers::ProcessingToken::AUDIO_BACKEND)
Create a conditional operation for pipeline branching.
std::vector< std::shared_ptr< Kakshya::DynamicVideoStream > > m_source_graphics_streams
std::shared_ptr< Kakshya::DynamicSoundStream > m_source_audio_stream
static BufferOperation modify_buffer(std::shared_ptr< Buffers::AudioBuffer > buffer, Buffers::AudioProcessingFunction modifier)
Create a modify operation for direct buffer manipulation.
std::vector< std::shared_ptr< Kakshya::DynamicSoundStream > > m_source_audio_streams
TransformationFunction m_transformer
BufferOperation & as_streaming()
Mark this operation as streaming (executes continuously) Useful for modify_buffer and similar statefu...
std::shared_ptr< Kakshya::DynamicSoundStream > m_target_audio_stream
OpType
Defines the fundamental operation types in the processing pipeline.
@ BRANCH
Branch to sub-pipeline based on conditions.
@ SYNC
Synchronize with timing/cycles for coordination.
@ LOAD
Load data from container to buffer with position control.
@ CONDITION
Conditional operation for branching logic.
@ FUSE
Fuse multiple sources using custom fusion functions.
@ ROUTE
Route data to destination (buffer or container)
@ CAPTURE
Capture data from source buffer using BufferCapture strategy.
@ MODIFY
Modify Buffer Data using custom quick process.
@ DISPATCH
Dispatch to external handler for custom processing.
@ TRANSFORM
Apply transformation function to data variants.
static BufferOperation fuse_data(std::vector< std::shared_ptr< Buffers::AudioBuffer > > sources, TransformVectorFunction fusion_func, std::shared_ptr< Buffers::AudioBuffer > target)
Create a fusion operation for multiple AudioBuffer sources.
std::shared_ptr< Buffers::VKBuffer > m_target_graphics_buffer
std::optional< Portal::Graphics::RenderConfig > m_render
static bool is_process_phase_operation(const BufferOperation &op)
static CaptureBuilder capture_file_from(const std::shared_ptr< IO::IOManager > &io_manager, const std::string &filepath, uint32_t channel=0)
Create CaptureBuilder for file with fluent configuration.
ExecutionPhase get_execution_phase() const
Get the execution phase hint for this operation.
Fundamental unit of operation in buffer processing pipelines.
CaptureBuilder & on_capture_processing()
Set processing control to ON_CAPTURE mode.
Definition Capture.cpp:118
Fluent builder interface for constructing BufferCapture configurations.
Definition Capture.hpp:249
std::function< void(const std::shared_ptr< AudioBuffer > &)> AudioProcessingFunction
Audio processing function - receives correctly-typed AudioBuffer.
ProcessingToken
Bitfield enum defining processing characteristics and backend requirements for buffer operations.
@ AUDIO_BACKEND
Standard audio processing backend configuration.
@ GRAPHICS_BACKEND
Standard graphics processing backend configuration.
std::function< void(const std::shared_ptr< VKBuffer > &)> GraphicsProcessingFunction
Graphics processing function - receives correctly-typed VKBuffer.
@ AsyncIO
Async I/O operations ( network, streaming)
@ Kriya
Automatable tasks and fluent scheduling api for Nodes and Buffers.
bool ensure_rendering(const std::shared_ptr< Buffers::VKBuffer > &buffer, const Portal::Graphics::RenderConfig &config)
Make a buffer draw to the window in a render config, unless it already does.
std::function< Kakshya::DataVariant(std::vector< Kakshya::DataVariant > &, uint32_t)> TransformVectorFunction
std::function< Kakshya::DataVariant(Kakshya::DataVariant &, uint32_t)> TransformationFunction
Definition Capture.hpp:18
std::function< void(Kakshya::DataVariant &, uint32_t)> OperationFunction
Definition Capture.hpp:17
Source source()
Begin a Source chain.
Definition Plot.hpp:127
MAYAFLUX_API uint32_t s_registered_frame_rate
Definition Clock.cpp:10
Configuration for opening a camera device via FFmpeg.