enable ffmpeg native h26x software decoders for all platforms (#7750)

* enable ffmpeg native h26x software decoders for all platforms

* h26x software decoders depend on hwcodec feature, so all platforms
  enable it, software h26x decoders are always available like vpx, no available check and no option
* ffmpeg:
	- build: mac arm64 build ffmpeg with my m1, others build with ci
	- version: win/linux use ffmpeg release/5.1, becaues higher version require higher nvidia driver,  other platforms use release/7.0
* test:
	- ios not test.
	- android: sometimes the screen will appear blurry, but it will recover after a while.
	- arm64 linux: test a example of hwcodec repo

Signed-off-by: 21pages <pages21@163.com>

* check hwcodec only when enabled and immediately when clicked enabled

Signed-off-by: 21pages <pages21@163.com>

---------

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2024-04-18 13:12:45 +08:00
committed by GitHub
parent 4e8cbe3db1
commit 4252b5e273
16 changed files with 106 additions and 39 deletions

View File

@@ -829,10 +829,9 @@ pub fn get_api_server() -> String {
#[inline]
pub fn has_hwcodec() -> bool {
#[cfg(not(any(feature = "hwcodec", feature = "mediacodec")))]
return false;
#[cfg(any(feature = "hwcodec", feature = "mediacodec"))]
return true;
// Has real hardware codec using gpu
(cfg!(feature = "hwcodec") && (cfg!(windows) || cfg!(target_os = "linux")))
|| cfg!(feature = "mediacodec")
}
#[inline]
@@ -1315,3 +1314,14 @@ pub fn verify2fa(code: String) -> bool {
}
res
}
pub fn check_hwcodec() {
#[cfg(feature = "hwcodec")]
#[cfg(any(target_os = "windows", target_os = "linux"))]
{
scrap::hwcodec::start_check_process(true);
if crate::platform::is_installed() {
ipc::notify_server_to_check_hwcodec().ok();
}
}
}