[MediaStream] Implement MediaStreamTrack.getSettings()
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Dec 2015 20:20:37 +0000 (20:20 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Dec 2015 20:20:37 +0000 (20:20 +0000)
commit9105f762ae2eab59cf21d96440ae627e1a2eb796
tree431fd70f0e1811ab47ebf155c0d3ecef7aa2229a
parent3da4a2d35513c66abd446a69a6815644994e736d
[MediaStream] Implement MediaStreamTrack.getSettings()
https://bugs.webkit.org/show_bug.cgi?id=151727

Reviewed by Jer Noble.

Source/WebCore:

MediaStreamTrack.getStates has been replaced by MediaStreamTrack.getSettings.

Test: fast/mediastream/MediaStreamTrack-getSettings.html

* CMakeLists.txt: MediaSourceStates.* -> MediaSourceSettings.*.
* DerivedSources.make: No more MediaSourceStates.idl.
* Modules/mediastream/CapabilityRange.cpp: MediaSourceStates.* -> MediaSourceSettings.*.
* Modules/mediastream/MediaSourceSettings.cpp: Copied from Source/WebCore/Modules/mediastream/MediaSourceStates.cpp.
(WebCore::MediaSourceSettings::create):
(WebCore::MediaSourceSettings::MediaSourceSettings):
(WebCore::MediaSourceSettings::facingMode):
(WebCore::MediaSourceStates::create): Deleted.
(WebCore::MediaSourceStates::MediaSourceStates): Deleted.
(WebCore::MediaSourceStates::sourceType): Deleted.
(WebCore::MediaSourceStates::facingMode): Deleted.
* Modules/mediastream/MediaSourceSettings.h: Copied from Source/WebCore/Modules/mediastream/MediaSourceStates.h.

MediaSourceStates.* renamed to MediaSourceSettings.* and updated to new API.
* Modules/mediastream/MediaSourceStates.cpp: Removed.
* Modules/mediastream/MediaSourceStates.h: Removed.
* Modules/mediastream/MediaSourceStates.idl: Removed.

* Modules/mediastream/MediaStreamCapabilities.cpp:
(WebCore::MediaStreamCapabilities::sourceType): Return an empty vector for now, will be fixed
  by the changes for https://bugs.webkit.org/show_bug.cgi?id=151728.
(WebCore::MediaStreamCapabilities::sourceId): RealtimeMediaSourceStates -> MediaSourceSettings.
(WebCore::MediaStreamCapabilities::facingMode): Ditto.

* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::getSettings): New.
(WebCore::MediaStreamTrack::getCapabilities): Don't modify states, just pass through whatever
  private track returns.
(WebCore::MediaStreamTrack::trackSettingsChanged):
(WebCore::MediaStreamTrack::states): Deleted.
(WebCore::MediaStreamTrack::trackStatesChanged): Deleted.
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/MediaStreamTrack.idl: MediaSourceStates -> MediaSourceSettings.

* Modules/webaudio/MediaStreamAudioSource.cpp:
(WebCore::MediaStreamAudioSource::settings):
(WebCore::MediaStreamAudioSource::states): Deleted.
* Modules/webaudio/MediaStreamAudioSource.h: MediaSourceStates -> MediaSourceSettings.

* WebCore.xcodeproj/project.pbxproj: MediaSourceStates.* -> MediaSourceSettings.*.

* bindings/js/JSMediaSourceStatesCustom.cpp: Removed.
* bindings/js/JSMediaStreamTrackCustom.cpp: Added.
(WebCore::JSMediaStreamTrack::getSettings): MediaSourceSettings is a generic dictionary so
  it has to be generated manually.

* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::intrinsicSize): states -> settings.
(WebCore::MediaStreamPrivate::trackStatesChanged): Deleted.
* platform/mediastream/MediaStreamPrivate.h:

* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::settings):
(WebCore::MediaStreamTrackPrivate::sourceSettingsChanged):
(WebCore::MediaStreamTrackPrivate::states): Deleted.
(WebCore::MediaStreamTrackPrivate::sourceStatesChanged): Deleted.
* platform/mediastream/MediaStreamTrackPrivate.h:

* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::settingsDidChanged):
(WebCore::RealtimeMediaSource::statesDidChanged): Deleted.
* platform/mediastream/RealtimeMediaSource.h:

* platform/mediastream/RealtimeMediaSourceCapabilities.h:
(WebCore::RealtimeMediaSourceCapabilities::facingModes): States -> Settings.
(WebCore::RealtimeMediaSourceCapabilities::addFacingMode): Ditto.
(WebCore::RealtimeMediaSourceCapabilities::sourceTypes): Deleted.
(WebCore::RealtimeMediaSourceCapabilities::setSourceType): Deleted.
(WebCore::RealtimeMediaSourceCapabilities::addSourceType): Deleted.

* platform/mediastream/RealtimeMediaSourceCenter.h: States -> Settings.
* platform/mediastream/RealtimeMediaSourceSettings.cpp: Copied from Source/WebCore/platform/mediastream/RealtimeMediaSourceStates.cpp.
(WebCore::RealtimeMediaSourceSettings::facingMode):
(WebCore::RealtimeMediaSourceStates::facingMode): Deleted.
(WebCore::RealtimeMediaSourceStates::sourceType): Deleted.

* platform/mediastream/RealtimeMediaSourceSettings.h: Copied from Source/WebCore/platform/mediastream/RealtimeMediaSourceStates.h.
* platform/mediastream/RealtimeMediaSourceStates.cpp: Removed.

* platform/mediastream/RealtimeMediaSourceStates.h: Removed.
* platform/mediastream/mac/AVAudioCaptureSource.h:
* platform/mediastream/mac/AVAudioCaptureSource.mm:
(WebCore::AVAudioCaptureSource::updateStates): Deleted.

