update hwcodec, fix gpu/cpu stuck caused by nv codec (#7826)

* Disable all nv codec encoding on windows except nv sdk encoding,
  because it doesn't use CUContext
* Keep nv codec on linux, because I didn't reproduce the stuck on it
* Add ffmpeg d3d11 vram decoding

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2024-04-25 20:16:48 +08:00
committed by GitHub
parent 23147f2328
commit 0e7e27f99d
2 changed files with 7 additions and 3 deletions

View File

@@ -17,7 +17,7 @@ use hbb_common::{
};
use hwcodec::{
common::{DataFormat, Driver, MAX_GOP},
native::{
vram::{
decode::{self, DecodeFrame, Decoder},
encode::{self, EncodeFrame, Encoder},
Available, DecodeContext, DynamicContext, EncodeContext, FeatureContext,
@@ -294,6 +294,10 @@ impl VRamDecoder {
pub fn try_get(format: CodecFormat, luid: Option<i64>) -> Option<DecodeContext> {
let v: Vec<_> = Self::available(format, luid);
if v.len() > 0 {
// prefer ffmpeg
if let Some(ctx) = v.iter().find(|c| c.driver == Driver::FFMPEG) {
return Some(ctx.clone());
}
Some(v[0].clone())
} else {
None