<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[215099] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/215099">215099</a></dd>
<dt>Author</dt> <dd>eric.carlson@apple.com</dd>
<dt>Date</dt> <dd>2017-04-07 10:29:40 -0700 (Fri, 07 Apr 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>MediaSample should store video sample rotation instead of orientation
https://bugs.webkit.org/show_bug.cgi?id=170598

Reviewed by Youenn Fablet.

No new tests, no functional change.

* platform/MediaSample.h:
(WebCore::MediaSample::videoRotation):
(WebCore::MediaSample::videoOrientation): Deleted.
* platform/graphics/avfoundation/MediaSampleAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoTransformationMatrix):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayLayer):

* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::processNewFrame):

* platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::OnFrame):
(WebCore::RealtimeIncomingVideoSource::processNewSample):
* platform/mediastream/mac/RealtimeIncomingVideoSource.h:

* platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformMediaSampleh">trunk/Source/WebCore/platform/MediaSample.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationMediaSampleAVFObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/MediaSampleAVFObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaStreamAVFObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaStreamAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreammacAVVideoCaptureSourcemm">trunk/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreammacRealtimeIncomingVideoSourcecpp">trunk/Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSource.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreammacRealtimeIncomingVideoSourceh">trunk/Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSource.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreammacRealtimeOutgoingVideoSourcecpp">trunk/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (215098 => 215099)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-04-07 16:57:35 UTC (rev 215098)
+++ trunk/Source/WebCore/ChangeLog        2017-04-07 17:29:40 UTC (rev 215099)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2017-04-07  Eric Carlson  &lt;eric.carlson@apple.com&gt;
+
+        MediaSample should store video sample rotation instead of orientation
+        https://bugs.webkit.org/show_bug.cgi?id=170598
+
+        Reviewed by Youenn Fablet.
+
+        No new tests, no functional change.
+
+        * platform/MediaSample.h:
+        (WebCore::MediaSample::videoRotation):
+        (WebCore::MediaSample::videoOrientation): Deleted.
+        * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
+        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoTransformationMatrix):
+        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
+        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayLayer):
+
+        * platform/mediastream/mac/AVVideoCaptureSource.mm:
+        (WebCore::AVVideoCaptureSource::processNewFrame):
+
+        * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
+        (WebCore::RealtimeIncomingVideoSource::OnFrame):
+        (WebCore::RealtimeIncomingVideoSource::processNewSample):
+        * platform/mediastream/mac/RealtimeIncomingVideoSource.h:
+
+        * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
+        (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
+
</ins><span class="cx"> 2017-04-07  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WebKit should percent encode single quotes in query strings
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformMediaSampleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/MediaSample.h (215098 => 215099)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/MediaSample.h        2017-04-07 16:57:35 UTC (rev 215098)
+++ trunk/Source/WebCore/platform/MediaSample.h        2017-04-07 17:29:40 UTC (rev 215099)
</span><span class="lines">@@ -80,14 +80,13 @@
</span><span class="cx">     virtual SampleFlags flags() const = 0;
</span><span class="cx">     virtual PlatformSample platformSample() = 0;
</span><span class="cx"> 
</span><del>-    enum class VideoOrientation {
-        Unknown,
-        Portrait,
-        PortraitUpsideDown,
-        LandscapeRight,
-        LandscapeLeft,
</del><ins>+    enum class VideoRotation {
+        None = 0,
+        UpsideDown = 180,
+        Right = 90,
+        Left = 270,
</ins><span class="cx">     };
</span><del>-    virtual VideoOrientation videoOrientation() const { return VideoOrientation::Unknown; }
</del><ins>+    virtual VideoRotation videoRotation() const { return VideoRotation::None; }
</ins><span class="cx">     virtual bool videoMirrored() const { return false; }
</span><span class="cx"> 
</span><span class="cx">     bool isSync() const { return flags() &amp; IsSync; }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationMediaSampleAVFObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaSampleAVFObjC.h (215098 => 215099)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaSampleAVFObjC.h        2017-04-07 16:57:35 UTC (rev 215098)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaSampleAVFObjC.h        2017-04-07 17:29:40 UTC (rev 215099)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> public:
</span><span class="cx">     static Ref&lt;MediaSampleAVFObjC&gt; create(CMSampleBufferRef sample, int trackID) { return adoptRef(*new MediaSampleAVFObjC(sample, trackID)); }
</span><span class="cx">     static Ref&lt;MediaSampleAVFObjC&gt; create(CMSampleBufferRef sample, AtomicString trackID) { return adoptRef(*new MediaSampleAVFObjC(sample, trackID)); }
</span><del>-    static Ref&lt;MediaSampleAVFObjC&gt; create(CMSampleBufferRef sample, VideoOrientation orientation = VideoOrientation::Unknown, bool mirrored = false) { return adoptRef(*new MediaSampleAVFObjC(sample, orientation, mirrored)); }
</del><ins>+    static Ref&lt;MediaSampleAVFObjC&gt; create(CMSampleBufferRef sample, VideoRotation rotation = VideoRotation::None, bool mirrored = false) { return adoptRef(*new MediaSampleAVFObjC(sample, rotation, mirrored)); }
</ins><span class="cx">     static RefPtr&lt;MediaSampleAVFObjC&gt; createImageSample(Ref&lt;JSC::Uint8ClampedArray&gt;&amp;&amp;, unsigned long width, unsigned long height);
</span><span class="cx">     static RefPtr&lt;MediaSampleAVFObjC&gt; createImageSample(Vector&lt;uint8_t&gt;&amp;&amp;, unsigned long width, unsigned long height);
</span><span class="cx"> 
</span><span class="lines">@@ -58,9 +58,9 @@
</span><span class="cx">         , m_id(String::format(&quot;%d&quot;, trackID))
</span><span class="cx">     {
</span><span class="cx">     }
</span><del>-    MediaSampleAVFObjC(CMSampleBufferRef sample, VideoOrientation orientation, bool mirrored)
</del><ins>+    MediaSampleAVFObjC(CMSampleBufferRef sample, VideoRotation rotation, bool mirrored)
</ins><span class="cx">         : m_sample(sample)
</span><del>-        , m_orientation(orientation)
</del><ins>+        , m_rotation(rotation)
</ins><span class="cx">         , m_mirrored(mirrored)
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="lines">@@ -88,12 +88,12 @@
</span><span class="cx">     std::pair&lt;RefPtr&lt;MediaSample&gt;, RefPtr&lt;MediaSample&gt;&gt; divide(const MediaTime&amp; presentationTime) override;
</span><span class="cx">     Ref&lt;MediaSample&gt; createNonDisplayingCopy() const override;
</span><span class="cx"> 
</span><del>-    VideoOrientation videoOrientation() const final { return m_orientation; }
</del><ins>+    VideoRotation videoRotation() const final { return m_rotation; }
</ins><span class="cx">     bool videoMirrored() const final { return m_mirrored; }
</span><span class="cx"> 
</span><span class="cx">     RetainPtr&lt;CMSampleBufferRef&gt; m_sample;
</span><span class="cx">     AtomicString m_id;
</span><del>-    VideoOrientation m_orientation { VideoOrientation::Unknown };
</del><ins>+    VideoRotation m_rotation { VideoRotation::None };
</ins><span class="cx">     bool m_mirrored { false };
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaStreamAVFObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h (215098 => 215099)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h        2017-04-07 16:57:35 UTC (rev 215098)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h        2017-04-07 17:29:40 UTC (rev 215099)
</span><span class="lines">@@ -252,7 +252,7 @@
</span><span class="cx">     float m_volume { 1 };
</span><span class="cx">     DisplayMode m_displayMode { None };
</span><span class="cx">     PlaybackState m_playbackState { PlaybackState::None };
</span><del>-    MediaSample::VideoOrientation m_videoOrientation { MediaSample::VideoOrientation::Unknown };
</del><ins>+    MediaSample::VideoRotation m_videoRotation { MediaSample::VideoRotation::None };
</ins><span class="cx">     CGAffineTransform m_videoTransform;
</span><span class="cx">     bool m_videoMirrored { false };
</span><span class="cx">     bool m_playing { false };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaStreamAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm (215098 => 215099)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm        2017-04-07 16:57:35 UTC (rev 215098)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm        2017-04-07 17:29:40 UTC (rev 215099)
</span><span class="lines">@@ -314,18 +314,10 @@
</span><span class="cx">     if (!width || !height)
</span><span class="cx">         return CGAffineTransformIdentity;
</span><span class="cx"> 
</span><del>-    ASSERT(m_videoOrientation &gt;= MediaSample::VideoOrientation::Unknown);
-    ASSERT(m_videoOrientation &lt;= MediaSample::VideoOrientation::LandscapeLeft);
</del><ins>+    ASSERT(m_videoRotation &gt;= MediaSample::VideoRotation::None);
+    ASSERT(m_videoRotation &lt;= MediaSample::VideoRotation::Left);
</ins><span class="cx"> 
</span><del>-    // Unknown, Portrait, PortraitUpsideDown, LandscapeRight, LandscapeLeft,
-#if PLATFORM(MAC)
-    static float sensorAngle[] = { 0, 0, 180, 90, 270 };
-#else
-    static float sensorAngle[] = { 0, 180, 0, 90, 270 };
-#endif
-    float rotation = sensorAngle[static_cast&lt;int&gt;(m_videoOrientation)];
-    m_videoTransform = CGAffineTransformMakeRotation(rotation * M_PI / 180);
-
</del><ins>+    m_videoTransform = CGAffineTransformMakeRotation(static_cast&lt;int&gt;(m_videoRotation) * M_PI / 180);
</ins><span class="cx">     if (sample.videoMirrored())
</span><span class="cx">         m_videoTransform = CGAffineTransformScale(m_videoTransform, -1, 1);
</span><span class="cx"> 
</span><span class="lines">@@ -370,8 +362,8 @@
</span><span class="cx">     updateSampleTimes(sample, timelineOffset, &quot;MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample&quot;);
</span><span class="cx"> 
</span><span class="cx">     if (m_sampleBufferDisplayLayer) {
</span><del>-        if (sample.videoOrientation() != m_videoOrientation || sample.videoMirrored() != m_videoMirrored) {
-            m_videoOrientation = sample.videoOrientation();
</del><ins>+        if (sample.videoRotation() != m_videoRotation || sample.videoMirrored() != m_videoMirrored) {
+            m_videoRotation = sample.videoRotation();
</ins><span class="cx">             m_videoMirrored = sample.videoMirrored();
</span><span class="cx">             runWithoutAnimations([this, &amp;sample] {
</span><span class="cx">                 m_sampleBufferDisplayLayer.get().affineTransform = videoTransformationMatrix(sample, true);
</span><span class="lines">@@ -1121,7 +1113,7 @@
</span><span class="cx"> 
</span><span class="cx">     auto backgroundBounds = m_backgroundLayer.get().bounds;
</span><span class="cx">     auto videoBounds = backgroundBounds;
</span><del>-    if (m_videoOrientation == MediaSample::VideoOrientation::LandscapeRight || m_videoOrientation == MediaSample::VideoOrientation::LandscapeLeft)
</del><ins>+    if (m_videoRotation == MediaSample::VideoRotation::Right || m_videoRotation == MediaSample::VideoRotation::Left)
</ins><span class="cx">         std::swap(videoBounds.size.width, videoBounds.size.height);
</span><span class="cx"> 
</span><span class="cx">     m_sampleBufferDisplayLayer.get().bounds = videoBounds;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreammacAVVideoCaptureSourcemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm (215098 => 215099)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm        2017-04-07 16:57:35 UTC (rev 215098)
+++ trunk/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm        2017-04-07 17:29:40 UTC (rev 215099)
</span><span class="lines">@@ -428,25 +428,40 @@
</span><span class="cx">     m_buffer = sampleBuffer;
</span><span class="cx">     m_lastImage = nullptr;
</span><span class="cx"> 
</span><del>-    MediaSample::VideoOrientation orientation = MediaSample::VideoOrientation::Unknown;
</del><ins>+    MediaSample::VideoRotation rotation;
+#if PLATFORM(IOS)
</ins><span class="cx">     switch ([connection videoOrientation]) {
</span><span class="cx">     case AVCaptureVideoOrientationPortrait:
</span><del>-        orientation = MediaSample::VideoOrientation::Portrait;
</del><ins>+        rotation = MediaSample::VideoRotation::UpsideDown;
</ins><span class="cx">         break;
</span><span class="cx">     case AVCaptureVideoOrientationPortraitUpsideDown:
</span><del>-        orientation = MediaSample::VideoOrientation::PortraitUpsideDown;
</del><ins>+        rotation = MediaSample::VideoRotation::None;
</ins><span class="cx">         break;
</span><span class="cx">     case AVCaptureVideoOrientationLandscapeRight:
</span><del>-        orientation = MediaSample::VideoOrientation::LandscapeRight;
</del><ins>+    case AVCaptureVideoOrientationLandscapeLeft:
+        rotation = MediaSample::VideoRotation::Right;
</ins><span class="cx">         break;
</span><ins>+    }
+#else
+    switch ([connection videoOrientation]) {
+    case AVCaptureVideoOrientationPortrait:
+        rotation = MediaSample::VideoRotation::None;
+        break;
+    case AVCaptureVideoOrientationPortraitUpsideDown:
+        rotation = MediaSample::VideoRotation::UpsideDown;
+        break;
+    case AVCaptureVideoOrientationLandscapeRight:
+        rotation = MediaSample::VideoRotation::Right;
+        break;
</ins><span class="cx">     case AVCaptureVideoOrientationLandscapeLeft:
</span><del>-        orientation = MediaSample::VideoOrientation::LandscapeLeft;
</del><ins>+        rotation = MediaSample::VideoRotation::Left;
</ins><span class="cx">         break;
</span><span class="cx">     }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     bool settingsChanged = false;
</span><span class="cx">     CMVideoDimensions dimensions = CMVideoFormatDescriptionGetDimensions(formatDescription);
</span><del>-    if (orientation == MediaSample::VideoOrientation::LandscapeRight || orientation == MediaSample::VideoOrientation::LandscapeLeft)
</del><ins>+    if (rotation == MediaSample::VideoRotation::Right || rotation == MediaSample::VideoRotation::Left)
</ins><span class="cx">         std::swap(dimensions.width, dimensions.height);
</span><span class="cx"> 
</span><span class="cx">     if (dimensions.width != m_width || dimensions.height != m_height) {
</span><span class="lines">@@ -458,7 +473,7 @@
</span><span class="cx">     if (settingsChanged)
</span><span class="cx">         settingsDidChange();
</span><span class="cx"> 
</span><del>-    videoSampleAvailable(MediaSampleAVFObjC::create(m_buffer.get(), orientation, [connection isVideoMirrored]));
</del><ins>+    videoSampleAvailable(MediaSampleAVFObjC::create(m_buffer.get(), rotation, [connection isVideoMirrored]));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection(AVCaptureOutputType*, CMSampleBufferRef sampleBuffer, AVCaptureConnectionType* captureConnection)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreammacRealtimeIncomingVideoSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSource.cpp (215098 => 215099)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSource.cpp        2017-04-07 16:57:35 UTC (rev 215098)
+++ trunk/Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSource.cpp        2017-04-07 17:29:40 UTC (rev 215099)
</span><span class="lines">@@ -171,31 +171,31 @@
</span><span class="cx">     unsigned width = frame.width();
</span><span class="cx">     unsigned height = frame.height();
</span><span class="cx"> 
</span><del>-    MediaSample::VideoOrientation orientation;
</del><ins>+    MediaSample::VideoRotation rotation;
</ins><span class="cx">     switch (frame.rotation()) {
</span><span class="cx">     case webrtc::kVideoRotation_0:
</span><del>-        orientation = MediaSample::VideoOrientation::Portrait;
</del><ins>+        rotation = MediaSample::VideoRotation::None;
</ins><span class="cx">         break;
</span><span class="cx">     case webrtc::kVideoRotation_180:
</span><del>-        orientation = MediaSample::VideoOrientation::PortraitUpsideDown;
</del><ins>+        rotation = MediaSample::VideoRotation::UpsideDown;
</ins><span class="cx">         break;
</span><span class="cx">     case webrtc::kVideoRotation_90:
</span><del>-        orientation = MediaSample::VideoOrientation::LandscapeRight;
</del><ins>+        rotation = MediaSample::VideoRotation::Right;
</ins><span class="cx">         std::swap(width, height);
</span><span class="cx">         break;
</span><span class="cx">     case webrtc::kVideoRotation_270:
</span><del>-        orientation = MediaSample::VideoOrientation::LandscapeLeft;
</del><ins>+        rotation = MediaSample::VideoRotation::Left;
</ins><span class="cx">         std::swap(width, height);
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;RealtimeIncomingVideoSource&gt; protectedThis(this);
</span><del>-    callOnMainThread([protectedThis = WTFMove(protectedThis), sample = WTFMove(sample), width, height, orientation] {
-        protectedThis-&gt;processNewSample(sample.get(), width, height, orientation);
</del><ins>+    callOnMainThread([protectedThis = WTFMove(protectedThis), sample = WTFMove(sample), width, height, rotation] {
+        protectedThis-&gt;processNewSample(sample.get(), width, height, rotation);
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RealtimeIncomingVideoSource::processNewSample(CMSampleBufferRef sample, unsigned width, unsigned height, MediaSample::VideoOrientation orientation)
</del><ins>+void RealtimeIncomingVideoSource::processNewSample(CMSampleBufferRef sample, unsigned width, unsigned height, MediaSample::VideoRotation rotation)
</ins><span class="cx"> {
</span><span class="cx">     m_buffer = sample;
</span><span class="cx">     if (width != m_currentSettings.width() || height != m_currentSettings.height()) {
</span><span class="lines">@@ -204,7 +204,7 @@
</span><span class="cx">         settingsDidChange();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    videoSampleAvailable(MediaSampleAVFObjC::create(sample, orientation));
</del><ins>+    videoSampleAvailable(MediaSampleAVFObjC::create(sample, rotation));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;RealtimeMediaSourceCapabilities&gt; RealtimeIncomingVideoSource::capabilities() const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreammacRealtimeIncomingVideoSourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSource.h (215098 => 215099)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSource.h        2017-04-07 16:57:35 UTC (rev 215098)
+++ trunk/Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSource.h        2017-04-07 17:29:40 UTC (rev 215099)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx">     MediaConstraints&amp; constraints() { return *m_constraints.get(); }
</span><span class="cx">     RealtimeMediaSourceSupportedConstraints&amp; supportedConstraints();
</span><span class="cx"> 
</span><del>-    void processNewSample(CMSampleBufferRef, unsigned, unsigned, MediaSample::VideoOrientation);
</del><ins>+    void processNewSample(CMSampleBufferRef, unsigned, unsigned, MediaSample::VideoRotation);
</ins><span class="cx"> 
</span><span class="cx">     bool isProducingData() const final { return m_isProducingData &amp;&amp; m_buffer; }
</span><span class="cx">     bool applySize(const IntSize&amp;) final { return true; }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreammacRealtimeOutgoingVideoSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp (215098 => 215099)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp        2017-04-07 16:57:35 UTC (rev 215098)
+++ trunk/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp        2017-04-07 17:29:40 UTC (rev 215099)
</span><span class="lines">@@ -121,18 +121,17 @@
</span><span class="cx">     auto pixelFormatType = CVPixelBufferGetPixelFormatType(pixelBuffer);
</span><span class="cx"> 
</span><span class="cx">     webrtc::VideoRotation rotation;
</span><del>-    switch (sample.videoOrientation()) {
-    case MediaSample::VideoOrientation::Unknown:
-    case MediaSample::VideoOrientation::Portrait:
</del><ins>+    switch (sample.videoRotation()) {
+    case MediaSample::VideoRotation::None:
</ins><span class="cx">         rotation = webrtc::kVideoRotation_0;
</span><span class="cx">         break;
</span><del>-    case MediaSample::VideoOrientation::PortraitUpsideDown:
</del><ins>+    case MediaSample::VideoRotation::UpsideDown:
</ins><span class="cx">         rotation = webrtc::kVideoRotation_180;
</span><span class="cx">         break;
</span><del>-    case MediaSample::VideoOrientation::LandscapeRight:
</del><ins>+    case MediaSample::VideoRotation::Right:
</ins><span class="cx">         rotation = webrtc::kVideoRotation_90;
</span><span class="cx">         break;
</span><del>-    case MediaSample::VideoOrientation::LandscapeLeft:
</del><ins>+    case MediaSample::VideoRotation::Left:
</ins><span class="cx">         rotation = webrtc::kVideoRotation_270;
</span><span class="cx">         break;
</span><span class="cx">     }
</span></span></pre>
</div>
</div>

</body>
</html>