[MediaStream] Include supported frame rates in video capture presets
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Sep 2018 22:10:16 +0000 (22:10 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Sep 2018 22:10:16 +0000 (22:10 +0000)
commitba5800f05fb2154486b576defd546a10695bcb7b
tree63ceef8490799a6de15b7097e6c8b49495814a70
parentec69f8c8a9fdeb2b747f374bb45956c2919c155f
[MediaStream] Include supported frame rates in video capture presets
https://bugs.webkit.org/show_bug.cgi?id=189351
<rdar://problem/44188917>

Reviewed by Youenn Fablet.

No new tests, no functionality changed.

Include frame rates as well as width/height in video capture presets, so the mock video
capture devices model real camera devices more closely.

* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::setSizeAndFrameRate): Renamed from applySizeAndFrameRate. Use
setSize instead of setWidth and setHeight.
(WebCore::RealtimeMediaSource::applyConstraints): applySizeAndFrameRate -> setSizeAndFrameRate.
(WebCore::RealtimeMediaSource::applySizeAndFrameRate): Deleted.
(WebCore::RealtimeMediaSource::setWidth): Deleted.
(WebCore::RealtimeMediaSource::setHeight): Deleted.
* platform/mediastream/RealtimeMediaSource.h:

* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::setSupportedPresets): New.
(WebCore::updateMinMax):
(WebCore::RealtimeVideoSource::addSupportedCapabilities const): Calculate capabilities from
presets.
(WebCore::RealtimeVideoSource::supportsSizeAndFrameRate): Use bestSupportedSizeAndFrameRate.
(WebCore::RealtimeVideoSource::bestSupportedSizeAndFrameRate):
(WebCore::RealtimeVideoSource::setSizeAndFrameRate):
(WebCore::RealtimeVideoSource::setSupportedFrameRates): Deleted.
(WebCore::RealtimeVideoSource::bestSupportedCaptureSizeForWidthAndHeight): Deleted.
(WebCore::RealtimeVideoSource::applySizeAndFrameRate): Deleted.
(WebCore::RealtimeVideoSource::supportsFrameRate): Deleted.
* platform/mediastream/RealtimeVideoSource.h:
(WebCore::RealtimeVideoSource::setSupportedCaptureSizes): Deleted.
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::GStreamerVideoCaptureSource::stopProducingData):
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::setSizeAndFrameRate):
(WebCore::AVVideoCaptureSource::applySizeAndFrameRate): Deleted.
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
* platform/mock/MockMediaDevice.h:
(WebCore::MockCameraProperties::encode const):
(WebCore::MockCameraProperties::decode):
(WebCore::MockDisplayProperties::encode const):
(WebCore::MockDisplayProperties::decode):
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::defaultDevices):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
(WebCore::MockRealtimeVideoSource::capabilities const):
(WebCore::MockRealtimeVideoSource::settings const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235760 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp
Source/WebCore/platform/mediastream/RealtimeMediaSource.h
Source/WebCore/platform/mediastream/RealtimeVideoSource.cpp
Source/WebCore/platform/mediastream/RealtimeVideoSource.h
Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp
Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.h
Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm
Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm
Source/WebCore/platform/mock/MockMediaDevice.h
Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp
Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp