Diff
Modified: trunk/LayoutTests/ChangeLog (258423 => 258424)
--- trunk/LayoutTests/ChangeLog 2020-03-13 20:19:16 UTC (rev 258423)
+++ trunk/LayoutTests/ChangeLog 2020-03-13 20:22:17 UTC (rev 258424)
@@ -1,3 +1,15 @@
+2020-03-13 Ryan Haddad <ryanhad...@apple.com>
+
+ Unreviewed, reverting r258391.
+
+ Breaks internal builds.
+
+ Reverted changeset:
+
+ "Apply rotation at source level if WebRTC sink ask so"
+ https://bugs.webkit.org/show_bug.cgi?id=205645
+ https://trac.webkit.org/changeset/258391
+
2020-03-13 Chris Dumez <cdu...@apple.com>
[Mac wk2 ] fast/dom/attr_dead_doc.html is flaky failing.
Deleted: trunk/LayoutTests/webrtc/video-rotation-no-cvo-expected.txt (258423 => 258424)
--- trunk/LayoutTests/webrtc/video-rotation-no-cvo-expected.txt 2020-03-13 20:19:16 UTC (rev 258423)
+++ trunk/LayoutTests/webrtc/video-rotation-no-cvo-expected.txt 2020-03-13 20:22:17 UTC (rev 258424)
@@ -1,4 +0,0 @@
-
-
-PASS Testing video exchange with rotation applied before transmission
-
Deleted: trunk/LayoutTests/webrtc/video-rotation-no-cvo.html (258423 => 258424)
--- trunk/LayoutTests/webrtc/video-rotation-no-cvo.html 2020-03-13 20:19:16 UTC (rev 258423)
+++ trunk/LayoutTests/webrtc/video-rotation-no-cvo.html 2020-03-13 20:22:17 UTC (rev 258424)
@@ -1,42 +0,0 @@
-<!-- webkit-test-runner [ enableCaptureVideoInUIProcess=true ] -->
-<!doctype html>
-<html>
- <head>
- <meta charset="utf-8">
- <title>Testing video rotation without CVO</title>
- <script src=""
- <script src=""
- </head>
- <body>
- <video id="localVideo" autoplay playsInline width="320" height="240"></video>
- <video id="remoteVideo" autoplay playsInline width="320" height="240"></video>
- <script src =""
- <script>
-promise_test(async (test) => {
- const localStream = await navigator.mediaDevices.getUserMedia({ video: { width: 320, height: 240 } });
- if (window.testRunner)
- window.testRunner.setMockCameraOrientation(90);
-
- localVideo.srcObject = localStream;
- const remoteStream = await new Promise((resolve, reject) => {
- track = localStream.getVideoTracks()[0];
-
- createConnections((firstConnection) => {
- firstConnection.addTrack(track, localStream);
- if (window.internals)
- internals.applyRotationForOutgoingVideoSources(firstConnection);
- }, (secondConnection) => {
- secondConnection._ontrack_ = (trackEvent) => {
- resolve(trackEvent.streams[0]);
- };
- });
- setTimeout(() => reject("Test timed out"), 5000);
- });
-
- remoteVideo.srcObject = remoteStream;
- await remoteVideo.play();
- await waitForVideoSize(remoteVideo, 240, 320);
-}, "Testing video exchange with rotation applied before transmission");
- </script>
- </body>
-</html>
Modified: trunk/Source/WebCore/ChangeLog (258423 => 258424)
--- trunk/Source/WebCore/ChangeLog 2020-03-13 20:19:16 UTC (rev 258423)
+++ trunk/Source/WebCore/ChangeLog 2020-03-13 20:22:17 UTC (rev 258424)
@@ -1,3 +1,15 @@
+2020-03-13 Ryan Haddad <ryanhad...@apple.com>
+
+ Unreviewed, reverting r258391.
+
+ Breaks internal builds.
+
+ Reverted changeset:
+
+ "Apply rotation at source level if WebRTC sink ask so"
+ https://bugs.webkit.org/show_bug.cgi?id=205645
+ https://trac.webkit.org/changeset/258391
+
2020-03-13 Kate Cheney <katherine_che...@apple.com>
Report all third party loads on a per-page basis
Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp (258423 => 258424)
--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp 2020-03-13 20:19:16 UTC (rev 258423)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp 2020-03-13 20:22:17 UTC (rev 258424)
@@ -513,7 +513,7 @@
for (auto& transceiver : m_peerConnection.currentTransceivers()) {
if (!transceiver->sender().isStopped()) {
if (auto* videoSource = backendFromRTPSender(transceiver->sender()).videoSource())
- videoSource->applyRotation();
+ videoSource->setApplyRotation(true);
}
}
}
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (258423 => 258424)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2020-03-13 20:19:16 UTC (rev 258423)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2020-03-13 20:22:17 UTC (rev 258424)
@@ -4068,7 +4068,7 @@
CD1E7347167BC78E009A885D /* TextTrackRepresentation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD1E7346167BC78E009A885D /* TextTrackRepresentation.cpp */; };
CD225C0B1C46FBF400140761 /* WebCoreNSURLSession.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD225C091C46FBF400140761 /* WebCoreNSURLSession.mm */; };
CD225C0C1C46FBF400140761 /* WebCoreNSURLSession.h in Headers */ = {isa = PBXBuildFile; fileRef = CD225C0A1C46FBF400140761 /* WebCoreNSURLSession.h */; settings = {ATTRIBUTES = (Private, ); }; };
- CD27AE5022A9868700947FF9 /* ImageRotationSessionVT.h in Headers */ = {isa = PBXBuildFile; fileRef = CD27AE4E22A9868700947FF9 /* ImageRotationSessionVT.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ CD27AE5022A9868700947FF9 /* ImageRotationSessionVT.h in Headers */ = {isa = PBXBuildFile; fileRef = CD27AE4E22A9868700947FF9 /* ImageRotationSessionVT.h */; };
CD27AE5122A9868700947FF9 /* ImageRotationSessionVT.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD27AE4F22A9868700947FF9 /* ImageRotationSessionVT.mm */; };
CD2F4A2418D89F700063746D /* AudioHardwareListener.h in Headers */ = {isa = PBXBuildFile; fileRef = CD2F4A2218D89F700063746D /* AudioHardwareListener.h */; settings = {ATTRIBUTES = (Private, ); }; };
CD2F4A2818D8A3490063746D /* AudioHardwareListenerMac.h in Headers */ = {isa = PBXBuildFile; fileRef = CD2F4A2618D8A3490063746D /* AudioHardwareListenerMac.h */; };
Modified: trunk/Source/WebCore/platform/graphics/cv/ImageRotationSessionVT.h (258423 => 258424)
--- trunk/Source/WebCore/platform/graphics/cv/ImageRotationSessionVT.h 2020-03-13 20:19:16 UTC (rev 258423)
+++ trunk/Source/WebCore/platform/graphics/cv/ImageRotationSessionVT.h 2020-03-13 20:22:17 UTC (rev 258424)
@@ -36,8 +36,6 @@
namespace WebCore {
-class MediaSample;
-
class ImageRotationSessionVT final {
WTF_MAKE_FAST_ALLOCATED;
public:
@@ -54,9 +52,8 @@
Yes,
};
- ImageRotationSessionVT(AffineTransform&&, FloatSize, OSType, IsCGImageCompatible);
- ImageRotationSessionVT(const RotationProperties&, FloatSize, OSType, IsCGImageCompatible);
- ImageRotationSessionVT() = default;
+ ImageRotationSessionVT(AffineTransform&&, FloatSize, OSType pixelFormat, IsCGImageCompatible);
+ ImageRotationSessionVT(RotationProperties&&, FloatSize, OSType pixelFormat, IsCGImageCompatible);
const Optional<AffineTransform>& transform() const { return m_transform; }
const RotationProperties& rotationProperties() const { return m_rotationProperties; }
@@ -64,13 +61,8 @@
const FloatSize& rotatedSize() { return m_rotatedSize; }
RetainPtr<CVPixelBufferRef> rotate(CVPixelBufferRef);
- WEBCORE_EXPORT RetainPtr<CVPixelBufferRef> rotate(MediaSample&, const RotationProperties&, IsCGImageCompatible);
- bool isMatching(MediaSample&, const RotationProperties&);
-
private:
- void initialize(const RotationProperties&, FloatSize, OSType pixelFormat, IsCGImageCompatible);
-
Optional<AffineTransform> m_transform;
RotationProperties m_rotationProperties;
FloatSize m_size;
@@ -79,16 +71,6 @@
RetainPtr<CVPixelBufferPoolRef> m_rotationPool;
};
-inline bool operator==(const ImageRotationSessionVT::RotationProperties& rotation1, const ImageRotationSessionVT::RotationProperties& rotation2)
-{
- return rotation1.flipX == rotation2.flipX && rotation1.flipY == rotation2.flipY && rotation1.angle == rotation2.angle;
}
-inline bool operator!=(const ImageRotationSessionVT::RotationProperties& rotation1, const ImageRotationSessionVT::RotationProperties& rotation2)
-{
- return !(rotation1 == rotation2);
-}
-
-}
-
#endif
Modified: trunk/Source/WebCore/platform/graphics/cv/ImageRotationSessionVT.mm (258423 => 258424)
--- trunk/Source/WebCore/platform/graphics/cv/ImageRotationSessionVT.mm 2020-03-13 20:19:16 UTC (rev 258423)
+++ trunk/Source/WebCore/platform/graphics/cv/ImageRotationSessionVT.mm 2020-03-13 20:22:17 UTC (rev 258424)
@@ -27,7 +27,6 @@
#include "ImageRotationSessionVT.h"
#include "AffineTransform.h"
-#include "MediaSample.h"
#include "CoreVideoSoftLink.h"
#include "VideoToolboxSoftLink.h"
@@ -65,16 +64,11 @@
m_transform = WTFMove(transform);
}
-ImageRotationSessionVT::ImageRotationSessionVT(const RotationProperties& rotation, FloatSize size, OSType pixelFormat, IsCGImageCompatible cvImageCompatibility)
-{
- initialize(rotation, size, pixelFormat, cvImageCompatibility);
-}
-void ImageRotationSessionVT::initialize(const RotationProperties& rotation, FloatSize size, OSType pixelFormat, IsCGImageCompatible cvImageCompatibility)
+ImageRotationSessionVT::ImageRotationSessionVT(RotationProperties&& rotation, FloatSize size, OSType pixelFormat, IsCGImageCompatible cvImageCompatibility)
+ : m_rotationProperties(WTFMove(rotation))
+ , m_size(size)
{
- m_rotationProperties = rotation;
- m_size = size;
-
if (m_rotationProperties.angle == 90 || m_rotationProperties.angle == 270)
size = size.transposedSize();
@@ -95,7 +89,6 @@
(__bridge NSString *)kCVPixelBufferHeightKey: @(m_rotatedSize.height()),
(__bridge NSString *)kCVPixelBufferPixelFormatTypeKey: @(pixelFormat),
(__bridge NSString *)kCVPixelBufferCGImageCompatibilityKey: (cvImageCompatibility == IsCGImageCompatible::Yes ? @YES : @NO),
- (__bridge NSString *)kCVPixelBufferIOSurfacePropertiesKey : @{ }
};
CVPixelBufferPoolRef rawPool = nullptr;
if (auto err = CVPixelBufferPoolCreate(kCFAllocatorDefault, nullptr, (__bridge CFDictionaryRef)pixelAttributes, &rawPool); err != noErr)
@@ -113,20 +106,6 @@
return nullptr;
}
-RetainPtr<CVPixelBufferRef> ImageRotationSessionVT::rotate(MediaSample& sample, const RotationProperties& rotation, IsCGImageCompatible cvImageCompatibility)
-{
- auto pixelBuffer = static_cast<CVPixelBufferRef>(CMSampleBufferGetImageBuffer(sample.platformSample().sample.cmSampleBuffer));
- ASSERT(pixelBuffer);
- if (!pixelBuffer)
- return nullptr;
-
- IntSize size { (int)CVPixelBufferGetWidth(pixelBuffer), (int)CVPixelBufferGetHeight(pixelBuffer) };
- if (rotation != m_rotationProperties || m_size != size)
- initialize(rotation, size, CVPixelBufferGetPixelFormatType(pixelBuffer), cvImageCompatibility);
-
- return rotate(pixelBuffer);
}
-}
-
#endif
Modified: trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.h (258423 => 258424)
--- trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.h 2020-03-13 20:19:16 UTC (rev 258423)
+++ trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.h 2020-03-13 20:22:17 UTC (rev 258424)
@@ -200,8 +200,6 @@
virtual void delaySamples(Seconds) { };
void setInterruptedForTesting(bool);
- virtual bool setShouldApplyRotation(bool) { return false; }
-
protected:
RealtimeMediaSource(Type, String&& name, String&& deviceID = { }, String&& hashSalt = { });
Modified: trunk/Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.cpp (258423 => 258424)
--- trunk/Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.cpp 2020-03-13 20:19:16 UTC (rev 258423)
+++ trunk/Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.cpp 2020-03-13 20:22:17 UTC (rev 258424)
@@ -80,23 +80,8 @@
{
ASSERT(!m_videoSource->hasObserver(*this));
m_videoSource = WTFMove(newSource);
-
- if (!m_areSinksAskingToApplyRotation)
- return;
- if (!m_videoSource->source().setShouldApplyRotation(true))
- m_shouldApplyRotation = true;
}
-void RealtimeOutgoingVideoSource::applyRotation()
-{
- if (m_areSinksAskingToApplyRotation)
- return;
-
- m_areSinksAskingToApplyRotation = true;
- if (!m_videoSource->source().setShouldApplyRotation(true))
- m_shouldApplyRotation = true;
-}
-
void RealtimeOutgoingVideoSource::stop()
{
ASSERT(isMainThread());
@@ -150,7 +135,7 @@
ASSERT(!sinkWants.black_frames);
if (sinkWants.rotation_applied)
- applyRotation();
+ m_shouldApplyRotation = true;
auto locker = holdLock(m_sinksLock);
m_sinks.add(sink);
Modified: trunk/Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.h (258423 => 258424)
--- trunk/Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.h 2020-03-13 20:19:16 UTC (rev 258423)
+++ trunk/Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.h 2020-03-13 20:22:17 UTC (rev 258424)
@@ -71,7 +71,7 @@
return rtc::RefCountReleaseStatus::kOtherRefsRemained;
}
- void applyRotation();
+ void setApplyRotation(bool shouldApplyRotation) { m_shouldApplyRotation = shouldApplyRotation; }
protected:
explicit RealtimeOutgoingVideoSource(Ref<MediaStreamTrackPrivate>&&);
@@ -134,7 +134,6 @@
mutable RecursiveLock m_sinksLock;
HashSet<rtc::VideoSinkInterface<webrtc::VideoFrame>*> m_sinks;
- bool m_areSinksAskingToApplyRotation { false };
bool m_enabled { true };
bool m_muted { false };
Modified: trunk/Source/WebKit/ChangeLog (258423 => 258424)
--- trunk/Source/WebKit/ChangeLog 2020-03-13 20:19:16 UTC (rev 258423)
+++ trunk/Source/WebKit/ChangeLog 2020-03-13 20:22:17 UTC (rev 258424)
@@ -1,3 +1,15 @@
+2020-03-13 Ryan Haddad <ryanhad...@apple.com>
+
+ Unreviewed, reverting r258391.
+
+ Breaks internal builds.
+
+ Reverted changeset:
+
+ "Apply rotation at source level if WebRTC sink ask so"
+ https://bugs.webkit.org/show_bug.cgi?id=205645
+ https://trac.webkit.org/changeset/258391
+
2020-03-13 Kate Cheney <katherine_che...@apple.com>
Report all third party loads on a per-page basis
Modified: trunk/Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp (258423 => 258424)
--- trunk/Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp 2020-03-13 20:19:16 UTC (rev 258423)
+++ trunk/Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp 2020-03-13 20:22:17 UTC (rev 258424)
@@ -35,7 +35,6 @@
#include "WebProcessProxy.h"
#include <WebCore/AudioSession.h>
#include <WebCore/CARingBuffer.h>
-#include <WebCore/ImageRotationSessionVT.h>
#include <WebCore/MediaConstraints.h>
#include <WebCore/RealtimeMediaSourceCenter.h>
#include <WebCore/RemoteVideoSample.h>
@@ -97,8 +96,6 @@
m_source->requestToEnd(*this);
}
- void setShouldApplyRotation(bool shouldApplyRotation) { m_shouldApplyRotation = true; }
-
private:
void sourceStopped() final {
if (m_source->captureDidFail()) {
@@ -138,12 +135,7 @@
void videoSampleAvailable(MediaSample& sample) final
{
#if HAVE(IOSURFACE)
- std::unique_ptr<RemoteVideoSample> remoteSample;
- if (m_shouldApplyRotation && sample.videoRotation() != MediaSample::VideoRotation::None) {
- auto pixelBuffer = rotatePixelBuffer(sample);
- remoteSample = RemoteVideoSample::create(pixelBuffer.get(), sample.presentationTime());
- } else
- remoteSample = RemoteVideoSample::create(sample);
+ auto remoteSample = RemoteVideoSample::create(sample);
if (remoteSample)
m_connection->send(Messages::UserMediaCaptureManager::RemoteVideoSampleAvailable(m_id, WTFMove(*remoteSample)), 0);
#else
@@ -151,30 +143,6 @@
#endif
}
- RetainPtr<CVPixelBufferRef> rotatePixelBuffer(MediaSample& sample)
- {
- if (!m_rotationSession)
- m_rotationSession = makeUnique<ImageRotationSessionVT>();
-
- ImageRotationSessionVT::RotationProperties rotation;
- switch (sample.videoRotation()) {
- case MediaSample::VideoRotation::None:
- ASSERT_NOT_REACHED();
- rotation.angle = 0;
- break;
- case MediaSample::VideoRotation::UpsideDown:
- rotation.angle = 180;
- break;
- case MediaSample::VideoRotation::Right:
- rotation.angle = 90;
- break;
- case MediaSample::VideoRotation::Left:
- rotation.angle = 270;
- break;
- }
- return m_rotationSession->rotate(sample, rotation, ImageRotationSessionVT::IsCGImageCompatible::No);
- }
-
void storageChanged(SharedMemory* storage) final {
SharedMemory::Handle handle;
if (storage)
@@ -196,8 +164,6 @@
CAAudioStreamDescription m_description { };
int64_t m_numberOfFrames { 0 };
bool m_isEnded { false };
- std::unique_ptr<ImageRotationSessionVT> m_rotationSession;
- bool m_shouldApplyRotation { false };
};
UserMediaCaptureManagerProxy::UserMediaCaptureManagerProxy(UniqueRef<ConnectionProxy>&& connectionProxy)
@@ -312,12 +278,6 @@
proxy->requestToEnd();
}
-void UserMediaCaptureManagerProxy::setShouldApplyRotation(RealtimeMediaSourceIdentifier sourceID, bool shouldApplyRotation)
-{
- if (auto* proxy = m_proxies.get(sourceID))
- proxy->setShouldApplyRotation(shouldApplyRotation);
-}
-
void UserMediaCaptureManagerProxy::clear()
{
m_proxies.clear();
Modified: trunk/Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.h (258423 => 258424)
--- trunk/Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.h 2020-03-13 20:19:16 UTC (rev 258423)
+++ trunk/Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.h 2020-03-13 20:22:17 UTC (rev 258424)
@@ -79,7 +79,6 @@
void applyConstraints(WebCore::RealtimeMediaSourceIdentifier, const WebCore::MediaConstraints&);
void clone(WebCore::RealtimeMediaSourceIdentifier clonedID, WebCore::RealtimeMediaSourceIdentifier cloneID);
void requestToEnd(WebCore::RealtimeMediaSourceIdentifier);
- void setShouldApplyRotation(WebCore::RealtimeMediaSourceIdentifier, bool shouldApplyRotation);
class SourceProxy;
friend class SourceProxy;
Modified: trunk/Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in (258423 => 258424)
--- trunk/Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in 2020-03-13 20:19:16 UTC (rev 258423)
+++ trunk/Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in 2020-03-13 20:22:17 UTC (rev 258424)
@@ -32,7 +32,6 @@
ApplyConstraints(WebCore::RealtimeMediaSourceIdentifier id, struct WebCore::MediaConstraints constraints)
Clone(WebCore::RealtimeMediaSourceIdentifier clonedID, WebCore::RealtimeMediaSourceIdentifier cloneID)
RequestToEnd(WebCore::RealtimeMediaSourceIdentifier sourceID)
- SetShouldApplyRotation(WebCore::RealtimeMediaSourceIdentifier sourceID, bool shouldApplyRotation)
}
#endif
Modified: trunk/Source/WebKit/WebProcess/cocoa/UserMediaCaptureManager.cpp (258423 => 258424)
--- trunk/Source/WebKit/WebProcess/cocoa/UserMediaCaptureManager.cpp 2020-03-13 20:19:16 UTC (rev 258423)
+++ trunk/Source/WebKit/WebProcess/cocoa/UserMediaCaptureManager.cpp 2020-03-13 20:22:17 UTC (rev 258424)
@@ -249,9 +249,7 @@
// RealtimeMediaSource
void beginConfiguration() final { }
void commitConfiguration() final { }
- bool setShouldApplyRotation(bool /* shouldApplyRotation */) final;
-
void applyConstraints(const WebCore::MediaConstraints&, ApplyConstraintsHandler&&) final;
void requestToEnd(RealtimeMediaSource::Observer&) { stopBeingObserved(); }
@@ -431,12 +429,6 @@
connection()->send(Messages::UserMediaCaptureManagerProxy::StopProducingData(m_id), 0);
}
-bool UserMediaCaptureManager::Source::setShouldApplyRotation(bool shouldApplyRotation)
-{
- connection()->send(Messages::UserMediaCaptureManagerProxy::SetShouldApplyRotation(m_id, shouldApplyRotation), 0);
- return true;
-}
-
const WebCore::RealtimeMediaSourceCapabilities& UserMediaCaptureManager::Source::capabilities()
{
return m_capabilities;