[MediaCapabilities] Implement MediaEngineConfigurationFactory registration
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Sep 2018 23:18:15 +0000 (23:18 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Sep 2018 23:18:15 +0000 (23:18 +0000)
commitc4df594c0d7eb35322bbe6ccf48c7468fd7ca694
treee3e06398a0c44b5879d446d99a54b5a12b1a4ebd
parentb6c6740c1d65ca85b42de6d800c1d52cf6c2e720
[MediaCapabilities] Implement MediaEngineConfigurationFactory registration
https://bugs.webkit.org/show_bug.cgi?id=189438

Reviewed by Eric Carlson.

Source/WebCore:

Implement a mechanism to register platform-specific MediaEngineConfigurationFactory methods, and a mechanism to iterate
over those registered factories when createDecodingConfiguration() and createEncodingConfiguration() are called.

The Factory has been radically simplified; the concept of MediaEngineDecodingConfiguration
and MediaEngineEncodingConfiguration and its subclasess have been removed. Since the primary
objects representing video and audio configurations are IDLDictionaries, the native objects
are just structs full of POD types (and Strings). Since these have no dependencies on
higher-level HTML concepts, they can be moved into platform/ and accessed from there. This
patch also converts MediaCapabilitiesInfo to an Interface, so its implementation also can
become a struct and live in platform/. The MediaEngineDecodingConfigurationMock and
MediaEngineEncodingConfigurationMock have been consolidated in a single class which simply
parses MediaDecodingConfiguration and MediaEncodingConifguration objects (now that they live
in Platform) and return a MediaCapabilitiesInfo object (now that it does too).

* Modules/mediacapabilities/MediaCapabilities.cpp:
(WebCore::isValidVideoConfiguration):
(WebCore::MediaCapabilities::decodingInfo):
(WebCore::MediaCapabilities::encodingInfo):
* Modules/mediacapabilities/MediaCapabilitiesInfo.h: Removed.
* Modules/mediacapabilities/MediaCapabilitiesInfo.idl:
* Modules/mediacapabilities/VideoConfiguration.idl:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/MediaCapabilitiesInfo.h: Copied from Source/WebCore/Modules/mediacapabilities/MediaDecodingType.h.
* platform/mediacapabilities/AudioConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/AudioConfiguration.h.
* platform/mediacapabilities/MediaConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaConfiguration.h.
* platform/mediacapabilities/MediaDecodingConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaDecodingConfiguration.h.
* platform/mediacapabilities/MediaDecodingType.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaDecodingType.h.
* platform/mediacapabilities/MediaEncodingConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaEncodingConfiguration.h.
* platform/mediacapabilities/MediaEncodingType.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaEncodingType.h.
* platform/mediacapabilities/MediaEngineConfiguration.cpp: Removed.
* platform/mediacapabilities/MediaEngineConfiguration.h: Removed.
* platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
(WebCore::factories):
(WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):
(WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration):
* platform/mediacapabilities/MediaEngineConfigurationFactory.h:
* platform/mediacapabilities/MediaEngineEncodingConfiguration.h: Removed.
* platform/mediacapabilities/VideoConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/VideoConfiguration.h.
* platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
* platform/mock/MediaEngineConfigurationFactoryMock.cpp: Added.
(WebCore::canDecodeMedia):
(WebCore::canSmoothlyDecodeMedia):
(WebCore::canPowerEfficientlyDecodeMedia):
(WebCore::canEncodeMedia):
(WebCore::canSmoothlyEncodeMedia):
(WebCore::canPowerEfficientlyEncodeMedia):
(WebCore::MediaEngineConfigurationFactoryMock::createDecodingConfiguration):
(WebCore::MediaEngineConfigurationFactoryMock::createEncodingConfiguration):
* platform/mock/MediaEngineConfigurationFactoryMock.h: Renamed from Source/WebCore/platform/mediacapabilities/MediaEngineDecodingConfiguration.h.
* platform/mock/MediaEngineDecodingConfigurationMock.cpp: Removed.
* platform/mock/MediaEngineDecodingConfigurationMock.h: Removed.
* platform/mock/MediaEngineEncodingConfigurationMock.cpp: Removed.
* platform/mock/MediaEngineEncodingConfigurationMock.h: Removed.

LayoutTests:

* media/mediacapabilities/mediacapabilities-types-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235919 268f45cc-cd09-0410-ab3c-d52691b4dbfc
29 files changed:
LayoutTests/ChangeLog
LayoutTests/media/mediacapabilities/mediacapabilities-types-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediacapabilities/MediaCapabilities.cpp
Source/WebCore/Modules/mediacapabilities/MediaCapabilitiesInfo.h [deleted file]
Source/WebCore/Modules/mediacapabilities/MediaCapabilitiesInfo.idl
Source/WebCore/Modules/mediacapabilities/VideoConfiguration.idl
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/MediaCapabilitiesInfo.h [new file with mode: 0644]
Source/WebCore/platform/mediacapabilities/AudioConfiguration.h [moved from Source/WebCore/Modules/mediacapabilities/AudioConfiguration.h with 95% similarity]
Source/WebCore/platform/mediacapabilities/MediaConfiguration.h [moved from Source/WebCore/Modules/mediacapabilities/MediaConfiguration.h with 100% similarity]
Source/WebCore/platform/mediacapabilities/MediaDecodingConfiguration.h [moved from Source/WebCore/Modules/mediacapabilities/MediaDecodingConfiguration.h with 100% similarity]
Source/WebCore/platform/mediacapabilities/MediaDecodingType.h [moved from Source/WebCore/Modules/mediacapabilities/MediaDecodingType.h with 100% similarity]
Source/WebCore/platform/mediacapabilities/MediaEncodingConfiguration.h [moved from Source/WebCore/Modules/mediacapabilities/MediaEncodingConfiguration.h with 100% similarity]
Source/WebCore/platform/mediacapabilities/MediaEncodingType.h [moved from Source/WebCore/Modules/mediacapabilities/MediaEncodingType.h with 100% similarity]
Source/WebCore/platform/mediacapabilities/MediaEngineConfiguration.cpp [deleted file]
Source/WebCore/platform/mediacapabilities/MediaEngineConfiguration.h [deleted file]
Source/WebCore/platform/mediacapabilities/MediaEngineConfigurationFactory.cpp
Source/WebCore/platform/mediacapabilities/MediaEngineConfigurationFactory.h
Source/WebCore/platform/mediacapabilities/MediaEngineEncodingConfiguration.h [deleted file]
Source/WebCore/platform/mediacapabilities/VideoConfiguration.h [moved from Source/WebCore/Modules/mediacapabilities/VideoConfiguration.h with 98% similarity]
Source/WebCore/platform/mediastream/mac/DisplayCaptureSourceCocoa.h
Source/WebCore/platform/mock/MediaEngineConfigurationFactoryMock.cpp [new file with mode: 0644]
Source/WebCore/platform/mock/MediaEngineConfigurationFactoryMock.h [moved from Source/WebCore/platform/mediacapabilities/MediaEngineDecodingConfiguration.h with 64% similarity]
Source/WebCore/platform/mock/MediaEngineDecodingConfigurationMock.cpp [deleted file]
Source/WebCore/platform/mock/MediaEngineDecodingConfigurationMock.h [deleted file]
Source/WebCore/platform/mock/MediaEngineEncodingConfigurationMock.cpp [deleted file]
Source/WebCore/platform/mock/MediaEngineEncodingConfigurationMock.h [deleted file]