update hwcodec, qsv support changing bitrate (#7911)
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
committed by
GitHub
Unverified
parent
29b13d19d6
commit
991694aca5
@@ -183,7 +183,7 @@ impl EncoderApi for HwRamEncoder {
|
||||
}
|
||||
|
||||
fn support_abr(&self) -> bool {
|
||||
!self.name.contains("qsv")
|
||||
["qsv", "vaapi"].iter().all(|&x| !self.name.contains(x))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ use hbb_common::{
|
||||
ResultType,
|
||||
};
|
||||
use hwcodec::{
|
||||
common::{DataFormat, Driver, MAX_GOP},
|
||||
common::{AdapterVendor::*, DataFormat, Driver, MAX_GOP},
|
||||
vram::{
|
||||
decode::{self, DecodeFrame, Decoder},
|
||||
encode::{self, EncodeFrame, Encoder},
|
||||
@@ -49,6 +49,7 @@ pub struct VRamEncoder {
|
||||
bitrate: u32,
|
||||
last_frame_len: usize,
|
||||
same_bad_len_counter: usize,
|
||||
config: VRamEncoderConfig,
|
||||
}
|
||||
|
||||
impl EncoderApi for VRamEncoder {
|
||||
@@ -84,6 +85,7 @@ impl EncoderApi for VRamEncoder {
|
||||
bitrate,
|
||||
last_frame_len: 0,
|
||||
same_bad_len_counter: 0,
|
||||
config,
|
||||
}),
|
||||
Err(_) => {
|
||||
hbb_common::config::HwCodecConfig::clear_vram();
|
||||
@@ -179,7 +181,7 @@ impl EncoderApi for VRamEncoder {
|
||||
}
|
||||
|
||||
fn support_abr(&self) -> bool {
|
||||
self.ctx.f.driver != Driver::MFX
|
||||
self.config.device.vendor_id != ADAPTER_VENDOR_INTEL as u32
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user