[fix] fix startup failure caused by wgc_plugin working directory change

This commit is contained in:
dijunkun
2026-04-14 01:53:20 +08:00
parent c1394db285
commit 3e95a7ba29
2 changed files with 18 additions and 1 deletions
@@ -1,9 +1,26 @@
#include <mutex>
#include "path_manager.h"
#include "rd_log.h"
#include "screen_capturer_wgc.h"
#include "wgc_plugin_api.h"
namespace {
void InitializePluginLogger() {
static std::once_flag once;
std::call_once(once, []() {
crossdesk::PathManager path_manager("CrossDesk");
crossdesk::InitLogger(path_manager.GetLogPath().string());
});
}
} // namespace
extern "C" {
crossdesk::ScreenCapturer* CrossDeskCreateWgcCapturer() {
InitializePluginLogger();
return new crossdesk::ScreenCapturerWgc();
}
+1 -1
View File
@@ -155,7 +155,7 @@ function setup_targets()
target("wgc_plugin")
set_kind("shared")
add_packages("libyuv")
add_deps("rd_log")
add_deps("rd_log", "path_manager")
add_defines("CROSSDESK_WGC_PLUGIN_BUILD=1")
add_links("windowsapp")
add_files("src/screen_capturer/windows/screen_capturer_wgc.cpp",