Changeset 245032 in webkit
- Timestamp:
- May 7, 2019 2:04:09 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r245031 r245032 1 2019-05-07 Youenn Fablet <youenn@apple.com> 2 3 getUserMedia framerate unusable under low light in iOS 12.2 4 https://bugs.webkit.org/show_bug.cgi?id=196214 5 <rdar://problem/49232193> 6 7 Reviewed by Geoffrey Garen. 8 9 When setting the frame rate, set it to the exact value instead of a range. 10 Otherwise, the capture device might use the lowest frame rate according the light conditions 11 for best picture quality which is not what is expected by most web pages. 12 13 Move frame rate range computation to closer where actually used. 14 Since frame rate matching is fuzzy, add some checks in case the expected frame rate is slightly out of min/max range. 15 16 Manually tested on a real device. 17 18 * platform/mediastream/mac/AVVideoCaptureSource.mm: 19 (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset): 20 1 21 2019-05-07 Robin Morisset <rmorisset@apple.com> 2 22 -
trunk/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm
r244704 r245032 300 300 m_pendingFrameRate = 0; 301 301 302 auto* frameRateRange = frameDurationForFrameRate(requestedFrameRate);303 ASSERT(frameRateRange);304 if (!frameRateRange)305 return;306 307 302 if (!avPreset) 308 303 return; … … 316 311 if (!m_currentPreset || ![m_currentPreset->format.get() isEqual:avPreset->format.get()]) { 317 312 [device() setActiveFormat:avPreset->format.get()]; 318 319 frameRateRange = frameDurationForFrameRate(requestedFrameRate);320 ASSERT(frameRateRange);321 if (!frameRateRange)322 return;323 313 324 314 #if PLATFORM(MAC) … … 332 322 #endif 333 323 } 334 335 ALWAYS_LOG_IF(loggerPtr(), LOGIDENTIFIER, "setting frame rate ", CMTimeGetSeconds([frameRateRange minFrameDuration]), " .. ", CMTimeGetSeconds([frameRateRange maxFrameDuration])); 336 [device() setActiveVideoMinFrameDuration:[frameRateRange minFrameDuration]]; 337 [device() setActiveVideoMaxFrameDuration:[frameRateRange maxFrameDuration]]; 324 auto* frameRateRange = frameDurationForFrameRate(requestedFrameRate); 325 ASSERT(frameRateRange); 326 if (!frameRateRange) 327 return; 328 329 if (requestedFrameRate < frameRateRange.minFrameRate) 330 requestedFrameRate = frameRateRange.minFrameRate; 331 else if (requestedFrameRate > frameRateRange.maxFrameRate) 332 requestedFrameRate = frameRateRange.maxFrameRate; 333 334 ALWAYS_LOG_IF(loggerPtr(), LOGIDENTIFIER, "setting frame rate to ", requestedFrameRate); 335 [device() setActiveVideoMinFrameDuration: CMTimeMake(1, requestedFrameRate)]; 336 [device() setActiveVideoMaxFrameDuration: CMTimeMake(1, requestedFrameRate)]; 337 338 338 [device() unlockForConfiguration]; 339 339 }
Note: See TracChangeset
for help on using the changeset viewer.