[MediaStream] Add mock window capture source
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Sep 2018 20:12:57 +0000 (20:12 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Sep 2018 20:12:57 +0000 (20:12 +0000)
commitdd19eb574ce367a84a01f76ee99fc35cd9e4968b
tree2c2173c5242b5c49f72e9facd86977c4153a811c
parentbfdcd98c718ad7a056ad14b0ffeb9600426ca7e0
[MediaStream] Add mock window capture source
https://bugs.webkit.org/show_bug.cgi?id=189843
<rdar://problem/44687445>

Reviewed by Youenn Fablet.

No new tests, the API is disabled and it isn't possible to test yet.

* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::processNewFrame): Remove an extra blank line.

* platform/mock/MockMediaDevice.h:
(WebCore::MockDisplayProperties::encode const): Get rid of defaultFrameRate, add type.
(WebCore::MockDisplayProperties::decode): Ditto.
(WebCore::MockMediaDevice::type const):

* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::defaultDevices): Add mock window devices.
(WebCore::MockRealtimeMediaSourceCenter::audioDevices): Cleanup.
(WebCore::MockRealtimeMediaSourceCenter::videoDevices): Cleanup.
(WebCore::MockRealtimeMediaSourceCenter::displayDevices): New.

* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Set default size on displays.
(WebCore::MockRealtimeVideoSource::supportsSizeAndFrameRate): Call RealtimeVideoSource for
mock camera, base class for device.
(WebCore::MockRealtimeVideoSource::setSizeAndFrameRate): Ditto.
(WebCore::MockRealtimeVideoSource::generatePresets): ASSERT if called as a camera.
(WebCore::MockRealtimeVideoSource::capabilities): updateCapabilities is only appropriate for cameras.
(WebCore::MockRealtimeVideoSource::settings): Camera and Device are different surface types.
(WebCore::MockRealtimeVideoSource::drawText): Render name, not ID.
(WebCore::MockRealtimeVideoSource::mockDisplayType const):

* platform/mock/MockRealtimeVideoSource.h:
(WebCore::MockRealtimeVideoSource::mockDisplay const):
(WebCore::MockRealtimeVideoSource::mockScreen const):
(WebCore::MockRealtimeVideoSource::mockWindow const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236422 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
Source/WebCore/platform/mediastream/RealtimeVideoSource.h
Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm
Source/WebCore/platform/mock/MockMediaDevice.h
Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp
Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp
Source/WebCore/platform/mock/MockRealtimeVideoSource.h