scrap: check hwconfig in another process

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2022-06-09 19:46:41 +08:00
parent feaadcfc96
commit 42c7c5982c
7 changed files with 141 additions and 36 deletions

View File

@@ -103,7 +103,7 @@ impl Encoder {
codec: Box::new(hw),
}),
Err(e) => {
HwEncoder::best(true);
HwEncoder::best(true, true);
Err(e)
}
},
@@ -114,7 +114,7 @@ impl Encoder {
// TODO
pub fn update_video_encoder(id: i32, update: EncoderUpdate) {
log::info!("update video encoder:{:?}", update);
log::info!("encoder update: {:?}", update);
#[cfg(feature = "hwcodec")]
{
let mut states = PEER_DECODER_STATES.lock().unwrap();
@@ -133,7 +133,7 @@ impl Encoder {
}
let current_encoder_name = HwEncoder::current_name();
if states.len() > 0 {
let best = HwEncoder::best(false);
let (best, _) = HwEncoder::best(false, true);
let enabled_h264 =
best.h264.is_some() && states.len() > 0 && states.iter().all(|(_, s)| s.H264);
let enabled_h265 =