mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-12-16 20:17:10 +08:00
[feat] add build option USE_CUDA to enable or disable CUDA-based hardware codec acceleration and USE_CUDA=false by default
This commit is contained in:
8
.github/workflows/build.yml
vendored
8
.github/workflows/build.yml
vendored
@@ -55,7 +55,7 @@ jobs:
|
|||||||
XMAKE_GLOBALDIR: /data
|
XMAKE_GLOBALDIR: /data
|
||||||
run: |
|
run: |
|
||||||
ls -la $XMAKE_GLOBALDIR
|
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
|
xmake b -vy --root crossdesk
|
||||||
|
|
||||||
- name: Decode and save certificate
|
- name: Decode and save certificate
|
||||||
@@ -120,7 +120,7 @@ jobs:
|
|||||||
CUDA_PATH: /usr/local/cuda
|
CUDA_PATH: /usr/local/cuda
|
||||||
XMAKE_GLOBALDIR: /data
|
XMAKE_GLOBALDIR: /data
|
||||||
run: |
|
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
|
xmake b -vy --root crossdesk
|
||||||
|
|
||||||
- name: Decode and save certificate
|
- name: Decode and save certificate
|
||||||
@@ -189,7 +189,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build CrossDesk
|
- name: Build CrossDesk
|
||||||
run: |
|
run: |
|
||||||
xmake f --CROSSDESK_VERSION=${VERSION_NUM} -y
|
xmake f --CROSSDESK_VERSION=${VERSION_NUM} --USE_CUDA=true -y
|
||||||
xmake b -vy crossdesk
|
xmake b -vy crossdesk
|
||||||
|
|
||||||
- name: Decode and save certificate
|
- name: Decode and save certificate
|
||||||
@@ -298,7 +298,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build CrossDesk
|
- name: Build CrossDesk
|
||||||
run: |
|
run: |
|
||||||
xmake f --CROSSDESK_VERSION=${{ env.VERSION_NUM }} -y
|
xmake f --CROSSDESK_VERSION=${{ env.VERSION_NUM }} --USE_CUDA=true -y
|
||||||
xmake b -vy crossdesk
|
xmake b -vy crossdesk
|
||||||
|
|
||||||
- name: Decode and save certificate
|
- name: Decode and save certificate
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#define INPUT_WINDOW_PADDING_EN 96
|
#define INPUT_WINDOW_PADDING_EN 96
|
||||||
#define SETTINGS_WINDOW_WIDTH_CN 202
|
#define SETTINGS_WINDOW_WIDTH_CN 202
|
||||||
#define SETTINGS_WINDOW_WIDTH_EN 248
|
#define SETTINGS_WINDOW_WIDTH_EN 248
|
||||||
|
#if USE_CUDA
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
#define SETTINGS_WINDOW_HEIGHT_CN 405
|
#define SETTINGS_WINDOW_HEIGHT_CN 405
|
||||||
#define SETTINGS_WINDOW_HEIGHT_EN 405
|
#define SETTINGS_WINDOW_HEIGHT_EN 405
|
||||||
@@ -27,6 +28,15 @@
|
|||||||
#define SETTINGS_WINDOW_HEIGHT_CN 375
|
#define SETTINGS_WINDOW_HEIGHT_CN 375
|
||||||
#define SETTINGS_WINDOW_HEIGHT_EN 375
|
#define SETTINGS_WINDOW_HEIGHT_EN 375
|
||||||
#endif
|
#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_CN 228
|
||||||
#define SELF_HOSTED_SERVER_CONFIG_WINDOW_WIDTH_EN 275
|
#define SELF_HOSTED_SERVER_CONFIG_WINDOW_WIDTH_EN 275
|
||||||
#define SELF_HOSTED_SERVER_CONFIG_WINDOW_HEIGHT_CN 195
|
#define SELF_HOSTED_SERVER_CONFIG_WINDOW_HEIGHT_CN 195
|
||||||
|
|||||||
@@ -158,6 +158,7 @@ int Render::SettingWindow() {
|
|||||||
video_encode_format_items, IM_ARRAYSIZE(video_encode_format_items));
|
video_encode_format_items, IM_ARRAYSIZE(video_encode_format_items));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if USE_CUDA && !defined(__aarch64__) && !defined(__arm__)
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -176,6 +177,7 @@ int Render::SettingWindow() {
|
|||||||
ImGui::Checkbox("##enable_hardware_video_codec",
|
ImGui::Checkbox("##enable_hardware_video_codec",
|
||||||
&enable_hardware_video_codec_);
|
&enable_hardware_video_codec_);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
|
|
||||||
|
|||||||
Submodule submodules/minirtc updated: 29ae03237f...0461314f9b
@@ -7,6 +7,12 @@ option("CROSSDESK_VERSION")
|
|||||||
set_description("Set CROSSDESK_VERSION for build")
|
set_description("Set CROSSDESK_VERSION for build")
|
||||||
option_end()
|
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")
|
add_rules("mode.release", "mode.debug")
|
||||||
set_languages("c++17")
|
set_languages("c++17")
|
||||||
set_encodings("utf-8")
|
set_encodings("utf-8")
|
||||||
@@ -16,6 +22,8 @@ set_encodings("utf-8")
|
|||||||
-- add_cxxflags("/W4", "/WX")
|
-- add_cxxflags("/W4", "/WX")
|
||||||
|
|
||||||
add_defines("UNICODE")
|
add_defines("UNICODE")
|
||||||
|
add_defines("USE_CUDA=" .. (is_config("USE_CUDA", true) and "1" or "0"))
|
||||||
|
|
||||||
if is_mode("debug") then
|
if is_mode("debug") then
|
||||||
add_defines("CROSSDESK_DEBUG")
|
add_defines("CROSSDESK_DEBUG")
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user