Title: [295044] trunk/Source
Revision
295044
Author
[email protected]
Date
2022-05-30 23:43:01 -0700 (Mon, 30 May 2022)

Log Message

RemoteVideoFrameProxy::pixelBuffer should properly compute canUseIOSurface
https://bugs.webkit.org/show_bug.cgi?id=241100

Patch by Youenn Fablet <[email protected]> on 2022-05-30
Reviewed by Eric Carlson.

We can use IOSurface when doing WebGL in WebProcess, instead of when doing WebGL in GPUProcess.
Update canUseIOSurface accordingly.
Add error logging when creating a CVPixelBufferRef.

* Source/WebCore/platform/graphics/cv/CVUtilities.mm:
(WebCore::createCVPixelBuffer):
* Source/WebKit/WebProcess/GPU/media/RemoteVideoFrameProxy.cpp:
(WebKit::RemoteVideoFrameProxy::pixelBuffer const):

Canonical link: https://commits.webkit.org/251139@main

Modified Paths

Diff

Modified: trunk/Source/WebCore/platform/graphics/cv/CVUtilities.mm (295043 => 295044)


--- trunk/Source/WebCore/platform/graphics/cv/CVUtilities.mm	2022-05-31 05:49:51 UTC (rev 295043)
+++ trunk/Source/WebCore/platform/graphics/cv/CVUtilities.mm	2022-05-31 06:43:01 UTC (rev 295044)
@@ -28,6 +28,7 @@
 
 #import "ColorSpaceCG.h"
 #import "IOSurface.h"
+#import "Logging.h"
 #import "RealtimeVideoUtilities.h"
 #import <wtf/StdLibExtras.h>
 #import <wtf/cf/TypeCastsCF.h>
@@ -128,8 +129,10 @@
 {
     CVPixelBufferRef pixelBuffer = nullptr;
     auto status = CVPixelBufferCreateWithIOSurface(kCFAllocatorDefault, surface, pixelBufferCreationOptions(surface), &pixelBuffer);
-    if (status != kCVReturnSuccess || !pixelBuffer)
+    if (status != kCVReturnSuccess || !pixelBuffer) {
+        RELEASE_LOG_ERROR(WebRTC, "createCVPixelBuffer failed with IOSurface status=%d, pixelBuffer=%p", (int)status, pixelBuffer);
         return makeUnexpected(status);
+    }
     return adoptCF(pixelBuffer);
 }
 

Modified: trunk/Source/WebKit/WebProcess/GPU/media/RemoteVideoFrameProxy.cpp (295043 => 295044)


--- trunk/Source/WebKit/WebProcess/GPU/media/RemoteVideoFrameProxy.cpp	2022-05-31 05:49:51 UTC (rev 295043)
+++ trunk/Source/WebKit/WebProcess/GPU/media/RemoteVideoFrameProxy.cpp	2022-05-31 06:43:01 UTC (rev 295044)
@@ -107,7 +107,7 @@
         auto videoFrameObjectHeapProxy = std::exchange(m_videoFrameObjectHeapProxy, nullptr);
 
         bool canSendSync = isMainRunLoop(); // FIXME: we should be able to sendSync from other threads too.
-        bool canUseIOSurface = WebProcess::singleton().shouldUseRemoteRenderingForWebGL();
+        bool canUseIOSurface = !WebProcess::singleton().shouldUseRemoteRenderingForWebGL();
         if (!canUseIOSurface || !canSendSync) {
             BinarySemaphore semaphore;
             videoFrameObjectHeapProxy->getVideoFrameBuffer(*this, canUseIOSurface, [this, &semaphore](auto pixelBuffer) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to