haikuwebkit/LayoutTests/webrtc/video-unmute.html

55 lines
1.9 KiB
HTML
Raw Permalink Normal View History

PeerConnection should respect tracks that are muted at the time they are added https://bugs.webkit.org/show_bug.cgi?id=172771 Patch by Youenn Fablet <youenn@apple.com> on 2017-05-31 Reviewed by Eric Carlson. Source/WebCore: Tests: webrtc/peer-connection-audio-unmute.html webrtc/video-unmute.html Making sure that muted/enabled state of sources are correctly handled at creation time of the outgoing webrtc sources. This should trigger silent audio and black frames. * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource): (WebCore::RealtimeOutgoingAudioSource::setSource): (WebCore::RealtimeOutgoingAudioSource::initializeConverter): * platform/mediastream/mac/RealtimeOutgoingAudioSource.h: * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource): (WebCore::RealtimeOutgoingVideoSource::setSource): (WebCore::RealtimeOutgoingVideoSource::sourceMutedChanged): (WebCore::RealtimeOutgoingVideoSource::sourceEnabledChanged): (WebCore::RealtimeOutgoingVideoSource::initializeFromSource): (WebCore::RealtimeOutgoingVideoSource::AddOrUpdateSink): (WebCore::RealtimeOutgoingVideoSource::RemoveSink): (WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded): (WebCore::RealtimeOutgoingVideoSource::setSizeFromSource): Deleted. (WebCore::RealtimeOutgoingVideoSource::sendBlackFrames): Deleted. * platform/mediastream/mac/RealtimeOutgoingVideoSource.h: LayoutTests: * webrtc/audio-replace-track.html: * webrtc/peer-connection-audio-unmute-expected.txt: Added. * webrtc/peer-connection-audio-unmute.html: Added. * webrtc/routines.js: * webrtc/video-unmute-expected.txt: Added. * webrtc/video-unmute.html: Added. Canonical link: https://commits.webkit.org/189671@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217624 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:51:12 +00:00
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Testing basic video exchange from offerer to receiver</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
</head>
<body>
<video id="localVideo" autoplay playsInline width="320" height="240"></video>
<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>
<script src ="routines.js"></script>
<script>
var track;
var remoteTrack;
promise_test((test) => {
if (window.testRunner)
testRunner.setUserMediaPermission(true);
return navigator.mediaDevices.getUserMedia({video: {width: 320, height: 240, facingMode: "environment"}}).then((localStream) => {
track = localStream.getVideoTracks()[0];
track.enabled = false;
localVideo.srcObject = localStream;
return new Promise((resolve, reject) => {
createConnections((firstConnection) => {
firstConnection.addTrack(track, localStream);
}, (secondConnection) => {
secondConnection.ontrack = (trackEvent) => {
remoteTrack = trackEvent.track;
resolve(trackEvent.streams[0]);
};
});
setTimeout(() => reject("Test timed out"), 5000);
});
}).then((remoteStream) => {
video.srcObject = remoteStream;
return video.play();
});
}, "Setting video exchange");
promise_test((test) => {
return checkVideoBlack(true, canvas1, video);
A cloned MediaStreamTrack should mute independently other tracks using the same source https://bugs.webkit.org/show_bug.cgi?id=172831 <rdar://problem/32518527> Patch by Youenn Fablet <youenn@apple.com> on 2017-06-19 Reviewed by Eric Carlson. Source/WebCore: Test: webrtc/clone-audio-track.html Move enabled handling in MediaStreamTrackPrivate instead of RealtimeMediaSource. Move WebRTC and WebAudio customers of RealtimeMediaSource to MediaStreamTrackPrivate. Move creation of WebAudio provider to MediaStreamTrackPrivate. This allows changing some parameters of tracks having the same source independently. Using this for enabled track attribute. We no longer stop generating frames in case track is disabled. This should be added back as an optimization in a follow-up. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::addTrack): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack): * Modules/webaudio/MediaStreamAudioSource.cpp: * Modules/webaudio/MediaStreamAudioSource.h: * WebCore.xcodeproj/project.pbxproj: * platform/mediastream/MediaStreamTrackPrivate.cpp: (WebCore::MediaStreamTrackPrivate::create): (WebCore::MediaStreamTrackPrivate::~MediaStreamTrackPrivate): (WebCore::MediaStreamTrackPrivate::setEnabled): (WebCore::MediaStreamTrackPrivate::audioSourceProvider): (WebCore::MediaStreamTrackPrivate::videoSampleAvailable): (WebCore::MediaStreamTrackPrivate::audioSamplesAvailable): * platform/mediastream/MediaStreamTrackPrivate.h: (WebCore::MediaStreamTrackPrivate::Observer::audioSamplesAvailable): * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::removeObserver): * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/mac/AVMediaCaptureSource.h: * platform/mediastream/mac/AVMediaCaptureSource.mm: * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::startProducingData): (WebCore::CoreAudioCaptureSource::stopProducingData): * platform/mediastream/mac/CoreAudioCaptureSource.h: * platform/mediastream/mac/MockRealtimeAudioSourceMac.h: * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm: (WebCore::MockRealtimeAudioSourceMac::render): * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp: (WebCore::RealtimeIncomingAudioSource::~RealtimeIncomingAudioSource): (WebCore::RealtimeIncomingAudioSource::OnData): * platform/mediastream/mac/RealtimeIncomingAudioSource.h: * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp: (WebCore::RealtimeIncomingVideoSource::pixelBufferFromVideoFrame): * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource): (WebCore::RealtimeOutgoingAudioSource::setSource): * platform/mediastream/mac/RealtimeOutgoingAudioSource.h: * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource): (WebCore::RealtimeOutgoingVideoSource::setSource): (WebCore::RealtimeOutgoingVideoSource::initializeFromSource): * platform/mediastream/mac/RealtimeOutgoingVideoSource.h: * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h: * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm: (WebCore::WebAudioSourceProviderAVFObjC::create): (WebCore::WebAudioSourceProviderAVFObjC::WebAudioSourceProviderAVFObjC): (WebCore::WebAudioSourceProviderAVFObjC::setClient): (WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable): * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::generateFrame): * platform/spi/cocoa/PassKitSPI.h: Source/WebKit2: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::setStorage): LayoutTests: * webrtc/clone-audio-track.html: Added. * webrtc/video-disabled-black.html: * webrtc/video-unmute-expected.txt: * webrtc/video-unmute.html: Canonical link: https://commits.webkit.org/190441@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218497 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-06-19 17:12:57 +00:00
}, "Track is disabled, video should be black");
PeerConnection should respect tracks that are muted at the time they are added https://bugs.webkit.org/show_bug.cgi?id=172771 Patch by Youenn Fablet <youenn@apple.com> on 2017-05-31 Reviewed by Eric Carlson. Source/WebCore: Tests: webrtc/peer-connection-audio-unmute.html webrtc/video-unmute.html Making sure that muted/enabled state of sources are correctly handled at creation time of the outgoing webrtc sources. This should trigger silent audio and black frames. * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource): (WebCore::RealtimeOutgoingAudioSource::setSource): (WebCore::RealtimeOutgoingAudioSource::initializeConverter): * platform/mediastream/mac/RealtimeOutgoingAudioSource.h: * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource): (WebCore::RealtimeOutgoingVideoSource::setSource): (WebCore::RealtimeOutgoingVideoSource::sourceMutedChanged): (WebCore::RealtimeOutgoingVideoSource::sourceEnabledChanged): (WebCore::RealtimeOutgoingVideoSource::initializeFromSource): (WebCore::RealtimeOutgoingVideoSource::AddOrUpdateSink): (WebCore::RealtimeOutgoingVideoSource::RemoveSink): (WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded): (WebCore::RealtimeOutgoingVideoSource::setSizeFromSource): Deleted. (WebCore::RealtimeOutgoingVideoSource::sendBlackFrames): Deleted. * platform/mediastream/mac/RealtimeOutgoingVideoSource.h: LayoutTests: * webrtc/audio-replace-track.html: * webrtc/peer-connection-audio-unmute-expected.txt: Added. * webrtc/peer-connection-audio-unmute.html: Added. * webrtc/routines.js: * webrtc/video-unmute-expected.txt: Added. * webrtc/video-unmute.html: Added. Canonical link: https://commits.webkit.org/189671@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217624 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:51:12 +00:00
promise_test((test) => {
track.enabled = true;
return checkVideoBlack(false, canvas2, video);
PeerConnection should respect tracks that are muted at the time they are added https://bugs.webkit.org/show_bug.cgi?id=172771 Patch by Youenn Fablet <youenn@apple.com> on 2017-05-31 Reviewed by Eric Carlson. Source/WebCore: Tests: webrtc/peer-connection-audio-unmute.html webrtc/video-unmute.html Making sure that muted/enabled state of sources are correctly handled at creation time of the outgoing webrtc sources. This should trigger silent audio and black frames. * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource): (WebCore::RealtimeOutgoingAudioSource::setSource): (WebCore::RealtimeOutgoingAudioSource::initializeConverter): * platform/mediastream/mac/RealtimeOutgoingAudioSource.h: * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource): (WebCore::RealtimeOutgoingVideoSource::setSource): (WebCore::RealtimeOutgoingVideoSource::sourceMutedChanged): (WebCore::RealtimeOutgoingVideoSource::sourceEnabledChanged): (WebCore::RealtimeOutgoingVideoSource::initializeFromSource): (WebCore::RealtimeOutgoingVideoSource::AddOrUpdateSink): (WebCore::RealtimeOutgoingVideoSource::RemoveSink): (WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded): (WebCore::RealtimeOutgoingVideoSource::setSizeFromSource): Deleted. (WebCore::RealtimeOutgoingVideoSource::sendBlackFrames): Deleted. * platform/mediastream/mac/RealtimeOutgoingVideoSource.h: LayoutTests: * webrtc/audio-replace-track.html: * webrtc/peer-connection-audio-unmute-expected.txt: Added. * webrtc/peer-connection-audio-unmute.html: Added. * webrtc/routines.js: * webrtc/video-unmute-expected.txt: Added. * webrtc/video-unmute.html: Added. Canonical link: https://commits.webkit.org/189671@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217624 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:51:12 +00:00
}, "Track is enabled, video should not be black");
</script>
</body>
</html>