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

◆ stop_video_capture()

void MayaFlux::IO::IOManager::stop_video_capture ( uint32_t  capture_id)

Stop a running video capture and finalise the file.

Calls writer->stop_recording(), the counterpart to the record() call capture_window() made, and stores the encode future in m_save_tasks. Non-blocking.

Parameters
capture_idHandle returned by capture_window().

Definition at line 655 of file IOManager.cpp.

656{
657 VideoCaptureState state;
658 {
659 std::lock_guard lock(m_video_captures_mutex);
660 auto it = m_video_captures.find(capture_id);
661 if (it == m_video_captures.end()) {
663 "stop_video_capture: unknown capture_id={}", capture_id);
664 return;
665 }
666 state = std::move(it->second);
667 m_video_captures.erase(it);
668 }
669
670 track_save_task(state.writer->stop_recording());
671}
#define MF_WARN(comp, ctx,...)
void track_save_task(std::future< bool > fut)
Retain a save task in m_save_tasks and opportunistically reclaim finished ones.
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, track_save_task(), and MayaFlux::IO::IOManager::VideoCaptureState::writer.

Referenced by stop(), and stop_capture().

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