Spawn the capture routine, resetting the frame counter.
98{
101 "SpatialCapture: cannot start, null cache");
102 return;
103 }
104
107 "SpatialCapture: cannot start, no sources");
108 return;
109 }
110
112
113 m_state = std::make_shared<CaptureState>();
116 m_state->max_frames = max_frames;
117 m_state->recording.store(
true, std::memory_order_release);
118
120 + std::to_string(g_next_spatial_capture_id.fetch_add(1, std::memory_order_relaxed));
121
122 auto routine = [](Vruta::TaskScheduler&,
123 std::shared_ptr<CaptureState> state,
124 uint64_t interval) -> Vruta::GraphicsRoutine {
126 while (!p.should_terminate
127 && !state->stop_requested.load(std::memory_order_acquire)
129 co_await Kriya::FrameDelay { .frames_to_wait = interval };
130 }
131 state->recording.store(false, std::memory_order_release);
132 };
133
135 std::make_shared<Vruta::GraphicsRoutine>(
138
140 "SpatialCapture: recording {} stream(s) every {} frame(s), {}",
142 max_frames == 0 ? std::string("unbounded")
143 : std::format("{} frames", max_frames));
144}
#define MF_INFO(comp, ctx,...)
#define MF_ERROR(comp, ctx,...)
std::shared_ptr< SpatialCache > m_cache
std::vector< SpatialCaptureSource > m_sources
static bool run_one_frame(CaptureState &state)
One tick: write every source's stream.
std::shared_ptr< CaptureState > m_state
Vruta::TaskScheduler & m_scheduler
void stop()
Request the capture routine stop.
@ FileIO
Filesystem I/O operations.
@ IO
Networking, file handling, streaming.
GetPromiseBase< Vruta::graphics_promise > GetGraphicsPromise
Graphics domain promise accessor.