mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-06-11 12:43:12 +08:00
Option allow-d3d-render
and fix ios ci (#11107)
* option `allow-d3d-render`, default false Add this option because it fails on some machines Signed-off-by: 21pages <sunboeasy@gmail.com> * only add nokhwa to windows and linux dependencies Signed-off-by: 21pages <sunboeasy@gmail.com> --------- Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
parent
1403c939db
commit
d1c8b331c5
@ -78,6 +78,7 @@ const String kOptionScrollStyle = "scroll_style";
|
||||
const String kOptionImageQuality = "image_quality";
|
||||
const String kOptionOpenNewConnInTabs = "enable-open-new-connections-in-tabs";
|
||||
const String kOptionTextureRender = "use-texture-render";
|
||||
const String kOptionD3DRender = "allow-d3d-render";
|
||||
const String kOptionOpenInTabs = "allow-open-in-tabs";
|
||||
const String kOptionOpenInWindows = "allow-open-in-windows";
|
||||
const String kOptionForceAlwaysRelay = "force-always-relay";
|
||||
|
@ -496,6 +496,16 @@ class _GeneralState extends State<_General> {
|
||||
await bind.mainSetLocalOption(key: k, value: v ? 'Y' : 'N'),
|
||||
),
|
||||
),
|
||||
if (isWindows)
|
||||
Tooltip(
|
||||
message: translate('d3d_render_tip'),
|
||||
child: _OptionCheckBox(
|
||||
context,
|
||||
"Use D3D rendering",
|
||||
kOptionD3DRender,
|
||||
isServer: false,
|
||||
),
|
||||
),
|
||||
if (!isWeb && !bind.isCustomClient())
|
||||
_OptionCheckBox(
|
||||
context,
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 7cf11f7b771e27ecbd14fd1dd0ced55a64f40eb5
|
||||
Subproject commit 1819875476d487612a654099881b8a16f4337599
|
@ -23,7 +23,6 @@ lazy_static = "1.4"
|
||||
hbb_common = { path = "../hbb_common" }
|
||||
webm = { git = "https://github.com/rustdesk-org/rust-webm" }
|
||||
serde = {version="1.0", features=["derive"]}
|
||||
nokhwa = { git = "https://github.com/rustdesk-org/nokhwa.git", branch = "fix_from_raw_parts", features = ["input-native"] }
|
||||
|
||||
[dependencies.winapi]
|
||||
version = "0.3"
|
||||
@ -63,3 +62,6 @@ gstreamer-video = { version = "0.16", optional = true }
|
||||
git = "https://github.com/rustdesk-org/hwcodec"
|
||||
optional = true
|
||||
|
||||
[target.'cfg(any(target_os = "windows", target_os = "linux"))'.dependencies]
|
||||
nokhwa = { git = "https://github.com/rustdesk-org/nokhwa.git", branch = "fix_from_raw_parts", features = ["input-native"] }
|
||||
|
||||
|
@ -3,6 +3,7 @@ use std::{
|
||||
sync::{Arc, Mutex},
|
||||
};
|
||||
|
||||
#[cfg(any(target_os = "windows", target_os = "linux"))]
|
||||
use nokhwa::{
|
||||
pixel_format::RgbAFormat,
|
||||
query,
|
||||
@ -23,6 +24,9 @@ lazy_static::lazy_static! {
|
||||
static ref SYNC_CAMERA_DISPLAYS: Arc<Mutex<Vec<DisplayInfo>>> = Arc::new(Mutex::new(Vec::new()));
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "windows", target_os = "linux")))]
|
||||
const CAMERA_NOT_SUPPORTED: &str = "This platform doesn't support camera yet";
|
||||
|
||||
pub struct Cameras;
|
||||
|
||||
// pre-condition
|
||||
@ -30,12 +34,9 @@ pub fn primary_camera_exists() -> bool {
|
||||
Cameras::exists(PRIMARY_CAMERA_IDX)
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "windows", target_os = "linux"))]
|
||||
impl Cameras {
|
||||
pub fn all_info() -> ResultType<Vec<DisplayInfo>> {
|
||||
// TODO: support more platforms.
|
||||
#[cfg(not(any(target_os = "linux", target_os = "windows")))]
|
||||
return Ok(Vec::new());
|
||||
|
||||
match query(ApiBackend::Auto) {
|
||||
Ok(cameras) => {
|
||||
let mut camera_displays = SYNC_CAMERA_DISPLAYS.lock().unwrap();
|
||||
@ -102,10 +103,6 @@ impl Cameras {
|
||||
}
|
||||
|
||||
pub fn exists(index: usize) -> bool {
|
||||
// TODO: support more platforms.
|
||||
#[cfg(not(any(target_os = "linux", target_os = "windows")))]
|
||||
return false;
|
||||
|
||||
match query(ApiBackend::Auto) {
|
||||
Ok(cameras) => index < cameras.len(),
|
||||
_ => return false,
|
||||
@ -113,10 +110,6 @@ impl Cameras {
|
||||
}
|
||||
|
||||
fn create_camera(index: &CameraIndex) -> ResultType<Camera> {
|
||||
// TODO: support more platforms.
|
||||
#[cfg(not(any(target_os = "linux", target_os = "windows")))]
|
||||
bail!("This platform doesn't support camera yet");
|
||||
|
||||
let result = Camera::new(
|
||||
index.clone(),
|
||||
RequestedFormat::new::<RgbAFormat>(RequestedFormatType::AbsoluteHighestResolution),
|
||||
@ -147,13 +140,41 @@ impl Cameras {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "windows", target_os = "linux")))]
|
||||
impl Cameras {
|
||||
pub fn all_info() -> ResultType<Vec<DisplayInfo>> {
|
||||
return Ok(Vec::new());
|
||||
}
|
||||
|
||||
pub fn exists(index: usize) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn get_camera_resolution(index: usize) -> ResultType<Resolution> {
|
||||
bail!(CAMERA_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
pub fn get_sync_cameras() -> Vec<DisplayInfo> {
|
||||
vec![]
|
||||
}
|
||||
|
||||
pub fn get_capturer(current: usize) -> ResultType<Box<dyn TraitCapturer>> {
|
||||
bail!(CAMERA_NOT_SUPPORTED);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "windows", target_os = "linux"))]
|
||||
pub struct CameraCapturer {
|
||||
camera: Camera,
|
||||
data: Vec<u8>,
|
||||
last_data: Vec<u8>, // for faster compare and copy
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "windows", target_os = "linux")))]
|
||||
pub struct CameraCapturer;
|
||||
|
||||
impl CameraCapturer {
|
||||
#[cfg(any(target_os = "windows", target_os = "linux"))]
|
||||
fn new(current: usize) -> ResultType<Self> {
|
||||
let index = CameraIndex::Index(current as u32);
|
||||
let camera = Cameras::create_camera(&index)?;
|
||||
@ -163,9 +184,15 @@ impl CameraCapturer {
|
||||
last_data: Vec::new(),
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "windows", target_os = "linux")))]
|
||||
fn new(_current: usize) -> ResultType<Self> {
|
||||
bail!(CAMERA_NOT_SUPPORTED);
|
||||
}
|
||||
}
|
||||
|
||||
impl TraitCapturer for CameraCapturer {
|
||||
#[cfg(any(target_os = "windows", target_os = "linux"))]
|
||||
fn frame<'a>(&'a mut self, _timeout: std::time::Duration) -> std::io::Result<Frame<'a>> {
|
||||
// TODO: move this check outside `frame`.
|
||||
if !self.camera.is_stream_open() {
|
||||
@ -212,6 +239,14 @@ impl TraitCapturer for CameraCapturer {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "windows", target_os = "linux")))]
|
||||
fn frame<'a>(&'a mut self, _timeout: std::time::Duration) -> std::io::Result<Frame<'a>> {
|
||||
Err(io::Error::new(
|
||||
io::ErrorKind::Other,
|
||||
CAMERA_NOT_SUPPORTED.to_string(),
|
||||
))
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
fn is_gdi(&self) -> bool {
|
||||
false
|
||||
|
@ -864,7 +864,7 @@ pub fn enable_vram_option(encode: bool) -> bool {
|
||||
if encode {
|
||||
enable && enable_directx_capture()
|
||||
} else {
|
||||
enable
|
||||
enable && allow_d3d_render()
|
||||
}
|
||||
} else {
|
||||
false
|
||||
@ -874,10 +874,13 @@ pub fn enable_vram_option(encode: bool) -> bool {
|
||||
#[cfg(windows)]
|
||||
pub fn enable_directx_capture() -> bool {
|
||||
use hbb_common::config::keys::OPTION_ENABLE_DIRECTX_CAPTURE as OPTION;
|
||||
option2bool(
|
||||
OPTION,
|
||||
&Config::get_option(hbb_common::config::keys::OPTION_ENABLE_DIRECTX_CAPTURE),
|
||||
)
|
||||
option2bool(OPTION, &Config::get_option(OPTION))
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
pub fn allow_d3d_render() -> bool {
|
||||
use hbb_common::config::keys::OPTION_ALLOW_D3D_RENDER as OPTION;
|
||||
option2bool(OPTION, &hbb_common::config::LocalConfig::get_option(OPTION))
|
||||
}
|
||||
|
||||
pub const BR_BEST: f32 = 1.5;
|
||||
|
@ -48,8 +48,9 @@ pub use self::convert::*;
|
||||
pub const STRIDE_ALIGN: usize = 64; // commonly used in libvpx vpx_img_alloc caller
|
||||
pub const HW_STRIDE_ALIGN: usize = 0; // recommended by av_frame_get_buffer
|
||||
|
||||
pub mod camera;
|
||||
pub mod aom;
|
||||
#[cfg(not(any(target_os = "ios")))]
|
||||
pub mod camera;
|
||||
pub mod record;
|
||||
mod vpx;
|
||||
|
||||
|
@ -25,7 +25,8 @@ pub struct RecorderContext {
|
||||
pub server: bool,
|
||||
pub id: String,
|
||||
pub dir: String,
|
||||
pub video_service_name: String,
|
||||
pub display_idx: usize,
|
||||
pub camera: bool,
|
||||
pub tx: Option<Sender<RecordState>>,
|
||||
}
|
||||
|
||||
@ -46,7 +47,11 @@ impl RecorderContext2 {
|
||||
+ "_"
|
||||
+ &ctx.id.clone()
|
||||
+ &chrono::Local::now().format("_%Y%m%d%H%M%S%3f_").to_string()
|
||||
+ &format!("{}_", ctx.video_service_name)
|
||||
+ &format!(
|
||||
"{}{}_",
|
||||
if ctx.camera { "camera" } else { "display" },
|
||||
ctx.display_idx
|
||||
)
|
||||
+ &self.format.to_string().to_lowercase()
|
||||
+ if self.format == CodecFormat::VP9
|
||||
|| self.format == CodecFormat::VP8
|
||||
|
@ -1389,14 +1389,15 @@ impl VideoHandler {
|
||||
}
|
||||
|
||||
/// Start or stop screen record.
|
||||
pub fn record_screen(&mut self, start: bool, id: String, video_service_name: String) {
|
||||
pub fn record_screen(&mut self, start: bool, id: String, display_idx: usize, camera: bool) {
|
||||
self.record = false;
|
||||
if start {
|
||||
self.recorder = Recorder::new(RecorderContext {
|
||||
server: false,
|
||||
id,
|
||||
dir: crate::ui_interface::video_save_directory(false),
|
||||
video_service_name,
|
||||
display_idx,
|
||||
camera,
|
||||
tx: None,
|
||||
})
|
||||
.map_or(Default::default(), |r| Arc::new(Mutex::new(Some(r))));
|
||||
@ -2437,14 +2438,7 @@ pub fn start_video_thread<F, T>(
|
||||
{
|
||||
let mut video_callback = video_callback;
|
||||
let mut last_chroma = None;
|
||||
let video_service_name = crate::video_service::get_service_name(
|
||||
if session.is_view_camera() {
|
||||
crate::video_service::VideoSource::Camera
|
||||
} else {
|
||||
crate::video_service::VideoSource::Monitor
|
||||
},
|
||||
display,
|
||||
);
|
||||
let is_view_camera = session.is_view_camera();
|
||||
|
||||
std::thread::spawn(move || {
|
||||
#[cfg(windows)]
|
||||
@ -2487,7 +2481,7 @@ pub fn start_video_thread<F, T>(
|
||||
let record_permission = session.lc.read().unwrap().record_permission;
|
||||
let id = session.lc.read().unwrap().id.clone();
|
||||
if record_state && record_permission {
|
||||
handler.record_screen(true, id, video_service_name.clone());
|
||||
handler.record_screen(true, id, display, is_view_camera);
|
||||
}
|
||||
video_handler = Some(handler);
|
||||
}
|
||||
@ -2568,7 +2562,7 @@ pub fn start_video_thread<F, T>(
|
||||
MediaData::RecordScreen(start) => {
|
||||
let id = session.lc.read().unwrap().id.clone();
|
||||
if let Some(handler) = video_handler.as_mut() {
|
||||
handler.record_screen(start, id, video_service_name.clone());
|
||||
handler.record_screen(start, id, display, is_view_camera);
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
|
@ -993,6 +993,7 @@ pub fn main_get_env(key: String) -> SyncReturn<String> {
|
||||
|
||||
pub fn main_set_local_option(key: String, value: String) {
|
||||
let is_texture_render_key = key.eq(config::keys::OPTION_TEXTURE_RENDER);
|
||||
let is_d3d_render_key = key.eq(config::keys::OPTION_ALLOW_D3D_RENDER);
|
||||
set_local_option(key, value.clone());
|
||||
if is_texture_render_key {
|
||||
let session_event = [("v", &value)];
|
||||
@ -1002,6 +1003,11 @@ pub fn main_set_local_option(key: String, value: String) {
|
||||
session.ui_handler.update_use_texture_render();
|
||||
}
|
||||
}
|
||||
if is_d3d_render_key {
|
||||
for session in sessions::get_sessions() {
|
||||
session.update_supported_decodings();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// We do use use `main_get_local_option` and `main_set_local_option`.
|
||||
@ -1650,7 +1656,7 @@ pub fn session_alternative_codecs(session_id: SessionID) -> String {
|
||||
|
||||
pub fn session_change_prefer_codec(session_id: SessionID) {
|
||||
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
|
||||
session.change_prefer_codec();
|
||||
session.update_supported_decodings();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", "您的远程端不支持查看摄像头。"),
|
||||
("Enable camera", "允许查看摄像头"),
|
||||
("No cameras", "没有摄像头"),
|
||||
("d3d_render_tip", "当启用 D3D 渲染时,某些机器可能无法显示远程画面。"),
|
||||
("Use D3D rendering", "使用 D3D 渲染"),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -240,5 +240,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("View camera", "View camera"),
|
||||
("upgrade_remote_rustdesk_client_to_{}_tip", "Please upgrade the RustDesk client to version {} or newer on the remote side!"),
|
||||
("view_camera_unsupported_tip", "The remote device does not support viewing the camera."),
|
||||
("d3d_render_tip", "When D3D rendering is enabled, the remote control screen may be black on some machines."),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", "Il dispositivo remoto non supporta la visualizzazione della camera."),
|
||||
("Enable camera", "Abilita camera"),
|
||||
("No cameras", "Nessuna camera"),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -657,5 +657,12 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Untagged", ""),
|
||||
("new-version-of-{}-tip", ""),
|
||||
("Accessible devices", ""),
|
||||
("View camera", ""),
|
||||
("upgrade_remote_rustdesk_client_to_{}_tip", ""),
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", "您的遠端設備不支援查看鏡頭"),
|
||||
("Enable camera", "允許查看鏡頭"),
|
||||
("No cameras", "沒有鏡頭"),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -662,5 +662,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("view_camera_unsupported_tip", ""),
|
||||
("Enable camera", ""),
|
||||
("No cameras", ""),
|
||||
("d3d_render_tip", ""),
|
||||
("Use D3D rendering", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
@ -503,6 +503,7 @@ fn run(vs: VideoService) -> ResultType<()> {
|
||||
record_incoming,
|
||||
last_portable_service_running,
|
||||
vs.source,
|
||||
display_idx,
|
||||
) {
|
||||
Ok(result) => result,
|
||||
Err(err) => {
|
||||
@ -522,6 +523,7 @@ fn run(vs: VideoService) -> ResultType<()> {
|
||||
record_incoming,
|
||||
last_portable_service_running,
|
||||
vs.source,
|
||||
display_idx,
|
||||
)?
|
||||
}
|
||||
};
|
||||
@ -791,6 +793,7 @@ fn setup_encoder(
|
||||
record_incoming: bool,
|
||||
last_portable_service_running: bool,
|
||||
source: VideoSource,
|
||||
display_idx: usize,
|
||||
) -> ResultType<(
|
||||
Encoder,
|
||||
EncoderCfg,
|
||||
@ -808,7 +811,7 @@ fn setup_encoder(
|
||||
);
|
||||
Encoder::set_fallback(&encoder_cfg);
|
||||
let codec_format = Encoder::negotiated_codec();
|
||||
let recorder = get_recorder(record_incoming, name);
|
||||
let recorder = get_recorder(record_incoming, display_idx, source == VideoSource::Camera);
|
||||
let use_i444 = Encoder::use_i444(&encoder_cfg);
|
||||
let encoder = Encoder::new(encoder_cfg.clone(), use_i444)?;
|
||||
Ok((encoder, encoder_cfg, codec_format, use_i444, recorder))
|
||||
@ -891,7 +894,11 @@ fn get_encoder_config(
|
||||
}
|
||||
}
|
||||
|
||||
fn get_recorder(record_incoming: bool, video_service_name: String) -> Arc<Mutex<Option<Recorder>>> {
|
||||
fn get_recorder(
|
||||
record_incoming: bool,
|
||||
display_idx: usize,
|
||||
camera: bool,
|
||||
) -> Arc<Mutex<Option<Recorder>>> {
|
||||
#[cfg(windows)]
|
||||
let root = crate::platform::is_root();
|
||||
#[cfg(not(windows))]
|
||||
@ -910,7 +917,8 @@ fn get_recorder(record_incoming: bool, video_service_name: String) -> Arc<Mutex<
|
||||
server: true,
|
||||
id: Config::get_id(),
|
||||
dir: crate::ui_interface::video_save_directory(root),
|
||||
video_service_name,
|
||||
display_idx,
|
||||
camera,
|
||||
tx,
|
||||
})
|
||||
.map_or(Default::default(), |r| Arc::new(Mutex::new(Some(r))))
|
||||
|
@ -415,7 +415,7 @@ class Header: Reactor.Component {
|
||||
adaptDisplay();
|
||||
} else if (type == "codec-preference") {
|
||||
handler.set_option("codec-preference", me.id);
|
||||
handler.change_prefer_codec();
|
||||
handler.update_supported_decodings();
|
||||
}
|
||||
toggleMenuState();
|
||||
}
|
||||
@ -587,7 +587,7 @@ function toggleQualityMonitor(name) {
|
||||
|
||||
function toggleI444(name) {
|
||||
handler.toggle_option(name);
|
||||
handler.change_prefer_codec();
|
||||
handler.update_supported_decodings();
|
||||
toggleMenuState();
|
||||
}
|
||||
|
||||
|
@ -533,7 +533,7 @@ impl sciter::EventHandler for SciterSession {
|
||||
fn is_keyboard_mode_supported(String);
|
||||
fn save_keyboard_mode(String);
|
||||
fn alternative_codecs();
|
||||
fn change_prefer_codec();
|
||||
fn update_supported_decodings();
|
||||
fn restart_remote_device();
|
||||
fn request_voice_call();
|
||||
fn close_voice_call();
|
||||
|
@ -488,14 +488,14 @@ impl<T: InvokeUiSession> Session<T> {
|
||||
(vp8, av1, h264, h265)
|
||||
}
|
||||
|
||||
pub fn change_prefer_codec(&self) {
|
||||
pub fn update_supported_decodings(&self) {
|
||||
let msg = self.lc.write().unwrap().update_supported_decodings();
|
||||
self.send(Data::Message(msg));
|
||||
}
|
||||
|
||||
pub fn use_texture_render_changed(&self) {
|
||||
self.send(Data::ResetDecoder(None));
|
||||
self.change_prefer_codec();
|
||||
self.update_supported_decodings();
|
||||
self.send(Data::Message(LoginConfigHandler::refresh()));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user