haikuwebkit/LayoutTests/webrtc/video-mute-vp8.html

134 lines
4.8 KiB
HTML
Raw Permalink Normal View History

Add VP8 support to WebRTC https://bugs.webkit.org/show_bug.cgi?id=189976 Reviewed by Eric Carlson. LayoutTests/imported/w3c: * web-platform-tests/webrtc/RTCPeerConnection-addIceCandidate-expected.txt: Source/ThirdParty/libwebrtc: Add support for conditional VP8 support for both encoding and decoding. This boolean is used by WebCore based on the new VP8 runtime flag. Enable yasm compilation as a dependency of libvpx. Compilation is done without using SSE4/AVX2 optimizations. * Configurations/libvpx.xcconfig: Added. * Configurations/libwebrtc.iOS.exp: * Configurations/libwebrtc.iOSsim.exp: * Configurations/libwebrtc.mac.exp: * Configurations/libwebrtc.xcconfig: * Configurations/libwebrtcpcrtc.xcconfig: * Source/third_party/libvpx/run_yasm_webkit.py: Added. * Source/third_party/libvpx/source/config/mac/x64/vpx_config.asm: * Source/third_party/libvpx/source/config/mac/x64/vpx_config.h: * Source/third_party/libvpx/source/config/mac/x64/vpx_dsp_rtcd.h: * Source/webrtc/sdk/WebKit/WebKitUtilities.h: * Source/webrtc/sdk/WebKit/WebKitUtilities.mm: (webrtc::createWebKitEncoderFactory): (webrtc::createWebKitDecoderFactory): * Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCVideoCodecFactory.h: * libwebrtc.xcodeproj/project.pbxproj: Source/WebCore: Add a runtime flag to control activation of VP8 codec. Bind this runtime flag to the video codec factories. Test: webrtc/video-mute-vp8.html * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::createLibWebRTCPeerConnectionBackend): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCVP8CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP8CodecEnabled): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Enable VP8 codec for tests. Source/WebKit: * Shared/WebPreferences.yaml: LayoutTests: * webrtc/audio-peer-connection-g722.html: * webrtc/routines.js: * webrtc/video-mute-vp8-expected.txt: Added. * webrtc/video-mute-vp8.html: Added. Canonical link: https://commits.webkit.org/205219@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236821 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-04 01:53:27 +00:00
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Testing muting video</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
</head>
<body>
<div>Video should be running, go to black and running.</div>
<div>Following, should be a snapshot of the video, a black frame and a snapshot of the video.</div>
<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>
<script>
promise_test(async (test) => {
if (window.internals)
window.internals.clearPeerConnectionFactory();
const codecs = RTCRtpSender.getCapabilities("video").codecs;
assert_true(codecs.some((codec) => { return codec.mimeType.indexOf("VP8") >= 0 }), "VP8 is listed as a codec");
codecs.forEach((codec) => {
if (codec.mimeType.indexOf("VP8") >=0)
assert_equals(codec.sdpFmtpLine, undefined, "VP8 codec.sdpFmtpLine is undefined");
});
const pc = new RTCPeerConnection();
pc.addTransceiver("video");
const description = await pc.createOffer();
pc.close();
assert_true(description.sdp.indexOf("VP8") !== -1, "VP8 codec is in the SDP");
}, "Verify VP8 activation")
Add VP8 support to WebRTC https://bugs.webkit.org/show_bug.cgi?id=189976 Reviewed by Eric Carlson. LayoutTests/imported/w3c: * web-platform-tests/webrtc/RTCPeerConnection-addIceCandidate-expected.txt: Source/ThirdParty/libwebrtc: Add support for conditional VP8 support for both encoding and decoding. This boolean is used by WebCore based on the new VP8 runtime flag. Enable yasm compilation as a dependency of libvpx. Compilation is done without using SSE4/AVX2 optimizations. * Configurations/libvpx.xcconfig: Added. * Configurations/libwebrtc.iOS.exp: * Configurations/libwebrtc.iOSsim.exp: * Configurations/libwebrtc.mac.exp: * Configurations/libwebrtc.xcconfig: * Configurations/libwebrtcpcrtc.xcconfig: * Source/third_party/libvpx/run_yasm_webkit.py: Added. * Source/third_party/libvpx/source/config/mac/x64/vpx_config.asm: * Source/third_party/libvpx/source/config/mac/x64/vpx_config.h: * Source/third_party/libvpx/source/config/mac/x64/vpx_dsp_rtcd.h: * Source/webrtc/sdk/WebKit/WebKitUtilities.h: * Source/webrtc/sdk/WebKit/WebKitUtilities.mm: (webrtc::createWebKitEncoderFactory): (webrtc::createWebKitDecoderFactory): * Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCVideoCodecFactory.h: * libwebrtc.xcodeproj/project.pbxproj: Source/WebCore: Add a runtime flag to control activation of VP8 codec. Bind this runtime flag to the video codec factories. Test: webrtc/video-mute-vp8.html * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::createLibWebRTCPeerConnectionBackend): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCVP8CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP8CodecEnabled): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Enable VP8 codec for tests. Source/WebKit: * Shared/WebPreferences.yaml: LayoutTests: * webrtc/audio-peer-connection-g722.html: * webrtc/routines.js: * webrtc/video-mute-vp8-expected.txt: Added. * webrtc/video-mute-vp8.html: Added. Canonical link: https://commits.webkit.org/205219@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236821 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-04 01:53:27 +00:00
var track;
var remoteTrack;
var receivingConnection;
promise_test((test) => {
if (window.testRunner)
testRunner.setUserMediaPermission(true);
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);
Implement transceiver setCodecPreferences https://bugs.webkit.org/show_bug.cgi?id=190840 <rdar://problem/45496326> Reviewed by Eric Carlson. LayoutTests/imported/w3c: * web-platform-tests/webrtc/RTCRtpTransceiver-setCodecPreferences-expected.txt: Source/ThirdParty/libwebrtc: * Configurations/libwebrtc.iOS.exp: * Configurations/libwebrtc.iOSsim.exp: * Configurations/libwebrtc.mac.exp: Source/WebCore: Add binding code to pipe setCodecPreferences up to webrtc backend, Covered by updated and rebased tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/mediastream/RTCRtpCapabilities.idl: * Modules/mediastream/RTCRtpCodecCapability.idl: Added. * Modules/mediastream/RTCRtpTransceiver.cpp: (WebCore::RTCRtpTransceiver::setCodecPreferences): * Modules/mediastream/RTCRtpTransceiver.h: * Modules/mediastream/RTCRtpTransceiver.idl: * Modules/mediastream/RTCRtpTransceiverBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCObservers.h: (WebCore::toExceptionCode): Deleted. * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp: (WebCore::toRtpCodecCapability): (WebCore::LibWebRTCRtpTransceiverBackend::setCodecPreferences): * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: (WebCore::toExceptionCode): (WebCore::toException): * Modules/mediastream/libwebrtc/LibWebRTCUtils.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/mediastream/RTCRtpCapabilities.h: (): Deleted. * platform/mediastream/RTCRtpCodecCapability.h: Added. * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: (WebCore::toRTCRtpCapabilities): LayoutTests: * webrtc/video-mute-vp8.html: Canonical link: https://commits.webkit.org/218842@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253966 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-01 12:55:46 +00:00
firstConnection.getTransceivers()[0].setCodecPreferences([{mimeType: "video/VP8", clockRate: 90000}]);
Add VP8 support to WebRTC https://bugs.webkit.org/show_bug.cgi?id=189976 Reviewed by Eric Carlson. LayoutTests/imported/w3c: * web-platform-tests/webrtc/RTCPeerConnection-addIceCandidate-expected.txt: Source/ThirdParty/libwebrtc: Add support for conditional VP8 support for both encoding and decoding. This boolean is used by WebCore based on the new VP8 runtime flag. Enable yasm compilation as a dependency of libvpx. Compilation is done without using SSE4/AVX2 optimizations. * Configurations/libvpx.xcconfig: Added. * Configurations/libwebrtc.iOS.exp: * Configurations/libwebrtc.iOSsim.exp: * Configurations/libwebrtc.mac.exp: * Configurations/libwebrtc.xcconfig: * Configurations/libwebrtcpcrtc.xcconfig: * Source/third_party/libvpx/run_yasm_webkit.py: Added. * Source/third_party/libvpx/source/config/mac/x64/vpx_config.asm: * Source/third_party/libvpx/source/config/mac/x64/vpx_config.h: * Source/third_party/libvpx/source/config/mac/x64/vpx_dsp_rtcd.h: * Source/webrtc/sdk/WebKit/WebKitUtilities.h: * Source/webrtc/sdk/WebKit/WebKitUtilities.mm: (webrtc::createWebKitEncoderFactory): (webrtc::createWebKitDecoderFactory): * Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCVideoCodecFactory.h: * libwebrtc.xcodeproj/project.pbxproj: Source/WebCore: Add a runtime flag to control activation of VP8 codec. Bind this runtime flag to the video codec factories. Test: webrtc/video-mute-vp8.html * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::createLibWebRTCPeerConnectionBackend): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCVP8CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP8CodecEnabled): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Enable VP8 codec for tests. Source/WebKit: * Shared/WebPreferences.yaml: LayoutTests: * webrtc/audio-peer-connection-g722.html: * webrtc/routines.js: * webrtc/video-mute-vp8-expected.txt: Added. * webrtc/video-mute-vp8.html: Added. Canonical link: https://commits.webkit.org/205219@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236821 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-04 01:53:27 +00:00
}, (secondConnection) => {
receivingConnection = secondConnection;
secondConnection.ontrack = (trackEvent) => {
remoteTrack = trackEvent.track;
resolve(trackEvent.streams[0]);
};
Implement transceiver setCodecPreferences https://bugs.webkit.org/show_bug.cgi?id=190840 <rdar://problem/45496326> Reviewed by Eric Carlson. LayoutTests/imported/w3c: * web-platform-tests/webrtc/RTCRtpTransceiver-setCodecPreferences-expected.txt: Source/ThirdParty/libwebrtc: * Configurations/libwebrtc.iOS.exp: * Configurations/libwebrtc.iOSsim.exp: * Configurations/libwebrtc.mac.exp: Source/WebCore: Add binding code to pipe setCodecPreferences up to webrtc backend, Covered by updated and rebased tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/mediastream/RTCRtpCapabilities.idl: * Modules/mediastream/RTCRtpCodecCapability.idl: Added. * Modules/mediastream/RTCRtpTransceiver.cpp: (WebCore::RTCRtpTransceiver::setCodecPreferences): * Modules/mediastream/RTCRtpTransceiver.h: * Modules/mediastream/RTCRtpTransceiver.idl: * Modules/mediastream/RTCRtpTransceiverBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCObservers.h: (WebCore::toExceptionCode): Deleted. * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp: (WebCore::toRtpCodecCapability): (WebCore::LibWebRTCRtpTransceiverBackend::setCodecPreferences): * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: (WebCore::toExceptionCode): (WebCore::toException): * Modules/mediastream/libwebrtc/LibWebRTCUtils.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/mediastream/RTCRtpCapabilities.h: (): Deleted. * platform/mediastream/RTCRtpCodecCapability.h: Added. * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: (WebCore::toRTCRtpCapabilities): LayoutTests: * webrtc/video-mute-vp8.html: Canonical link: https://commits.webkit.org/218842@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253966 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-01 12:55:46 +00:00
}, { observeOffer : test.step_func((offer) => {
assert_false(offer.sdp.includes("H264"), "No H264");
assert_true(offer.sdp.includes("VP8"), "VP8");
Add VP8 support to WebRTC https://bugs.webkit.org/show_bug.cgi?id=189976 Reviewed by Eric Carlson. LayoutTests/imported/w3c: * web-platform-tests/webrtc/RTCPeerConnection-addIceCandidate-expected.txt: Source/ThirdParty/libwebrtc: Add support for conditional VP8 support for both encoding and decoding. This boolean is used by WebCore based on the new VP8 runtime flag. Enable yasm compilation as a dependency of libvpx. Compilation is done without using SSE4/AVX2 optimizations. * Configurations/libvpx.xcconfig: Added. * Configurations/libwebrtc.iOS.exp: * Configurations/libwebrtc.iOSsim.exp: * Configurations/libwebrtc.mac.exp: * Configurations/libwebrtc.xcconfig: * Configurations/libwebrtcpcrtc.xcconfig: * Source/third_party/libvpx/run_yasm_webkit.py: Added. * Source/third_party/libvpx/source/config/mac/x64/vpx_config.asm: * Source/third_party/libvpx/source/config/mac/x64/vpx_config.h: * Source/third_party/libvpx/source/config/mac/x64/vpx_dsp_rtcd.h: * Source/webrtc/sdk/WebKit/WebKitUtilities.h: * Source/webrtc/sdk/WebKit/WebKitUtilities.mm: (webrtc::createWebKitEncoderFactory): (webrtc::createWebKitDecoderFactory): * Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCVideoCodecFactory.h: * libwebrtc.xcodeproj/project.pbxproj: Source/WebCore: Add a runtime flag to control activation of VP8 codec. Bind this runtime flag to the video codec factories. Test: webrtc/video-mute-vp8.html * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::createLibWebRTCPeerConnectionBackend): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCVP8CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP8CodecEnabled): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Enable VP8 codec for tests. Source/WebKit: * Shared/WebPreferences.yaml: LayoutTests: * webrtc/audio-peer-connection-g722.html: * webrtc/routines.js: * webrtc/video-mute-vp8-expected.txt: Added. * webrtc/video-mute-vp8.html: Added. Canonical link: https://commits.webkit.org/205219@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236821 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-04 01:53:27 +00:00
return offer;
Implement transceiver setCodecPreferences https://bugs.webkit.org/show_bug.cgi?id=190840 <rdar://problem/45496326> Reviewed by Eric Carlson. LayoutTests/imported/w3c: * web-platform-tests/webrtc/RTCRtpTransceiver-setCodecPreferences-expected.txt: Source/ThirdParty/libwebrtc: * Configurations/libwebrtc.iOS.exp: * Configurations/libwebrtc.iOSsim.exp: * Configurations/libwebrtc.mac.exp: Source/WebCore: Add binding code to pipe setCodecPreferences up to webrtc backend, Covered by updated and rebased tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/mediastream/RTCRtpCapabilities.idl: * Modules/mediastream/RTCRtpCodecCapability.idl: Added. * Modules/mediastream/RTCRtpTransceiver.cpp: (WebCore::RTCRtpTransceiver::setCodecPreferences): * Modules/mediastream/RTCRtpTransceiver.h: * Modules/mediastream/RTCRtpTransceiver.idl: * Modules/mediastream/RTCRtpTransceiverBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCObservers.h: (WebCore::toExceptionCode): Deleted. * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp: (WebCore::toRtpCodecCapability): (WebCore::LibWebRTCRtpTransceiverBackend::setCodecPreferences): * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: (WebCore::toExceptionCode): (WebCore::toException): * Modules/mediastream/libwebrtc/LibWebRTCUtils.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/mediastream/RTCRtpCapabilities.h: (): Deleted. * platform/mediastream/RTCRtpCodecCapability.h: Added. * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: (WebCore::toRTCRtpCapabilities): LayoutTests: * webrtc/video-mute-vp8.html: Canonical link: https://commits.webkit.org/218842@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253966 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-01 12:55:46 +00:00
})
Add VP8 support to WebRTC https://bugs.webkit.org/show_bug.cgi?id=189976 Reviewed by Eric Carlson. LayoutTests/imported/w3c: * web-platform-tests/webrtc/RTCPeerConnection-addIceCandidate-expected.txt: Source/ThirdParty/libwebrtc: Add support for conditional VP8 support for both encoding and decoding. This boolean is used by WebCore based on the new VP8 runtime flag. Enable yasm compilation as a dependency of libvpx. Compilation is done without using SSE4/AVX2 optimizations. * Configurations/libvpx.xcconfig: Added. * Configurations/libwebrtc.iOS.exp: * Configurations/libwebrtc.iOSsim.exp: * Configurations/libwebrtc.mac.exp: * Configurations/libwebrtc.xcconfig: * Configurations/libwebrtcpcrtc.xcconfig: * Source/third_party/libvpx/run_yasm_webkit.py: Added. * Source/third_party/libvpx/source/config/mac/x64/vpx_config.asm: * Source/third_party/libvpx/source/config/mac/x64/vpx_config.h: * Source/third_party/libvpx/source/config/mac/x64/vpx_dsp_rtcd.h: * Source/webrtc/sdk/WebKit/WebKitUtilities.h: * Source/webrtc/sdk/WebKit/WebKitUtilities.mm: (webrtc::createWebKitEncoderFactory): (webrtc::createWebKitDecoderFactory): * Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCVideoCodecFactory.h: * libwebrtc.xcodeproj/project.pbxproj: Source/WebCore: Add a runtime flag to control activation of VP8 codec. Bind this runtime flag to the video codec factories. Test: webrtc/video-mute-vp8.html * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::createLibWebRTCPeerConnectionBackend): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCVP8CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP8CodecEnabled): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Enable VP8 codec for tests. Source/WebKit: * Shared/WebPreferences.yaml: LayoutTests: * webrtc/audio-peer-connection-g722.html: * webrtc/routines.js: * webrtc/video-mute-vp8-expected.txt: Added. * webrtc/video-mute-vp8.html: Added. Canonical link: https://commits.webkit.org/205219@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236821 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-04 01:53:27 +00:00
});
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");
async function getInboundRTPStatsNumberOfDecodedFrames(connection)
{
var report = await connection.getStats();
var framesDecoded;
report.forEach((statItem) => {
if (statItem.type === "inbound-rtp")
framesDecoded = statItem.framesDecoded;
});
return framesDecoded;
}
async function testFrameDecodedIncreased(connection, count, previousFramesNumber)
{
if (previousFramesNumber === undefined) {
let number = await getInboundRTPStatsNumberOfDecodedFrames(connection);
await waitFor(1000);
return testFrameDecodedIncreased(connection, 0, number);
}
var number = await getInboundRTPStatsNumberOfDecodedFrames(connection);
if (previousFramesNumber && number > previousFramesNumber)
return;
if (count >= 20)
return Promise.reject("test increasing frame encoded timed out");
await waitFor(1000);
return testFrameDecodedIncreased(connection, ++count, previousFramesNumber);
}
promise_test((test) => {
return testFrameDecodedIncreased(receivingConnection);
}, "If disabled, black frames should still be coming");
promise_test((test) => {
track.enabled = true;
return checkVideoBlack(false, canvas2, video);
Update testharness.js from upstream https://bugs.webkit.org/show_bug.cgi?id=201808 Reviewed by Darin Adler. LayoutTests/imported/w3c: Update existing layout tests so that they are compatible with this new version of testharness.js. * IndexedDB-private-browsing/idbdatabase_createObjectStore9-invalidparameters.html: * IndexedDB-private-browsing/idbobjectstore_deleted.html: * web-platform-tests/custom-elements/resources/custom-elements-helpers.js: (create_window_in_test): LayoutTests: Update testharness.js from upstream 6fd5e1e086ce590a4780a30d12968. Update existing layout tests so that they are compatible with this new version of testharness.js. * TestExpectations: * css-custom-properties-api/length-expected.txt: * css-custom-properties-api/length.html: * css-custom-properties-api/registerProperty.html: * css-dark-mode/older-systems/color-scheme-css-expected.txt: * css-dark-mode/older-systems/color-scheme-css.html: * css-dark-mode/older-systems/color-scheme-meta-expected.txt: * css-dark-mode/older-systems/color-scheme-meta.html: * css3/flexbox/style-change-expected.txt: * fast/css/DOMQuad-serialization.html: * fast/css/Element-style.html: * fast/css/parse-justify-self-expected.txt: * fast/css/parse-justify-self.html: * fast/events/clipboard-event-constructor-expected.txt: * fast/events/clipboard-event-constructor.html: * fast/media/mq-js-update-media-expected.txt: * fast/media/mq-js-update-media.html: * fast/mediacapturefromelement/CanvasCaptureMediaStream-offscreencanvas-expected.txt: * fast/mediastream/captureStream/canvas2d-expected.txt: * fast/mediastream/captureStream/canvas2d-heavy-drawing.html: * fast/mediastream/captureStream/canvas2d.html: * fast/shadow-dom/event-path-with-window-expected.txt: * fast/shadow-dom/event-path-with-window.html: * fast/shadow-dom/offsetParent-across-shadow-boundaries-expected.txt: * fast/shadow-dom/offsetParent-across-shadow-boundaries.html: * fast/shadow-dom/slotchange-for-slot-mutation-expected.txt: * fast/shadow-dom/slotchange-for-slot-mutation.html: * fast/shadow-dom/stylesheet-title-in-shadow-tree-expected.txt: * fast/shadow-dom/stylesheet-title-in-shadow-tree.html: * http/tests/fetch/redirectmode-and-preload-expected.txt: * http/tests/fetch/redirectmode-and-preload.html: * imported/blink/editing/selection/selectstart-event-crash-expected.txt: * js/promises-tests/promises-in-workers-expected.txt: * js/promises-tests/promises-in-workers.js: * resources/check-layout-th.js: (window.checkLayout): * resources/testharness.js: (WindowTestEnvironment): (WindowTestEnvironment.prototype._dispatch): (WindowTestEnvironment.prototype._forEach_windows): (WindowTestEnvironment.prototype.next_default_test_name): (WorkerTestEnvironment.prototype.next_default_test_name): (ServiceWorkerTestEnvironment.on_all_loaded): (ServiceWorkerTestEnvironment): (ShellTestEnvironment): (ShellTestEnvironment.prototype.next_default_test_name): (ShellTestEnvironment.prototype.on_new_harness_properties): (ShellTestEnvironment.prototype.on_tests_ready): (ShellTestEnvironment.prototype.add_on_loaded_callback): (ShellTestEnvironment.prototype.test_timeout): (create_test_environment): (is_shared_worker): (is_service_worker): (test): (promise_test): (this.wait_for): (EventWatcher): (done): * streams/readable-byte-stream-controller-expected.txt: * streams/readable-byte-stream-controller-worker-expected.txt: Added. * streams/readable-byte-stream-controller-worker.html: Copied from LayoutTests/streams/readable-byte-stream-controller.html. * streams/readable-byte-stream-controller.html: * streams/readable-stream-byob-reader-expected.txt: * streams/readable-stream-byob-reader-worker-expected.txt: Added. * streams/readable-stream-byob-reader-worker.html: Copied from LayoutTests/streams/readable-stream-byob-reader.html. * streams/readable-stream-byob-reader.html: * streams/readable-stream-byob-request-expected.txt: * streams/readable-stream-byob-request-worker-expected.txt: Copied from LayoutTests/streams/readable-stream-byob-request-expected.txt. * streams/readable-stream-byob-request-worker.html: Copied from LayoutTests/streams/readable-stream-byob-request.html. * streams/readable-stream-byob-request.html: * streams/reference-implementation/readable-stream-templated-expected.txt: * streams/reference-implementation/readable-stream-templated.html: * streams/reference-implementation/writable-stream-abort-expected.txt: * streams/reference-implementation/writable-stream-expected.txt: * webrtc/datachannel/basic-expected.txt: * webrtc/datachannel/basic.html: * webrtc/datachannel/mdns-ice-candidates-expected.txt: * webrtc/datachannel/mdns-ice-candidates.html: * webrtc/pc-detached-document-expected.txt: * webrtc/pc-detached-document.html: * webrtc/video-mute-expected.txt: * webrtc/video-mute-vp8-expected.txt: * webrtc/video-mute-vp8.html: * webrtc/video-mute.html: Canonical link: https://commits.webkit.org/215471@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249918 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-16 21:04:08 +00:00
}, "Track is enabled, video should not be black 2");
Add VP8 support to WebRTC https://bugs.webkit.org/show_bug.cgi?id=189976 Reviewed by Eric Carlson. LayoutTests/imported/w3c: * web-platform-tests/webrtc/RTCPeerConnection-addIceCandidate-expected.txt: Source/ThirdParty/libwebrtc: Add support for conditional VP8 support for both encoding and decoding. This boolean is used by WebCore based on the new VP8 runtime flag. Enable yasm compilation as a dependency of libvpx. Compilation is done without using SSE4/AVX2 optimizations. * Configurations/libvpx.xcconfig: Added. * Configurations/libwebrtc.iOS.exp: * Configurations/libwebrtc.iOSsim.exp: * Configurations/libwebrtc.mac.exp: * Configurations/libwebrtc.xcconfig: * Configurations/libwebrtcpcrtc.xcconfig: * Source/third_party/libvpx/run_yasm_webkit.py: Added. * Source/third_party/libvpx/source/config/mac/x64/vpx_config.asm: * Source/third_party/libvpx/source/config/mac/x64/vpx_config.h: * Source/third_party/libvpx/source/config/mac/x64/vpx_dsp_rtcd.h: * Source/webrtc/sdk/WebKit/WebKitUtilities.h: * Source/webrtc/sdk/WebKit/WebKitUtilities.mm: (webrtc::createWebKitEncoderFactory): (webrtc::createWebKitDecoderFactory): * Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCVideoCodecFactory.h: * libwebrtc.xcodeproj/project.pbxproj: Source/WebCore: Add a runtime flag to control activation of VP8 codec. Bind this runtime flag to the video codec factories. Test: webrtc/video-mute-vp8.html * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::createLibWebRTCPeerConnectionBackend): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCVP8CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP8CodecEnabled): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Enable VP8 codec for tests. Source/WebKit: * Shared/WebPreferences.yaml: LayoutTests: * webrtc/audio-peer-connection-g722.html: * webrtc/routines.js: * webrtc/video-mute-vp8-expected.txt: Added. * webrtc/video-mute-vp8.html: Added. Canonical link: https://commits.webkit.org/205219@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236821 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-04 01:53:27 +00:00
</script>
</body>
</html>