Skip to content

Commit

Permalink
Cherry-pick 261626@main (e2ccf6b). https://bugs.webkit.org/show_bug.c…
Browse files Browse the repository at this point in the history
…gi?id=253833

    [GStreamer][WebRTC] Ensure end-point pipeline is stopped when destroying
    https://bugs.webkit.org/show_bug.cgi?id=253833

    Reviewed by Xabier Rodriguez-Calvar.

    As subject says, make sure the pipeline is teared down during disposal of the EndPoint.

    * Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp:
    (WebCore::GStreamerMediaEndpoint::~GStreamerMediaEndpoint):
    (WebCore::GStreamerMediaEndpoint::teardownPipeline):
    * Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.h:

    Canonical link: https://commits.webkit.org/261626@main
  • Loading branch information
philn authored and aperezdc committed Apr 12, 2023
1 parent 6cd3e03 commit bb3a2cb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Expand Up @@ -80,6 +80,13 @@ GStreamerMediaEndpoint::GStreamerMediaEndpoint(GStreamerPeerConnectionBackend& p
});
}

GStreamerMediaEndpoint::~GStreamerMediaEndpoint()
{
if (!m_pipeline)
return;
teardownPipeline();
}

bool GStreamerMediaEndpoint::initializePipeline()
{
static uint32_t nPipeline = 0;
Expand Down Expand Up @@ -176,6 +183,7 @@ bool GStreamerMediaEndpoint::initializePipeline()
void GStreamerMediaEndpoint::teardownPipeline()
{
ASSERT(m_pipeline);
GST_DEBUG_OBJECT(m_pipeline.get(), "Tearing down.");
#if !RELEASE_LOG_DISABLED
stopLoggingStats();
#endif
Expand Down
Expand Up @@ -52,7 +52,7 @@ class GStreamerMediaEndpoint : public ThreadSafeRefCounted<GStreamerMediaEndpoin
{
public:
static Ref<GStreamerMediaEndpoint> create(GStreamerPeerConnectionBackend& peerConnection) { return adoptRef(*new GStreamerMediaEndpoint(peerConnection)); }
~GStreamerMediaEndpoint() = default;
~GStreamerMediaEndpoint();

bool setConfiguration(MediaEndpointConfiguration&);
void restartIce();
Expand Down

0 comments on commit bb3a2cb

Please sign in to comment.