mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-06 16:31:27 +03:00
@@ -18,8 +18,6 @@
|
||||
// to-do:
|
||||
// https://slhck.info/video/2017/03/01/rate-control.html
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
use super::display_service::IS_X11;
|
||||
use super::{
|
||||
display_service::{check_display_changed, get_display_info},
|
||||
service::ServiceTmpl,
|
||||
@@ -28,6 +26,8 @@ use super::{
|
||||
};
|
||||
#[cfg(target_os = "linux")]
|
||||
use crate::common::SimpleCallOnReturn;
|
||||
#[cfg(target_os = "linux")]
|
||||
use crate::platform::linux::is_x11;
|
||||
#[cfg(windows)]
|
||||
use crate::{platform::windows::is_process_consent_running, privacy_win_mag};
|
||||
use hbb_common::{
|
||||
@@ -46,8 +46,6 @@ use scrap::{
|
||||
vpxcodec::{VpxEncoderConfig, VpxVideoCodecId},
|
||||
CodecName, Display, TraitCapturer,
|
||||
};
|
||||
#[cfg(target_os = "linux")]
|
||||
use std::sync::atomic::Ordering;
|
||||
#[cfg(windows)]
|
||||
use std::sync::Once;
|
||||
use std::{
|
||||
@@ -329,7 +327,7 @@ fn get_capturer(
|
||||
) -> ResultType<CapturerInfo> {
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
if !IS_X11.load(Ordering::SeqCst) {
|
||||
if !is_x11() {
|
||||
return super::wayland::get_capturer();
|
||||
}
|
||||
}
|
||||
@@ -571,7 +569,7 @@ fn run(vs: VideoService) -> ResultType<()> {
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
would_block_count += 1;
|
||||
if !IS_X11.load(Ordering::SeqCst) {
|
||||
if !is_x11() {
|
||||
if would_block_count >= 100 {
|
||||
// to-do: Unknown reason for WouldBlock 100 times (seconds = 100 * 1 / fps)
|
||||
// https://github.com/rustdesk/rustdesk/blob/63e6b2f8ab51743e77a151e2b7ff18816f5fa2fb/libs/scrap/src/common/wayland.rs#L81
|
||||
@@ -751,7 +749,7 @@ fn handle_one_frame(
|
||||
|
||||
pub fn is_inited_msg() -> Option<Message> {
|
||||
#[cfg(target_os = "linux")]
|
||||
if !IS_X11.load(Ordering::SeqCst) {
|
||||
if !is_x11() {
|
||||
return super::wayland::is_inited();
|
||||
}
|
||||
None
|
||||
|
||||
Reference in New Issue
Block a user