Changeset 231351 in webkit


Ignore:
Timestamp:
May 4, 2018 6:26:13 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

[MSE][GStreamer] Delete properly the stream from the WebKitMediaSource
https://bugs.webkit.org/show_bug.cgi?id=185242

Patch by Yacine Bandou <yacine.bandou_ext@softathome.com> on 2018-05-04
Reviewed by Xabier Rodriguez-Calvar.

When the sourceBuffer is removed from mediasource, the appropriate stream is not
properly deleted from WebKitMediaSource, because the appsrc and parser elements
of the stream are not removed from the WebKitMediaSource bin.

This patch avoids the regression of r231089, see https://bugs.webkit.org/show_bug.cgi?id=185071

  • platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:

(webKitMediaSrcFreeStream):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r231350 r231351  
     12018-05-04  Yacine Bandou  <yacine.bandou_ext@softathome.com>
     2
     3        [MSE][GStreamer] Delete properly the stream from the WebKitMediaSource
     4        https://bugs.webkit.org/show_bug.cgi?id=185242
     5
     6        Reviewed by Xabier Rodriguez-Calvar.
     7
     8        When the sourceBuffer is removed from mediasource, the appropriate stream is not
     9        properly deleted from WebKitMediaSource, because the appsrc and parser elements
     10        of the stream are not removed from the WebKitMediaSource bin.
     11
     12        This patch avoids the regression of r231089, see https://bugs.webkit.org/show_bug.cgi?id=185071
     13
     14        * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
     15        (webKitMediaSrcFreeStream):
     16
    1172018-05-04  Carlos Garcia Campos  <cgarcia@igalia.com>
    218
  • trunk/Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp

    r230625 r231351  
    514514        gst_app_src_set_callbacks(GST_APP_SRC(stream->appsrc), &disabledAppsrcCallbacks, nullptr, nullptr);
    515515        gst_app_src_end_of_stream(GST_APP_SRC(stream->appsrc));
    516     }
     516        gst_element_set_state(stream->appsrc, GST_STATE_NULL);
     517        gst_bin_remove(GST_BIN(source), stream->appsrc);
     518        stream->appsrc = nullptr;
     519    }
     520
     521    if (stream->parser) {
     522        gst_element_set_state(stream->parser, GST_STATE_NULL);
     523        gst_bin_remove(GST_BIN(source), stream->parser);
     524        stream->parser = nullptr;
     525    }
     526
     527    GST_OBJECT_LOCK(source);
     528    switch (stream->type) {
     529    case WebCore::Audio:
     530        source->priv->numberOfAudioStreams--;
     531        break;
     532    case WebCore::Video:
     533        source->priv->numberOfVideoStreams--;
     534        break;
     535    case WebCore::Text:
     536        source->priv->numberOfTextStreams--;
     537        break;
     538    default:
     539        break;
     540    }
     541    GST_OBJECT_UNLOCK(source);
    517542
    518543    if (stream->type != WebCore::Invalid) {
Note: See TracChangeset for help on using the changeset viewer.