* platform/mediastream/mac/AVCaptureDeviceManager.h:
* platform/mediastream/mac/AVCaptureDeviceManager.mm:

* platform/mediastream/mac/AVMediaCaptureSource.h:
* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::AVMediaCaptureSource::states): Deleted.

* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::updateStates): Deleted.

* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:

* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:

* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::initializeSupportedConstraints):
(WebCore::MockRealtimeAudioSource::updateStates): Deleted.
* platform/mock/MockRealtimeAudioSource.h:

* platform/mock/MockRealtimeMediaSource.cpp:
(WebCore::MockRealtimeMediaSource::capabilities): Minor cleanup.
(WebCore::MockRealtimeMediaSource::settings):
(WebCore::MockRealtimeMediaSource::supportedConstraints):
(WebCore::MockRealtimeMediaSource::states): Deleted.
* platform/mock/MockRealtimeMediaSource.h:
(WebCore::MockRealtimeMediaSource::constraints):
(WebCore::MockRealtimeMediaSource::currentStates): Deleted.

* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::updateSettings):
(WebCore::MockRealtimeVideoSource::initializeCapabilities):
(WebCore::MockRealtimeVideoSource::initializeSupportedConstraints):
(WebCore::MockRealtimeVideoSource::setFrameRate): states -> settings.
(WebCore::MockRealtimeVideoSource::setSize): Ditto.
(WebCore::MockRealtimeVideoSource::drawAnimation): Ditto.
(WebCore::MockRealtimeVideoSource::drawText): Ditto.
(WebCore::MockRealtimeVideoSource::updateStates): Deleted.
(WebCore::MockRealtimeVideoSource::setFacingMode): Deleted.
* platform/mock/MockRealtimeVideoSource.h:

LayoutTests:

* fast/mediastream/MediaStream-video-element-expected.txt:
* fast/mediastream/MediaStream-video-element-track-stop-expected.txt:
* fast/mediastream/MediaStream-video-element-track-stop.html:
* fast/mediastream/MediaStream-video-element.html:
* fast/mediastream/MediaStreamTrack-getSettings-expected.txt: Added.
* fast/mediastream/MediaStreamTrack-getSettings.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192954 268f45cc-cd09-0410-ab3c-d52691b4dbfc
54 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/mediastream/MediaStream-video-element-expected.txt
LayoutTests/fast/mediastream/MediaStream-video-element-track-stop-expected.txt
LayoutTests/fast/mediastream/MediaStream-video-element-track-stop.html
LayoutTests/fast/mediastream/MediaStream-video-element.html
LayoutTests/fast/mediastream/MediaStreamTrack-getSettings-expected.txt [new file with mode: 0644]
LayoutTests/fast/mediastream/MediaStreamTrack-getSettings.html [new file with mode: 0644]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/Modules/mediastream/CapabilityRange.cpp
Source/WebCore/Modules/mediastream/CaptureDeviceInfo.h
Source/WebCore/Modules/mediastream/CaptureDeviceManager.cpp
Source/WebCore/Modules/mediastream/CaptureDeviceManager.h
Source/WebCore/Modules/mediastream/MediaSourceSettings.cpp [moved from Source/WebCore/Modules/mediastream/MediaSourceStates.cpp with 69% similarity]
Source/WebCore/Modules/mediastream/MediaSourceSettings.h [new file with mode: 0644]
Source/WebCore/Modules/mediastream/MediaSourceStates.h [deleted file]
Source/WebCore/Modules/mediastream/MediaSourceStates.idl [deleted file]
Source/WebCore/Modules/mediastream/MediaStreamCapabilities.cpp
Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp
Source/WebCore/Modules/mediastream/MediaStreamTrack.h
Source/WebCore/Modules/mediastream/MediaStreamTrack.idl
Source/WebCore/Modules/webaudio/MediaStreamAudioSource.cpp
Source/WebCore/Modules/webaudio/MediaStreamAudioSource.h
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSMediaSourceStatesCustom.cpp [deleted file]
Source/WebCore/bindings/js/JSMediaStreamTrackCustom.cpp [new file with mode: 0644]
Source/WebCore/platform/mediastream/MediaStreamPrivate.cpp
Source/WebCore/platform/mediastream/MediaStreamPrivate.h
Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.cpp
Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.h
Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp
Source/WebCore/platform/mediastream/RealtimeMediaSource.h
Source/WebCore/platform/mediastream/RealtimeMediaSourceCapabilities.h
Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.h
Source/WebCore/platform/mediastream/RealtimeMediaSourceSettings.cpp [moved from Source/WebCore/platform/mediastream/RealtimeMediaSourceStates.cpp with 67% similarity]
Source/WebCore/platform/mediastream/RealtimeMediaSourceSettings.h [new file with mode: 0644]
Source/WebCore/platform/mediastream/RealtimeMediaSourceStates.h [deleted file]
Source/WebCore/platform/mediastream/mac/AVAudioCaptureSource.h
Source/WebCore/platform/mediastream/mac/AVAudioCaptureSource.mm
Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.h
Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.mm
Source/WebCore/platform/mediastream/mac/AVMediaCaptureSource.h
Source/WebCore/platform/mediastream/mac/AVMediaCaptureSource.mm
Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.h
Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm
Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.mm
Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h
Source/WebCore/platform/mock/MockRealtimeAudioSource.cpp
Source/WebCore/platform/mock/MockRealtimeAudioSource.h
Source/WebCore/platform/mock/MockRealtimeMediaSource.cpp
Source/WebCore/platform/mock/MockRealtimeMediaSource.h
Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp
Source/WebCore/platform/mock/MockRealtimeVideoSource.h