haikuwebkit/LayoutTests/webrtc/vp9.html

136 lines
5.1 KiB
HTML
Raw Permalink Normal View History

Add VP9 WebRTC codec runtime flag https://bugs.webkit.org/show_bug.cgi?id=213724 Reviewed by Eric Carlson. Source/ThirdParty/libwebrtc: Update WebKit binding code to switch on/off VP9 encoder/decoder. We still use vp9_noop for now, so encoder/decoder is not functional. * Configurations/libwebrtc.iOS.exp: * Configurations/libwebrtc.iOSsim.exp: * Configurations/libwebrtc.mac.exp: * Configurations/libwebrtc.xcconfig: * Configurations/libwebrtcpcrtc.xcconfig: * Source/webrtc/modules/video_coding/codecs/vp9/vp9_noop.cc: * Source/webrtc/sdk/WebKit/WebKitDecoder.mm: (webrtc::createWebKitDecoderFactory): * Source/webrtc/sdk/WebKit/WebKitEncoder.mm: (webrtc::createWebKitEncoderFactory): (webrtc::setH264HardwareEncoderAllowed): (webrtc::isH264HardwareEncoderAllowed): * Source/webrtc/sdk/WebKit/WebKitUtilities.h: * Source/webrtc/sdk/WebKit/WebKitUtilities.mm: * Source/webrtc/sdk/objc/api/video_codec/RTCVideoDecoderVP9.h: * Source/webrtc/sdk/objc/api/video_codec/RTCVideoEncoderVP9.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.m: (-[RTCDefaultVideoDecoderFactory initWithH265:vp9:]): (-[RTCDefaultVideoDecoderFactory supportedCodecs]): * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.m: (-[RTCDefaultVideoEncoderFactory initWithH265:vp9:]): (-[RTCDefaultVideoEncoderFactory supportedCodecs]): * libwebrtc.xcodeproj/project.pbxproj: Source/WebCore: Add binding code to switch on/off VP9 in WebRTC factories based on runtime flag. Test: webrtc/vp9.html * page/Page.cpp: (WebCore::m_shouldRelaxThirdPartyCookieBlocking): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCVP9CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP9CodecEnabled): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): * testing/Internals.cpp: (WebCore::Internals::setWebRTCH265Support): (WebCore::Internals::setWebRTCVP9Support): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: * Shared/WebPreferences.yaml: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): LayoutTests: * webrtc/h265.html: * webrtc/vp9-expected.txt: Added. * webrtc/vp9.html: Added. Canonical link: https://commits.webkit.org/226582@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263734 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 07:19:59 +00:00
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>VP9 in WebRTC</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
</head>
<body>
Add a functional WebRTC VP9 codec https://bugs.webkit.org/show_bug.cgi?id=213778 Reviewed by Eric Carlson. Source/ThirdParty/libwebrtc: Update libvpx to synchronize VP9 support with the rest of libwebrtc. Disable vp9_noop in the build system and use function vp9 encoder/decoder instead. * Configurations/libvpx.xcconfig: * Source/third_party/libvpx/BUILD.gn: * Source/third_party/libvpx/OWNERS: * Source/third_party/libvpx/README.chromium: * Source/third_party/libvpx/generate_gni.sh: * Source/third_party/libvpx/libvpx_srcs.gni: * Source/third_party/libvpx/lint_config.sh: * Source/third_party/libvpx/run_perl.py: * Source/third_party/libvpx/source/config/ios/arm-neon/vp8_rtcd.h: * Source/third_party/libvpx/source/config/ios/arm-neon/vp9_rtcd.h: * Source/third_party/libvpx/source/config/ios/arm-neon/vpx_config.asm: * Source/third_party/libvpx/source/config/ios/arm-neon/vpx_config.c: * Source/third_party/libvpx/source/config/ios/arm-neon/vpx_config.h: * Source/third_party/libvpx/source/config/ios/arm-neon/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/ios/arm64/vp8_rtcd.h: * Source/third_party/libvpx/source/config/ios/arm64/vp9_rtcd.h: * Source/third_party/libvpx/source/config/ios/arm64/vpx_config.asm: * Source/third_party/libvpx/source/config/ios/arm64/vpx_config.c: * Source/third_party/libvpx/source/config/ios/arm64/vpx_config.h: * Source/third_party/libvpx/source/config/ios/arm64/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/linux/arm-neon-cpu-detect/vp8_rtcd.h: * Source/third_party/libvpx/source/config/linux/arm-neon-cpu-detect/vp9_rtcd.h: * Source/third_party/libvpx/source/config/linux/arm-neon-cpu-detect/vpx_config.asm: * Source/third_party/libvpx/source/config/linux/arm-neon-cpu-detect/vpx_config.c: * Source/third_party/libvpx/source/config/linux/arm-neon-cpu-detect/vpx_config.h: * Source/third_party/libvpx/source/config/linux/arm-neon-cpu-detect/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/linux/arm-neon-highbd/vp8_rtcd.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/arm-neon/vp8_rtcd.h. * Source/third_party/libvpx/source/config/linux/arm-neon-highbd/vp9_rtcd.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/generic/vp9_rtcd.h. * Source/third_party/libvpx/source/config/linux/arm-neon-highbd/vpx_config.asm: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/arm-neon/vpx_config.asm. * Source/third_party/libvpx/source/config/linux/arm-neon-highbd/vpx_config.c: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/ios/arm-neon/vpx_config.c. (vpx_codec_build_config): * Source/third_party/libvpx/source/config/linux/arm-neon-highbd/vpx_config.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/arm-neon/vpx_config.h. * Source/third_party/libvpx/source/config/linux/arm-neon-highbd/vpx_dsp_rtcd.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/generic/vpx_dsp_rtcd.h. * Source/third_party/libvpx/source/config/linux/arm-neon-highbd/vpx_scale_rtcd.h: Added. * Source/third_party/libvpx/source/config/linux/arm-neon/vp8_rtcd.h: * Source/third_party/libvpx/source/config/linux/arm-neon/vp9_rtcd.h: * Source/third_party/libvpx/source/config/linux/arm-neon/vpx_config.asm: * Source/third_party/libvpx/source/config/linux/arm-neon/vpx_config.c: * Source/third_party/libvpx/source/config/linux/arm-neon/vpx_config.h: * Source/third_party/libvpx/source/config/linux/arm-neon/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/linux/arm/vp8_rtcd.h: * Source/third_party/libvpx/source/config/linux/arm/vp9_rtcd.h: * Source/third_party/libvpx/source/config/linux/arm/vpx_config.asm: * Source/third_party/libvpx/source/config/linux/arm/vpx_config.c: * Source/third_party/libvpx/source/config/linux/arm/vpx_config.h: * Source/third_party/libvpx/source/config/linux/arm/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/linux/arm64-highbd/vp8_rtcd.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/arm-neon/vp8_rtcd.h. * Source/third_party/libvpx/source/config/linux/arm64-highbd/vp9_rtcd.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/generic/vp9_rtcd.h. * Source/third_party/libvpx/source/config/linux/arm64-highbd/vpx_config.asm: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/arm64/vpx_config.asm. * Source/third_party/libvpx/source/config/linux/arm64-highbd/vpx_config.c: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/ios/arm64/vpx_config.c. (vpx_codec_build_config): * Source/third_party/libvpx/source/config/linux/arm64-highbd/vpx_config.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/arm64/vpx_config.h. * Source/third_party/libvpx/source/config/linux/arm64-highbd/vpx_dsp_rtcd.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/generic/vpx_dsp_rtcd.h. * Source/third_party/libvpx/source/config/linux/arm64-highbd/vpx_scale_rtcd.h: Added. * Source/third_party/libvpx/source/config/linux/arm64/vp8_rtcd.h: * Source/third_party/libvpx/source/config/linux/arm64/vp9_rtcd.h: * Source/third_party/libvpx/source/config/linux/arm64/vpx_config.asm: * Source/third_party/libvpx/source/config/linux/arm64/vpx_config.c: * Source/third_party/libvpx/source/config/linux/arm64/vpx_config.h: * Source/third_party/libvpx/source/config/linux/arm64/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/linux/generic/vp8_rtcd.h: * Source/third_party/libvpx/source/config/linux/generic/vp9_rtcd.h: * Source/third_party/libvpx/source/config/linux/generic/vpx_config.asm: * Source/third_party/libvpx/source/config/linux/generic/vpx_config.c: * Source/third_party/libvpx/source/config/linux/generic/vpx_config.h: * Source/third_party/libvpx/source/config/linux/generic/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/linux/ia32/vp8_rtcd.h: * Source/third_party/libvpx/source/config/linux/ia32/vp9_rtcd.h: * Source/third_party/libvpx/source/config/linux/ia32/vpx_config.asm: * Source/third_party/libvpx/source/config/linux/ia32/vpx_config.c: * Source/third_party/libvpx/source/config/linux/ia32/vpx_config.h: * Source/third_party/libvpx/source/config/linux/ia32/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/linux/mips64el/vp8_rtcd.h: * Source/third_party/libvpx/source/config/linux/mips64el/vp9_rtcd.h: * Source/third_party/libvpx/source/config/linux/mips64el/vpx_config.c: * Source/third_party/libvpx/source/config/linux/mips64el/vpx_config.h: * Source/third_party/libvpx/source/config/linux/mips64el/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/linux/mipsel/vp8_rtcd.h: * Source/third_party/libvpx/source/config/linux/mipsel/vp9_rtcd.h: * Source/third_party/libvpx/source/config/linux/mipsel/vpx_config.c: * Source/third_party/libvpx/source/config/linux/mipsel/vpx_config.h: * Source/third_party/libvpx/source/config/linux/mipsel/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/linux/x64/vp8_rtcd.h: * Source/third_party/libvpx/source/config/linux/x64/vp9_rtcd.h: * Source/third_party/libvpx/source/config/linux/x64/vpx_config.asm: * Source/third_party/libvpx/source/config/linux/x64/vpx_config.c: * Source/third_party/libvpx/source/config/linux/x64/vpx_config.h: * Source/third_party/libvpx/source/config/linux/x64/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/mac/ia32/vp8_rtcd.h: * Source/third_party/libvpx/source/config/mac/ia32/vp9_rtcd.h: * Source/third_party/libvpx/source/config/mac/ia32/vpx_config.asm: * Source/third_party/libvpx/source/config/mac/ia32/vpx_config.c: * Source/third_party/libvpx/source/config/mac/ia32/vpx_config.h: * Source/third_party/libvpx/source/config/mac/ia32/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/mac/x64/vp8_rtcd.h: * Source/third_party/libvpx/source/config/mac/x64/vp8_rtcd_no_acceleration.h: * Source/third_party/libvpx/source/config/mac/x64/vp9_rtcd.h: * Source/third_party/libvpx/source/config/mac/x64/vpx_config.asm: * Source/third_party/libvpx/source/config/mac/x64/vpx_config.c: * Source/third_party/libvpx/source/config/mac/x64/vpx_config.h: * Source/third_party/libvpx/source/config/mac/x64/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/mac/x64/vpx_dsp_rtcd_no_acceleration.h: * Source/third_party/libvpx/source/config/nacl/vp8_rtcd.h: * Source/third_party/libvpx/source/config/nacl/vp9_rtcd.h: * Source/third_party/libvpx/source/config/nacl/vpx_config.c: * Source/third_party/libvpx/source/config/nacl/vpx_config.h: * Source/third_party/libvpx/source/config/nacl/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/vpx_version.h: * Source/third_party/libvpx/source/config/win/arm64/vp8_rtcd.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/arm-neon/vp8_rtcd.h. * Source/third_party/libvpx/source/config/win/arm64/vp9_rtcd.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/generic/vp9_rtcd.h. * Source/third_party/libvpx/source/config/win/arm64/vpx_config.asm: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/ios/arm64/vpx_config.asm. * Source/third_party/libvpx/source/config/win/arm64/vpx_config.c: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/mips64el/vpx_config.c. (vpx_codec_build_config): * Source/third_party/libvpx/source/config/win/arm64/vpx_config.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/arm64/vpx_config.h. * Source/third_party/libvpx/source/config/win/arm64/vpx_dsp_rtcd.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/generic/vpx_dsp_rtcd.h. * Source/third_party/libvpx/source/config/win/arm64/vpx_scale_rtcd.h: Added. * Source/third_party/libvpx/source/config/win/ia32/vp8_rtcd.h: * Source/third_party/libvpx/source/config/win/ia32/vp9_rtcd.h: * Source/third_party/libvpx/source/config/win/ia32/vpx_config.asm: * Source/third_party/libvpx/source/config/win/ia32/vpx_config.c: * Source/third_party/libvpx/source/config/win/ia32/vpx_config.h: * Source/third_party/libvpx/source/config/win/ia32/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/win/x64/vp8_rtcd.h: * Source/third_party/libvpx/source/config/win/x64/vp9_rtcd.h: * Source/third_party/libvpx/source/config/win/x64/vpx_config.asm: * Source/third_party/libvpx/source/config/win/x64/vpx_config.c: * Source/third_party/libvpx/source/config/win/x64/vpx_config.h: * Source/third_party/libvpx/source/config/win/x64/vpx_dsp_rtcd.h: * libwebrtc.xcodeproj/project.pbxproj: LayoutTests: * webrtc/vp9-expected.txt: * webrtc/vp9.html: Canonical link: https://commits.webkit.org/226663@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263820 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-01 21:01:45 +00:00
<video id="video" autoplay playsInline width="320" height="240"></video>
<canvas id="canvas1" width="320" height="240"></canvas>
<canvas id="canvas2" width="320" height="240"></canvas>
<canvas id="canvas3" width="320" height="240"></canvas>
<script src ="routines.js"></script>
Add VP9 WebRTC codec runtime flag https://bugs.webkit.org/show_bug.cgi?id=213724 Reviewed by Eric Carlson. Source/ThirdParty/libwebrtc: Update WebKit binding code to switch on/off VP9 encoder/decoder. We still use vp9_noop for now, so encoder/decoder is not functional. * Configurations/libwebrtc.iOS.exp: * Configurations/libwebrtc.iOSsim.exp: * Configurations/libwebrtc.mac.exp: * Configurations/libwebrtc.xcconfig: * Configurations/libwebrtcpcrtc.xcconfig: * Source/webrtc/modules/video_coding/codecs/vp9/vp9_noop.cc: * Source/webrtc/sdk/WebKit/WebKitDecoder.mm: (webrtc::createWebKitDecoderFactory): * Source/webrtc/sdk/WebKit/WebKitEncoder.mm: (webrtc::createWebKitEncoderFactory): (webrtc::setH264HardwareEncoderAllowed): (webrtc::isH264HardwareEncoderAllowed): * Source/webrtc/sdk/WebKit/WebKitUtilities.h: * Source/webrtc/sdk/WebKit/WebKitUtilities.mm: * Source/webrtc/sdk/objc/api/video_codec/RTCVideoDecoderVP9.h: * Source/webrtc/sdk/objc/api/video_codec/RTCVideoEncoderVP9.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.m: (-[RTCDefaultVideoDecoderFactory initWithH265:vp9:]): (-[RTCDefaultVideoDecoderFactory supportedCodecs]): * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.m: (-[RTCDefaultVideoEncoderFactory initWithH265:vp9:]): (-[RTCDefaultVideoEncoderFactory supportedCodecs]): * libwebrtc.xcodeproj/project.pbxproj: Source/WebCore: Add binding code to switch on/off VP9 in WebRTC factories based on runtime flag. Test: webrtc/vp9.html * page/Page.cpp: (WebCore::m_shouldRelaxThirdPartyCookieBlocking): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCVP9CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP9CodecEnabled): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): * testing/Internals.cpp: (WebCore::Internals::setWebRTCH265Support): (WebCore::Internals::setWebRTCVP9Support): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: * Shared/WebPreferences.yaml: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): LayoutTests: * webrtc/h265.html: * webrtc/vp9-expected.txt: Added. * webrtc/vp9.html: Added. Canonical link: https://commits.webkit.org/226582@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263734 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 07:19:59 +00:00
<script>
Introduce an experimental flag specific to VP9 profile 2 https://bugs.webkit.org/show_bug.cgi?id=219350 Reviewed by Eric Carlson. Source/ThirdParty/libwebrtc: Allow to enable profile 0 but not profile 2 for VP9 encoder and decoder. * Source/webrtc/sdk/WebKit/WebKitDecoder.mm: (webrtc::createWebKitDecoderFactory): * Source/webrtc/sdk/WebKit/WebKitEncoder.mm: (webrtc::createWebKitEncoderFactory): * Source/webrtc/sdk/WebKit/WebKitUtilities.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.m: (-[RTCDefaultVideoDecoderFactory initWithH265:vp9Profile0:vp9Profile2:vp9VTB:]): (-[RTCDefaultVideoDecoderFactory supportedCodecs]): (-[RTCDefaultVideoDecoderFactory initWithH265:vp9:vp9VTB:]): Deleted. * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.m: (-[RTCDefaultVideoEncoderFactory initWithH265:vp9Profile0:vp9Profile2:lowLatencyH264:]): (+[RTCDefaultVideoEncoderFactory supportedCodecs]): (+[RTCDefaultVideoEncoderFactory supportedCodecsWithH265:vp9Profile0:vp9Profile2:]): (-[RTCDefaultVideoEncoderFactory supportedCodecs]): (-[RTCDefaultVideoEncoderFactory initWithH265:vp9:lowLatencyH264:]): Deleted. (+[RTCDefaultVideoEncoderFactory supportedCodecsWithH265:vp9:]): Deleted. Source/WebCore: Introduce an experimental flag for VP9 profile 2. Pass it to libwebrtc backend when creating codec factories. Profile 2 support is only enabled if profile 0 support is also enabled. Covered by updated test. * page/Page.cpp: (WebCore::m_shouldRelaxThirdPartyCookieBlocking): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCVP9Profile0CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP9Profile0CodecEnabled): (WebCore::RuntimeEnabledFeatures::webRTCVP9Profile2CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP9Profile2CodecEnabled): (WebCore::RuntimeEnabledFeatures::webRTCVP9CodecEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setWebRTCVP9CodecEnabled): Deleted. * platform/mediastream/libwebrtc/LibWebRTCProvider.h: (WebCore::LibWebRTCProvider::setVP9Support): * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): * testing/Internals.cpp: (WebCore::Internals::setWebRTCVP9Support): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Source/WTF: * Scripts/Preferences/WebPreferencesExperimental.yaml: LayoutTests: * webrtc/vp9-expected.txt: * webrtc/vp9-vtb.html: * webrtc/vp9.html: Canonical link: https://commits.webkit.org/231965@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270256 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-30 19:36:55 +00:00
let hasVP9 = false;
Add VP9 WebRTC codec runtime flag https://bugs.webkit.org/show_bug.cgi?id=213724 Reviewed by Eric Carlson. Source/ThirdParty/libwebrtc: Update WebKit binding code to switch on/off VP9 encoder/decoder. We still use vp9_noop for now, so encoder/decoder is not functional. * Configurations/libwebrtc.iOS.exp: * Configurations/libwebrtc.iOSsim.exp: * Configurations/libwebrtc.mac.exp: * Configurations/libwebrtc.xcconfig: * Configurations/libwebrtcpcrtc.xcconfig: * Source/webrtc/modules/video_coding/codecs/vp9/vp9_noop.cc: * Source/webrtc/sdk/WebKit/WebKitDecoder.mm: (webrtc::createWebKitDecoderFactory): * Source/webrtc/sdk/WebKit/WebKitEncoder.mm: (webrtc::createWebKitEncoderFactory): (webrtc::setH264HardwareEncoderAllowed): (webrtc::isH264HardwareEncoderAllowed): * Source/webrtc/sdk/WebKit/WebKitUtilities.h: * Source/webrtc/sdk/WebKit/WebKitUtilities.mm: * Source/webrtc/sdk/objc/api/video_codec/RTCVideoDecoderVP9.h: * Source/webrtc/sdk/objc/api/video_codec/RTCVideoEncoderVP9.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.m: (-[RTCDefaultVideoDecoderFactory initWithH265:vp9:]): (-[RTCDefaultVideoDecoderFactory supportedCodecs]): * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.m: (-[RTCDefaultVideoEncoderFactory initWithH265:vp9:]): (-[RTCDefaultVideoEncoderFactory supportedCodecs]): * libwebrtc.xcodeproj/project.pbxproj: Source/WebCore: Add binding code to switch on/off VP9 in WebRTC factories based on runtime flag. Test: webrtc/vp9.html * page/Page.cpp: (WebCore::m_shouldRelaxThirdPartyCookieBlocking): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCVP9CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP9CodecEnabled): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): * testing/Internals.cpp: (WebCore::Internals::setWebRTCH265Support): (WebCore::Internals::setWebRTCVP9Support): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: * Shared/WebPreferences.yaml: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): LayoutTests: * webrtc/h265.html: * webrtc/vp9-expected.txt: Added. * webrtc/vp9.html: Added. Canonical link: https://commits.webkit.org/226582@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263734 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 07:19:59 +00:00
test(() => {
if (window.internals)
Introduce an experimental flag specific to VP9 profile 2 https://bugs.webkit.org/show_bug.cgi?id=219350 Reviewed by Eric Carlson. Source/ThirdParty/libwebrtc: Allow to enable profile 0 but not profile 2 for VP9 encoder and decoder. * Source/webrtc/sdk/WebKit/WebKitDecoder.mm: (webrtc::createWebKitDecoderFactory): * Source/webrtc/sdk/WebKit/WebKitEncoder.mm: (webrtc::createWebKitEncoderFactory): * Source/webrtc/sdk/WebKit/WebKitUtilities.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.m: (-[RTCDefaultVideoDecoderFactory initWithH265:vp9Profile0:vp9Profile2:vp9VTB:]): (-[RTCDefaultVideoDecoderFactory supportedCodecs]): (-[RTCDefaultVideoDecoderFactory initWithH265:vp9:vp9VTB:]): Deleted. * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.m: (-[RTCDefaultVideoEncoderFactory initWithH265:vp9Profile0:vp9Profile2:lowLatencyH264:]): (+[RTCDefaultVideoEncoderFactory supportedCodecs]): (+[RTCDefaultVideoEncoderFactory supportedCodecsWithH265:vp9Profile0:vp9Profile2:]): (-[RTCDefaultVideoEncoderFactory supportedCodecs]): (-[RTCDefaultVideoEncoderFactory initWithH265:vp9:lowLatencyH264:]): Deleted. (+[RTCDefaultVideoEncoderFactory supportedCodecsWithH265:vp9:]): Deleted. Source/WebCore: Introduce an experimental flag for VP9 profile 2. Pass it to libwebrtc backend when creating codec factories. Profile 2 support is only enabled if profile 0 support is also enabled. Covered by updated test. * page/Page.cpp: (WebCore::m_shouldRelaxThirdPartyCookieBlocking): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCVP9Profile0CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP9Profile0CodecEnabled): (WebCore::RuntimeEnabledFeatures::webRTCVP9Profile2CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP9Profile2CodecEnabled): (WebCore::RuntimeEnabledFeatures::webRTCVP9CodecEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setWebRTCVP9CodecEnabled): Deleted. * platform/mediastream/libwebrtc/LibWebRTCProvider.h: (WebCore::LibWebRTCProvider::setVP9Support): * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): * testing/Internals.cpp: (WebCore::Internals::setWebRTCVP9Support): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Source/WTF: * Scripts/Preferences/WebPreferencesExperimental.yaml: LayoutTests: * webrtc/vp9-expected.txt: * webrtc/vp9-vtb.html: * webrtc/vp9.html: Canonical link: https://commits.webkit.org/231965@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270256 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-30 19:36:55 +00:00
window.internals.setWebRTCVP9Support(false, false);
Add VP9 WebRTC codec runtime flag https://bugs.webkit.org/show_bug.cgi?id=213724 Reviewed by Eric Carlson. Source/ThirdParty/libwebrtc: Update WebKit binding code to switch on/off VP9 encoder/decoder. We still use vp9_noop for now, so encoder/decoder is not functional. * Configurations/libwebrtc.iOS.exp: * Configurations/libwebrtc.iOSsim.exp: * Configurations/libwebrtc.mac.exp: * Configurations/libwebrtc.xcconfig: * Configurations/libwebrtcpcrtc.xcconfig: * Source/webrtc/modules/video_coding/codecs/vp9/vp9_noop.cc: * Source/webrtc/sdk/WebKit/WebKitDecoder.mm: (webrtc::createWebKitDecoderFactory): * Source/webrtc/sdk/WebKit/WebKitEncoder.mm: (webrtc::createWebKitEncoderFactory): (webrtc::setH264HardwareEncoderAllowed): (webrtc::isH264HardwareEncoderAllowed): * Source/webrtc/sdk/WebKit/WebKitUtilities.h: * Source/webrtc/sdk/WebKit/WebKitUtilities.mm: * Source/webrtc/sdk/objc/api/video_codec/RTCVideoDecoderVP9.h: * Source/webrtc/sdk/objc/api/video_codec/RTCVideoEncoderVP9.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.m: (-[RTCDefaultVideoDecoderFactory initWithH265:vp9:]): (-[RTCDefaultVideoDecoderFactory supportedCodecs]): * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.m: (-[RTCDefaultVideoEncoderFactory initWithH265:vp9:]): (-[RTCDefaultVideoEncoderFactory supportedCodecs]): * libwebrtc.xcodeproj/project.pbxproj: Source/WebCore: Add binding code to switch on/off VP9 in WebRTC factories based on runtime flag. Test: webrtc/vp9.html * page/Page.cpp: (WebCore::m_shouldRelaxThirdPartyCookieBlocking): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCVP9CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP9CodecEnabled): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): * testing/Internals.cpp: (WebCore::Internals::setWebRTCH265Support): (WebCore::Internals::setWebRTCVP9Support): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: * Shared/WebPreferences.yaml: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): LayoutTests: * webrtc/h265.html: * webrtc/vp9-expected.txt: Added. * webrtc/vp9.html: Added. Canonical link: https://commits.webkit.org/226582@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263734 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 07:19:59 +00:00
let codecs = RTCRtpSender.getCapabilities("video").codecs;
Introduce an experimental flag specific to VP9 profile 2 https://bugs.webkit.org/show_bug.cgi?id=219350 Reviewed by Eric Carlson. Source/ThirdParty/libwebrtc: Allow to enable profile 0 but not profile 2 for VP9 encoder and decoder. * Source/webrtc/sdk/WebKit/WebKitDecoder.mm: (webrtc::createWebKitDecoderFactory): * Source/webrtc/sdk/WebKit/WebKitEncoder.mm: (webrtc::createWebKitEncoderFactory): * Source/webrtc/sdk/WebKit/WebKitUtilities.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.m: (-[RTCDefaultVideoDecoderFactory initWithH265:vp9Profile0:vp9Profile2:vp9VTB:]): (-[RTCDefaultVideoDecoderFactory supportedCodecs]): (-[RTCDefaultVideoDecoderFactory initWithH265:vp9:vp9VTB:]): Deleted. * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.m: (-[RTCDefaultVideoEncoderFactory initWithH265:vp9Profile0:vp9Profile2:lowLatencyH264:]): (+[RTCDefaultVideoEncoderFactory supportedCodecs]): (+[RTCDefaultVideoEncoderFactory supportedCodecsWithH265:vp9Profile0:vp9Profile2:]): (-[RTCDefaultVideoEncoderFactory supportedCodecs]): (-[RTCDefaultVideoEncoderFactory initWithH265:vp9:lowLatencyH264:]): Deleted. (+[RTCDefaultVideoEncoderFactory supportedCodecsWithH265:vp9:]): Deleted. Source/WebCore: Introduce an experimental flag for VP9 profile 2. Pass it to libwebrtc backend when creating codec factories. Profile 2 support is only enabled if profile 0 support is also enabled. Covered by updated test. * page/Page.cpp: (WebCore::m_shouldRelaxThirdPartyCookieBlocking): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCVP9Profile0CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP9Profile0CodecEnabled): (WebCore::RuntimeEnabledFeatures::webRTCVP9Profile2CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP9Profile2CodecEnabled): (WebCore::RuntimeEnabledFeatures::webRTCVP9CodecEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setWebRTCVP9CodecEnabled): Deleted. * platform/mediastream/libwebrtc/LibWebRTCProvider.h: (WebCore::LibWebRTCProvider::setVP9Support): * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): * testing/Internals.cpp: (WebCore::Internals::setWebRTCVP9Support): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Source/WTF: * Scripts/Preferences/WebPreferencesExperimental.yaml: LayoutTests: * webrtc/vp9-expected.txt: * webrtc/vp9-vtb.html: * webrtc/vp9.html: Canonical link: https://commits.webkit.org/231965@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270256 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-30 19:36:55 +00:00
vp9Codecs = codecs.filter(codec => codec.mimeType === "video/VP9");
assert_equals(vp9Codecs.length, 0, "no vp9 codec");
Add VP9 WebRTC codec runtime flag https://bugs.webkit.org/show_bug.cgi?id=213724 Reviewed by Eric Carlson. Source/ThirdParty/libwebrtc: Update WebKit binding code to switch on/off VP9 encoder/decoder. We still use vp9_noop for now, so encoder/decoder is not functional. * Configurations/libwebrtc.iOS.exp: * Configurations/libwebrtc.iOSsim.exp: * Configurations/libwebrtc.mac.exp: * Configurations/libwebrtc.xcconfig: * Configurations/libwebrtcpcrtc.xcconfig: * Source/webrtc/modules/video_coding/codecs/vp9/vp9_noop.cc: * Source/webrtc/sdk/WebKit/WebKitDecoder.mm: (webrtc::createWebKitDecoderFactory): * Source/webrtc/sdk/WebKit/WebKitEncoder.mm: (webrtc::createWebKitEncoderFactory): (webrtc::setH264HardwareEncoderAllowed): (webrtc::isH264HardwareEncoderAllowed): * Source/webrtc/sdk/WebKit/WebKitUtilities.h: * Source/webrtc/sdk/WebKit/WebKitUtilities.mm: * Source/webrtc/sdk/objc/api/video_codec/RTCVideoDecoderVP9.h: * Source/webrtc/sdk/objc/api/video_codec/RTCVideoEncoderVP9.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.m: (-[RTCDefaultVideoDecoderFactory initWithH265:vp9:]): (-[RTCDefaultVideoDecoderFactory supportedCodecs]): * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.m: (-[RTCDefaultVideoEncoderFactory initWithH265:vp9:]): (-[RTCDefaultVideoEncoderFactory supportedCodecs]): * libwebrtc.xcodeproj/project.pbxproj: Source/WebCore: Add binding code to switch on/off VP9 in WebRTC factories based on runtime flag. Test: webrtc/vp9.html * page/Page.cpp: (WebCore::m_shouldRelaxThirdPartyCookieBlocking): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCVP9CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP9CodecEnabled): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): * testing/Internals.cpp: (WebCore::Internals::setWebRTCH265Support): (WebCore::Internals::setWebRTCVP9Support): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: * Shared/WebPreferences.yaml: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): LayoutTests: * webrtc/h265.html: * webrtc/vp9-expected.txt: Added. * webrtc/vp9.html: Added. Canonical link: https://commits.webkit.org/226582@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263734 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 07:19:59 +00:00
if (window.internals)
Introduce an experimental flag specific to VP9 profile 2 https://bugs.webkit.org/show_bug.cgi?id=219350 Reviewed by Eric Carlson. Source/ThirdParty/libwebrtc: Allow to enable profile 0 but not profile 2 for VP9 encoder and decoder. * Source/webrtc/sdk/WebKit/WebKitDecoder.mm: (webrtc::createWebKitDecoderFactory): * Source/webrtc/sdk/WebKit/WebKitEncoder.mm: (webrtc::createWebKitEncoderFactory): * Source/webrtc/sdk/WebKit/WebKitUtilities.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.m: (-[RTCDefaultVideoDecoderFactory initWithH265:vp9Profile0:vp9Profile2:vp9VTB:]): (-[RTCDefaultVideoDecoderFactory supportedCodecs]): (-[RTCDefaultVideoDecoderFactory initWithH265:vp9:vp9VTB:]): Deleted. * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.m: (-[RTCDefaultVideoEncoderFactory initWithH265:vp9Profile0:vp9Profile2:lowLatencyH264:]): (+[RTCDefaultVideoEncoderFactory supportedCodecs]): (+[RTCDefaultVideoEncoderFactory supportedCodecsWithH265:vp9Profile0:vp9Profile2:]): (-[RTCDefaultVideoEncoderFactory supportedCodecs]): (-[RTCDefaultVideoEncoderFactory initWithH265:vp9:lowLatencyH264:]): Deleted. (+[RTCDefaultVideoEncoderFactory supportedCodecsWithH265:vp9:]): Deleted. Source/WebCore: Introduce an experimental flag for VP9 profile 2. Pass it to libwebrtc backend when creating codec factories. Profile 2 support is only enabled if profile 0 support is also enabled. Covered by updated test. * page/Page.cpp: (WebCore::m_shouldRelaxThirdPartyCookieBlocking): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCVP9Profile0CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP9Profile0CodecEnabled): (WebCore::RuntimeEnabledFeatures::webRTCVP9Profile2CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP9Profile2CodecEnabled): (WebCore::RuntimeEnabledFeatures::webRTCVP9CodecEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setWebRTCVP9CodecEnabled): Deleted. * platform/mediastream/libwebrtc/LibWebRTCProvider.h: (WebCore::LibWebRTCProvider::setVP9Support): * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): * testing/Internals.cpp: (WebCore::Internals::setWebRTCVP9Support): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Source/WTF: * Scripts/Preferences/WebPreferencesExperimental.yaml: LayoutTests: * webrtc/vp9-expected.txt: * webrtc/vp9-vtb.html: * webrtc/vp9.html: Canonical link: https://commits.webkit.org/231965@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270256 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-30 19:36:55 +00:00
window.internals.setWebRTCVP9Support(true, false);
Add VP9 WebRTC codec runtime flag https://bugs.webkit.org/show_bug.cgi?id=213724 Reviewed by Eric Carlson. Source/ThirdParty/libwebrtc: Update WebKit binding code to switch on/off VP9 encoder/decoder. We still use vp9_noop for now, so encoder/decoder is not functional. * Configurations/libwebrtc.iOS.exp: * Configurations/libwebrtc.iOSsim.exp: * Configurations/libwebrtc.mac.exp: * Configurations/libwebrtc.xcconfig: * Configurations/libwebrtcpcrtc.xcconfig: * Source/webrtc/modules/video_coding/codecs/vp9/vp9_noop.cc: * Source/webrtc/sdk/WebKit/WebKitDecoder.mm: (webrtc::createWebKitDecoderFactory): * Source/webrtc/sdk/WebKit/WebKitEncoder.mm: (webrtc::createWebKitEncoderFactory): (webrtc::setH264HardwareEncoderAllowed): (webrtc::isH264HardwareEncoderAllowed): * Source/webrtc/sdk/WebKit/WebKitUtilities.h: * Source/webrtc/sdk/WebKit/WebKitUtilities.mm: * Source/webrtc/sdk/objc/api/video_codec/RTCVideoDecoderVP9.h: * Source/webrtc/sdk/objc/api/video_codec/RTCVideoEncoderVP9.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.m: (-[RTCDefaultVideoDecoderFactory initWithH265:vp9:]): (-[RTCDefaultVideoDecoderFactory supportedCodecs]): * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.m: (-[RTCDefaultVideoEncoderFactory initWithH265:vp9:]): (-[RTCDefaultVideoEncoderFactory supportedCodecs]): * libwebrtc.xcodeproj/project.pbxproj: Source/WebCore: Add binding code to switch on/off VP9 in WebRTC factories based on runtime flag. Test: webrtc/vp9.html * page/Page.cpp: (WebCore::m_shouldRelaxThirdPartyCookieBlocking): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCVP9CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP9CodecEnabled): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): * testing/Internals.cpp: (WebCore::Internals::setWebRTCH265Support): (WebCore::Internals::setWebRTCVP9Support): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: * Shared/WebPreferences.yaml: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): LayoutTests: * webrtc/h265.html: * webrtc/vp9-expected.txt: Added. * webrtc/vp9.html: Added. Canonical link: https://commits.webkit.org/226582@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263734 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 07:19:59 +00:00
codecs = RTCRtpSender.getCapabilities("video").codecs;
Introduce an experimental flag specific to VP9 profile 2 https://bugs.webkit.org/show_bug.cgi?id=219350 Reviewed by Eric Carlson. Source/ThirdParty/libwebrtc: Allow to enable profile 0 but not profile 2 for VP9 encoder and decoder. * Source/webrtc/sdk/WebKit/WebKitDecoder.mm: (webrtc::createWebKitDecoderFactory): * Source/webrtc/sdk/WebKit/WebKitEncoder.mm: (webrtc::createWebKitEncoderFactory): * Source/webrtc/sdk/WebKit/WebKitUtilities.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.m: (-[RTCDefaultVideoDecoderFactory initWithH265:vp9Profile0:vp9Profile2:vp9VTB:]): (-[RTCDefaultVideoDecoderFactory supportedCodecs]): (-[RTCDefaultVideoDecoderFactory initWithH265:vp9:vp9VTB:]): Deleted. * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.m: (-[RTCDefaultVideoEncoderFactory initWithH265:vp9Profile0:vp9Profile2:lowLatencyH264:]): (+[RTCDefaultVideoEncoderFactory supportedCodecs]): (+[RTCDefaultVideoEncoderFactory supportedCodecsWithH265:vp9Profile0:vp9Profile2:]): (-[RTCDefaultVideoEncoderFactory supportedCodecs]): (-[RTCDefaultVideoEncoderFactory initWithH265:vp9:lowLatencyH264:]): Deleted. (+[RTCDefaultVideoEncoderFactory supportedCodecsWithH265:vp9:]): Deleted. Source/WebCore: Introduce an experimental flag for VP9 profile 2. Pass it to libwebrtc backend when creating codec factories. Profile 2 support is only enabled if profile 0 support is also enabled. Covered by updated test. * page/Page.cpp: (WebCore::m_shouldRelaxThirdPartyCookieBlocking): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCVP9Profile0CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP9Profile0CodecEnabled): (WebCore::RuntimeEnabledFeatures::webRTCVP9Profile2CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP9Profile2CodecEnabled): (WebCore::RuntimeEnabledFeatures::webRTCVP9CodecEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setWebRTCVP9CodecEnabled): Deleted. * platform/mediastream/libwebrtc/LibWebRTCProvider.h: (WebCore::LibWebRTCProvider::setVP9Support): * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): * testing/Internals.cpp: (WebCore::Internals::setWebRTCVP9Support): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Source/WTF: * Scripts/Preferences/WebPreferencesExperimental.yaml: LayoutTests: * webrtc/vp9-expected.txt: * webrtc/vp9-vtb.html: * webrtc/vp9.html: Canonical link: https://commits.webkit.org/231965@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270256 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-30 19:36:55 +00:00
vp9Codecs = codecs.filter(codec => codec.mimeType === "video/VP9");
assert_equals(vp9Codecs.length, 1, "One vp9 codec");
assert_equals(vp9Codecs[0].sdpFmtpLine, "profile-id=0", "profile 0");
if (window.internals)
window.internals.setWebRTCVP9Support(true, true);
codecs = RTCRtpSender.getCapabilities("video").codecs;
vp9Codecs = codecs.filter(codec => codec.mimeType === "video/VP9");
assert_equals(vp9Codecs[0].sdpFmtpLine, "profile-id=0", "first codec");
assert_equals(vp9Codecs[1].sdpFmtpLine, "profile-id=2", "second codec");
hasVP9 = true;
}, "VP9 in sender getCapabilities");
test(() => {
if (window.internals)
window.internals.setWebRTCVP9Support(false, false);
let codecs = RTCRtpReceiver.getCapabilities("video").codecs;
vp9Codecs = codecs.filter(codec => codec.mimeType === "video/VP9");
assert_equals(vp9Codecs.length, 0, "no vp9 codec");
if (window.internals)
window.internals.setWebRTCVP9Support(true, false);
codecs = RTCRtpReceiver.getCapabilities("video").codecs;
vp9Codecs = codecs.filter(codec => codec.mimeType === "video/VP9");
assert_equals(vp9Codecs.length, 1, "One vp9 codec");
assert_equals(vp9Codecs[0].sdpFmtpLine, "profile-id=0", "profile 0");
if (window.internals)
window.internals.setWebRTCVP9Support(true, true);
codecs = RTCRtpReceiver.getCapabilities("video").codecs;
vp9Codecs = codecs.filter(codec => codec.mimeType === "video/VP9");
assert_equals(vp9Codecs[0].sdpFmtpLine, "profile-id=0", "first codec");
assert_equals(vp9Codecs[1].sdpFmtpLine, "profile-id=2", "second codec");
}, "VP9 in receiver getCapabilities");
Add VP9 WebRTC codec runtime flag https://bugs.webkit.org/show_bug.cgi?id=213724 Reviewed by Eric Carlson. Source/ThirdParty/libwebrtc: Update WebKit binding code to switch on/off VP9 encoder/decoder. We still use vp9_noop for now, so encoder/decoder is not functional. * Configurations/libwebrtc.iOS.exp: * Configurations/libwebrtc.iOSsim.exp: * Configurations/libwebrtc.mac.exp: * Configurations/libwebrtc.xcconfig: * Configurations/libwebrtcpcrtc.xcconfig: * Source/webrtc/modules/video_coding/codecs/vp9/vp9_noop.cc: * Source/webrtc/sdk/WebKit/WebKitDecoder.mm: (webrtc::createWebKitDecoderFactory): * Source/webrtc/sdk/WebKit/WebKitEncoder.mm: (webrtc::createWebKitEncoderFactory): (webrtc::setH264HardwareEncoderAllowed): (webrtc::isH264HardwareEncoderAllowed): * Source/webrtc/sdk/WebKit/WebKitUtilities.h: * Source/webrtc/sdk/WebKit/WebKitUtilities.mm: * Source/webrtc/sdk/objc/api/video_codec/RTCVideoDecoderVP9.h: * Source/webrtc/sdk/objc/api/video_codec/RTCVideoEncoderVP9.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.m: (-[RTCDefaultVideoDecoderFactory initWithH265:vp9:]): (-[RTCDefaultVideoDecoderFactory supportedCodecs]): * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.m: (-[RTCDefaultVideoEncoderFactory initWithH265:vp9:]): (-[RTCDefaultVideoEncoderFactory supportedCodecs]): * libwebrtc.xcodeproj/project.pbxproj: Source/WebCore: Add binding code to switch on/off VP9 in WebRTC factories based on runtime flag. Test: webrtc/vp9.html * page/Page.cpp: (WebCore::m_shouldRelaxThirdPartyCookieBlocking): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCVP9CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP9CodecEnabled): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): * testing/Internals.cpp: (WebCore::Internals::setWebRTCH265Support): (WebCore::Internals::setWebRTCVP9Support): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: * Shared/WebPreferences.yaml: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): LayoutTests: * webrtc/h265.html: * webrtc/vp9-expected.txt: Added. * webrtc/vp9.html: Added. Canonical link: https://commits.webkit.org/226582@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263734 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 07:19:59 +00:00
if (hasVP9) {
promise_test(async (test) => {
const pc = new RTCPeerConnection();
pc.addTransceiver("video");
const description = await pc.createOffer();
pc.close();
assert_true(description.sdp.indexOf("VP9") !== -1, "VP9 codec is in the SDP");
}, "Verify VP9 activation")
Add a functional WebRTC VP9 codec https://bugs.webkit.org/show_bug.cgi?id=213778 Reviewed by Eric Carlson. Source/ThirdParty/libwebrtc: Update libvpx to synchronize VP9 support with the rest of libwebrtc. Disable vp9_noop in the build system and use function vp9 encoder/decoder instead. * Configurations/libvpx.xcconfig: * Source/third_party/libvpx/BUILD.gn: * Source/third_party/libvpx/OWNERS: * Source/third_party/libvpx/README.chromium: * Source/third_party/libvpx/generate_gni.sh: * Source/third_party/libvpx/libvpx_srcs.gni: * Source/third_party/libvpx/lint_config.sh: * Source/third_party/libvpx/run_perl.py: * Source/third_party/libvpx/source/config/ios/arm-neon/vp8_rtcd.h: * Source/third_party/libvpx/source/config/ios/arm-neon/vp9_rtcd.h: * Source/third_party/libvpx/source/config/ios/arm-neon/vpx_config.asm: * Source/third_party/libvpx/source/config/ios/arm-neon/vpx_config.c: * Source/third_party/libvpx/source/config/ios/arm-neon/vpx_config.h: * Source/third_party/libvpx/source/config/ios/arm-neon/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/ios/arm64/vp8_rtcd.h: * Source/third_party/libvpx/source/config/ios/arm64/vp9_rtcd.h: * Source/third_party/libvpx/source/config/ios/arm64/vpx_config.asm: * Source/third_party/libvpx/source/config/ios/arm64/vpx_config.c: * Source/third_party/libvpx/source/config/ios/arm64/vpx_config.h: * Source/third_party/libvpx/source/config/ios/arm64/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/linux/arm-neon-cpu-detect/vp8_rtcd.h: * Source/third_party/libvpx/source/config/linux/arm-neon-cpu-detect/vp9_rtcd.h: * Source/third_party/libvpx/source/config/linux/arm-neon-cpu-detect/vpx_config.asm: * Source/third_party/libvpx/source/config/linux/arm-neon-cpu-detect/vpx_config.c: * Source/third_party/libvpx/source/config/linux/arm-neon-cpu-detect/vpx_config.h: * Source/third_party/libvpx/source/config/linux/arm-neon-cpu-detect/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/linux/arm-neon-highbd/vp8_rtcd.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/arm-neon/vp8_rtcd.h. * Source/third_party/libvpx/source/config/linux/arm-neon-highbd/vp9_rtcd.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/generic/vp9_rtcd.h. * Source/third_party/libvpx/source/config/linux/arm-neon-highbd/vpx_config.asm: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/arm-neon/vpx_config.asm. * Source/third_party/libvpx/source/config/linux/arm-neon-highbd/vpx_config.c: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/ios/arm-neon/vpx_config.c. (vpx_codec_build_config): * Source/third_party/libvpx/source/config/linux/arm-neon-highbd/vpx_config.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/arm-neon/vpx_config.h. * Source/third_party/libvpx/source/config/linux/arm-neon-highbd/vpx_dsp_rtcd.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/generic/vpx_dsp_rtcd.h. * Source/third_party/libvpx/source/config/linux/arm-neon-highbd/vpx_scale_rtcd.h: Added. * Source/third_party/libvpx/source/config/linux/arm-neon/vp8_rtcd.h: * Source/third_party/libvpx/source/config/linux/arm-neon/vp9_rtcd.h: * Source/third_party/libvpx/source/config/linux/arm-neon/vpx_config.asm: * Source/third_party/libvpx/source/config/linux/arm-neon/vpx_config.c: * Source/third_party/libvpx/source/config/linux/arm-neon/vpx_config.h: * Source/third_party/libvpx/source/config/linux/arm-neon/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/linux/arm/vp8_rtcd.h: * Source/third_party/libvpx/source/config/linux/arm/vp9_rtcd.h: * Source/third_party/libvpx/source/config/linux/arm/vpx_config.asm: * Source/third_party/libvpx/source/config/linux/arm/vpx_config.c: * Source/third_party/libvpx/source/config/linux/arm/vpx_config.h: * Source/third_party/libvpx/source/config/linux/arm/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/linux/arm64-highbd/vp8_rtcd.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/arm-neon/vp8_rtcd.h. * Source/third_party/libvpx/source/config/linux/arm64-highbd/vp9_rtcd.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/generic/vp9_rtcd.h. * Source/third_party/libvpx/source/config/linux/arm64-highbd/vpx_config.asm: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/arm64/vpx_config.asm. * Source/third_party/libvpx/source/config/linux/arm64-highbd/vpx_config.c: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/ios/arm64/vpx_config.c. (vpx_codec_build_config): * Source/third_party/libvpx/source/config/linux/arm64-highbd/vpx_config.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/arm64/vpx_config.h. * Source/third_party/libvpx/source/config/linux/arm64-highbd/vpx_dsp_rtcd.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/generic/vpx_dsp_rtcd.h. * Source/third_party/libvpx/source/config/linux/arm64-highbd/vpx_scale_rtcd.h: Added. * Source/third_party/libvpx/source/config/linux/arm64/vp8_rtcd.h: * Source/third_party/libvpx/source/config/linux/arm64/vp9_rtcd.h: * Source/third_party/libvpx/source/config/linux/arm64/vpx_config.asm: * Source/third_party/libvpx/source/config/linux/arm64/vpx_config.c: * Source/third_party/libvpx/source/config/linux/arm64/vpx_config.h: * Source/third_party/libvpx/source/config/linux/arm64/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/linux/generic/vp8_rtcd.h: * Source/third_party/libvpx/source/config/linux/generic/vp9_rtcd.h: * Source/third_party/libvpx/source/config/linux/generic/vpx_config.asm: * Source/third_party/libvpx/source/config/linux/generic/vpx_config.c: * Source/third_party/libvpx/source/config/linux/generic/vpx_config.h: * Source/third_party/libvpx/source/config/linux/generic/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/linux/ia32/vp8_rtcd.h: * Source/third_party/libvpx/source/config/linux/ia32/vp9_rtcd.h: * Source/third_party/libvpx/source/config/linux/ia32/vpx_config.asm: * Source/third_party/libvpx/source/config/linux/ia32/vpx_config.c: * Source/third_party/libvpx/source/config/linux/ia32/vpx_config.h: * Source/third_party/libvpx/source/config/linux/ia32/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/linux/mips64el/vp8_rtcd.h: * Source/third_party/libvpx/source/config/linux/mips64el/vp9_rtcd.h: * Source/third_party/libvpx/source/config/linux/mips64el/vpx_config.c: * Source/third_party/libvpx/source/config/linux/mips64el/vpx_config.h: * Source/third_party/libvpx/source/config/linux/mips64el/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/linux/mipsel/vp8_rtcd.h: * Source/third_party/libvpx/source/config/linux/mipsel/vp9_rtcd.h: * Source/third_party/libvpx/source/config/linux/mipsel/vpx_config.c: * Source/third_party/libvpx/source/config/linux/mipsel/vpx_config.h: * Source/third_party/libvpx/source/config/linux/mipsel/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/linux/x64/vp8_rtcd.h: * Source/third_party/libvpx/source/config/linux/x64/vp9_rtcd.h: * Source/third_party/libvpx/source/config/linux/x64/vpx_config.asm: * Source/third_party/libvpx/source/config/linux/x64/vpx_config.c: * Source/third_party/libvpx/source/config/linux/x64/vpx_config.h: * Source/third_party/libvpx/source/config/linux/x64/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/mac/ia32/vp8_rtcd.h: * Source/third_party/libvpx/source/config/mac/ia32/vp9_rtcd.h: * Source/third_party/libvpx/source/config/mac/ia32/vpx_config.asm: * Source/third_party/libvpx/source/config/mac/ia32/vpx_config.c: * Source/third_party/libvpx/source/config/mac/ia32/vpx_config.h: * Source/third_party/libvpx/source/config/mac/ia32/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/mac/x64/vp8_rtcd.h: * Source/third_party/libvpx/source/config/mac/x64/vp8_rtcd_no_acceleration.h: * Source/third_party/libvpx/source/config/mac/x64/vp9_rtcd.h: * Source/third_party/libvpx/source/config/mac/x64/vpx_config.asm: * Source/third_party/libvpx/source/config/mac/x64/vpx_config.c: * Source/third_party/libvpx/source/config/mac/x64/vpx_config.h: * Source/third_party/libvpx/source/config/mac/x64/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/mac/x64/vpx_dsp_rtcd_no_acceleration.h: * Source/third_party/libvpx/source/config/nacl/vp8_rtcd.h: * Source/third_party/libvpx/source/config/nacl/vp9_rtcd.h: * Source/third_party/libvpx/source/config/nacl/vpx_config.c: * Source/third_party/libvpx/source/config/nacl/vpx_config.h: * Source/third_party/libvpx/source/config/nacl/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/vpx_version.h: * Source/third_party/libvpx/source/config/win/arm64/vp8_rtcd.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/arm-neon/vp8_rtcd.h. * Source/third_party/libvpx/source/config/win/arm64/vp9_rtcd.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/generic/vp9_rtcd.h. * Source/third_party/libvpx/source/config/win/arm64/vpx_config.asm: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/ios/arm64/vpx_config.asm. * Source/third_party/libvpx/source/config/win/arm64/vpx_config.c: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/mips64el/vpx_config.c. (vpx_codec_build_config): * Source/third_party/libvpx/source/config/win/arm64/vpx_config.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/arm64/vpx_config.h. * Source/third_party/libvpx/source/config/win/arm64/vpx_dsp_rtcd.h: Copied from Source/ThirdParty/libwebrtc/Source/third_party/libvpx/source/config/linux/generic/vpx_dsp_rtcd.h. * Source/third_party/libvpx/source/config/win/arm64/vpx_scale_rtcd.h: Added. * Source/third_party/libvpx/source/config/win/ia32/vp8_rtcd.h: * Source/third_party/libvpx/source/config/win/ia32/vp9_rtcd.h: * Source/third_party/libvpx/source/config/win/ia32/vpx_config.asm: * Source/third_party/libvpx/source/config/win/ia32/vpx_config.c: * Source/third_party/libvpx/source/config/win/ia32/vpx_config.h: * Source/third_party/libvpx/source/config/win/ia32/vpx_dsp_rtcd.h: * Source/third_party/libvpx/source/config/win/x64/vp8_rtcd.h: * Source/third_party/libvpx/source/config/win/x64/vp9_rtcd.h: * Source/third_party/libvpx/source/config/win/x64/vpx_config.asm: * Source/third_party/libvpx/source/config/win/x64/vpx_config.c: * Source/third_party/libvpx/source/config/win/x64/vpx_config.h: * Source/third_party/libvpx/source/config/win/x64/vpx_dsp_rtcd.h: * libwebrtc.xcodeproj/project.pbxproj: LayoutTests: * webrtc/vp9-expected.txt: * webrtc/vp9.html: Canonical link: https://commits.webkit.org/226663@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263820 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-01 21:01:45 +00:00
var track;
var remoteTrack;
var receivingConnection;
promise_test((test) => {
return navigator.mediaDevices.getUserMedia({video: {width: 320, height: 240, facingMode: "environment"}}).then((localStream) => {
return new Promise((resolve, reject) => {
track = localStream.getVideoTracks()[0];
createConnections((firstConnection) => {
firstConnection.addTrack(track, localStream);
}, (secondConnection) => {
receivingConnection = secondConnection;
secondConnection.ontrack = (trackEvent) => {
remoteTrack = trackEvent.track;
resolve(trackEvent.streams[0]);
};
}, { observeOffer : (offer) => {
offer.sdp = setCodec(offer.sdp, "VP9");
return offer;
}
});
setTimeout(() => reject("Test timed out"), 5000);
});
}).then((remoteStream) => {
video.srcObject = remoteStream;
return video.play();
});
}, "Setting video exchange");
promise_test(() => {
if (receivingConnection.connectionState === "connected")
return Promise.resolve();
return new Promise((resolve, reject) => {
receivingConnection.onconnectionstatechange = () => {
if (receivingConnection.connectionState === "connected")
resolve();
};
setTimeout(() => reject("Test timed out"), 5000);
});
}, "Ensuring connection state is connected");
promise_test((test) => {
return checkVideoBlack(false, canvas1, video);
}, "Track is enabled, video should not be black");
promise_test((test) => {
track.enabled = false;
return checkVideoBlack(true, canvas2, video);
}, "Track is disabled, video should be black");
promise_test((test) => {
track.enabled = true;
return checkVideoBlack(false, canvas2, video);
}, "Track is enabled, video should not be black 2");
Add VP9 WebRTC codec runtime flag https://bugs.webkit.org/show_bug.cgi?id=213724 Reviewed by Eric Carlson. Source/ThirdParty/libwebrtc: Update WebKit binding code to switch on/off VP9 encoder/decoder. We still use vp9_noop for now, so encoder/decoder is not functional. * Configurations/libwebrtc.iOS.exp: * Configurations/libwebrtc.iOSsim.exp: * Configurations/libwebrtc.mac.exp: * Configurations/libwebrtc.xcconfig: * Configurations/libwebrtcpcrtc.xcconfig: * Source/webrtc/modules/video_coding/codecs/vp9/vp9_noop.cc: * Source/webrtc/sdk/WebKit/WebKitDecoder.mm: (webrtc::createWebKitDecoderFactory): * Source/webrtc/sdk/WebKit/WebKitEncoder.mm: (webrtc::createWebKitEncoderFactory): (webrtc::setH264HardwareEncoderAllowed): (webrtc::isH264HardwareEncoderAllowed): * Source/webrtc/sdk/WebKit/WebKitUtilities.h: * Source/webrtc/sdk/WebKit/WebKitUtilities.mm: * Source/webrtc/sdk/objc/api/video_codec/RTCVideoDecoderVP9.h: * Source/webrtc/sdk/objc/api/video_codec/RTCVideoEncoderVP9.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.m: (-[RTCDefaultVideoDecoderFactory initWithH265:vp9:]): (-[RTCDefaultVideoDecoderFactory supportedCodecs]): * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.h: * Source/webrtc/sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.m: (-[RTCDefaultVideoEncoderFactory initWithH265:vp9:]): (-[RTCDefaultVideoEncoderFactory supportedCodecs]): * libwebrtc.xcodeproj/project.pbxproj: Source/WebCore: Add binding code to switch on/off VP9 in WebRTC factories based on runtime flag. Test: webrtc/vp9.html * page/Page.cpp: (WebCore::m_shouldRelaxThirdPartyCookieBlocking): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCVP9CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP9CodecEnabled): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): * testing/Internals.cpp: (WebCore::Internals::setWebRTCH265Support): (WebCore::Internals::setWebRTCVP9Support): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: * Shared/WebPreferences.yaml: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): LayoutTests: * webrtc/h265.html: * webrtc/vp9-expected.txt: Added. * webrtc/vp9.html: Added. Canonical link: https://commits.webkit.org/226582@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263734 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-30 07:19:59 +00:00
}
</script>
</body>
</html>