RealtimeOutgoingVideoSource should not rotate muted frames
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 May 2017 18:29:13 +0000 (18:29 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 May 2017 18:29:13 +0000 (18:29 +0000)
commit96150a215b860216ddc7da108c7cca82f464c6b1
treee97eb847fc0706b42a2368a2d0f83ec87b002579
parent008f369a12822f0fc8e64329b62276788dca60d0
RealtimeOutgoingVideoSource should not rotate muted frames
https://bugs.webkit.org/show_bug.cgi?id=172659

Patch by Youenn Fablet <youenn@apple.com> on 2017-05-30
Reviewed by Eric Carlson.

Source/WebCore:

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:

LayoutTests:

* webrtc/routines.js:
* webrtc/video-rotation-expected.txt: Added.
* webrtc/video-rotation.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217562 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/webrtc/routines.js
LayoutTests/webrtc/video-rotation-expected.txt [new file with mode: 0644]
LayoutTests/webrtc/video-rotation.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/PeerConnectionBackend.h
Source/WebCore/Modules/mediastream/RTCPeerConnection.h
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h
Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.h
Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.mm
Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp
Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSource.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl