Assume a modern macOS environment
Mac OS X 10.5 was shipped in 2006, and Mac OS X 10.7 was shipped in 2010. Assume that WebRTC is not running on releases older than those. Bug: none Change-Id: Ia7323c2ae7f186602aa972f390ea682bd2d1ff47 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353240 Auto-Submit: Avi Drissman <avi@chromium.org> Reviewed-by: Henrik Andreassson <henrika@webrtc.org> Commit-Queue: Henrik Andreassson <henrika@webrtc.org> Cr-Commit-Position: refs/heads/main@{#42423}
This commit is contained in:
parent
752a2b8afb
commit
f076fd91a1
@ -282,10 +282,8 @@ class AudioDeviceMac : public AudioDeviceGeneric {
|
||||
uint16_t _outputDeviceIndex;
|
||||
AudioDeviceID _inputDeviceID;
|
||||
AudioDeviceID _outputDeviceID;
|
||||
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
|
||||
AudioDeviceIOProcID _inDeviceIOProcID;
|
||||
AudioDeviceIOProcID _deviceIOProcID;
|
||||
#endif
|
||||
bool _inputDeviceIsSpecified;
|
||||
bool _outputDeviceIsSpecified;
|
||||
|
||||
|
||||
@ -16,16 +16,6 @@
|
||||
|
||||
#include "rtc_base/checks.h"
|
||||
|
||||
#if !defined(MAC_OS_X_VERSION_10_7) || \
|
||||
MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
|
||||
|
||||
@interface NSScreen (LionAPI)
|
||||
- (CGFloat)backingScaleFactor;
|
||||
- (NSRect)convertRectToBacking:(NSRect)aRect;
|
||||
@end
|
||||
|
||||
#endif // MAC_OS_X_VERSION_10_7
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace {
|
||||
@ -60,16 +50,9 @@ MacDisplayConfiguration GetConfigurationForScreen(NSScreen* screen) {
|
||||
NSRect ns_bounds = [screen frame];
|
||||
display_config.bounds = NSRectToDesktopRect(ns_bounds);
|
||||
|
||||
// If the host is running Mac OS X 10.7+ or later, query the scaling factor
|
||||
// between logical and physical (aka "backing") pixels, otherwise assume 1:1.
|
||||
if ([screen respondsToSelector:@selector(backingScaleFactor)] &&
|
||||
[screen respondsToSelector:@selector(convertRectToBacking:)]) {
|
||||
display_config.dip_to_pixel_scale = [screen backingScaleFactor];
|
||||
NSRect ns_pixel_bounds = [screen convertRectToBacking: ns_bounds];
|
||||
display_config.pixel_bounds = NSRectToDesktopRect(ns_pixel_bounds);
|
||||
} else {
|
||||
display_config.pixel_bounds = display_config.bounds;
|
||||
}
|
||||
display_config.dip_to_pixel_scale = [screen backingScaleFactor];
|
||||
NSRect ns_pixel_bounds = [screen convertRectToBacking:ns_bounds];
|
||||
display_config.pixel_bounds = NSRectToDesktopRect(ns_pixel_bounds);
|
||||
|
||||
// Determine if the display is built-in or external.
|
||||
display_config.is_builtin = CGDisplayIsBuiltin(display_config.id);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user