mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-27 23:21:06 +03:00
feat: take screenshot (#11591)
* feat: take screenshot Signed-off-by: fufesou <linlong1266@gmail.com> * screenshot, vram temp switch capturer Signed-off-by: fufesou <linlong1266@gmail.com> * fix: misspelling Signed-off-by: fufesou <linlong1266@gmail.com> * screenshot, taking Signed-off-by: fufesou <linlong1266@gmail.com> * screenshot, rgba stride Signed-off-by: fufesou <linlong1266@gmail.com> * Bumps 1.4.0 Signed-off-by: fufesou <linlong1266@gmail.com> --------- Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -250,6 +250,16 @@ pub fn session_refresh(session_id: SessionID, display: usize) {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn session_take_screenshot(session_id: SessionID, display: usize) {
|
||||
if let Some(s) = sessions::get_session_by_session_id(&session_id) {
|
||||
s.take_screenshot(display as _, session_id.to_string());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn session_handle_screenshot(session_id: SessionID, action: String) -> String {
|
||||
crate::client::screenshot::handle_screenshot(action)
|
||||
}
|
||||
|
||||
pub fn session_is_multi_ui_session(session_id: SessionID) -> SyncReturn<bool> {
|
||||
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
|
||||
SyncReturn(session.is_multi_ui_session())
|
||||
@@ -2461,6 +2471,27 @@ pub fn main_set_common(_key: String, _value: String) {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn session_get_common_sync(
|
||||
session_id: SessionID,
|
||||
key: String,
|
||||
param: String,
|
||||
) -> SyncReturn<Option<String>> {
|
||||
SyncReturn(session_get_common(session_id, key, param))
|
||||
}
|
||||
|
||||
pub fn session_get_common(session_id: SessionID, key: String, param: String) -> Option<String> {
|
||||
if let Some(s) = sessions::get_session_by_session_id(&session_id) {
|
||||
let v = if key == "is_screenshot_supported" {
|
||||
s.is_screenshot_supported().to_string()
|
||||
} else {
|
||||
"".to_owned()
|
||||
};
|
||||
Some(v)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os = "android")]
|
||||
pub mod server_side {
|
||||
use hbb_common::{config, log};
|
||||
|
||||
Reference in New Issue
Block a user