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

◆ stop_capture() [1/2]

void MayaFlux::IO::IOManager::stop_capture ( const std::shared_ptr< Core::Window > &  window)

Stop the active window capture and finalise the file.

Convenience overload that resolves the capture id by window pointer. No-op with a warning if no capture is active for this window.

Parameters
windowWindow previously passed to capture_window().

Definition at line 510 of file IOManager.cpp.

511{
512 if (!window) {
514 "stop_capture(window): null window");
515 return;
516 }
517
518 uint32_t found_id = 0;
519 {
520 std::lock_guard lock(m_video_captures_mutex);
521 for (const auto& [id, state] : m_video_captures) {
522 if (state.writer->capture_window() == window) {
523 found_id = id;
524 break;
525 }
526 }
527 }
528
529 if (found_id == 0) {
531 "stop_capture(window): no active capture for window '{}'",
532 window->get_create_info().title);
533 return;
534 }
535
536 stop_capture(found_id);
537}
#define MF_WARN(comp, ctx,...)
void stop_capture(uint32_t capture_id)
Stop a running capture and finalise the file.
std::mutex m_video_captures_mutex
std::unordered_map< uint32_t, VideoCaptureState > m_video_captures
@ FileIO
Filesystem I/O operations.
@ IO
Networking, file handling, streaming.

References MayaFlux::Journal::FileIO, MayaFlux::Journal::IO, m_video_captures, m_video_captures_mutex, MF_WARN, and stop_capture().

+ Here is the call graph for this function: