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

◆ capture_to_stream() [1/3]

BufferOperation MayaFlux::Kriya::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 
)
static

Capture a camera straight into a dynamic video stream it creates.

One operation opens the camera, hooks it to a buffer, makes a ring sized from that buffer's real frame size and format, and each cycle appends the camera frame to it. The stream is reached through get_graphics_stream() so playback can be set up, for example lag_behind_head.

Parameters
ring_framesFrames the ring keeps; zero keeps three seconds at the registered frame rate.
liveDraws the live camera when given.
displayDraws the stream through the pipeline's IOManager when given; the pipeline needs one.

Definition at line 272 of file BufferOperation.cpp.

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}
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.
@ AsyncIO
Async I/O operations ( network, streaming)
@ Kriya
Automatable tasks and fluent scheduling api for Nodes and Buffers.

References MayaFlux::Journal::AsyncIO, capture_to_stream(), and MayaFlux::Journal::Kriya.

Referenced by capture_to_stream(), and capture_to_stream().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: