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

◆ capture_file() [1/2]

BufferOperation MayaFlux::Kriya::BufferOperation::capture_file ( const std::shared_ptr< IO::IOManager > &  io_manager,
const std::string &  filepath,
IO::VideoLoadConfig  config,
uint32_t  cycle_count = 1,
std::optional< Portal::Graphics::RenderConfig >  render = std::nullopt 
)
static

Capture a video file with explicit video load configuration.

Parameters
renderDraws the video when given.

Definition at line 149 of file BufferOperation.cpp.

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 {
174 BufferCapture(buffer, cycle_count > 1 ? BufferCapture::CaptureMode::ACCUMULATE : BufferCapture::CaptureMode::TRANSIENT, cycle_count)
175 };
176}
std::shared_ptr< NetworkGeometryBuffer > buffer
@ ACCUMULATE
Accumulate over multiple cycles in container.
@ CAPTURE
Capture data from source buffer using BufferCapture strategy.
@ 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.

References MayaFlux::Kriya::BufferCapture::ACCUMULATE, MayaFlux::Journal::AsyncIO, buffer, CAPTURE, MayaFlux::Kriya::detail::ensure_rendering(), MayaFlux::Journal::Kriya, and MayaFlux::Kriya::BufferCapture::TRANSIENT.

+ Here is the call graph for this function: