WebKit Bugzilla
Attachment 369305 Details for
Bug 196214
: getUserMedia framerate unusable under low light in iOS 12.2
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-196214-20190507112149.patch (text/plain), 3.98 KB, created by
youenn fablet
on 2019-05-07 11:21:50 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2019-05-07 11:21:50 PDT
Size:
3.98 KB
patch
obsolete
>Subversion Revision: 244961 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 160d5581ebb0692f17b8569cd6b48cf844874a21..3dad5edfcaa9bda77efe75d3f1834001dcff8386 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2019-05-07 Youenn Fablet <youenn@apple.com> >+ >+ getUserMedia framerate unusable under low light in iOS 12.2 >+ https://bugs.webkit.org/show_bug.cgi?id=196214 >+ <rdar://problem/49232193> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ When setting the frame rate, set it to the exact value instead of a range. >+ Otherwise, the capture device might use the lowest frame rate according the light conditions >+ for best picture quality which is not what is expected by most web pages. >+ >+ Move frame rate range computation to closer where actually used. >+ Since frame rate matching is fuzzy, add some checks in case the expected frame rate is slightly out of min/max range. >+ >+ Manually tested on a real device. >+ >+ * platform/mediastream/mac/AVVideoCaptureSource.mm: >+ (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset): >+ > 2019-05-06 Youenn Fablet <youenn@apple.com> > > Video stream freeze on front camera orientation changing >diff --git a/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm b/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm >index 85144adf4590a6d8c42fe05b813fc51fa8b3cb3b..106734ffe905ab29ac844b835307e145008d39d3 100644 >--- a/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm >+++ b/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm >@@ -299,11 +299,6 @@ void AVVideoCaptureSource::setSizeAndFrameRateWithPreset(IntSize requestedSize, > m_pendingPreset = nullptr; > m_pendingFrameRate = 0; > >- auto* frameRateRange = frameDurationForFrameRate(requestedFrameRate); >- ASSERT(frameRateRange); >- if (!frameRateRange) >- return; >- > if (!avPreset) > return; > >@@ -316,11 +311,6 @@ void AVVideoCaptureSource::setSizeAndFrameRateWithPreset(IntSize requestedSize, > if (!m_currentPreset || ![m_currentPreset->format.get() isEqual:avPreset->format.get()]) { > [device() setActiveFormat:avPreset->format.get()]; > >- frameRateRange = frameDurationForFrameRate(requestedFrameRate); >- ASSERT(frameRateRange); >- if (!frameRateRange) >- return; >- > #if PLATFORM(MAC) > auto settingsDictionary = @{ > (__bridge NSString *)kCVPixelBufferPixelFormatTypeKey: @(avVideoCapturePixelBufferFormat()), >@@ -331,10 +321,20 @@ void AVVideoCaptureSource::setSizeAndFrameRateWithPreset(IntSize requestedSize, > [m_videoOutput setVideoSettings:settingsDictionary]; > #endif > } >+ auto* frameRateRange = frameDurationForFrameRate(requestedFrameRate); >+ ASSERT(frameRateRange); >+ if (!frameRateRange) >+ return; >+ >+ if (requestedFrameRate < frameRateRange.minFrameRate) >+ requestedFrameRate = frameRateRange.minFrameRate; >+ else if (requestedFrameRate > frameRateRange.maxFrameRate) >+ requestedFrameRate = frameRateRange.maxFrameRate; >+ >+ ALWAYS_LOG_IF(loggerPtr(), LOGIDENTIFIER, "setting frame rate to ", requestedFrameRate); >+ [device() setActiveVideoMinFrameDuration: CMTimeMake(1, requestedFrameRate)]; >+ [device() setActiveVideoMaxFrameDuration: CMTimeMake(1, requestedFrameRate)]; > >- ALWAYS_LOG_IF(loggerPtr(), LOGIDENTIFIER, "setting frame rate ", CMTimeGetSeconds([frameRateRange minFrameDuration]), " .. ", CMTimeGetSeconds([frameRateRange maxFrameDuration])); >- [device() setActiveVideoMinFrameDuration:[frameRateRange minFrameDuration]]; >- [device() setActiveVideoMaxFrameDuration:[frameRateRange maxFrameDuration]]; > [device() unlockForConfiguration]; > } > } @catch(NSException *exception) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 196214
: 369305