haikuwebkit/LayoutTests/webrtc/audio-replace-track.html

71 lines
2.6 KiB
HTML
Raw Permalink Normal View History

Add libwebrtc backend support for RTCRtpSender::replaceTrack https://bugs.webkit.org/show_bug.cgi?id=169841 Patch by Youenn Fablet <youenn@apple.com> on 2017-03-24 Reviewed by Alex Christensen. Source/WebCore: Tests: webrtc/audio-replace-track.html webrtc/video-replace-track.html Adding support for replaceTrack for audio and video sources. Replacing tracks will always succeed for audio sources. For video tracks, it will only succeed if the video resolution is not greater. LibWebRTCPeerConnectionBackend will delegate the track replacing by replacing the source of the outgoing sources with the source wrapped in the replacing track. Video test is not fully passing as size constraints for mock video sources are not providing the right video stream resolution. * Modules/mediastream/RTCRtpSender.cpp: (WebCore::RTCRtpSender::replaceTrack): * Modules/mediastream/RTCRtpSender.h: * Modules/mediastream/RTCRtpSender.idl: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::setSource): * platform/mediastream/mac/RealtimeOutgoingAudioSource.h: * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::setSource): * platform/mediastream/mac/RealtimeOutgoingVideoSource.h: * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::drawText): (WebCore::MockRealtimeVideoSource::generateFrame): LayoutTests: * webrtc/audio-replace-track-expected.txt: Added. * webrtc/audio-replace-track.html: Added. * webrtc/video-replace-track-expected.txt: Added. * webrtc/video-replace-track.html: Added. * webrtc/video-replace-track-to-null-expected.txt: Added. * webrtc/video-replace-track-to-null.html: Added. Canonical link: https://commits.webkit.org/186982@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214357 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-24 18:01:18 +00:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Testing replacing an audio track during a WebRTC call</title>
Add libwebrtc backend support for RTCRtpSender::replaceTrack https://bugs.webkit.org/show_bug.cgi?id=169841 Patch by Youenn Fablet <youenn@apple.com> on 2017-03-24 Reviewed by Alex Christensen. Source/WebCore: Tests: webrtc/audio-replace-track.html webrtc/video-replace-track.html Adding support for replaceTrack for audio and video sources. Replacing tracks will always succeed for audio sources. For video tracks, it will only succeed if the video resolution is not greater. LibWebRTCPeerConnectionBackend will delegate the track replacing by replacing the source of the outgoing sources with the source wrapped in the replacing track. Video test is not fully passing as size constraints for mock video sources are not providing the right video stream resolution. * Modules/mediastream/RTCRtpSender.cpp: (WebCore::RTCRtpSender::replaceTrack): * Modules/mediastream/RTCRtpSender.h: * Modules/mediastream/RTCRtpSender.idl: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::setSource): * platform/mediastream/mac/RealtimeOutgoingAudioSource.h: * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::setSource): * platform/mediastream/mac/RealtimeOutgoingVideoSource.h: * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::drawText): (WebCore::MockRealtimeVideoSource::generateFrame): LayoutTests: * webrtc/audio-replace-track-expected.txt: Added. * webrtc/audio-replace-track.html: Added. * webrtc/video-replace-track-expected.txt: Added. * webrtc/video-replace-track.html: Added. * webrtc/video-replace-track-to-null-expected.txt: Added. * webrtc/video-replace-track-to-null.html: Added. Canonical link: https://commits.webkit.org/186982@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214357 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-24 18:01:18 +00:00
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src ="routines.js"></script>
[iOS] Unset active media capture source when stopped capturing https://bugs.webkit.org/show_bug.cgi?id=171815 <rdar://problem/32117885> Patch by Youenn Fablet <youenn@apple.com> on 2017-05-11 Reviewed by Eric Carlson. Source/WebCore: Test: platform/ios/mediastream/getUserMedia-single-capture.html Introducing SingleSourceFactory template class to be used by capture factories for iOS. This class ensures that only one source is active at a time. Update all capture sources accordingly. Ensure sources are no longer considered as active sources when being destroyed. Add support for mock sources and introducing m_isProducingData for them as well. Update WebRTC outgoing source classes to handle the case of replaced track and resetting the enabled/mute state according the new source. Update the way we handle timestamps for audio data. We now consider that we read/write as a flow. This allows smooth audio track replacing. * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/mac/AVAudioCaptureSource.mm: (WebCore::AVAudioCaptureSource::~AVAudioCaptureSource): (WebCore::AVAudioCaptureSourceFactory::setActiveSource): Deleted. * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource): (WebCore::AVVideoCaptureSourceFactory::setActiveSource): Deleted. * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource): (WebCore::CoreAudioCaptureSource::stopProducingData): (WebCore::CoreAudioCaptureSourceFactory::setActiveSource): Deleted. * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::setSource): (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable): (WebCore::RealtimeOutgoingAudioSource::pullAudioData): * platform/mediastream/mac/RealtimeOutgoingAudioSource.h: * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::setSource): (WebCore::RealtimeOutgoingVideoSource::sourceMutedChanged): (WebCore::RealtimeOutgoingVideoSource::sourceEnabledChanged): * platform/mock/MockRealtimeAudioSource.cpp: (WebCore::mockAudioCaptureSourceFactory): (WebCore::MockRealtimeAudioSource::factory): (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource): (WebCore::MockRealtimeAudioSource::startProducingData): (WebCore::MockRealtimeAudioSource::stopProducingData): * platform/mock/MockRealtimeAudioSource.h: * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::mockVideoCaptureSourceFactory): (WebCore::MockRealtimeVideoSource::factory): (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource): (WebCore::MockRealtimeVideoSource::startProducingData): (WebCore::MockRealtimeVideoSource::stopProducingData): * platform/mock/MockRealtimeVideoSource.h: (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource): Deleted. LayoutTests: Improving the existing tests for better reliability and debugability. Updating tests to use less webkitAudioContext. * platform/ios/mediastream/getUserMedia-single-capture-expected.txt: Added. * platform/ios/mediastream/getUserMedia-single-capture.html: Added. * webrtc/audio-peer-connection-webaudio.html: * webrtc/audio-replace-track-expected.txt: * webrtc/audio-replace-track.html: * webrtc/peer-connection-audio-mute.html: * webrtc/peer-connection-audio-mute2.html: * webrtc/peer-connection-remote-audio-mute.html: * webrtc/peer-connection-remote-audio-mute2.html: * webrtc/routines.js: * webrtc/video-replace-track-expected.txt: * webrtc/video-replace-track.html: Canonical link: https://commits.webkit.org/188932@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-12 00:52:45 +00:00
</head>
<body>
Add libwebrtc backend support for RTCRtpSender::replaceTrack https://bugs.webkit.org/show_bug.cgi?id=169841 Patch by Youenn Fablet <youenn@apple.com> on 2017-03-24 Reviewed by Alex Christensen. Source/WebCore: Tests: webrtc/audio-replace-track.html webrtc/video-replace-track.html Adding support for replaceTrack for audio and video sources. Replacing tracks will always succeed for audio sources. For video tracks, it will only succeed if the video resolution is not greater. LibWebRTCPeerConnectionBackend will delegate the track replacing by replacing the source of the outgoing sources with the source wrapped in the replacing track. Video test is not fully passing as size constraints for mock video sources are not providing the right video stream resolution. * Modules/mediastream/RTCRtpSender.cpp: (WebCore::RTCRtpSender::replaceTrack): * Modules/mediastream/RTCRtpSender.h: * Modules/mediastream/RTCRtpSender.idl: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::setSource): * platform/mediastream/mac/RealtimeOutgoingAudioSource.h: * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::setSource): * platform/mediastream/mac/RealtimeOutgoingVideoSource.h: * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::drawText): (WebCore::MockRealtimeVideoSource::generateFrame): LayoutTests: * webrtc/audio-replace-track-expected.txt: Added. * webrtc/audio-replace-track.html: Added. * webrtc/video-replace-track-expected.txt: Added. * webrtc/video-replace-track.html: Added. * webrtc/video-replace-track-to-null-expected.txt: Added. * webrtc/video-replace-track-to-null.html: Added. Canonical link: https://commits.webkit.org/186982@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214357 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-24 18:01:18 +00:00
<script>
[iOS] Unset active media capture source when stopped capturing https://bugs.webkit.org/show_bug.cgi?id=171815 <rdar://problem/32117885> Patch by Youenn Fablet <youenn@apple.com> on 2017-05-11 Reviewed by Eric Carlson. Source/WebCore: Test: platform/ios/mediastream/getUserMedia-single-capture.html Introducing SingleSourceFactory template class to be used by capture factories for iOS. This class ensures that only one source is active at a time. Update all capture sources accordingly. Ensure sources are no longer considered as active sources when being destroyed. Add support for mock sources and introducing m_isProducingData for them as well. Update WebRTC outgoing source classes to handle the case of replaced track and resetting the enabled/mute state according the new source. Update the way we handle timestamps for audio data. We now consider that we read/write as a flow. This allows smooth audio track replacing. * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/mac/AVAudioCaptureSource.mm: (WebCore::AVAudioCaptureSource::~AVAudioCaptureSource): (WebCore::AVAudioCaptureSourceFactory::setActiveSource): Deleted. * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource): (WebCore::AVVideoCaptureSourceFactory::setActiveSource): Deleted. * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource): (WebCore::CoreAudioCaptureSource::stopProducingData): (WebCore::CoreAudioCaptureSourceFactory::setActiveSource): Deleted. * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::setSource): (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable): (WebCore::RealtimeOutgoingAudioSource::pullAudioData): * platform/mediastream/mac/RealtimeOutgoingAudioSource.h: * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::setSource): (WebCore::RealtimeOutgoingVideoSource::sourceMutedChanged): (WebCore::RealtimeOutgoingVideoSource::sourceEnabledChanged): * platform/mock/MockRealtimeAudioSource.cpp: (WebCore::mockAudioCaptureSourceFactory): (WebCore::MockRealtimeAudioSource::factory): (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource): (WebCore::MockRealtimeAudioSource::startProducingData): (WebCore::MockRealtimeAudioSource::stopProducingData): * platform/mock/MockRealtimeAudioSource.h: * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::mockVideoCaptureSourceFactory): (WebCore::MockRealtimeVideoSource::factory): (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource): (WebCore::MockRealtimeVideoSource::startProducingData): (WebCore::MockRealtimeVideoSource::stopProducingData): * platform/mock/MockRealtimeVideoSource.h: (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource): Deleted. LayoutTests: Improving the existing tests for better reliability and debugability. Updating tests to use less webkitAudioContext. * platform/ios/mediastream/getUserMedia-single-capture-expected.txt: Added. * platform/ios/mediastream/getUserMedia-single-capture.html: Added. * webrtc/audio-peer-connection-webaudio.html: * webrtc/audio-replace-track-expected.txt: * webrtc/audio-replace-track.html: * webrtc/peer-connection-audio-mute.html: * webrtc/peer-connection-audio-mute2.html: * webrtc/peer-connection-remote-audio-mute.html: * webrtc/peer-connection-remote-audio-mute2.html: * webrtc/routines.js: * webrtc/video-replace-track-expected.txt: * webrtc/video-replace-track.html: Canonical link: https://commits.webkit.org/188932@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-12 00:52:45 +00:00
var sender;
var remoteStream;
var secondStream;
var receivingConnection;
Add libwebrtc backend support for RTCRtpSender::replaceTrack https://bugs.webkit.org/show_bug.cgi?id=169841 Patch by Youenn Fablet <youenn@apple.com> on 2017-03-24 Reviewed by Alex Christensen. Source/WebCore: Tests: webrtc/audio-replace-track.html webrtc/video-replace-track.html Adding support for replaceTrack for audio and video sources. Replacing tracks will always succeed for audio sources. For video tracks, it will only succeed if the video resolution is not greater. LibWebRTCPeerConnectionBackend will delegate the track replacing by replacing the source of the outgoing sources with the source wrapped in the replacing track. Video test is not fully passing as size constraints for mock video sources are not providing the right video stream resolution. * Modules/mediastream/RTCRtpSender.cpp: (WebCore::RTCRtpSender::replaceTrack): * Modules/mediastream/RTCRtpSender.h: * Modules/mediastream/RTCRtpSender.idl: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::setSource): * platform/mediastream/mac/RealtimeOutgoingAudioSource.h: * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::setSource): * platform/mediastream/mac/RealtimeOutgoingVideoSource.h: * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::drawText): (WebCore::MockRealtimeVideoSource::generateFrame): LayoutTests: * webrtc/audio-replace-track-expected.txt: Added. * webrtc/audio-replace-track.html: Added. * webrtc/video-replace-track-expected.txt: Added. * webrtc/video-replace-track.html: Added. * webrtc/video-replace-track-to-null-expected.txt: Added. * webrtc/video-replace-track-to-null.html: Added. Canonical link: https://commits.webkit.org/186982@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214357 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-24 18:01:18 +00:00
promise_test((test) => {
if (window.testRunner)
testRunner.setUserMediaPermission(true);
[iOS] Unset active media capture source when stopped capturing https://bugs.webkit.org/show_bug.cgi?id=171815 <rdar://problem/32117885> Patch by Youenn Fablet <youenn@apple.com> on 2017-05-11 Reviewed by Eric Carlson. Source/WebCore: Test: platform/ios/mediastream/getUserMedia-single-capture.html Introducing SingleSourceFactory template class to be used by capture factories for iOS. This class ensures that only one source is active at a time. Update all capture sources accordingly. Ensure sources are no longer considered as active sources when being destroyed. Add support for mock sources and introducing m_isProducingData for them as well. Update WebRTC outgoing source classes to handle the case of replaced track and resetting the enabled/mute state according the new source. Update the way we handle timestamps for audio data. We now consider that we read/write as a flow. This allows smooth audio track replacing. * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/mac/AVAudioCaptureSource.mm: (WebCore::AVAudioCaptureSource::~AVAudioCaptureSource): (WebCore::AVAudioCaptureSourceFactory::setActiveSource): Deleted. * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource): (WebCore::AVVideoCaptureSourceFactory::setActiveSource): Deleted. * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource): (WebCore::CoreAudioCaptureSource::stopProducingData): (WebCore::CoreAudioCaptureSourceFactory::setActiveSource): Deleted. * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::setSource): (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable): (WebCore::RealtimeOutgoingAudioSource::pullAudioData): * platform/mediastream/mac/RealtimeOutgoingAudioSource.h: * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::setSource): (WebCore::RealtimeOutgoingVideoSource::sourceMutedChanged): (WebCore::RealtimeOutgoingVideoSource::sourceEnabledChanged): * platform/mock/MockRealtimeAudioSource.cpp: (WebCore::mockAudioCaptureSourceFactory): (WebCore::MockRealtimeAudioSource::factory): (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource): (WebCore::MockRealtimeAudioSource::startProducingData): (WebCore::MockRealtimeAudioSource::stopProducingData): * platform/mock/MockRealtimeAudioSource.h: * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::mockVideoCaptureSourceFactory): (WebCore::MockRealtimeVideoSource::factory): (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource): (WebCore::MockRealtimeVideoSource::startProducingData): (WebCore::MockRealtimeVideoSource::stopProducingData): * platform/mock/MockRealtimeVideoSource.h: (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource): Deleted. LayoutTests: Improving the existing tests for better reliability and debugability. Updating tests to use less webkitAudioContext. * platform/ios/mediastream/getUserMedia-single-capture-expected.txt: Added. * platform/ios/mediastream/getUserMedia-single-capture.html: Added. * webrtc/audio-peer-connection-webaudio.html: * webrtc/audio-replace-track-expected.txt: * webrtc/audio-replace-track.html: * webrtc/peer-connection-audio-mute.html: * webrtc/peer-connection-audio-mute2.html: * webrtc/peer-connection-remote-audio-mute.html: * webrtc/peer-connection-remote-audio-mute2.html: * webrtc/routines.js: * webrtc/video-replace-track-expected.txt: * webrtc/video-replace-track.html: Canonical link: https://commits.webkit.org/188932@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-12 00:52:45 +00:00
return navigator.mediaDevices.getUserMedia({ audio: { sampleRate: { exact: 48000 } } }).then((firstStream) => {
Add libwebrtc backend support for RTCRtpSender::replaceTrack https://bugs.webkit.org/show_bug.cgi?id=169841 Patch by Youenn Fablet <youenn@apple.com> on 2017-03-24 Reviewed by Alex Christensen. Source/WebCore: Tests: webrtc/audio-replace-track.html webrtc/video-replace-track.html Adding support for replaceTrack for audio and video sources. Replacing tracks will always succeed for audio sources. For video tracks, it will only succeed if the video resolution is not greater. LibWebRTCPeerConnectionBackend will delegate the track replacing by replacing the source of the outgoing sources with the source wrapped in the replacing track. Video test is not fully passing as size constraints for mock video sources are not providing the right video stream resolution. * Modules/mediastream/RTCRtpSender.cpp: (WebCore::RTCRtpSender::replaceTrack): * Modules/mediastream/RTCRtpSender.h: * Modules/mediastream/RTCRtpSender.idl: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::setSource): * platform/mediastream/mac/RealtimeOutgoingAudioSource.h: * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::setSource): * platform/mediastream/mac/RealtimeOutgoingVideoSource.h: * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::drawText): (WebCore::MockRealtimeVideoSource::generateFrame): LayoutTests: * webrtc/audio-replace-track-expected.txt: Added. * webrtc/audio-replace-track.html: Added. * webrtc/video-replace-track-expected.txt: Added. * webrtc/video-replace-track.html: Added. * webrtc/video-replace-track-to-null-expected.txt: Added. * webrtc/video-replace-track-to-null.html: Added. Canonical link: https://commits.webkit.org/186982@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214357 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-24 18:01:18 +00:00
return new Promise((resolve, reject) => {
createConnections((firstConnection) => {
sender = firstConnection.addTrack(firstStream.getAudioTracks()[0], firstStream);
}, (secondConnection) => {
receivingConnection = secondConnection;
Add libwebrtc backend support for RTCRtpSender::replaceTrack https://bugs.webkit.org/show_bug.cgi?id=169841 Patch by Youenn Fablet <youenn@apple.com> on 2017-03-24 Reviewed by Alex Christensen. Source/WebCore: Tests: webrtc/audio-replace-track.html webrtc/video-replace-track.html Adding support for replaceTrack for audio and video sources. Replacing tracks will always succeed for audio sources. For video tracks, it will only succeed if the video resolution is not greater. LibWebRTCPeerConnectionBackend will delegate the track replacing by replacing the source of the outgoing sources with the source wrapped in the replacing track. Video test is not fully passing as size constraints for mock video sources are not providing the right video stream resolution. * Modules/mediastream/RTCRtpSender.cpp: (WebCore::RTCRtpSender::replaceTrack): * Modules/mediastream/RTCRtpSender.h: * Modules/mediastream/RTCRtpSender.idl: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::setSource): * platform/mediastream/mac/RealtimeOutgoingAudioSource.h: * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::setSource): * platform/mediastream/mac/RealtimeOutgoingVideoSource.h: * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::drawText): (WebCore::MockRealtimeVideoSource::generateFrame): LayoutTests: * webrtc/audio-replace-track-expected.txt: Added. * webrtc/audio-replace-track.html: Added. * webrtc/video-replace-track-expected.txt: Added. * webrtc/video-replace-track.html: Added. * webrtc/video-replace-track-to-null-expected.txt: Added. * webrtc/video-replace-track-to-null.html: Added. Canonical link: https://commits.webkit.org/186982@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214357 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-24 18:01:18 +00:00
secondConnection.ontrack = (trackEvent) => { resolve(trackEvent.streams[0]); };
});
setTimeout(() => reject("Test timed out"), 5000);
});
}).then((stream) => {
remoteStream = stream;
[iOS] Unset active media capture source when stopped capturing https://bugs.webkit.org/show_bug.cgi?id=171815 <rdar://problem/32117885> Patch by Youenn Fablet <youenn@apple.com> on 2017-05-11 Reviewed by Eric Carlson. Source/WebCore: Test: platform/ios/mediastream/getUserMedia-single-capture.html Introducing SingleSourceFactory template class to be used by capture factories for iOS. This class ensures that only one source is active at a time. Update all capture sources accordingly. Ensure sources are no longer considered as active sources when being destroyed. Add support for mock sources and introducing m_isProducingData for them as well. Update WebRTC outgoing source classes to handle the case of replaced track and resetting the enabled/mute state according the new source. Update the way we handle timestamps for audio data. We now consider that we read/write as a flow. This allows smooth audio track replacing. * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/mac/AVAudioCaptureSource.mm: (WebCore::AVAudioCaptureSource::~AVAudioCaptureSource): (WebCore::AVAudioCaptureSourceFactory::setActiveSource): Deleted. * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource): (WebCore::AVVideoCaptureSourceFactory::setActiveSource): Deleted. * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource): (WebCore::CoreAudioCaptureSource::stopProducingData): (WebCore::CoreAudioCaptureSourceFactory::setActiveSource): Deleted. * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::setSource): (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable): (WebCore::RealtimeOutgoingAudioSource::pullAudioData): * platform/mediastream/mac/RealtimeOutgoingAudioSource.h: * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::setSource): (WebCore::RealtimeOutgoingVideoSource::sourceMutedChanged): (WebCore::RealtimeOutgoingVideoSource::sourceEnabledChanged): * platform/mock/MockRealtimeAudioSource.cpp: (WebCore::mockAudioCaptureSourceFactory): (WebCore::MockRealtimeAudioSource::factory): (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource): (WebCore::MockRealtimeAudioSource::startProducingData): (WebCore::MockRealtimeAudioSource::stopProducingData): * platform/mock/MockRealtimeAudioSource.h: * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::mockVideoCaptureSourceFactory): (WebCore::MockRealtimeVideoSource::factory): (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource): (WebCore::MockRealtimeVideoSource::startProducingData): (WebCore::MockRealtimeVideoSource::stopProducingData): * platform/mock/MockRealtimeVideoSource.h: (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource): Deleted. LayoutTests: Improving the existing tests for better reliability and debugability. Updating tests to use less webkitAudioContext. * platform/ios/mediastream/getUserMedia-single-capture-expected.txt: Added. * platform/ios/mediastream/getUserMedia-single-capture.html: Added. * webrtc/audio-peer-connection-webaudio.html: * webrtc/audio-replace-track-expected.txt: * webrtc/audio-replace-track.html: * webrtc/peer-connection-audio-mute.html: * webrtc/peer-connection-audio-mute2.html: * webrtc/peer-connection-remote-audio-mute.html: * webrtc/peer-connection-remote-audio-mute2.html: * webrtc/routines.js: * webrtc/video-replace-track-expected.txt: * webrtc/video-replace-track.html: Canonical link: https://commits.webkit.org/188932@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-12 00:52:45 +00:00
});
}, "Starting an audio connection");
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");
[iOS] Unset active media capture source when stopped capturing https://bugs.webkit.org/show_bug.cgi?id=171815 <rdar://problem/32117885> Patch by Youenn Fablet <youenn@apple.com> on 2017-05-11 Reviewed by Eric Carlson. Source/WebCore: Test: platform/ios/mediastream/getUserMedia-single-capture.html Introducing SingleSourceFactory template class to be used by capture factories for iOS. This class ensures that only one source is active at a time. Update all capture sources accordingly. Ensure sources are no longer considered as active sources when being destroyed. Add support for mock sources and introducing m_isProducingData for them as well. Update WebRTC outgoing source classes to handle the case of replaced track and resetting the enabled/mute state according the new source. Update the way we handle timestamps for audio data. We now consider that we read/write as a flow. This allows smooth audio track replacing. * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/mac/AVAudioCaptureSource.mm: (WebCore::AVAudioCaptureSource::~AVAudioCaptureSource): (WebCore::AVAudioCaptureSourceFactory::setActiveSource): Deleted. * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource): (WebCore::AVVideoCaptureSourceFactory::setActiveSource): Deleted. * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource): (WebCore::CoreAudioCaptureSource::stopProducingData): (WebCore::CoreAudioCaptureSourceFactory::setActiveSource): Deleted. * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::setSource): (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable): (WebCore::RealtimeOutgoingAudioSource::pullAudioData): * platform/mediastream/mac/RealtimeOutgoingAudioSource.h: * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::setSource): (WebCore::RealtimeOutgoingVideoSource::sourceMutedChanged): (WebCore::RealtimeOutgoingVideoSource::sourceEnabledChanged): * platform/mock/MockRealtimeAudioSource.cpp: (WebCore::mockAudioCaptureSourceFactory): (WebCore::MockRealtimeAudioSource::factory): (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource): (WebCore::MockRealtimeAudioSource::startProducingData): (WebCore::MockRealtimeAudioSource::stopProducingData): * platform/mock/MockRealtimeAudioSource.h: * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::mockVideoCaptureSourceFactory): (WebCore::MockRealtimeVideoSource::factory): (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource): (WebCore::MockRealtimeVideoSource::startProducingData): (WebCore::MockRealtimeVideoSource::stopProducingData): * platform/mock/MockRealtimeVideoSource.h: (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource): Deleted. LayoutTests: Improving the existing tests for better reliability and debugability. Updating tests to use less webkitAudioContext. * platform/ios/mediastream/getUserMedia-single-capture-expected.txt: Added. * platform/ios/mediastream/getUserMedia-single-capture.html: Added. * webrtc/audio-peer-connection-webaudio.html: * webrtc/audio-replace-track-expected.txt: * webrtc/audio-replace-track.html: * webrtc/peer-connection-audio-mute.html: * webrtc/peer-connection-audio-mute2.html: * webrtc/peer-connection-remote-audio-mute.html: * webrtc/peer-connection-remote-audio-mute2.html: * webrtc/routines.js: * webrtc/video-replace-track-expected.txt: * webrtc/video-replace-track.html: Canonical link: https://commits.webkit.org/188932@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-12 00:52:45 +00:00
promise_test(() => {
return doHumAnalysis(remoteStream, true).then((result) => {
assert_true(result, "heard hum 1");
[iOS] Unset active media capture source when stopped capturing https://bugs.webkit.org/show_bug.cgi?id=171815 <rdar://problem/32117885> Patch by Youenn Fablet <youenn@apple.com> on 2017-05-11 Reviewed by Eric Carlson. Source/WebCore: Test: platform/ios/mediastream/getUserMedia-single-capture.html Introducing SingleSourceFactory template class to be used by capture factories for iOS. This class ensures that only one source is active at a time. Update all capture sources accordingly. Ensure sources are no longer considered as active sources when being destroyed. Add support for mock sources and introducing m_isProducingData for them as well. Update WebRTC outgoing source classes to handle the case of replaced track and resetting the enabled/mute state according the new source. Update the way we handle timestamps for audio data. We now consider that we read/write as a flow. This allows smooth audio track replacing. * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/mac/AVAudioCaptureSource.mm: (WebCore::AVAudioCaptureSource::~AVAudioCaptureSource): (WebCore::AVAudioCaptureSourceFactory::setActiveSource): Deleted. * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource): (WebCore::AVVideoCaptureSourceFactory::setActiveSource): Deleted. * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource): (WebCore::CoreAudioCaptureSource::stopProducingData): (WebCore::CoreAudioCaptureSourceFactory::setActiveSource): Deleted. * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::setSource): (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable): (WebCore::RealtimeOutgoingAudioSource::pullAudioData): * platform/mediastream/mac/RealtimeOutgoingAudioSource.h: * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::setSource): (WebCore::RealtimeOutgoingVideoSource::sourceMutedChanged): (WebCore::RealtimeOutgoingVideoSource::sourceEnabledChanged): * platform/mock/MockRealtimeAudioSource.cpp: (WebCore::mockAudioCaptureSourceFactory): (WebCore::MockRealtimeAudioSource::factory): (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource): (WebCore::MockRealtimeAudioSource::startProducingData): (WebCore::MockRealtimeAudioSource::stopProducingData): * platform/mock/MockRealtimeAudioSource.h: * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::mockVideoCaptureSourceFactory): (WebCore::MockRealtimeVideoSource::factory): (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource): (WebCore::MockRealtimeVideoSource::startProducingData): (WebCore::MockRealtimeVideoSource::stopProducingData): * platform/mock/MockRealtimeVideoSource.h: (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource): Deleted. LayoutTests: Improving the existing tests for better reliability and debugability. Updating tests to use less webkitAudioContext. * platform/ios/mediastream/getUserMedia-single-capture-expected.txt: Added. * platform/ios/mediastream/getUserMedia-single-capture.html: Added. * webrtc/audio-peer-connection-webaudio.html: * webrtc/audio-replace-track-expected.txt: * webrtc/audio-replace-track.html: * webrtc/peer-connection-audio-mute.html: * webrtc/peer-connection-audio-mute2.html: * webrtc/peer-connection-remote-audio-mute.html: * webrtc/peer-connection-remote-audio-mute2.html: * webrtc/routines.js: * webrtc/video-replace-track-expected.txt: * webrtc/video-replace-track.html: Canonical link: https://commits.webkit.org/188932@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-12 00:52:45 +00:00
});
}, "Ensuring mock audio source is received on the remote side");
promise_test(() => {
return navigator.mediaDevices.getUserMedia({ audio: { sampleRate: { exact: 48000 } } }).then((stream) => {
secondStream = stream;
Add libwebrtc backend support for RTCRtpSender::replaceTrack https://bugs.webkit.org/show_bug.cgi?id=169841 Patch by Youenn Fablet <youenn@apple.com> on 2017-03-24 Reviewed by Alex Christensen. Source/WebCore: Tests: webrtc/audio-replace-track.html webrtc/video-replace-track.html Adding support for replaceTrack for audio and video sources. Replacing tracks will always succeed for audio sources. For video tracks, it will only succeed if the video resolution is not greater. LibWebRTCPeerConnectionBackend will delegate the track replacing by replacing the source of the outgoing sources with the source wrapped in the replacing track. Video test is not fully passing as size constraints for mock video sources are not providing the right video stream resolution. * Modules/mediastream/RTCRtpSender.cpp: (WebCore::RTCRtpSender::replaceTrack): * Modules/mediastream/RTCRtpSender.h: * Modules/mediastream/RTCRtpSender.idl: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::setSource): * platform/mediastream/mac/RealtimeOutgoingAudioSource.h: * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::setSource): * platform/mediastream/mac/RealtimeOutgoingVideoSource.h: * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::drawText): (WebCore::MockRealtimeVideoSource::generateFrame): LayoutTests: * webrtc/audio-replace-track-expected.txt: Added. * webrtc/audio-replace-track.html: Added. * webrtc/video-replace-track-expected.txt: Added. * webrtc/video-replace-track.html: Added. * webrtc/video-replace-track-to-null-expected.txt: Added. * webrtc/video-replace-track-to-null.html: Added. Canonical link: https://commits.webkit.org/186982@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214357 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-24 18:01:18 +00:00
return sender.replaceTrack(secondStream.getAudioTracks()[0], secondStream);
}).then(() => {
assert_true(sender.track === secondStream.getAudioTracks()[0]);
return waitFor(500);
[iOS] Unset active media capture source when stopped capturing https://bugs.webkit.org/show_bug.cgi?id=171815 <rdar://problem/32117885> Patch by Youenn Fablet <youenn@apple.com> on 2017-05-11 Reviewed by Eric Carlson. Source/WebCore: Test: platform/ios/mediastream/getUserMedia-single-capture.html Introducing SingleSourceFactory template class to be used by capture factories for iOS. This class ensures that only one source is active at a time. Update all capture sources accordingly. Ensure sources are no longer considered as active sources when being destroyed. Add support for mock sources and introducing m_isProducingData for them as well. Update WebRTC outgoing source classes to handle the case of replaced track and resetting the enabled/mute state according the new source. Update the way we handle timestamps for audio data. We now consider that we read/write as a flow. This allows smooth audio track replacing. * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/mac/AVAudioCaptureSource.mm: (WebCore::AVAudioCaptureSource::~AVAudioCaptureSource): (WebCore::AVAudioCaptureSourceFactory::setActiveSource): Deleted. * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource): (WebCore::AVVideoCaptureSourceFactory::setActiveSource): Deleted. * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource): (WebCore::CoreAudioCaptureSource::stopProducingData): (WebCore::CoreAudioCaptureSourceFactory::setActiveSource): Deleted. * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::setSource): (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable): (WebCore::RealtimeOutgoingAudioSource::pullAudioData): * platform/mediastream/mac/RealtimeOutgoingAudioSource.h: * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::setSource): (WebCore::RealtimeOutgoingVideoSource::sourceMutedChanged): (WebCore::RealtimeOutgoingVideoSource::sourceEnabledChanged): * platform/mock/MockRealtimeAudioSource.cpp: (WebCore::mockAudioCaptureSourceFactory): (WebCore::MockRealtimeAudioSource::factory): (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource): (WebCore::MockRealtimeAudioSource::startProducingData): (WebCore::MockRealtimeAudioSource::stopProducingData): * platform/mock/MockRealtimeAudioSource.h: * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::mockVideoCaptureSourceFactory): (WebCore::MockRealtimeVideoSource::factory): (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource): (WebCore::MockRealtimeVideoSource::startProducingData): (WebCore::MockRealtimeVideoSource::stopProducingData): * platform/mock/MockRealtimeVideoSource.h: (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource): Deleted. LayoutTests: Improving the existing tests for better reliability and debugability. Updating tests to use less webkitAudioContext. * platform/ios/mediastream/getUserMedia-single-capture-expected.txt: Added. * platform/ios/mediastream/getUserMedia-single-capture.html: Added. * webrtc/audio-peer-connection-webaudio.html: * webrtc/audio-replace-track-expected.txt: * webrtc/audio-replace-track.html: * webrtc/peer-connection-audio-mute.html: * webrtc/peer-connection-audio-mute2.html: * webrtc/peer-connection-remote-audio-mute.html: * webrtc/peer-connection-remote-audio-mute2.html: * webrtc/routines.js: * webrtc/video-replace-track-expected.txt: * webrtc/video-replace-track.html: Canonical link: https://commits.webkit.org/188932@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-12 00:52:45 +00:00
});
}, "Using replaceTrack for audio");
promise_test(() => {
return doHumAnalysis(remoteStream, true).then((results) => {
assert_true(results, "heard hum 2");
Add libwebrtc backend support for RTCRtpSender::replaceTrack https://bugs.webkit.org/show_bug.cgi?id=169841 Patch by Youenn Fablet <youenn@apple.com> on 2017-03-24 Reviewed by Alex Christensen. Source/WebCore: Tests: webrtc/audio-replace-track.html webrtc/video-replace-track.html Adding support for replaceTrack for audio and video sources. Replacing tracks will always succeed for audio sources. For video tracks, it will only succeed if the video resolution is not greater. LibWebRTCPeerConnectionBackend will delegate the track replacing by replacing the source of the outgoing sources with the source wrapped in the replacing track. Video test is not fully passing as size constraints for mock video sources are not providing the right video stream resolution. * Modules/mediastream/RTCRtpSender.cpp: (WebCore::RTCRtpSender::replaceTrack): * Modules/mediastream/RTCRtpSender.h: * Modules/mediastream/RTCRtpSender.idl: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::setSource): * platform/mediastream/mac/RealtimeOutgoingAudioSource.h: * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::setSource): * platform/mediastream/mac/RealtimeOutgoingVideoSource.h: * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::drawText): (WebCore::MockRealtimeVideoSource::generateFrame): LayoutTests: * webrtc/audio-replace-track-expected.txt: Added. * webrtc/audio-replace-track.html: Added. * webrtc/video-replace-track-expected.txt: Added. * webrtc/video-replace-track.html: Added. * webrtc/video-replace-track-to-null-expected.txt: Added. * webrtc/video-replace-track-to-null.html: Added. Canonical link: https://commits.webkit.org/186982@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214357 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-24 18:01:18 +00:00
});
[iOS] Unset active media capture source when stopped capturing https://bugs.webkit.org/show_bug.cgi?id=171815 <rdar://problem/32117885> Patch by Youenn Fablet <youenn@apple.com> on 2017-05-11 Reviewed by Eric Carlson. Source/WebCore: Test: platform/ios/mediastream/getUserMedia-single-capture.html Introducing SingleSourceFactory template class to be used by capture factories for iOS. This class ensures that only one source is active at a time. Update all capture sources accordingly. Ensure sources are no longer considered as active sources when being destroyed. Add support for mock sources and introducing m_isProducingData for them as well. Update WebRTC outgoing source classes to handle the case of replaced track and resetting the enabled/mute state according the new source. Update the way we handle timestamps for audio data. We now consider that we read/write as a flow. This allows smooth audio track replacing. * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/mac/AVAudioCaptureSource.mm: (WebCore::AVAudioCaptureSource::~AVAudioCaptureSource): (WebCore::AVAudioCaptureSourceFactory::setActiveSource): Deleted. * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource): (WebCore::AVVideoCaptureSourceFactory::setActiveSource): Deleted. * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource): (WebCore::CoreAudioCaptureSource::stopProducingData): (WebCore::CoreAudioCaptureSourceFactory::setActiveSource): Deleted. * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::setSource): (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable): (WebCore::RealtimeOutgoingAudioSource::pullAudioData): * platform/mediastream/mac/RealtimeOutgoingAudioSource.h: * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::setSource): (WebCore::RealtimeOutgoingVideoSource::sourceMutedChanged): (WebCore::RealtimeOutgoingVideoSource::sourceEnabledChanged): * platform/mock/MockRealtimeAudioSource.cpp: (WebCore::mockAudioCaptureSourceFactory): (WebCore::MockRealtimeAudioSource::factory): (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource): (WebCore::MockRealtimeAudioSource::startProducingData): (WebCore::MockRealtimeAudioSource::stopProducingData): * platform/mock/MockRealtimeAudioSource.h: * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::mockVideoCaptureSourceFactory): (WebCore::MockRealtimeVideoSource::factory): (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource): (WebCore::MockRealtimeVideoSource::startProducingData): (WebCore::MockRealtimeVideoSource::stopProducingData): * platform/mock/MockRealtimeVideoSource.h: (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource): Deleted. LayoutTests: Improving the existing tests for better reliability and debugability. Updating tests to use less webkitAudioContext. * platform/ios/mediastream/getUserMedia-single-capture-expected.txt: Added. * platform/ios/mediastream/getUserMedia-single-capture.html: Added. * webrtc/audio-peer-connection-webaudio.html: * webrtc/audio-replace-track-expected.txt: * webrtc/audio-replace-track.html: * webrtc/peer-connection-audio-mute.html: * webrtc/peer-connection-audio-mute2.html: * webrtc/peer-connection-remote-audio-mute.html: * webrtc/peer-connection-remote-audio-mute2.html: * webrtc/routines.js: * webrtc/video-replace-track-expected.txt: * webrtc/video-replace-track.html: Canonical link: https://commits.webkit.org/188932@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-12 00:52:45 +00:00
}, "Ensuring remote audio gets the replacing track data");
Add libwebrtc backend support for RTCRtpSender::replaceTrack https://bugs.webkit.org/show_bug.cgi?id=169841 Patch by Youenn Fablet <youenn@apple.com> on 2017-03-24 Reviewed by Alex Christensen. Source/WebCore: Tests: webrtc/audio-replace-track.html webrtc/video-replace-track.html Adding support for replaceTrack for audio and video sources. Replacing tracks will always succeed for audio sources. For video tracks, it will only succeed if the video resolution is not greater. LibWebRTCPeerConnectionBackend will delegate the track replacing by replacing the source of the outgoing sources with the source wrapped in the replacing track. Video test is not fully passing as size constraints for mock video sources are not providing the right video stream resolution. * Modules/mediastream/RTCRtpSender.cpp: (WebCore::RTCRtpSender::replaceTrack): * Modules/mediastream/RTCRtpSender.h: * Modules/mediastream/RTCRtpSender.idl: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::setSource): * platform/mediastream/mac/RealtimeOutgoingAudioSource.h: * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::setSource): * platform/mediastream/mac/RealtimeOutgoingVideoSource.h: * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::drawText): (WebCore::MockRealtimeVideoSource::generateFrame): LayoutTests: * webrtc/audio-replace-track-expected.txt: Added. * webrtc/audio-replace-track.html: Added. * webrtc/video-replace-track-expected.txt: Added. * webrtc/video-replace-track.html: Added. * webrtc/video-replace-track-to-null-expected.txt: Added. * webrtc/video-replace-track-to-null.html: Added. Canonical link: https://commits.webkit.org/186982@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214357 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-24 18:01:18 +00:00
</script>
</body>
</html>