more for cli

This commit is contained in:
rustdesk
2022-12-29 13:00:57 +08:00
parent 8c7bc08776
commit 45072a4de1
3 changed files with 8 additions and 0 deletions

View File

@@ -500,6 +500,7 @@ impl Connection {
let _ = privacy_mode::turn_off_privacy(0);
}
video_service::notify_video_frame_feched(id, None);
#[cfg(not(feature = "cli"))]
scrap::codec::Encoder::update_video_encoder(id, scrap::codec::EncoderUpdate::Remove);
video_service::VIDEO_QOS.lock().unwrap().reset();
if conn.authorized {
@@ -1076,17 +1077,20 @@ impl Connection {
if let Some(o) = lr.option.as_ref() {
self.update_option(o).await;
if let Some(q) = o.video_codec_state.clone().take() {
#[cfg(not(feature = "cli"))]
scrap::codec::Encoder::update_video_encoder(
self.inner.id(),
scrap::codec::EncoderUpdate::State(q),
);
} else {
#[cfg(not(feature = "cli"))]
scrap::codec::Encoder::update_video_encoder(
self.inner.id(),
scrap::codec::EncoderUpdate::DisableHwIfNotExist,
);
}
} else {
#[cfg(not(feature = "cli"))]
scrap::codec::Encoder::update_video_encoder(
self.inner.id(),
scrap::codec::EncoderUpdate::DisableHwIfNotExist,
@@ -1645,6 +1649,7 @@ impl Connection {
}
}
if let Some(q) = o.video_codec_state.clone().take() {
#[cfg(not(feature = "cli"))]
scrap::codec::Encoder::update_video_encoder(
self.inner.id(),
scrap::codec::EncoderUpdate::State(q),