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

◆ stop_capture()

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, then calls stop_video_capture(). No-op with a warning if no capture is active for this window.

Parameters
windowWindow previously passed to capture_window().

Definition at line 673 of file IOManager.cpp.

674{
675 if (!window) {
677 "stop_capture(window): null window");
678 return;
679 }
680
681 uint32_t found_id = 0;
682 {
683 std::lock_guard lock(m_video_captures_mutex);
684 for (const auto& [id, state] : m_video_captures) {
685 if (state.writer->capture_window() == window) {
686 found_id = id;
687 break;
688 }
689 }
690 }
691
692 if (found_id == 0) {
694 "stop_capture(window): no active capture for window '{}'",
695 window->get_create_info().title);
696 return;
697 }
698
699 stop_video_capture(found_id);
700}
#define MF_WARN(comp, ctx,...)
std::weak_ptr< Core::Window > window
Definition Picker.cpp:23
void stop_video_capture(uint32_t capture_id)
Stop a running video 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, stop_video_capture(), and window.

+ Here is the call graph for this function: