[webkit-changes] [WebKit/WebKit] dfa421: [GStreamer][WebCodecs] Circular references in vide...
Philippe Normand
noreply at github.com
Tue Aug 22 07:55:02 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: dfa421425d517ac2b7822c9b758cacb9d52743b2
https://github.com/WebKit/WebKit/commit/dfa421425d517ac2b7822c9b758cacb9d52743b2
Author: Philippe Normand <philn at igalia.com>
Date: 2023-08-22 (Tue, 22 Aug 2023)
Changed paths:
M Source/WebCore/platform/graphics/gstreamer/ImageGStreamer.h
M Source/WebCore/platform/graphics/gstreamer/ImageGStreamerCairo.cpp
M Source/WebCore/platform/graphics/gstreamer/VideoDecoderGStreamer.cpp
Log Message:
-----------
[GStreamer][WebCodecs] Circular references in video decoder leading to memory leaks
https://bugs.webkit.org/show_bug.cgi?id=260423
Reviewed by Xabier Rodriguez-Calvar.
Circular references between the GStreamerInternalVideoDecoder and its harness through captured
references in lambdas was preventing proper cleanup of the harness when closing the decoder. Using
WeakPtrs instead of strong Refs in captured variables fixes the issue.
Also, driving-by, fixing the ImageGStreamer API to fit with our style guidelines and making sure the
sample is cleared *after* the associated video frame is un-mapped.
* Source/WebCore/platform/graphics/gstreamer/ImageGStreamer.h:
(WebCore::ImageGStreamer::createImage):
* Source/WebCore/platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
(WebCore::ImageGStreamer::~ImageGStreamer):
* Source/WebCore/platform/graphics/gstreamer/VideoDecoderGStreamer.cpp:
(WebCore::GStreamerInternalVideoDecoder::harnessedElement const):
(WebCore::GStreamerVideoDecoder::create):
(WebCore::GStreamerVideoDecoder::~GStreamerVideoDecoder):
(WebCore::GStreamerInternalVideoDecoder::GStreamerInternalVideoDecoder):
(WebCore::GStreamerInternalVideoDecoder::decode):
Canonical link: https://commits.webkit.org/267132@main
More information about the webkit-changes
mailing list