enable keyframe interval when recording

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-08-07 21:32:36 +08:00
parent 8d830382de
commit 9905695699
15 changed files with 105 additions and 45 deletions

View File

@@ -36,6 +36,7 @@ struct UserData {
quality: Option<(i64, Quality)>, // (time, quality)
delay: Option<Delay>,
response_delayed: bool,
record: bool,
}
pub struct VideoQoS {
@@ -114,6 +115,10 @@ impl VideoQoS {
self.quality
}
pub fn record(&self) -> bool {
self.users.iter().any(|u| u.1.record)
}
pub fn abr_enabled() -> bool {
"N" != Config::get_option("enable-abr")
}
@@ -388,6 +393,12 @@ impl VideoQoS {
}
}
pub fn user_record(&mut self, id: i32, v: bool) {
if let Some(user) = self.users.get_mut(&id) {
user.record = v;
}
}
pub fn on_connection_close(&mut self, id: i32) {
self.users.remove(&id);
self.refresh(None);