mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-05-09 15:48:09 +03:00
view camera (#11040)
* view camera Signed-off-by: 21pages <sunboeasy@gmail.com> * `No cameras` prompt if no cameras available, `peerGetSessionsCount` use connType as parameter Signed-off-by: 21pages <sunboeasy@gmail.com> * fix, use video_service_name rather than display_idx as key in qos,etc Signed-off-by: 21pages <sunboeasy@gmail.com> --------- Signed-off-by: 21pages <sunboeasy@gmail.com> Co-authored-by: Adwin White <adwinw01@gmail.com> Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
This commit is contained in:
@@ -106,7 +106,7 @@ pub struct VideoQoS {
|
||||
fps: u32,
|
||||
ratio: f32,
|
||||
users: HashMap<i32, UserData>,
|
||||
displays: HashMap<usize, DisplayData>,
|
||||
displays: HashMap<String, DisplayData>,
|
||||
bitrate_store: u32,
|
||||
adjust_ratio_instant: Instant,
|
||||
abr_config: bool,
|
||||
@@ -168,8 +168,8 @@ impl VideoQoS {
|
||||
self.users.iter().any(|u| u.1.record)
|
||||
}
|
||||
|
||||
pub fn set_support_changing_quality(&mut self, display_idx: usize, support: bool) {
|
||||
if let Some(display) = self.displays.get_mut(&display_idx) {
|
||||
pub fn set_support_changing_quality(&mut self, video_service_name: &str, support: bool) {
|
||||
if let Some(display) = self.displays.get_mut(video_service_name) {
|
||||
display.support_changing_quality = support;
|
||||
}
|
||||
}
|
||||
@@ -346,16 +346,17 @@ impl VideoQoS {
|
||||
|
||||
// Common adjust functions
|
||||
impl VideoQoS {
|
||||
pub fn new_display(&mut self, display_idx: usize) {
|
||||
self.displays.insert(display_idx, DisplayData::default());
|
||||
pub fn new_display(&mut self, video_service_name: String) {
|
||||
self.displays
|
||||
.insert(video_service_name, DisplayData::default());
|
||||
}
|
||||
|
||||
pub fn remove_display(&mut self, display_idx: usize) {
|
||||
self.displays.remove(&display_idx);
|
||||
pub fn remove_display(&mut self, video_service_name: &str) {
|
||||
self.displays.remove(video_service_name);
|
||||
}
|
||||
|
||||
pub fn update_display_data(&mut self, display_idx: usize, send_counter: usize) {
|
||||
if let Some(display) = self.displays.get_mut(&display_idx) {
|
||||
pub fn update_display_data(&mut self, video_service_name: &str, send_counter: usize) {
|
||||
if let Some(display) = self.displays.get_mut(video_service_name) {
|
||||
display.send_counter += send_counter;
|
||||
}
|
||||
self.adjust_fps();
|
||||
|
||||
Reference in New Issue
Block a user