Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 11a2ba1a7a1c692d30a9ec41eb068c0f5bd76ffa
      
https://github.com/WebKit/WebKit/commit/11a2ba1a7a1c692d30a9ec41eb068c0f5bd76ffa
  Author: Simon Fraser <[email protected]>
  Date:   2023-10-24 (Tue, 24 Oct 2023)

  Changed paths:
    M Source/ThirdParty/libwebrtc/Configurations/libwebrtc.exp
    M Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitUtilities.h
    M Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitUtilities.mm
    M Source/WebCore/platform/graphics/cv/VideoFrameCV.mm
    M Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h
    M 
Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm
    M Source/WebKit/WebProcess/GPU/webrtc/SharedVideoFrame.cpp

  Log Message:
  -----------
  Rename webrtc::pixelBufferFrom* functions to have 'create' in the name and 
fix a CVPixelBufferRef leak
https://bugs.webkit.org/show_bug.cgi?id=263578
rdar://117388614

Reviewed by Youenn Fablet.

Convention is that functions that return retained objects should have 'create' 
or 'copy' in the name.
Rename pixelBufferFromFrame(), pixelBufferFromI420Buffer() and 
pixelBufferFromI420ABuffer() to follow this, to allow for
style checker improvements in future.

This made it clear that there was a leak in 
RealtimeIncomingVideoSourceCocoa::toVideoFrame(), where
the retained result of webrtc::pixelBufferFromFrame() was passed to 
createVideoSampleFromCVPixelBuffer(),
leaking the CVPixelBufferRef.

* Source/ThirdParty/libwebrtc/Configurations/libwebrtc.exp:
* Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitUtilities.h:
* Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitUtilities.mm:
(webrtc::createPixelBufferFromI420Buffer):
(webrtc::createPixelBufferFromI420ABuffer):
(webrtc::copyPixelBufferForFrame):
(webrtc::pixelBufferFromI420Buffer): Deleted.
(webrtc::pixelBufferFromI420ABuffer): Deleted.
(webrtc::pixelBufferFromFrame): Deleted.
* Source/WebCore/platform/graphics/cv/VideoFrameCV.mm:
(WebCore::VideoFrame::createI420):
(WebCore::VideoFrame::createI420A):
* Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h:
* Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::RealtimeIncomingVideoSourceCocoa::createVideoSampleFromCVPixelBuffer):
(WebCore::RealtimeIncomingVideoSourceCocoa::toVideoFrame):
* Source/WebKit/WebProcess/GPU/webrtc/SharedVideoFrame.cpp:
(WebKit::SharedVideoFrameWriter::writeBuffer):

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


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to