mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
add android screen record (incoming session)
This commit is contained in:
@@ -449,7 +449,7 @@ fn run(sp: GenericService) -> ResultType<()> {
|
||||
#[cfg(windows)]
|
||||
log::info!("gdi: {}", c.is_gdi());
|
||||
let codec_name = Encoder::current_hw_encoder_name();
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
let recorder = if !Config::get_option("allow-auto-record-incoming").is_empty() {
|
||||
Recorder::new(RecorderContext {
|
||||
id: "local".to_owned(),
|
||||
@@ -463,7 +463,7 @@ fn run(sp: GenericService) -> ResultType<()> {
|
||||
} else {
|
||||
Default::default()
|
||||
};
|
||||
#[cfg(any(target_os = "android", target_os = "ios"))]
|
||||
#[cfg(target_os = "ios")]
|
||||
let recorder: Arc<Mutex<Option<Recorder>>> = Default::default();
|
||||
#[cfg(windows)]
|
||||
start_uac_elevation_check();
|
||||
@@ -674,7 +674,7 @@ fn handle_one_frame(
|
||||
|
||||
let mut send_conn_ids: HashSet<i32> = Default::default();
|
||||
if let Ok(msg) = encoder.encode_to_message(frame, ms) {
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
recorder
|
||||
.lock()
|
||||
.unwrap()
|
||||
|
||||
@@ -413,7 +413,7 @@ pub async fn start_listen<T: InvokeUiCM>(
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
cm.remove_connection(current_id);
|
||||
cm.remove_connection(current_id, true);
|
||||
}
|
||||
|
||||
async fn handle_fs(fs: ipc::FS, write_jobs: &mut Vec<fs::TransferJob>, tx: &UnboundedSender<Data>) {
|
||||
|
||||
@@ -733,11 +733,21 @@ pub fn get_langs() -> String {
|
||||
#[inline]
|
||||
pub fn default_video_save_directory() -> String {
|
||||
let appname = crate::get_app_name();
|
||||
|
||||
#[cfg(any(target_os = "android", target_os = "ios"))]
|
||||
if let Ok(home) = config::APP_HOME_DIR.read() {
|
||||
let mut path = home.to_owned();
|
||||
path.push_str("/RustDesk/ScreenRecord");
|
||||
return path;
|
||||
}
|
||||
|
||||
if let Some(user) = directories_next::UserDirs::new() {
|
||||
if let Some(video_dir) = user.video_dir() {
|
||||
return video_dir.join(appname).to_string_lossy().to_string();
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
if let Some(home) = platform::get_active_user_home() {
|
||||
let name = if cfg!(target_os = "macos") {
|
||||
"Movies"
|
||||
@@ -746,6 +756,7 @@ pub fn default_video_save_directory() -> String {
|
||||
};
|
||||
return home.join(name).join(appname).to_string_lossy().to_string();
|
||||
}
|
||||
|
||||
if let Ok(exe) = std::env::current_exe() {
|
||||
if let Some(dir) = exe.parent() {
|
||||
return dir.join("videos").to_string_lossy().to_string();
|
||||
|
||||
Reference in New Issue
Block a user