diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 38b665d..b20276c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,7 +55,7 @@ jobs: XMAKE_GLOBALDIR: /data run: | ls -la $XMAKE_GLOBALDIR - xmake f --CROSSDESK_VERSION=${LEGAL_VERSION} --root -y + xmake f --CROSSDESK_VERSION=${LEGAL_VERSION} --USE_CUDA=true --root -y xmake b -vy --root crossdesk - name: Decode and save certificate @@ -120,7 +120,7 @@ jobs: CUDA_PATH: /usr/local/cuda XMAKE_GLOBALDIR: /data run: | - xmake f --CROSSDESK_VERSION=${LEGAL_VERSION} --root -y + xmake f --CROSSDESK_VERSION=${LEGAL_VERSION} --USE_CUDA=true --root -y xmake b -vy --root crossdesk - name: Decode and save certificate @@ -189,7 +189,7 @@ jobs: - name: Build CrossDesk run: | - xmake f --CROSSDESK_VERSION=${VERSION_NUM} -y + xmake f --CROSSDESK_VERSION=${VERSION_NUM} --USE_CUDA=true -y xmake b -vy crossdesk - name: Decode and save certificate @@ -298,7 +298,7 @@ jobs: - name: Build CrossDesk run: | - xmake f --CROSSDESK_VERSION=${{ env.VERSION_NUM }} -y + xmake f --CROSSDESK_VERSION=${{ env.VERSION_NUM }} --USE_CUDA=true -y xmake b -vy crossdesk - name: Decode and save certificate diff --git a/src/gui/assets/layouts/layout.h b/src/gui/assets/layouts/layout.h index edfe402..c47130f 100644 --- a/src/gui/assets/layouts/layout.h +++ b/src/gui/assets/layouts/layout.h @@ -20,6 +20,7 @@ #define INPUT_WINDOW_PADDING_EN 96 #define SETTINGS_WINDOW_WIDTH_CN 202 #define SETTINGS_WINDOW_WIDTH_EN 248 +#if USE_CUDA #if _WIN32 #define SETTINGS_WINDOW_HEIGHT_CN 405 #define SETTINGS_WINDOW_HEIGHT_EN 405 @@ -27,6 +28,15 @@ #define SETTINGS_WINDOW_HEIGHT_CN 375 #define SETTINGS_WINDOW_HEIGHT_EN 375 #endif +#else +#if _WIN32 +#define SETTINGS_WINDOW_HEIGHT_CN 375 +#define SETTINGS_WINDOW_HEIGHT_EN 375 +#else +#define SETTINGS_WINDOW_HEIGHT_CN 345 +#define SETTINGS_WINDOW_HEIGHT_EN 345 +#endif +#endif #define SELF_HOSTED_SERVER_CONFIG_WINDOW_WIDTH_CN 228 #define SELF_HOSTED_SERVER_CONFIG_WINDOW_WIDTH_EN 275 #define SELF_HOSTED_SERVER_CONFIG_WINDOW_HEIGHT_CN 195 diff --git a/src/gui/windows/main_settings_window.cpp b/src/gui/windows/main_settings_window.cpp index a5fcafb..fcf898e 100644 --- a/src/gui/windows/main_settings_window.cpp +++ b/src/gui/windows/main_settings_window.cpp @@ -158,6 +158,7 @@ int Render::SettingWindow() { video_encode_format_items, IM_ARRAYSIZE(video_encode_format_items)); } +#if USE_CUDA && !defined(__aarch64__) && !defined(__arm__) ImGui::Separator(); { @@ -176,6 +177,7 @@ int Render::SettingWindow() { ImGui::Checkbox("##enable_hardware_video_codec", &enable_hardware_video_codec_); } +#endif ImGui::Separator(); diff --git a/submodules/minirtc b/submodules/minirtc index 29ae032..0461314 160000 --- a/submodules/minirtc +++ b/submodules/minirtc @@ -1 +1 @@ -Subproject commit 29ae03237f0fd2b4a0e8e12f3a2ce3d8f228e7d9 +Subproject commit 0461314f9b4d7e0ab990558a91c4af055119cd34 diff --git a/xmake.lua b/xmake.lua index 57ddcf9..46ab5c4 100644 --- a/xmake.lua +++ b/xmake.lua @@ -7,6 +7,12 @@ option("CROSSDESK_VERSION") set_description("Set CROSSDESK_VERSION for build") option_end() +option("USE_CUDA") + set_default(false) + set_showmenu(true) + set_description("Use CUDA for hardware codec acceleration") +option_end() + add_rules("mode.release", "mode.debug") set_languages("c++17") set_encodings("utf-8") @@ -16,6 +22,8 @@ set_encodings("utf-8") -- add_cxxflags("/W4", "/WX") add_defines("UNICODE") +add_defines("USE_CUDA=" .. (is_config("USE_CUDA", true) and "1" or "0")) + if is_mode("debug") then add_defines("CROSSDESK_DEBUG") end