Title: [282193] trunk/Source/WebCore
Revision
282193
Author
[email protected]
Date
2021-09-08 23:49:35 -0700 (Wed, 08 Sep 2021)

Log Message

Add video metrics logging to LocalSampleBufferDisplayLayer
https://bugs.webkit.org/show_bug.cgi?id=229930

Reviewed by Eric Carlson.

Source/WebCore:

No change of behavior.

* platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm:
(WebCore::LocalSampleBufferDisplayLayer::enqueueSampleBuffer):
Log every minute AVSBDL metrics, which can help to evaluate video freeze issues.

Source/WebCore/PAL:

* PAL/pal/spi/cocoa/AVFoundationSPI.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (282192 => 282193)


--- trunk/Source/WebCore/ChangeLog	2021-09-09 05:27:51 UTC (rev 282192)
+++ trunk/Source/WebCore/ChangeLog	2021-09-09 06:49:35 UTC (rev 282193)
@@ -1,3 +1,16 @@
+2021-09-08  Youenn Fablet  <[email protected]>
+
+        Add video metrics logging to LocalSampleBufferDisplayLayer
+        https://bugs.webkit.org/show_bug.cgi?id=229930
+
+        Reviewed by Eric Carlson.
+
+        No change of behavior.
+
+        * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm:
+        (WebCore::LocalSampleBufferDisplayLayer::enqueueSampleBuffer):
+        Log every minute AVSBDL metrics, which can help to evaluate video freeze issues.
+
 2021-09-08  Kimmo Kinnunen  <[email protected]>
 
         webgl/2.0.y/conformance2/vertex_arrays/vertex-array-object.html fails

Modified: trunk/Source/WebCore/PAL/ChangeLog (282192 => 282193)


--- trunk/Source/WebCore/PAL/ChangeLog	2021-09-09 05:27:51 UTC (rev 282192)
+++ trunk/Source/WebCore/PAL/ChangeLog	2021-09-09 06:49:35 UTC (rev 282193)
@@ -1,3 +1,12 @@
+2021-09-08  Youenn Fablet  <[email protected]>
+
+        Add video metrics logging to LocalSampleBufferDisplayLayer
+        https://bugs.webkit.org/show_bug.cgi?id=229930
+
+        Reviewed by Eric Carlson.
+
+        * PAL/pal/spi/cocoa/AVFoundationSPI.h:
+
 2021-09-08  Per Arne  <[email protected]>
 
         Remove unneeded call on startup of WebContent process

Modified: trunk/Source/WebCore/PAL/pal/spi/cocoa/AVFoundationSPI.h (282192 => 282193)


--- trunk/Source/WebCore/PAL/pal/spi/cocoa/AVFoundationSPI.h	2021-09-09 05:27:51 UTC (rev 282192)
+++ trunk/Source/WebCore/PAL/pal/spi/cocoa/AVFoundationSPI.h	2021-09-09 06:49:35 UTC (rev 282193)
@@ -371,11 +371,13 @@
 @property (nonatomic, readonly) unsigned long numberOfDroppedVideoFrames;
 @property (nonatomic, readonly) unsigned long numberOfCorruptedVideoFrames;
 @property (nonatomic, readonly) unsigned long numberOfDisplayCompositedVideoFrames;
+@property (nonatomic, readonly) unsigned long numberOfNonDisplayCompositedVideoFrames;
 @property (nonatomic, readonly) double totalFrameDelay;
 @end
 #else
 @interface AVVideoPerformanceMetrics (AVVideoPerformanceMetricsDisplayCompositedVideoFrames)
 @property (nonatomic, readonly) unsigned long numberOfDisplayCompositedVideoFrames;
+@property (nonatomic, readonly) unsigned long numberOfNonDisplayCompositedVideoFrames;
 @end
 #endif
 

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm (282192 => 282193)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm	2021-09-09 05:27:51 UTC (rev 282192)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm	2021-09-09 06:49:35 UTC (rev 282193)
@@ -41,6 +41,8 @@
 #import <wtf/MonotonicTime.h>
 #import <wtf/cf/TypeCastsCF.h>
 
+#import <pal/spi/cocoa/AVFoundationSPI.h>
+
 #import <pal/cocoa/AVFoundationSoftLink.h>
 
 using namespace WebCore;
@@ -339,6 +341,11 @@
     [m_sampleBufferDisplayLayer enqueueSampleBuffer:sampleToEnqueue];
 
 #if !RELEASE_LOG_DISABLED
+    constexpr size_t frameCountPerLog = 1800; // log every minute at 30 fps
+    if (!(m_frameRateMonitor.frameCount() % frameCountPerLog)) {
+        if (auto* metrics = [m_sampleBufferDisplayLayer videoPerformanceMetrics])
+            RELEASE_LOG(WebRTC, "LocalSampleBufferDisplayLayer (%{public}s) metrics, total=%lu, dropped=%lu, corrupted=%lu, display-composited=%lu, non-display-composited=%lu (pending=%lu)", m_logIdentifier.utf8().data(), metrics.totalNumberOfVideoFrames, metrics.numberOfDroppedVideoFrames, metrics.numberOfCorruptedVideoFrames, metrics.numberOfDisplayCompositedVideoFrames, metrics.numberOfNonDisplayCompositedVideoFrames, m_pendingVideoSampleQueue.size());
+    }
     m_frameRateMonitor.update();
 #endif
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to