From ea4cefa3a75dd7a496db1be9b5a360173716bb61 Mon Sep 17 00:00:00 2001 From: Yura Yaroshevich Date: Tue, 29 Mar 2022 12:01:29 +0200 Subject: [PATCH] Added new apple devices. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added new apple devices to corresponding enumeration. Added H264 profile level information. Previous update was done as part of: https://webrtc-review.googlesource.com/c/src/+/202743 Device machine names obtained from: https://gist.github.com/adamawolf/3048717 Bug: None Change-Id: If5cf2773500f2dd73783ede637cd2694e114e353 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256976 Reviewed-by: Kári Helgason Commit-Queue: Yury Yarashevich Cr-Commit-Position: refs/heads/main@{#36372} --- .../video_codec/UIDevice+H264Profile.mm | 18 ++++++++++++++++++ sdk/objc/helpers/UIDevice+RTCDevice.h | 10 ++++++++++ sdk/objc/helpers/UIDevice+RTCDevice.mm | 19 ++++++++++++++++++- 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/sdk/objc/components/video_codec/UIDevice+H264Profile.mm b/sdk/objc/components/video_codec/UIDevice+H264Profile.mm index 42ebadf01e..0ef6a8d77c 100644 --- a/sdk/objc/components/video_codec/UIDevice+H264Profile.mm +++ b/sdk/objc/components/video_codec/UIDevice+H264Profile.mm @@ -24,6 +24,16 @@ struct SupportedH264Profile { constexpr SupportedH264Profile kH264MaxSupportedProfiles[] = { // iPhones with at least iOS 9 + {RTCDeviceTypeIPhone13ProMax, + {H264Profile::kProfileHigh, H264Level::kLevel5_2}}, // https://support.apple.com/kb/SP848 + {RTCDeviceTypeIPhone13Pro, + {H264Profile::kProfileHigh, H264Level::kLevel5_2}}, // https://support.apple.com/kb/SP852 + {RTCDeviceTypeIPhone13, + {H264Profile::kProfileHigh, H264Level::kLevel5_2}}, // https://support.apple.com/kb/SP851 + {RTCDeviceTypeIPhone13Mini, + {H264Profile::kProfileHigh, H264Level::kLevel5_2}}, // https://support.apple.com/kb/SP847 + {RTCDeviceTypeIPhoneSE2Gen, + {H264Profile::kProfileHigh, H264Level::kLevel5_2}}, // https://support.apple.com/kb/SP820 {RTCDeviceTypeIPhone12ProMax, {H264Profile::kProfileHigh, H264Level::kLevel5_2}}, // https://support.apple.com/kb/SP832 {RTCDeviceTypeIPhone12Pro, @@ -162,6 +172,14 @@ constexpr SupportedH264Profile kH264MaxSupportedProfiles[] = { {H264Profile::kProfileHigh, H264Level::kLevel4_2}}, // https://support.apple.com/kb/SP761 {RTCDeviceTypeIPadPro10Inch, {H264Profile::kProfileHigh, H264Level::kLevel4_2}}, // https://support.apple.com/kb/SP762 + {RTCDeviceTypeIPadMini6, + {H264Profile::kProfileHigh, H264Level::kLevel5_2}}, // https://support.apple.com/kb/SP850 + {RTCDeviceTypeIPad9, + {H264Profile::kProfileHigh, H264Level::kLevel4_2}}, // https://support.apple.com/kb/SP849 + {RTCDeviceTypeIPadPro5Gen12Inch, + {H264Profile::kProfileHigh, H264Level::kLevel5_2}}, // https://support.apple.com/kb/SP844 + {RTCDeviceTypeIPadPro5Gen11Inch, + {H264Profile::kProfileHigh, H264Level::kLevel5_2}}, // https://support.apple.com/kb/SP843 }; absl::optional FindMaxSupportedProfileForDevice(RTCDeviceType deviceType) { diff --git a/sdk/objc/helpers/UIDevice+RTCDevice.h b/sdk/objc/helpers/UIDevice+RTCDevice.h index eb9a076647..ab477e2ada 100644 --- a/sdk/objc/helpers/UIDevice+RTCDevice.h +++ b/sdk/objc/helpers/UIDevice+RTCDevice.h @@ -44,6 +44,12 @@ typedef NS_ENUM(NSInteger, RTCDeviceType) { RTCDeviceTypeIPhone12, RTCDeviceTypeIPhone12Pro, RTCDeviceTypeIPhone12ProMax, + RTCDeviceTypeIPhoneSE2Gen, + RTCDeviceTypeIPhone13, + RTCDeviceTypeIPhone13Mini, + RTCDeviceTypeIPhone13Pro, + RTCDeviceTypeIPhone13ProMax, + RTCDeviceTypeIPodTouch1G, RTCDeviceTypeIPodTouch2G, RTCDeviceTypeIPodTouch3G, @@ -88,7 +94,11 @@ typedef NS_ENUM(NSInteger, RTCDeviceType) { RTCDeviceTypeIPadMini5Gen, RTCDeviceTypeIPadAir3Gen, RTCDeviceTypeIPad8, + RTCDeviceTypeIPad9, + RTCDeviceTypeIPadMini6, RTCDeviceTypeIPadAir4Gen, + RTCDeviceTypeIPadPro5Gen11Inch, + RTCDeviceTypeIPadPro5Gen12Inch, RTCDeviceTypeSimulatori386, RTCDeviceTypeSimulatorx86_64, }; diff --git a/sdk/objc/helpers/UIDevice+RTCDevice.mm b/sdk/objc/helpers/UIDevice+RTCDevice.mm index 9b39b99b5c..77a5d79f79 100644 --- a/sdk/objc/helpers/UIDevice+RTCDevice.mm +++ b/sdk/objc/helpers/UIDevice+RTCDevice.mm @@ -52,10 +52,15 @@ @"iPhone12,1" : @(RTCDeviceTypeIPhone11), @"iPhone12,3" : @(RTCDeviceTypeIPhone11Pro), @"iPhone12,5" : @(RTCDeviceTypeIPhone11ProMax), + @"iPhone12,8" : @(RTCDeviceTypeIPhoneSE2Gen), @"iPhone13,1" : @(RTCDeviceTypeIPhone12Mini), @"iPhone13,2" : @(RTCDeviceTypeIPhone12), @"iPhone13,3" : @(RTCDeviceTypeIPhone12Pro), @"iPhone13,4" : @(RTCDeviceTypeIPhone12ProMax), + @"iPhone14,5" : @(RTCDeviceTypeIPhone13), + @"iPhone14,4" : @(RTCDeviceTypeIPhone13Mini), + @"iPhone14,2" : @(RTCDeviceTypeIPhone13Pro), + @"iPhone14,3" : @(RTCDeviceTypeIPhone13ProMax), @"iPod1,1" : @(RTCDeviceTypeIPodTouch1G), @"iPod2,1" : @(RTCDeviceTypeIPodTouch2G), @"iPod3,1" : @(RTCDeviceTypeIPodTouch3G), @@ -122,8 +127,20 @@ @"iPad11,4" : @(RTCDeviceTypeIPadAir3Gen), @"iPad11,6" : @(RTCDeviceTypeIPad8), @"iPad11,7" : @(RTCDeviceTypeIPad8), + @"iPad12,1" : @(RTCDeviceTypeIPad9), + @"iPad12,2" : @(RTCDeviceTypeIPad9), @"iPad13,1" : @(RTCDeviceTypeIPadAir4Gen), - @"iPad12,2" : @(RTCDeviceTypeIPadAir4Gen), + @"iPad13,2" : @(RTCDeviceTypeIPadAir4Gen), + @"iPad13,4" : @(RTCDeviceTypeIPadPro5Gen11Inch), + @"iPad13,5" : @(RTCDeviceTypeIPadPro5Gen11Inch), + @"iPad13,6" : @(RTCDeviceTypeIPadPro5Gen11Inch), + @"iPad13,7" : @(RTCDeviceTypeIPadPro5Gen11Inch), + @"iPad13,8" : @(RTCDeviceTypeIPadPro5Gen12Inch), + @"iPad13,9" : @(RTCDeviceTypeIPadPro5Gen12Inch), + @"iPad13,10" : @(RTCDeviceTypeIPadPro5Gen12Inch), + @"iPad13,11" : @(RTCDeviceTypeIPadPro5Gen12Inch), + @"iPad14,1" : @(RTCDeviceTypeIPadMini6), + @"iPad14,2" : @(RTCDeviceTypeIPadMini6), @"i386" : @(RTCDeviceTypeSimulatori386), @"x86_64" : @(RTCDeviceTypeSimulatorx86_64), };