Add support for HEVC codec types in Media Capabilities
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Sep 2018 23:24:21 +0000 (23:24 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Sep 2018 23:24:21 +0000 (23:24 +0000)
commit082be7a617d8eed84cea7eb44cd962cb59c431ef
treecba7b4e8d7a0266f7254702b1db28711f53dbf39
parent9497ced02097792ef0b16cb58699ca7ae4a73545
Add support for HEVC codec types in Media Capabilities
https://bugs.webkit.org/show_bug.cgi?id=189565

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/hevc-codec-parameters.html

Add some utility methods for parsing HEVC codec strings, and using those parsed
values to query the platform for detailed support for HEVC decoding.

Drive-by fix: Modify MediaEngineConfigurationFactory to allow for null function
pointers in the encode/decode factory pair.

* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/cocoa/VideoToolboxSoftLink.cpp:
* platform/cocoa/VideoToolboxSoftLink.h:
* platform/graphics/HEVCUtilities.cpp: Added.
(WebCore::parseHEVCCodecParameters):
* platform/graphics/HEVCUtilities.h: Added.
* platform/graphics/cocoa/HEVCUtilitiesCocoa.cpp: Added.
(WebCore::validateHEVCParameters):
* platform/graphics/cocoa/HEVCUtilitiesCocoa.h: Added.
* platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp: Added.
(WebCore::videoCodecTypeFromRFC4281Type):
(WebCore::createMediaPlayerDecodingConfigurationCocoa):
* platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.h: Added.
* platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
(WebCore::factories):
(WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):
(WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration):
* testing/Internals.cpp:
(WebCore::Internals::parseHEVCCodecParameters):
* testing/Internals.h:
* testing/Internals.idl:

Source/WTF:

Extract the toIntegralType template into its own header.

* wtf/CMakeLists.txt:
* wtf/text/StringConversion.h: Added.
(isCharacterAllowedInBase):
(toIntegralType):
* wtf/text/WTFString.cpp:

LayoutTests:

* media/hevc-codec-parameters-expected.txt: Added.
* media/hevc-codec-parameters.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236094 268f45cc-cd09-0410-ab3c-d52691b4dbfc
24 files changed:
LayoutTests/ChangeLog
LayoutTests/media/hevc-codec-parameters-expected.txt [new file with mode: 0644]
LayoutTests/media/hevc-codec-parameters.html [new file with mode: 0644]
Source/WTF/ChangeLog
Source/WTF/WTF.xcodeproj/project.pbxproj
Source/WTF/wtf/CMakeLists.txt
Source/WTF/wtf/text/StringToIntegerConversion.h [new file with mode: 0644]
Source/WTF/wtf/text/WTFString.cpp
Source/WebCore/ChangeLog
Source/WebCore/Sources.txt
Source/WebCore/SourcesCocoa.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/cocoa/VideoToolboxSoftLink.cpp
Source/WebCore/platform/cocoa/VideoToolboxSoftLink.h
Source/WebCore/platform/graphics/HEVCUtilities.cpp [new file with mode: 0644]
Source/WebCore/platform/graphics/HEVCUtilities.h [new file with mode: 0644]
Source/WebCore/platform/graphics/cocoa/HEVCUtilitiesCocoa.cpp [new file with mode: 0644]
Source/WebCore/platform/graphics/cocoa/HEVCUtilitiesCocoa.h [new file with mode: 0644]
Source/WebCore/platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp [new file with mode: 0644]
Source/WebCore/platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.h [new file with mode: 0644]
Source/WebCore/platform/mediacapabilities/MediaEngineConfigurationFactory.cpp
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl