Title: [275033] trunk/Source/WebCore
Revision
275033
Author
[email protected]
Date
2021-03-25 08:28:10 -0700 (Thu, 25 Mar 2021)

Log Message

Improve RealtimeIncomingVideoSourceCocoa::OnFrame logging to include rotation and size information
https://bugs.webkit.org/show_bug.cgi?id=223741

Reviewed by Eric Carlson.

No change of behavior.

* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (275032 => 275033)


--- trunk/Source/WebCore/ChangeLog	2021-03-25 15:03:41 UTC (rev 275032)
+++ trunk/Source/WebCore/ChangeLog	2021-03-25 15:28:10 UTC (rev 275033)
@@ -1,3 +1,15 @@
+2021-03-25  Youenn Fablet  <[email protected]>
+
+        Improve RealtimeIncomingVideoSourceCocoa::OnFrame logging to include rotation and size information
+        https://bugs.webkit.org/show_bug.cgi?id=223741
+
+        Reviewed by Eric Carlson.
+
+        No change of behavior.
+
+        * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
+        (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
+
 2021-03-25  Commit Queue  <[email protected]>
 
         Unreviewed, reverting r274826 and r274968.

Modified: trunk/Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm (275032 => 275033)


--- trunk/Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm	2021-03-25 15:03:41 UTC (rev 275032)
+++ trunk/Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm	2021-03-25 15:28:10 UTC (rev 275033)
@@ -141,8 +141,29 @@
     if (!isProducingData())
         return;
 
+    unsigned width = frame.width();
+    unsigned height = frame.height();
+
+    MediaSample::VideoRotation rotation;
+    switch (frame.rotation()) {
+    case webrtc::kVideoRotation_0:
+        rotation = MediaSample::VideoRotation::None;
+        break;
+    case webrtc::kVideoRotation_180:
+        rotation = MediaSample::VideoRotation::UpsideDown;
+        break;
+    case webrtc::kVideoRotation_90:
+        rotation = MediaSample::VideoRotation::Right;
+        std::swap(width, height);
+        break;
+    case webrtc::kVideoRotation_270:
+        rotation = MediaSample::VideoRotation::Left;
+        std::swap(width, height);
+        break;
+    }
+
 #if !RELEASE_LOG_DISABLED
-    ALWAYS_LOG_IF(loggerPtr() && !(++m_numberOfFrames % 60), LOGIDENTIFIER, "frame ", m_numberOfFrames);
+    ALWAYS_LOG_IF(loggerPtr() && !(++m_numberOfFrames % 60), LOGIDENTIFIER, "frame ", m_numberOfFrames, ", rotation ", frame.rotation(), " size ", width, "x", height);
 #endif
 
     auto pixelBuffer = pixelBufferFromVideoFrame(frame);
@@ -173,27 +194,6 @@
 
     auto sample = adoptCF(sampleBuffer);
 
-    unsigned width = frame.width();
-    unsigned height = frame.height();
-
-    MediaSample::VideoRotation rotation;
-    switch (frame.rotation()) {
-    case webrtc::kVideoRotation_0:
-        rotation = MediaSample::VideoRotation::None;
-        break;
-    case webrtc::kVideoRotation_180:
-        rotation = MediaSample::VideoRotation::UpsideDown;
-        break;
-    case webrtc::kVideoRotation_90:
-        rotation = MediaSample::VideoRotation::Right;
-        std::swap(width, height);
-        break;
-    case webrtc::kVideoRotation_270:
-        rotation = MediaSample::VideoRotation::Left;
-        std::swap(width, height);
-        break;
-    }
-
     setIntrinsicSize(IntSize(width, height));
     videoSampleAvailable(MediaSampleAVFObjC::create(sample.get(), rotation));
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to