update hwcodec (#12303)

* Test necessary codecs in single thread
* Terminate test process with parent process

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages
2025-07-15 18:49:45 +08:00
committed by GitHub
parent abb7748ee9
commit 69af5f2fa6
2 changed files with 5 additions and 1 deletions

2
Cargo.lock generated
View File

@@ -3288,7 +3288,7 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
[[package]]
name = "hwcodec"
version = "0.7.1"
source = "git+https://github.com/rustdesk-org/hwcodec#0ea7e709d3c48bb6446e33a9cc8fd0e0da5709b9"
source = "git+https://github.com/rustdesk-org/hwcodec#17c1dbb38450fe4a64aeba78fb50bec32f364a16"
dependencies = [
"bindgen 0.59.2",
"cc",

View File

@@ -678,6 +678,8 @@ impl HwCodecConfig {
}
pub fn check_available_hwcodec() -> String {
#[cfg(any(target_os = "linux", target_os = "macos"))]
hwcodec::common::setup_parent_death_signal();
let ctx = EncodeContext {
name: String::from(""),
mc_name: None,
@@ -724,6 +726,8 @@ pub fn start_check_process() {
if let Some(_) = exe.file_name().to_owned() {
let arg = "--check-hwcodec-config";
if let Ok(mut child) = std::process::Command::new(exe).arg(arg).spawn() {
#[cfg(windows)]
hwcodec::common::child_exit_when_parent_exit(child.id());
// wait up to 30 seconds, it maybe slow on windows startup for poorly performing machines
for _ in 0..30 {
std::thread::sleep(std::time::Duration::from_secs(1));