Skip to content

Fix screen capture orientation for landscape-native devices #1854

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

mrlukyman
Copy link
Contributor

Description

Fix orientation detection for devices where natural orientation is landscape.

Related Issue

Fixes #1852

Changes

  • Replace rotation-based detection with dimension-based detection in OrientationAwareScreenCapturer.java
  • Add DisplayMetrics import
  • Use actual display dimensions instead of assuming rotation meanings

Testing

  • Tested on embedded device with 1280x800 landscape display
  • Verified virtual display now creates with correct dimensions (1280x800)
  • Maintains compatibility with standard portrait devices

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings

@mrlukyman mrlukyman force-pushed the fix/screen-capture-landscape-orientation branch 2 times, most recently from 4f009a5 to 0fbda42 Compare May 29, 2025 10:14
- Corrects isDeviceOrientationPortrait() to properly detect device orientation
- Fixes virtual display dimensions for tablets and embedded devices
- Resolves issue where ROTATION_0 was incorrectly assumed to be portrait

Fixes flutter-webrtc#1852

Co-authored-by: Josh Galicic josh.galicic@hunterlab.com
@mrlukyman mrlukyman force-pushed the fix/screen-capture-landscape-orientation branch from 0fbda42 to d61fbb0 Compare May 29, 2025 10:19
@cloudwebrtc cloudwebrtc merged commit 8f0584b into flutter-webrtc:main May 29, 2025
7 of 8 checks passed
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.

WebRTC screen capture incorrect on devices where 0° rotation is landscape
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy