WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Fixing win and adding expectation for test
bug-172659-20170530105131.patch (text/plain), 21.35 KB, created by
youenn fablet
on 2017-05-30 10:51:53 PDT
(
hide
)
Description:
Fixing win and adding expectation for test
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2017-05-30 10:51:53 PDT
Size:
21.35 KB
patch
obsolete
>Subversion Revision: 217555 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 7da6e5123406e7ec5400a3f0ff4977b28a919c71..3fa45ddf54b4c857ff487788b0eb8b7da116a257 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,36 @@ >+2017-05-30 Youenn Fablet <youenn@apple.com> >+ >+ RealtimeOutgoingVideoSource should not rotate muted frames >+ https://bugs.webkit.org/show_bug.cgi?id=172659 >+ >+ Reviewed by Eric Carlson. >+ >+ Test: webrtc/video-rotation.html >+ >+ When sending black frames, it is unnecessary to rotate frames. >+ Instead, it is better to create frame with the expected width and height. >+ Making sure libwebrtc rotated images are not null, as only YUV rotation is supported. >+ >+ Adding internals API to test part of that code path. >+ Full coverage should be added when mock source is producing YUV images. >+ >+ * Modules/mediastream/PeerConnectionBackend.h: >+ (WebCore::PeerConnectionBackend::applyRotationForOutgoingVideoSources): >+ * Modules/mediastream/RTCPeerConnection.h: >+ * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: >+ (WebCore::LibWebRTCPeerConnectionBackend::applyRotationForOutgoingVideoSources): >+ * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: >+ * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: >+ (WebCore::RealtimeOutgoingVideoSource::sendBlackFrames): >+ (WebCore::RealtimeOutgoingVideoSource::sendFrame): >+ * platform/mediastream/mac/RealtimeOutgoingVideoSource.h: >+ * testing/Internals.cpp: >+ (WebCore::Internals::Internals): >+ (WebCore::Internals::applyRotationForOutgoingVideoSources): >+ (WebCore::Internals::setCameraMediaStreamTrackOrientation): >+ * testing/Internals.h: >+ * testing/Internals.idl: >+ > 2017-05-30 Fujii Hironori <Hironori.Fujii@sony.com> > > [WinCairo] TestWebKitAPI: SHOULD NEVER BE REACHED in WebCore::cairoSurfaceSize >diff --git a/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h b/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h >index 1b85f08d5ed72f654d982718237a3752ce1cd14a..8f95a1b789edfdb8e770339e25234ecbe7404357 100644 >--- a/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h >+++ b/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h >@@ -110,6 +110,8 @@ public: > void disableICECandidateFiltering(); > void enableICECandidateFiltering(); > >+ virtual void applyRotationForOutgoingVideoSources() { } >+ > protected: > void fireICECandidateEvent(RefPtr<RTCIceCandidate>&&); > void doneGatheringCandidates(); >diff --git a/Source/WebCore/Modules/mediastream/RTCPeerConnection.h b/Source/WebCore/Modules/mediastream/RTCPeerConnection.h >index f5e5fc349abd727b0ec088b9100d7cf6b0ab57d8..e3637bf23f5b06fcbfc27f1cf05570664956158c 100644 >--- a/Source/WebCore/Modules/mediastream/RTCPeerConnection.h >+++ b/Source/WebCore/Modules/mediastream/RTCPeerConnection.h >@@ -155,6 +155,9 @@ private: > void registerToController(RTCController&); > void unregisterFromController(); > >+ friend class Internals; >+ void applyRotationForOutgoingVideoSources() { m_backend->applyRotationForOutgoingVideoSources(); } >+ > // EventTarget implementation. > void refEventTarget() final { ref(); } > void derefEventTarget() final { deref(); } >diff --git a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp >index 1817e65f7e324824b4123633cceab5bba352f53f..1d84993258d61f8f5362508f8c7c7a3d62757eed 100644 >--- a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp >+++ b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp >@@ -375,6 +375,12 @@ RTCRtpParameters LibWebRTCPeerConnectionBackend::getParameters(RTCRtpSender& sen > return m_endpoint->getRTCRtpSenderParameters(sender); > } > >+void LibWebRTCPeerConnectionBackend::applyRotationForOutgoingVideoSources() >+{ >+ for (auto& source : m_videoSources) >+ source->setApplyRotation(true); >+} >+ > } // namespace WebCore > > #endif // USE(LIBWEBRTC) >diff --git a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h >index 5436f8f89b58656d09f0022fe9b4d4a0ea5ffb55..dc97538476ea4ad9b07d3f3c5af154c476219ad2 100644 >--- a/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h >+++ b/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h >@@ -73,6 +73,7 @@ private: > RTCRtpParameters getParameters(RTCRtpSender&) const final; > > void emulatePlatformEvent(const String&) final { } >+ void applyRotationForOutgoingVideoSources() final; > > friend LibWebRTCMediaEndpoint; > RTCPeerConnection& connection() { return m_peerConnection; } >diff --git a/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.h b/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.h >index 95837b11a5c6d97f872b6500588841020aca7f1d..55dc6481c2eb524f9bd4875bb7520a0efa54eeab 100644 >--- a/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.h >+++ b/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.h >@@ -59,6 +59,7 @@ private: > bool applySize(const IntSize&) final; > > void orientationChanged(int orientation) final; >+ void monitorOrientation(OrientationNotifier&) final; > > mutable RetainPtr<CGImageRef> m_previewImage; > mutable RetainPtr<PlatformLayer> m_previewLayer; >diff --git a/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.mm b/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.mm >index 00b3a7e09211e6ffb29d067c8a63853ffce0cf6f..e719f0676d21898443ce9c835710cd2e07d9edb0 100644 >--- a/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.mm >+++ b/Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.mm >@@ -143,8 +143,9 @@ void MockRealtimeVideoSourceMac::updateSampleBuffer() > > auto pixelBuffer = pixelBufferFromCGImage(imageBuffer->copyImage()->nativeImage().get()); > auto sampleBuffer = CMSampleBufferFromPixelBuffer(pixelBuffer.get()); >- >- videoSampleAvailable(MediaSampleAVFObjC::create(sampleBuffer.get())); >+ >+ // We use m_deviceOrientation to emulate sensor orientation >+ videoSampleAvailable(MediaSampleAVFObjC::create(sampleBuffer.get(), m_deviceOrientation)); > } > > bool MockRealtimeVideoSourceMac::applySize(const IntSize& newSize) >@@ -176,6 +177,12 @@ void MockRealtimeVideoSourceMac::orientationChanged(int orientation) > } > } > >+void MockRealtimeVideoSourceMac::monitorOrientation(OrientationNotifier& notifier) >+{ >+ notifier.addObserver(*this); >+ orientationChanged(notifier.orientation()); >+} >+ > } // namespace WebCore > > #endif // ENABLE(MEDIA_STREAM) >diff --git a/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp b/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp >index 57e9312c24c994ea64dd59f950a2db425e155337..485cd2b9ae932f27e3824ef8c6bc2ff3c1145a87 100644 >--- a/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp >+++ b/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp >@@ -138,7 +138,11 @@ void RealtimeOutgoingVideoSource::RemoveSink(rtc::VideoSinkInterface<webrtc::Vid > void RealtimeOutgoingVideoSource::sendBlackFrames() > { > if (!m_blackFrame) { >- auto frame = m_bufferPool.CreateBuffer(m_width, m_height); >+ auto width = m_width; >+ auto height = m_height; >+ if (m_shouldApplyRotation && (m_currentRotation == webrtc::kVideoRotation_0 || m_currentRotation == webrtc::kVideoRotation_90)) >+ std::swap(width, height); >+ auto frame = m_bufferPool.CreateBuffer(width, height); > frame->SetToBlack(); > m_blackFrame = WTFMove(frame); > } >@@ -154,13 +158,7 @@ void RealtimeOutgoingVideoSource::sendOneBlackFrame() > > void RealtimeOutgoingVideoSource::sendFrame(rtc::scoped_refptr<webrtc::VideoFrameBuffer>&& buffer) > { >- // FIXME: We should make AVVideoCaptureSource handle the rotation whenever possible. >- if (m_shouldApplyRotation && m_currentRotation != webrtc::kVideoRotation_0) { >- // This implementation is inefficient, we should rotate on the CMSampleBuffer directly instead of doing this double allocation. >- buffer = buffer->NativeToI420Buffer(); >- buffer = webrtc::I420Buffer::Rotate(*buffer, m_currentRotation); >- } >- webrtc::VideoFrame frame(buffer, 0, 0, m_currentRotation); >+ webrtc::VideoFrame frame(buffer, 0, 0, m_shouldApplyRotation ? webrtc::kVideoRotation_0 : m_currentRotation); > for (auto* sink : m_sinks) > sink->OnFrame(frame); > } >@@ -198,7 +196,15 @@ void RealtimeOutgoingVideoSource::videoSampleAvailable(MediaSample& sample) > auto pixelFormatType = CVPixelBufferGetPixelFormatType(pixelBuffer); > > if (pixelFormatType == kCVPixelFormatType_420YpCbCr8Planar || pixelFormatType == kCVPixelFormatType_420YpCbCr8BiPlanarFullRange) { >- sendFrame(new rtc::RefCountedObject<webrtc::CoreVideoFrameBuffer>(pixelBuffer)); >+ rtc::scoped_refptr<webrtc::VideoFrameBuffer> buffer = new rtc::RefCountedObject<webrtc::CoreVideoFrameBuffer>(pixelBuffer); >+ if (m_shouldApplyRotation && m_currentRotation != webrtc::kVideoRotation_0) { >+ // FIXME: We should make AVVideoCaptureSource handle the rotation whenever possible. >+ // This implementation is inefficient, we should rotate on the CMSampleBuffer directly instead of doing this double allocation. >+ auto rotatedBuffer = buffer->NativeToI420Buffer(); >+ ASSERT(rotatedBuffer); >+ buffer = webrtc::I420Buffer::Rotate(*rotatedBuffer, m_currentRotation); >+ } >+ sendFrame(WTFMove(buffer)); > return; > } > >@@ -213,6 +219,8 @@ void RealtimeOutgoingVideoSource::videoSampleAvailable(MediaSample& sample) > webrtc::ConvertToI420(webrtc::kBGRA, source, 0, 0, m_width, m_height, 0, webrtc::kVideoRotation_0, newBuffer); > } > CVPixelBufferUnlockBaseAddress(pixelBuffer, 0); >+ if (m_shouldApplyRotation && m_currentRotation != webrtc::kVideoRotation_0) >+ newBuffer = webrtc::I420Buffer::Rotate(*newBuffer, m_currentRotation); > sendFrame(WTFMove(newBuffer)); > } > >diff --git a/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSource.h b/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSource.h >index 5df55549f552faee4fee39c83aed3b57d82186e5..d80e2ded83615156358a58cfa39f5cd48493f83f 100644 >--- a/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSource.h >+++ b/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSource.h >@@ -54,6 +54,8 @@ public: > int AddRef() const final { ref(); return refCount(); } > int Release() const final { deref(); return refCount(); } > >+ void setApplyRotation(bool shouldApplyRotation) { m_shouldApplyRotation = shouldApplyRotation; } >+ > private: > RealtimeOutgoingVideoSource(Ref<RealtimeMediaSource>&&); > >diff --git a/Source/WebCore/testing/Internals.cpp b/Source/WebCore/testing/Internals.cpp >index 7eacb0ff54c3493ae400dc61b1a8cbbf3e1231cc..101ec0cdcdbe923b479a9999e91be6140266dff1 100644 >--- a/Source/WebCore/testing/Internals.cpp >+++ b/Source/WebCore/testing/Internals.cpp >@@ -461,6 +461,9 @@ void Internals::resetToConsistentState(Page& page) > > Internals::Internals(Document& document) > : ContextDestructionObserver(&document) >+#if ENABLE(MEDIA_STREAM) >+ , m_orientationNotifier(0) >+#endif > { > #if ENABLE(VIDEO_TRACK) > if (document.page()) >@@ -1326,6 +1329,10 @@ void Internals::stopPeerConnection(RTCPeerConnection& connection) > object.stop(); > } > >+void Internals::applyRotationForOutgoingVideoSources(RTCPeerConnection& connection) >+{ >+ connection.applyRotationForOutgoingVideoSources(); >+} > #endif > > #if ENABLE(MEDIA_STREAM) >@@ -4009,6 +4016,16 @@ void Internals::setPageVisibility(bool isVisible) > } > > #if ENABLE(MEDIA_STREAM) >+ >+void Internals::setCameraMediaStreamTrackOrientation(MediaStreamTrack& track, int orientation) >+{ >+ auto& source = track.source(); >+ if (!source.isCaptureSource()) >+ return; >+ m_orientationNotifier.orientationChanged(orientation); >+ source.monitorOrientation(m_orientationNotifier); >+} >+ > void Internals::observeMediaStreamTrack(MediaStreamTrack& track) > { > m_track = &track; >diff --git a/Source/WebCore/testing/Internals.h b/Source/WebCore/testing/Internals.h >index 52e168bf6340e01e50e455aa9992fafc00e2a0a3..1160d3e830f962e3f18a5141cf0c86521b75b8e8 100644 >--- a/Source/WebCore/testing/Internals.h >+++ b/Source/WebCore/testing/Internals.h >@@ -30,6 +30,7 @@ > #include "ContextDestructionObserver.h" > #include "ExceptionOr.h" > #include "JSDOMPromiseDeferred.h" >+#include "OrientationNotifer.h" > #include "PageConsoleClient.h" > #include "RealtimeMediaSource.h" > #include <runtime/Float32Array.h> >@@ -429,6 +430,7 @@ public: > void setICECandidateFiltering(bool); > void setEnumeratingAllNetworkInterfacesEnabled(bool); > void stopPeerConnection(RTCPeerConnection&); >+ void applyRotationForOutgoingVideoSources(RTCPeerConnection&); > #endif > > String getImageSourceURL(Element&); >@@ -570,6 +572,7 @@ public: > void setPageVisibility(bool isVisible); > > #if ENABLE(MEDIA_STREAM) >+ void setCameraMediaStreamTrackOrientation(MediaStreamTrack&, int orientation); > ExceptionOr<void> setMediaDeviceState(const String& id, const String& property, bool value); > unsigned long trackAudioSampleCount() const { return m_trackAudioSampleCount; } > unsigned long trackVideoSampleCount() const { return m_trackVideoSampleCount; } >@@ -591,6 +594,7 @@ private: > void videoSampleAvailable(MediaSample&) final; > void audioSamplesAvailable(const MediaTime&, const PlatformAudioData&, const AudioStreamDescription&, size_t) final { m_trackAudioSampleCount++; } > >+ OrientationNotifier m_orientationNotifier; > unsigned long m_trackVideoSampleCount { 0 }; > unsigned long m_trackAudioSampleCount { 0 }; > RefPtr<MediaStreamTrack> m_track; >diff --git a/Source/WebCore/testing/Internals.idl b/Source/WebCore/testing/Internals.idl >index 5fd86ac48f5a89edd3570bb024da3ad9ba8f0b52..5aa4ab390b5c8c523e0b0b193c360d4f477c880d 100644 >--- a/Source/WebCore/testing/Internals.idl >+++ b/Source/WebCore/testing/Internals.idl >@@ -533,6 +533,9 @@ enum EventThrottlingBehavior { > > void setPageVisibility(boolean isVisible); > >+ [Conditional=WEB_RTC] void applyRotationForOutgoingVideoSources(RTCPeerConnection connection); >+ >+ [Conditional=MEDIA_STREAM] void setCameraMediaStreamTrackOrientation(MediaStreamTrack track, short orientation); > [Conditional=MEDIA_STREAM] void observeMediaStreamTrack(MediaStreamTrack track); > [Conditional=MEDIA_STREAM] Promise<ImageData> grabNextMediaStreamTrackFrame(); > [Conditional=MEDIA_STREAM] readonly attribute unsigned long trackAudioSampleCount; >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 2374e1d534e8c07dd70d0fe0c2fb872430994813..04aa2829e8df40b9dbf5ad5b472b0b4d5199b167 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2017-05-30 Youenn Fablet <youenn@apple.com> >+ >+ RealtimeOutgoingVideoSource should not rotate muted frames >+ https://bugs.webkit.org/show_bug.cgi?id=172659 >+ >+ Reviewed by Eric Carlson. >+ >+ * webrtc/routines.js: >+ * webrtc/video-rotation-expected.txt: Added. >+ * webrtc/video-rotation.html: Added. >+ > 2017-05-30 Adrian Perez de Castro <aperez@igalia.com> > > [GTK] Test cases for typehead in form menu lists should start from known state >diff --git a/LayoutTests/TestExpectations b/LayoutTests/TestExpectations >index 516912d7db4fce8bbedbbe7b7d2dce0c2b135d52..04875ccbef39873eb9bf07d64c99734287302614 100644 >--- a/LayoutTests/TestExpectations >+++ b/LayoutTests/TestExpectations >@@ -745,9 +745,11 @@ fast/mediastream/RTCPeerConnection-more-media-to-negotiate.html [ Skip ] > fast/mediastream/RTCPeerConnection-overloaded-operations-params.html [ Skip ] > fast/mediastream/RTCRtpSender-replaceTrack.html [ Skip ] > fast/mediastream/RTCPeerConnection-dtmf.html [ Failure ] >+webrtc/video-rotation.html [ Pass Failure ] > # libwebrtc backend doesn't generate a=bundle-only lines > fast/mediastream/RTCPeerConnection-inspect-offer-bundlePolicy-bundle-only.html [ Failure ] > >+ > # Need updating wptserve > imported/w3c/web-platform-tests/XMLHttpRequest/setrequestheader-content-type.htm [ Skip ] > imported/w3c/web-platform-tests/XMLHttpRequest/open-url-redirected-worker-origin.htm [ Skip ] >diff --git a/LayoutTests/webrtc/routines.js b/LayoutTests/webrtc/routines.js >index 7e1a2ec63031173d8a03faeaea42ae3d245cc465..874edd09defa89c825cd03aba2e89123b529a48e 100644 >--- a/LayoutTests/webrtc/routines.js >+++ b/LayoutTests/webrtc/routines.js >@@ -130,3 +130,18 @@ function waitFor(duration) > { > return new Promise((resolve) => setTimeout(resolve, duration)); > } >+ >+function waitForVideoSize(video, width, height, count) >+{ >+ if (video.videoWidth === width && video.videoHeight === height) >+ return Promise.resolve("video has expected size"); >+ >+ if (count === undefined) >+ count = 0; >+ if (++count > 20) >+ return Promise.reject("waitForVideoSize timed out"); >+ >+ return waitFor(50).then(() => { >+ return waitForVideoSize(video, width, height, count); >+ }); >+} >diff --git a/LayoutTests/webrtc/video-rotation-expected.txt b/LayoutTests/webrtc/video-rotation-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..c4256511e6e538e4aaa82afdf5a713dee640210e >--- /dev/null >+++ b/LayoutTests/webrtc/video-rotation-expected.txt >@@ -0,0 +1,7 @@ >+ >+ >+PASS Setting video exchange >+PASS Track is enabled, video should not be black >+PASS Track is enabled and rotated, video should not be black and should change size >+PASS Track is disabled, video should be black >+ >diff --git a/LayoutTests/webrtc/video-rotation.html b/LayoutTests/webrtc/video-rotation.html >new file mode 100644 >index 0000000000000000000000000000000000000000..b8d18d9ba21ebe6ec6195ef36be297225e8715e8 >--- /dev/null >+++ b/LayoutTests/webrtc/video-rotation.html >@@ -0,0 +1,99 @@ >+<!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="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> >+function isVideoBlack(id) >+{ >+ var canvas = document.getElementById(id); >+ canvas.width = video.videoWidth; >+ canvas.height = video.videoHeight; >+ canvas.getContext('2d').drawImage(video, 0, 0, canvas.width, canvas.height); >+ >+ imageData = canvas.getContext('2d').getImageData(0, 0, canvas.width, canvas.height); >+ data = imageData.data; >+ for (var cptr = 0; cptr < canvas.width * canvas.height; ++cptr) { >+ // Approximatively black pixels. >+ if (data[4 * cptr] > 30 || data[4 * cptr + 1] > 30 || data[4 * cptr + 2] > 30) >+ return false; >+ } >+ return true; >+} >+ >+function pollVideoBlackCheck(expected, id, resolve) >+{ >+ if (isVideoBlack(id) === expected) { >+ resolve(); >+ return; >+ } >+ >+ setTimeout(() => pollVideoBlackCheck(expected, id, resolve), 50); >+} >+ >+function checkVideoBlack(expected, id) >+{ >+ return new Promise((resolve, reject) => { >+ pollVideoBlackCheck(expected, id, resolve); >+ setTimeout(() => reject("checkVideoBlack timed out for '" + id + "', expected " + expected), 5000); >+ }); >+} >+ >+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) => { >+ return new Promise((resolve, reject) => { >+ track = localStream.getVideoTracks()[0]; >+ >+ createConnections((firstConnection) => { >+ firstConnection.addTrack(track, localStream); >+ if (window.internals) >+ internals.applyRotationForOutgoingVideoSources(firstConnection); >+ }, (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(false, "canvas1"); >+}, "Track is enabled, video should not be black"); >+ >+promise_test((test) => { >+ if (window.internals) >+ window.internals.setCameraMediaStreamTrackOrientation(track, 90); >+ >+ return checkVideoBlack(false, "canvas1").then(() => { >+ return waitForVideoSize(video, 240, 320); >+ }); >+}, "Track is enabled and rotated, video should not be black and should change size"); >+ >+promise_test((test) => { >+ track.enabled = false; >+ return checkVideoBlack(true, "canvas2"); >+}, "Track is disabled, video should be black"); >+ >+ </script> >+ </body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 172659
:
311378
|
311385
|
311391
|
311511
|
311516
| 311518