scrap: add hwcodec

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2022-05-29 17:23:14 +08:00
parent f542a39329
commit 70968638bf
12 changed files with 1112 additions and 222 deletions

View File

@@ -365,6 +365,7 @@ impl Connection {
video_service::notify_video_frame_feched(id, None);
super::video_service::update_test_latency(id, 0);
super::video_service::update_image_quality(id, None);
scrap::coder::Encoder::update_video_encoder(id, None);
if let Err(err) = conn.try_port_forward_loop(&mut rx_from_cm).await {
conn.on_close(&err.to_string(), false);
}
@@ -1186,6 +1187,20 @@ impl Connection {
}
}
}
// TODO: add option
if let Some(q) = o.video_codec_state.clone().take() {
scrap::coder::Encoder::update_video_encoder(self.inner.id(), Some(q));
} else {
scrap::coder::Encoder::update_video_encoder(
self.inner.id(),
Some(VideoCodecState {
H264: false,
H265: false,
..Default::default()
}),
);
}
}
fn on_close(&mut self, reason: &str, lock: bool) {