MCPcopy Create free account
hub / github.com/ClassicOldSong/Apollo / captureThreadSync

Function captureThreadSync

src/video.cpp:2321–2347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2319 }
2320
2321 void captureThreadSync() {
2322 auto ref = capture_thread_sync.ref();
2323
2324 std::vector<std::unique_ptr<sync_session_ctx_t>> synced_session_ctxs;
2325
2326 auto &ctx = ref->encode_session_ctx_queue;
2327 auto lg = util::fail_guard([&]() {
2328 ctx.stop();
2329
2330 for (auto &ctx : synced_session_ctxs) {
2331 ctx->shutdown_event->raise(true);
2332 ctx->join_event->raise(true);
2333 }
2334
2335 for (auto &ctx : ctx.unsafe()) {
2336 ctx.shutdown_event->raise(true);
2337 ctx.join_event->raise(true);
2338 }
2339 });
2340
2341 // Encoding and capture takes place on this thread
2342 platf::adjust_thread_priority(platf::thread_priority_e::high);
2343
2344 std::vector<std::string> display_names;
2345 int display_p = -1;
2346 while (encode_run_sync(synced_session_ctxs, ctx, display_names, display_p) == encode_e::reinit) {}
2347 }
2348
2349 void capture_async(
2350 safe::mail_t mail,

Callers

nothing calls this directly

Calls 6

fail_guardFunction · 0.85
encode_run_syncFunction · 0.85
refMethod · 0.80
adjust_thread_priorityFunction · 0.50
stopMethod · 0.45
raiseMethod · 0.45

Tested by

no test coverage detected