Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@rustdesk
Copy link
Owner

@rustdesk rustdesk commented Jul 7, 2025

No description provided.

@rustdesk rustdesk requested a review from Copilot July 7, 2025 08:57
@rustdesk rustdesk changed the title ios ios screen sharing Jul 7, 2025

This comment was marked as outdated.

@rustdesk rustdesk requested a review from Copilot July 10, 2025 08:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR integrates iOS screen sharing and audio capture support into the existing server, scrap, and Flutter layers. Key changes include:

  • Added an iOS-specific audio service implementation in audio_service.rs.
  • Extended the scrap library with an iOS FFI and native ReplayKit-based capture.
  • Updated Flutter UI and model code to handle iOS permissions, settings, and conditionals.

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/server/audio_service.rs Added #[cfg(target_os = "ios")] audio service
src/platform/ios.rs New stubs for platform-level iOS APIs
libs/scrap/src/lib.rs Enabled scrap::ios module
libs/scrap/src/ios/ffi.rs FFI layer with callback and polling buffer
flutter/lib/mobile/pages/settings_page.dart Conditional UI tweaks for Android/iOS
flutter/lib/mobile/pages/server_page.dart Calls to checkIOSPermission, updated notification text
flutter/lib/models/server_model.dart checkIOSPermission and _restartServiceForAudio

showServerSettings(gFFI.dialogManager);
}),
if (!isIOS && !_hideNetwork && !_hideProxy)
if (!_hideNetwork && !_hideProxy)
Copy link

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proxy settings section no longer excludes iOS, causing proxy options to appear on iOS where they should be hidden. Reinstate an isAndroid guard or add an isIOS exclusion to prevent iOS from showing proxy UI.

Copilot uses AI. Check for mistakes.
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(translate("android_start_service_tip"),
Text(translate(isAndroid ? "android_start_service_tip" : "Start screen sharing service"),
Copy link

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The fallback string for iOS is a hard-coded literal rather than a translation key. Consider adding a localized key for consistency and future translations.

Suggested change
Text(translate(isAndroid ? "android_start_service_tip" : "Start screen sharing service"),
Text(translate(isAndroid ? "android_start_service_tip" : "ios_start_service_tip"),

Copilot uses AI. Check for mistakes.
}

lazy_static::lazy_static! {
static ref TEMP_BUFFER: Mutex<Vec<u8>> = Mutex::new(vec![0u8; 4096 * 2160 * 4]);
Copy link

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fallback buffer is statically sized for 4Kx2K RGBA and may be insufficient or wasteful for other resolutions. Consider resizing or reallocating the buffer based on actual get_display_info() dimensions to avoid over-allocating or truncated frames.

Suggested change
static ref TEMP_BUFFER: Mutex<Vec<u8>> = Mutex::new(vec![0u8; 4096 * 2160 * 4]);
static ref TEMP_BUFFER: Mutex<Vec<u8>> = {
let (width, height) = get_display_info();
Mutex::new(vec![0u8; (width * height * 4) as usize])
};

Copilot uses AI. Check for mistakes.
}

/// Check iOS permissions for screen recording and microphone
checkIOSPermission() async {
Copy link

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The async method has no explicit return type. For clarity and type safety, declare it as Future<void> checkIOSPermission() async { ... }.

Suggested change
checkIOSPermission() async {
Future<void> checkIOSPermission() async {

Copilot uses AI. Check for mistakes.
@safwenbarhoumi
Copy link

This merge need check because it make basic issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants