MCPcopy Create free account
hub / github.com/RGAA-Software/GoDesk / ProcessSwitchMonitor

Method ProcessSwitchMonitor

src/render/plugins/plugin_net_event_router.cpp:387–422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

385 }
386
387 void PluginNetEventRouter::ProcessSwitchMonitor(std::shared_ptr<Message>&& msg) {
388 app_->PostGlobalTask([=, this]() {
389 auto sm = msg->switch_monitor();
390 auto capture_plugin = app_->GetWorkingMonitorCapturePlugin();
391 if (!capture_plugin) {
392 return;
393 }
394 capture_plugin->SetCaptureMonitor(sm.name());
395 //plugin->SendCapturingMonitorMessage();
396
397 auto encoder_plugins = app_->GetWorkingVideoEncoderPlugins();
398 for (const auto& [k, encoder_plugin] : encoder_plugins) {
399 if (encoder_plugin) {
400 encoder_plugin->InsertIdr();
401 }
402 }
403
404 auto cm_msg = CaptureMonitorInfoMessage {
405 .monitors_ = capture_plugin->GetCaptureMonitorInfo(),
406 .capturing_monitor_name_ = capture_plugin->GetCapturingMonitorName(),
407 };
408 //msg_notifier_->SendAppMessage(msg);
409 //win_event_replayer_->UpdateCaptureMonitorInfo(cm_msg);
410 if (auto erp_plugin = plugin_manager_->GetEventsReplayerPlugin(); erp_plugin) {
411 erp_plugin->UpdateCaptureMonitorInfo(cm_msg);
412 }
413
414 int mon_index = 0;
415 auto mon_index_res = capture_plugin->GetMonIndexByName(sm.name());
416 if (mon_index_res.has_value()) {
417 mon_index = mon_index_res.value();
418 }
419 auto proto_msg = NetMessageMaker::MakeMonitorSwitched(sm.name(), mon_index);
420 app_->PostNetMessage(proto_msg);
421 });
422 }
423
424 void PluginNetEventRouter::ProcessSwitchWorkMode(std::shared_ptr<Message>&& msg) {
425 app_->PostGlobalTask([=, this]() {

Callers

nothing calls this directly

Calls 11

PostGlobalTaskMethod · 0.80
GetMonIndexByNameMethod · 0.80
SetCaptureMonitorMethod · 0.45
InsertIdrMethod · 0.45
GetCaptureMonitorInfoMethod · 0.45
PostNetMessageMethod · 0.45

Tested by

no test coverage detected