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

◆ file_to_stream() [2/2]

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

Route frames from a video file to a dynamic video stream.

Parameters
renderDraws the video file while it routes when given.

Definition at line 242 of file BufferOperation.cpp.

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}
std::shared_ptr< NetworkGeometryBuffer > buffer
BufferOperation(OpType type, BufferCapture capture)
@ ROUTE
Route data to destination (buffer or container)
@ GRAPHICS_BACKEND
Standard graphics processing backend configuration.
@ 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::Journal::AsyncIO, buffer, MayaFlux::Kriya::detail::ensure_rendering(), MayaFlux::Buffers::GRAPHICS_BACKEND, MayaFlux::Journal::Kriya, m_load_length, m_source_graphics_stream, m_target_graphics_stream, and ROUTE.

+ Here is the call graph for this function: