mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-12-17 20:47:01 +08:00
Compare commits
7 Commits
v1.0.2-bet
...
self-hoste
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5bd5b002d1 | ||
|
|
2f83301de7 | ||
|
|
c8152b5cbf | ||
|
|
b1df10c0de | ||
|
|
b78c9cf7d1 | ||
|
|
b3132db785 | ||
|
|
43db021326 |
19
.github/workflows/build.yml
vendored
19
.github/workflows/build.yml
vendored
@@ -292,7 +292,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
xmake f --CROSSDESK_VERSION=${{ env.VERSION_NUM }} -y
|
xmake f --CROSSDESK_VERSION=${{ env.VERSION_NUM }} -y
|
||||||
xmake b -vy crossdesk
|
xmake b -vy crossdesk
|
||||||
|
|
||||||
- name: Decode and save certificate
|
- name: Decode and save certificate
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
@@ -385,3 +385,20 @@ jobs:
|
|||||||
remote_host: ${{ secrets.SERVER_HOST }}
|
remote_host: ${{ secrets.SERVER_HOST }}
|
||||||
remote_user: ${{ secrets.SERVER_USER }}
|
remote_user: ${{ secrets.SERVER_USER }}
|
||||||
remote_key: ${{ secrets.SERVER_KEY }}
|
remote_key: ${{ secrets.SERVER_KEY }}
|
||||||
|
|
||||||
|
- name: Generate version.json
|
||||||
|
run: |
|
||||||
|
echo "{" > version.json
|
||||||
|
echo " \"latest_version\": \"${{ steps.version.outputs.VERSION_NUM }}\"" >> version.json
|
||||||
|
echo "}" >> version.json
|
||||||
|
cat version.json
|
||||||
|
|
||||||
|
- name: Upload version.json to server
|
||||||
|
uses: burnett01/rsync-deployments@5.2
|
||||||
|
with:
|
||||||
|
switches: -avzr --delete
|
||||||
|
path: version.json
|
||||||
|
remote_path: /var/www/html/version/
|
||||||
|
remote_host: ${{ secrets.SERVER_HOST }}
|
||||||
|
remote_user: ${{ secrets.SERVER_USER }}
|
||||||
|
remote_key: ${{ secrets.SERVER_KEY }}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#ifdef DESK_PORT_DEBUG
|
#ifdef CROSSDESK_DEBUG
|
||||||
#pragma comment(linker, "/subsystem:\"console\"")
|
#pragma comment(linker, "/subsystem:\"console\"")
|
||||||
#else
|
#else
|
||||||
#pragma comment(linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"")
|
#pragma comment(linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"")
|
||||||
|
|||||||
@@ -181,8 +181,9 @@ int ConfigCenter::SetServerPort(int signal_server_port) {
|
|||||||
|
|
||||||
int ConfigCenter::SetCoturnServerPort(int coturn_server_port) {
|
int ConfigCenter::SetCoturnServerPort(int coturn_server_port) {
|
||||||
coturn_server_port_ = coturn_server_port;
|
coturn_server_port_ = coturn_server_port;
|
||||||
SI_Error rc = ini_.SetLongValue(section_, "coturn_server_port",
|
ini_.SetLongValue(section_, "coturn_server_port",
|
||||||
static_cast<long>(coturn_server_port_));
|
static_cast<long>(coturn_server_port_));
|
||||||
|
SI_Error rc = ini_.SaveFile(config_path_.c_str());
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -201,6 +202,7 @@ int ConfigCenter::SetCertFilePath(const std::string& cert_file_path) {
|
|||||||
|
|
||||||
int ConfigCenter::SetSelfHosted(bool enable_self_hosted) {
|
int ConfigCenter::SetSelfHosted(bool enable_self_hosted) {
|
||||||
enable_self_hosted_ = enable_self_hosted;
|
enable_self_hosted_ = enable_self_hosted;
|
||||||
|
ini_.SetBoolValue(section_, "enable_self_hosted", enable_self_hosted_);
|
||||||
SI_Error rc = ini_.SaveFile(config_path_.c_str());
|
SI_Error rc = ini_.SaveFile(config_path_.c_str());
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
@@ -210,6 +212,12 @@ int ConfigCenter::SetSelfHosted(bool enable_self_hosted) {
|
|||||||
|
|
||||||
int ConfigCenter::SetMinimizeToTray(bool enable_minimize_to_tray) {
|
int ConfigCenter::SetMinimizeToTray(bool enable_minimize_to_tray) {
|
||||||
enable_minimize_to_tray_ = enable_minimize_to_tray;
|
enable_minimize_to_tray_ = enable_minimize_to_tray;
|
||||||
|
ini_.SetBoolValue(section_, "enable_minimize_to_tray",
|
||||||
|
enable_minimize_to_tray_);
|
||||||
|
SI_Error rc = ini_.SaveFile(config_path_.c_str());
|
||||||
|
if (rc < 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -145,6 +145,10 @@ int Render::ConnectTo(const std::string& remote_id, const char* password,
|
|||||||
memcpy(&props->params_, ¶ms_, sizeof(Params));
|
memcpy(&props->params_, ¶ms_, sizeof(Params));
|
||||||
props->params_.user_id = props->local_id_.c_str();
|
props->params_.user_id = props->local_id_.c_str();
|
||||||
props->peer_ = CreatePeer(&props->params_);
|
props->peer_ = CreatePeer(&props->params_);
|
||||||
|
|
||||||
|
for (auto& display_info : display_info_list_) {
|
||||||
|
AddVideoStream(peer_, display_info.name.c_str());
|
||||||
|
}
|
||||||
AddAudioStream(props->peer_, props->audio_label_.c_str());
|
AddAudioStream(props->peer_, props->audio_label_.c_str());
|
||||||
AddDataStream(props->peer_, props->data_label_.c_str());
|
AddDataStream(props->peer_, props->data_label_.c_str());
|
||||||
|
|
||||||
|
|||||||
@@ -258,6 +258,7 @@ int Render::LoadSettingsFromCacheFile() {
|
|||||||
enable_hardware_video_codec_ = config_center_->IsHardwareVideoCodec();
|
enable_hardware_video_codec_ = config_center_->IsHardwareVideoCodec();
|
||||||
enable_turn_ = config_center_->IsEnableTurn();
|
enable_turn_ = config_center_->IsEnableTurn();
|
||||||
enable_srtp_ = config_center_->IsEnableSrtp();
|
enable_srtp_ = config_center_->IsEnableSrtp();
|
||||||
|
enable_self_hosted_ = config_center_->IsSelfHosted();
|
||||||
|
|
||||||
language_button_value_last_ = language_button_value_;
|
language_button_value_last_ = language_button_value_;
|
||||||
video_quality_button_value_last_ = video_quality_button_value_;
|
video_quality_button_value_last_ = video_quality_button_value_;
|
||||||
@@ -265,6 +266,7 @@ int Render::LoadSettingsFromCacheFile() {
|
|||||||
enable_hardware_video_codec_last_ = enable_hardware_video_codec_;
|
enable_hardware_video_codec_last_ = enable_hardware_video_codec_;
|
||||||
enable_turn_last_ = enable_turn_;
|
enable_turn_last_ = enable_turn_;
|
||||||
enable_srtp_last_ = enable_srtp_;
|
enable_srtp_last_ = enable_srtp_;
|
||||||
|
enable_self_hosted_last_ = enable_self_hosted_;
|
||||||
|
|
||||||
LOG_INFO("Load settings from cache file");
|
LOG_INFO("Load settings from cache file");
|
||||||
|
|
||||||
|
|||||||
@@ -445,13 +445,15 @@ class Render {
|
|||||||
char signal_server_port_[6] = "9099";
|
char signal_server_port_[6] = "9099";
|
||||||
char coturn_server_port_[6] = "3478";
|
char coturn_server_port_[6] = "3478";
|
||||||
char cert_file_path_[256] = "";
|
char cert_file_path_[256] = "";
|
||||||
bool enable_self_hosted_server_ = false;
|
bool enable_self_hosted_ = false;
|
||||||
int language_button_value_last_ = 0;
|
int language_button_value_last_ = 0;
|
||||||
int video_quality_button_value_last_ = 0;
|
int video_quality_button_value_last_ = 0;
|
||||||
|
int video_frame_rate_button_value_last_ = 0;
|
||||||
int video_encode_format_button_value_last_ = 0;
|
int video_encode_format_button_value_last_ = 0;
|
||||||
bool enable_hardware_video_codec_last_ = false;
|
bool enable_hardware_video_codec_last_ = false;
|
||||||
bool enable_turn_last_ = false;
|
bool enable_turn_last_ = false;
|
||||||
bool enable_srtp_last_ = false;
|
bool enable_srtp_last_ = false;
|
||||||
|
bool enable_self_hosted_last_ = false;
|
||||||
bool enable_minimize_to_tray_ = false;
|
bool enable_minimize_to_tray_ = false;
|
||||||
bool enable_minimize_to_tray_last_ = false;
|
bool enable_minimize_to_tray_last_ = false;
|
||||||
char signal_server_ip_self_[256] = "";
|
char signal_server_ip_self_[256] = "";
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#define NV12_BUFFER_SIZE 1280 * 720 * 3 / 2
|
#define NV12_BUFFER_SIZE 1280 * 720 * 3 / 2
|
||||||
|
|
||||||
#ifdef DESK_PORT_DEBUG
|
#ifdef CROSSDESK_DEBUG
|
||||||
#else
|
#else
|
||||||
#define MOUSE_CONTROL 1
|
#define MOUSE_CONTROL 1
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -231,8 +231,7 @@ int Render::SettingWindow() {
|
|||||||
ImGui::SetCursorPosX(ENABLE_SELF_HOSTED_SERVER_CHECKBOX_PADDING_EN);
|
ImGui::SetCursorPosX(ENABLE_SELF_HOSTED_SERVER_CHECKBOX_PADDING_EN);
|
||||||
}
|
}
|
||||||
ImGui::SetCursorPosY(settings_items_offset);
|
ImGui::SetCursorPosY(settings_items_offset);
|
||||||
ImGui::Checkbox("##enable_self_hosted_server",
|
ImGui::Checkbox("##enable_self_hosted", &enable_self_hosted_);
|
||||||
&enable_self_hosted_server_);
|
|
||||||
}
|
}
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
@@ -289,14 +288,23 @@ int Render::SettingWindow() {
|
|||||||
|
|
||||||
// Video quality
|
// Video quality
|
||||||
if (video_quality_button_value_ == 0) {
|
if (video_quality_button_value_ == 0) {
|
||||||
config_center_->SetVideoQuality(ConfigCenter::VIDEO_QUALITY::HIGH);
|
config_center_->SetVideoQuality(ConfigCenter::VIDEO_QUALITY::LOW);
|
||||||
} else if (video_quality_button_value_ == 1) {
|
} else if (video_quality_button_value_ == 1) {
|
||||||
config_center_->SetVideoQuality(ConfigCenter::VIDEO_QUALITY::MEDIUM);
|
config_center_->SetVideoQuality(ConfigCenter::VIDEO_QUALITY::MEDIUM);
|
||||||
} else {
|
} else {
|
||||||
config_center_->SetVideoQuality(ConfigCenter::VIDEO_QUALITY::LOW);
|
config_center_->SetVideoQuality(ConfigCenter::VIDEO_QUALITY::HIGH);
|
||||||
}
|
}
|
||||||
video_quality_button_value_last_ = video_quality_button_value_;
|
video_quality_button_value_last_ = video_quality_button_value_;
|
||||||
|
|
||||||
|
if (video_frame_rate_button_value_ == 0) {
|
||||||
|
config_center_->SetVideoFrameRate(
|
||||||
|
ConfigCenter::VIDEO_FRAME_RATE::FPS_30);
|
||||||
|
} else if (video_frame_rate_button_value_ == 1) {
|
||||||
|
config_center_->SetVideoFrameRate(
|
||||||
|
ConfigCenter::VIDEO_FRAME_RATE::FPS_60);
|
||||||
|
}
|
||||||
|
video_frame_rate_button_value_last_ = video_frame_rate_button_value_;
|
||||||
|
|
||||||
// Video encode format
|
// Video encode format
|
||||||
if (video_encode_format_button_value_ == 0) {
|
if (video_encode_format_button_value_ == 0) {
|
||||||
config_center_->SetVideoEncodeFormat(
|
config_center_->SetVideoEncodeFormat(
|
||||||
@@ -332,11 +340,12 @@ int Render::SettingWindow() {
|
|||||||
}
|
}
|
||||||
enable_srtp_last_ = enable_srtp_;
|
enable_srtp_last_ = enable_srtp_;
|
||||||
|
|
||||||
if (enable_self_hosted_server_) {
|
if (enable_self_hosted_) {
|
||||||
config_center_->SetSelfHosted(true);
|
config_center_->SetSelfHosted(true);
|
||||||
} else {
|
} else {
|
||||||
config_center_->SetSelfHosted(false);
|
config_center_->SetSelfHosted(false);
|
||||||
}
|
}
|
||||||
|
enable_self_hosted_last_ = enable_self_hosted_;
|
||||||
|
|
||||||
settings_window_pos_reset_ = true;
|
settings_window_pos_reset_ = true;
|
||||||
|
|
||||||
@@ -366,6 +375,11 @@ int Render::SettingWindow() {
|
|||||||
video_quality_button_value_ = video_quality_button_value_last_;
|
video_quality_button_value_ = video_quality_button_value_last_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (video_frame_rate_button_value_ !=
|
||||||
|
video_frame_rate_button_value_last_) {
|
||||||
|
video_frame_rate_button_value_ = video_frame_rate_button_value_last_;
|
||||||
|
}
|
||||||
|
|
||||||
if (video_encode_format_button_value_ !=
|
if (video_encode_format_button_value_ !=
|
||||||
video_encode_format_button_value_last_) {
|
video_encode_format_button_value_last_) {
|
||||||
video_encode_format_button_value_ =
|
video_encode_format_button_value_ =
|
||||||
|
|||||||
@@ -18,7 +18,11 @@ std::filesystem::path PathManager::GetConfigPath() {
|
|||||||
|
|
||||||
std::filesystem::path PathManager::GetCachePath() {
|
std::filesystem::path PathManager::GetCachePath() {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
#ifdef CROSSDESK_DEBUG
|
||||||
|
return "cache";
|
||||||
|
#else
|
||||||
return GetKnownFolder(FOLDERID_LocalAppData) / app_name_ / "cache";
|
return GetKnownFolder(FOLDERID_LocalAppData) / app_name_ / "cache";
|
||||||
|
#endif
|
||||||
#elif __APPLE__
|
#elif __APPLE__
|
||||||
return GetEnvOrDefault("XDG_CACHE_HOME", GetHome() + "/.cache") / app_name_;
|
return GetEnvOrDefault("XDG_CACHE_HOME", GetHome() + "/.cache") / app_name_;
|
||||||
#else
|
#else
|
||||||
@@ -72,22 +76,34 @@ std::filesystem::path PathManager::GetKnownFolder(REFKNOWNFOLDERID id) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::string PathManager::GetHome() {
|
std::string PathManager::GetHome() {
|
||||||
if (const char* home = getenv("HOME")) {
|
|
||||||
return std::string(home);
|
|
||||||
}
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
char path[MAX_PATH];
|
char path[MAX_PATH];
|
||||||
if (SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_PROFILE, NULL, 0, path)))
|
if (SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_PROFILE, NULL, 0, path)))
|
||||||
return std::string(path);
|
return std::string(path);
|
||||||
|
#else
|
||||||
|
if (const char* home = getenv("HOME")) {
|
||||||
|
return std::string(home);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
std::filesystem::path PathManager::GetEnvOrDefault(const char* env_var,
|
std::filesystem::path PathManager::GetEnvOrDefault(const char* env_var,
|
||||||
const std::string& def) {
|
const std::string& def) {
|
||||||
|
#ifdef _WIN32
|
||||||
|
char* buffer = nullptr;
|
||||||
|
size_t size = 0;
|
||||||
|
|
||||||
|
if (_dupenv_s(&buffer, &size, env_var) == 0 && buffer != nullptr) {
|
||||||
|
std::filesystem::path result(buffer);
|
||||||
|
free(buffer);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
#else
|
||||||
if (const char* val = getenv(env_var)) {
|
if (const char* val = getenv(env_var)) {
|
||||||
return std::filesystem::path(val);
|
return std::filesystem::path(val);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return std::filesystem::path(def);
|
return std::filesystem::path(def);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,33 +14,42 @@ namespace crossdesk {
|
|||||||
|
|
||||||
static std::vector<DisplayInfo> gs_display_list;
|
static std::vector<DisplayInfo> gs_display_list;
|
||||||
|
|
||||||
std::string WideToUtf8(const wchar_t* wideStr) {
|
std::string WideToUtf8(const std::wstring& wstr) {
|
||||||
int size_needed = WideCharToMultiByte(CP_UTF8, 0, wideStr, -1, nullptr, 0,
|
if (wstr.empty()) return {};
|
||||||
nullptr, nullptr);
|
int size_needed = WideCharToMultiByte(
|
||||||
|
CP_UTF8, 0, wstr.data(), (int)wstr.size(), nullptr, 0, nullptr, nullptr);
|
||||||
std::string result(size_needed, 0);
|
std::string result(size_needed, 0);
|
||||||
WideCharToMultiByte(CP_UTF8, 0, wideStr, -1, &result[0], size_needed, nullptr,
|
WideCharToMultiByte(CP_UTF8, 0, wstr.data(), (int)wstr.size(), result.data(),
|
||||||
nullptr);
|
size_needed, nullptr, nullptr);
|
||||||
result.pop_back();
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string CleanDisplayName(const std::wstring& wide_name) {
|
||||||
|
std::string name = WideToUtf8(wide_name);
|
||||||
|
name.erase(std::remove_if(name.begin(), name.end(),
|
||||||
|
[](unsigned char c) { return !std::isalnum(c); }),
|
||||||
|
name.end());
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
BOOL WINAPI EnumMonitorProc(HMONITOR hmonitor, [[maybe_unused]] HDC hdc,
|
BOOL WINAPI EnumMonitorProc(HMONITOR hmonitor, [[maybe_unused]] HDC hdc,
|
||||||
[[maybe_unused]] LPRECT lprc, LPARAM data) {
|
[[maybe_unused]] LPRECT lprc, LPARAM data) {
|
||||||
MONITORINFOEX monitor_info_;
|
MONITORINFOEX monitor_info_;
|
||||||
monitor_info_.cbSize = sizeof(MONITORINFOEX);
|
monitor_info_.cbSize = sizeof(MONITORINFOEX);
|
||||||
|
|
||||||
if (GetMonitorInfo(hmonitor, &monitor_info_)) {
|
if (GetMonitorInfo(hmonitor, &monitor_info_)) {
|
||||||
|
std::string display_name = CleanDisplayName(monitor_info_.szDevice);
|
||||||
if (monitor_info_.dwFlags & MONITORINFOF_PRIMARY) {
|
if (monitor_info_.dwFlags & MONITORINFOF_PRIMARY) {
|
||||||
gs_display_list.insert(
|
gs_display_list.insert(
|
||||||
gs_display_list.begin(),
|
gs_display_list.begin(),
|
||||||
{(void*)hmonitor, WideToUtf8(monitor_info_.szDevice),
|
{(void*)hmonitor, display_name,
|
||||||
(monitor_info_.dwFlags & MONITORINFOF_PRIMARY) ? true : false,
|
(monitor_info_.dwFlags & MONITORINFOF_PRIMARY) ? true : false,
|
||||||
monitor_info_.rcMonitor.left, monitor_info_.rcMonitor.top,
|
monitor_info_.rcMonitor.left, monitor_info_.rcMonitor.top,
|
||||||
monitor_info_.rcMonitor.right, monitor_info_.rcMonitor.bottom});
|
monitor_info_.rcMonitor.right, monitor_info_.rcMonitor.bottom});
|
||||||
*(HMONITOR*)data = hmonitor;
|
*(HMONITOR*)data = hmonitor;
|
||||||
} else {
|
} else {
|
||||||
gs_display_list.push_back(DisplayInfo(
|
gs_display_list.push_back(DisplayInfo(
|
||||||
(void*)hmonitor, WideToUtf8(monitor_info_.szDevice),
|
(void*)hmonitor, display_name,
|
||||||
(monitor_info_.dwFlags & MONITORINFOF_PRIMARY) ? true : false,
|
(monitor_info_.dwFlags & MONITORINFOF_PRIMARY) ? true : false,
|
||||||
monitor_info_.rcMonitor.left, monitor_info_.rcMonitor.top,
|
monitor_info_.rcMonitor.left, monitor_info_.rcMonitor.top,
|
||||||
monitor_info_.rcMonitor.right, monitor_info_.rcMonitor.bottom));
|
monitor_info_.rcMonitor.right, monitor_info_.rcMonitor.bottom));
|
||||||
|
|||||||
@@ -118,13 +118,13 @@ void ScaleNv12ToABGR(char* src, int src_w, int src_h, int dst_w, int dst_h,
|
|||||||
|
|
||||||
memset(dst_rgba, 0, dst_w * dst_h * 4);
|
memset(dst_rgba, 0, dst_w * dst_h * 4);
|
||||||
for (int i = 0; i < dst_w * dst_h; ++i) {
|
for (int i = 0; i < dst_w * dst_h; ++i) {
|
||||||
dst_rgba[i * 4 + 3] = 0xFF;
|
dst_rgba[i * 4 + 3] = static_cast<char>(0xFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int y = 0; y < fit_h; ++y) {
|
for (int row = 0; row < fit_h; ++row) {
|
||||||
int dst_offset =
|
int dst_offset =
|
||||||
((y + (dst_h - fit_h) / 2) * dst_w + (dst_w - fit_w) / 2) * 4;
|
((row + (dst_h - fit_h) / 2) * dst_w + (dst_w - fit_w) / 2) * 4;
|
||||||
memcpy(dst_rgba + dst_offset, abgr.data() + y * fit_w * 4, fit_w * 4);
|
memcpy(dst_rgba + dst_offset, abgr.data() + row * fit_w * 4, fit_w * 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,7 +172,7 @@ int Thumbnail::SaveToThumbnail(const char* yuv420p, int width, int height,
|
|||||||
memset(rgba_buffer_, 0x00, thumbnail_width_ * thumbnail_height_ * 4);
|
memset(rgba_buffer_, 0x00, thumbnail_width_ * thumbnail_height_ * 4);
|
||||||
for (int i = 0; i < thumbnail_width_ * thumbnail_height_; ++i) {
|
for (int i = 0; i < thumbnail_width_ * thumbnail_height_; ++i) {
|
||||||
// Set alpha channel to opaque
|
// Set alpha channel to opaque
|
||||||
rgba_buffer_[i * 4 + 3] = 0xFF;
|
rgba_buffer_[i * 4 + 3] = static_cast<char>(0xFF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,7 +214,7 @@ int Thumbnail::LoadThumbnail(
|
|||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < image_paths.size(); i++) {
|
for (int i = 0; i < image_paths.size(); i++) {
|
||||||
size_t pos1 = image_paths[i].string().find('/') + 1;
|
// size_t pos1 = image_paths[i].string().find('/') + 1;
|
||||||
std::string cipher_image_name = image_paths[i].filename().string();
|
std::string cipher_image_name = image_paths[i].filename().string();
|
||||||
std::string remote_id;
|
std::string remote_id;
|
||||||
std::string cipher_password;
|
std::string cipher_password;
|
||||||
@@ -241,7 +241,7 @@ int Thumbnail::LoadThumbnail(
|
|||||||
AES_decrypt(cipher_password, aes128_key_, aes128_iv_);
|
AES_decrypt(cipher_password, aes128_key_, aes128_iv_);
|
||||||
} else {
|
} else {
|
||||||
size_t pos_n = cipher_image_name.find('N');
|
size_t pos_n = cipher_image_name.find('N');
|
||||||
size_t pos_at = cipher_image_name.find('@');
|
// size_t pos_at = cipher_image_name.find('@');
|
||||||
|
|
||||||
if (pos_n == std::string::npos) {
|
if (pos_n == std::string::npos) {
|
||||||
LOG_ERROR("Invalid filename");
|
LOG_ERROR("Invalid filename");
|
||||||
|
|||||||
Submodule submodules/minirtc updated: 40eaf93b42...1f999dbe1f
@@ -13,10 +13,11 @@ set_encodings("utf-8")
|
|||||||
|
|
||||||
-- set_policy("build.warning", true)
|
-- set_policy("build.warning", true)
|
||||||
-- set_warnings("all", "extra")
|
-- set_warnings("all", "extra")
|
||||||
|
-- add_cxxflags("/W4", "/WX")
|
||||||
|
|
||||||
add_defines("UNICODE")
|
add_defines("UNICODE")
|
||||||
if is_mode("debug") then
|
if is_mode("debug") then
|
||||||
add_defines("DESK_PORT_DEBUG")
|
add_defines("CROSSDESK_DEBUG")
|
||||||
end
|
end
|
||||||
|
|
||||||
add_requires("spdlog 1.14.1", {system = false})
|
add_requires("spdlog 1.14.1", {system = false})
|
||||||
|
|||||||
Reference in New Issue
Block a user