Camera video samples have a bad orientation if upside down
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 May 2020 14:13:24 +0000 (14:13 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 May 2020 14:13:24 +0000 (14:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=211373

Reviewed by Eric Carlson.

Manually tested on iPad and iPhones.

* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::computeSampleRotation):
-90 should be the same as 270 not -270.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261080 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm

index 907b494..dd0edcb 100644 (file)
@@ -1,3 +1,16 @@
+2020-05-04  Youenn Fablet  <youenn@apple.com>
+
+        Camera video samples have a bad orientation if upside down
+        https://bugs.webkit.org/show_bug.cgi?id=211373
+
+        Reviewed by Eric Carlson.
+
+        Manually tested on iPad and iPhones.
+
+        * platform/mediastream/mac/AVVideoCaptureSource.mm:
+        (WebCore::AVVideoCaptureSource::computeSampleRotation):
+        -90 should be the same as 270 not -270.
+
 2020-05-04  Yusuke Suzuki  <ysuzuki@apple.com>
 
         [gtk] isMainThread() assert when running minibrowser in debug builds.
index 4605469..d59520e 100644 (file)
@@ -525,10 +525,11 @@ void AVVideoCaptureSource::computeSampleRotation()
         sampleRotation = MediaSample::VideoRotation::UpsideDown;
         break;
     case 90:
+    case -270:
         sampleRotation = frontCamera ? MediaSample::VideoRotation::Left : MediaSample::VideoRotation::Right;
         break;
     case -90:
-    case -270:
+    case 270:
         sampleRotation = frontCamera ? MediaSample::VideoRotation::Right : MediaSample::VideoRotation::Left;
         break;
     default: