Bug 260327

Summary: focusDistance is missing for Back Ultra Wide Camera of iPhone 13
Product: WebKit Reporter: Shawn Lee <shawnlee>
Component: WebRTCAssignee: Nobody <webkit-unassigned>
Status: UNCONFIRMED    
Severity: Normal CC: ap, aqeelalamdp, eric.carlson, jer.noble, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Safari 17   
Hardware: Unspecified   
OS: Unspecified   

Shawn Lee
Reported 2023-08-16 19:53:41 PDT
On iso 17, there is new api get retrieve the min focus distance, however the value is missing for ultra wide camera for iPhone 13. Demo page :https://dtnxk9.csb.app/ iPhone 13: iPhone Microphone {"deviceId":"69BBA450B276790AB69BCD535254A1B0EA75D5CF","echoCancellation":[true,false],"groupId":"F53DA2553E8D2AD376B542C96A8A1C10AA72A298","sampleRate":{"max":96000,"min":8000},"volume":{"max":1,"min":0}} Front Camera {"aspectRatio":{"max":4032,"min":0.00033068783068783067},"deviceId":"1A100C35A33042B643BE0438DBBF9FDC95AF1913","facingMode":["user"],"frameRate":{"max":60,"min":1},"groupId":"EE0F5FFE58E3659B8F368D3DE69D6FC058471255","height":{"max":3024,"min":1},"width":{"max":4032,"min":1},"zoom":{"max":4,"min":1}} Back Dual Wide Camera {"aspectRatio":{"max":4032,"min":0.00033068783068783067},"deviceId":"D87C414E22C375BB0697DCB83A24D97BD520624D","facingMode":["environment"],"focusDistance":{"min":0.15},"frameRate":{"max":60,"min":1},"groupId":"55008F78206D58E1DD946531DB9BD5FFCBEF11CD","height":{"max":3024,"min":1},"width":{"max":4032,"min":1},"zoom":{"max":2,"min":0.5}} Back Ultra Wide Camera {"aspectRatio":{"max":4032,"min":0.00033068783068783067},"deviceId":"BE00A990BEDE2D324EB0AD51F567EE4ADC24D9B0","facingMode":["environment"],"frameRate":{"max":60,"min":1},"groupId":"F5613B39E0AE85C771B447138F6A0ADCEA0B806E","height":{"max":3024,"min":1},"width":{"max":4032,"min":1},"zoom":{"max":4,"min":1}} Back Camera {"aspectRatio":{"max":4032,"min":0.00033068783068783067},"deviceId":"D13A012C1D5C9F9899B40BDA0790184EE57FD282","facingMode":["environment"],"focusDistance":{"min":0.15},"frameRate":{"max":60,"min":1},"groupId":"25D7BB15BD1CD122C4C8F8DF524C5C57F80E9B9F","height":{"max":3024,"min":1},"width":{"max":4032,"min":1},"zoom":{"max":4,"min":1}} iPhone 13 pro : iPhone Microphone {"deviceId":"69BBA450B276790AB69BCD535254A1B0EA75D5CF","echoCancellation":[true,false],"groupId":"07A0DCF04A28397F51AE798B9227C99A322BA068","sampleRate":{"max":96000,"min":8000},"volume":{"max":1,"min":0}} Front Camera {"aspectRatio":{"max":4032,"min":0.00033068783068783067},"deviceId":"1A100C35A33042B643BE0438DBBF9FDC95AF1913","facingMode":["user"],"frameRate":{"max":60,"min":1},"groupId":"F433B1524B14098A9B2765C161DDAF12C0BA3E4F","height":{"max":3024,"min":1},"width":{"max":4032,"min":1},"zoom":{"max":4,"min":1}} Back Triple Camera {"aspectRatio":{"max":4032,"min":0.00033068783068783067},"deviceId":"73FEBB60DC2358265D2E35B3D49C450A52FE9E24","facingMode":["environment"],"focusDistance":{"min":0.02},"frameRate":{"max":60,"min":1},"groupId":"D859012F92052A70EBFB750BC988BCA37539805E","height":{"max":3024,"min":1},"width":{"max":4032,"min":1},"zoom":{"max":2,"min":0.5}} Back Dual Wide Camera {"aspectRatio":{"max":4032,"min":0.00033068783068783067},"deviceId":"D87C414E22C375BB0697DCB83A24D97BD520624D","facingMode":["environment"],"focusDistance":{"min":0.02},"frameRate":{"max":60,"min":1},"groupId":"001B309BB2369F7E16B55A267CE9D84058EE1AA1","height":{"max":3024,"min":1},"width":{"max":4032,"min":1},"zoom":{"max":2,"min":0.5}} Back Ultra Wide Camera {"aspectRatio":{"max":4032,"min":0.00033068783068783067},"deviceId":"BE00A990BEDE2D324EB0AD51F567EE4ADC24D9B0","facingMode":["environment"],"focusDistance":{"min":0.02},"frameRate":{"max":60,"min":1},"groupId":"DA3C322B75C9FE420B4B6282538C5858B78FA3FA","height":{"max":3024,"min":1},"width":{"max":4032,"min":1},"zoom":{"max":4,"min":1}} Back Dual Camera {"aspectRatio":{"max":4032,"min":0.00033068783068783067},"deviceId":"5FBFD35D6004F69AA048E7378063FDE14C3573E7","facingMode":["environment"],"focusDistance":{"min":0.15},"frameRate":{"max":60,"min":1},"groupId":"0ED5008B36E089E00EF1F544CB0762FEC426127C","height":{"max":3024,"min":1},"width":{"max":4032,"min":1},"zoom":{"max":4,"min":1}} Back Camera {"aspectRatio":{"max":4032,"min":0.00033068783068783067},"deviceId":"D13A012C1D5C9F9899B40BDA0790184EE57FD282","facingMode":["environment"],"focusDistance":{"min":0.15},"frameRate":{"max":60,"min":1},"groupId":"9CCECC48E16177BADCCCD72B80915C66B3E9C316","height":{"max":3024,"min":1},"width":{"max":4032,"min":1},"zoom":{"max":4,"min":1}} Back Telephoto Camera {"aspectRatio":{"max":4032,"min":0.00033068783068783067},"deviceId":"2738095FFF2E90F2821224889E8532F54325B357","facingMode":["environment"],"focusDistance":{"min":0.6},"frameRate":{"max":60,"min":1},"groupId":"B6D8147B6ABF334606F52EB6459291AF19C9FBA5","height":{"max":3024,"min":1},"width":{"max":4032,"min":1},"zoom":{"max":4,"min":1}}
Attachments
Alexey Proskuryakov
Comment 1 2023-08-21 09:22:10 PDT
Thank you for the report! Could you please clarify if this worked correctly before iOS 17? We can of course test ourselves, but it will be good to confirm that we're on the same page.
Radar WebKit Bug Importer
Comment 2 2023-08-21 09:22:21 PDT
Eric Carlson
Comment 3 2023-08-21 09:41:47 PDT
WebKit only includes `focusDistance` for a camera if `-[AVCaptureDevice minimumFocusDistance]` doesnt' return -1, see [1], so apparently the iPhone 13 ultra wide camera doesn't support it. [1] https://github.com/WebKit/WebKit/blob/main/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm#L322
Note You need to log in before you can comment on or make changes to this bug.