Title: [284831] branches/safari-612-branch/Source/WebKit
Revision
284831
Author
[email protected]
Date
2021-10-25 14:51:00 -0700 (Mon, 25 Oct 2021)

Log Message

Cherry-pick r283975. rdar://problem/84630618

    Error the encoder in case we cannot create a RemoteVideoSample
    https://bugs.webkit.org/show_bug.cgi?id=231505
    <rdar://83975229>

    Reviewed by Eric Carlson.

    * WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp:
    (WebKit::LibWebRTCCodecs::encodeFrame):
    RemoteVideoSample::create can return nullptr if we cannot get an IOSurface from the pixel buffer or if pixel buffer is null
    due to VTPixelBufferConformerCopyConformedPixelBuffer failing.
    In that case, we error the encoder instead of trying to encode the frame.

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

Modified Paths

Diff

Modified: branches/safari-612-branch/Source/WebKit/ChangeLog (284830 => 284831)


--- branches/safari-612-branch/Source/WebKit/ChangeLog	2021-10-25 21:50:57 UTC (rev 284830)
+++ branches/safari-612-branch/Source/WebKit/ChangeLog	2021-10-25 21:51:00 UTC (rev 284831)
@@ -1,5 +1,38 @@
 2021-10-25  Null  <[email protected]>
 
+        Cherry-pick r283975. rdar://problem/84630618
+
+    Error the encoder in case we cannot create a RemoteVideoSample
+    https://bugs.webkit.org/show_bug.cgi?id=231505
+    <rdar://83975229>
+    
+    Reviewed by Eric Carlson.
+    
+    * WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp:
+    (WebKit::LibWebRTCCodecs::encodeFrame):
+    RemoteVideoSample::create can return nullptr if we cannot get an IOSurface from the pixel buffer or if pixel buffer is null
+    due to VTPixelBufferConformerCopyConformedPixelBuffer failing.
+    In that case, we error the encoder instead of trying to encode the frame.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-10-12  Youenn Fablet  <[email protected]>
+
+            Error the encoder in case we cannot create a RemoteVideoSample
+            https://bugs.webkit.org/show_bug.cgi?id=231505
+            <rdar://83975229>
+
+            Reviewed by Eric Carlson.
+
+            * WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp:
+            (WebKit::LibWebRTCCodecs::encodeFrame):
+            RemoteVideoSample::create can return nullptr if we cannot get an IOSurface from the pixel buffer or if pixel buffer is null
+            due to VTPixelBufferConformerCopyConformedPixelBuffer failing.
+            In that case, we error the encoder instead of trying to encode the frame.
+
+2021-10-25  Null  <[email protected]>
+
         Cherry-pick r283592. rdar://problem/84625519
 
     [iOS] Transcode videos selected from UIImagePickerController

Modified: branches/safari-612-branch/Source/WebKit/WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp (284830 => 284831)


--- branches/safari-612-branch/Source/WebKit/WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp	2021-10-25 21:50:57 UTC (rev 284830)
+++ branches/safari-612-branch/Source/WebKit/WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp	2021-10-25 21:51:00 UTC (rev 284831)
@@ -31,6 +31,7 @@
 #include "GPUProcessConnection.h"
 #include "LibWebRTCCodecsMessages.h"
 #include "LibWebRTCCodecsProxyMessages.h"
+#include "Logging.h"
 #include "WebCoreArgumentCoders.h"
 #include "WebProcess.h"
 #include <WebCore/CVUtilities.h>
@@ -447,6 +448,10 @@
     if (!sample) {
         // FIXME: Optimize this code path, currently we have non BGRA for muted frames at least.
         sample = RemoteVideoSample::create(convertToBGRA(pixelBuffer.get()), MediaTime(frame.timestamp_us() * 1000, 1000000), toMediaSampleVideoRotation(frame.rotation()));
+        if (!sample) {
+            RELEASE_LOG_ERROR(WebRTC, "Unable to convert remote video sample");
+            return WEBRTC_VIDEO_CODEC_ERROR;
+        }
     }
 
     encoder.connection->send(Messages::LibWebRTCCodecsProxy::EncodeFrame { encoder.identifier, *sample, frame.timestamp(), shouldEncodeAsKeyFrame }, 0);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to