[Webkit-unassigned] [Bug 185592] [MSE][GStreamer] Before deleting the stream from WebKitMediaSource we should unlink its elements and flush the appsrc.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 14 01:15:26 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=185592

--- Comment #2 from Xabier Rodríguez Calvar <calvaris at igalia.com> ---
Comment on attachment 340280
  --> https://bugs.webkit.org/attachment.cgi?id=340280
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=340280&action=review

> Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:535
> +        GRefPtr<GstPad> sinkPad;
> +        GRefPtr<GstPad> sourcePad;
> +        if (stream->parser) {
> +            sourcePad = adoptGRef(gst_element_get_static_pad(stream->appsrc, "src"));
> +            if (gst_pad_is_linked(sourcePad.get())) {
> +                sinkPad = adoptGRef(gst_element_get_static_pad(stream->parser, "sink"));
> +                gst_pad_unlink(sourcePad.get(), sinkPad.get());
> +            }
> +            sourcePad = adoptGRef(gst_element_get_static_pad(stream->parser, "src"));
> +            if (gst_pad_is_linked(sourcePad.get())) {
> +                sinkPad = adoptGRef(gst_pad_get_peer(sourcePad.get()));
> +                gst_pad_unlink(sourcePad.get(), sinkPad.get());
> +            }
> +        } else {
> +            sourcePad = adoptGRef(gst_element_get_static_pad(stream->appsrc, "src"));
> +            if (gst_pad_is_linked(sourcePad.get())) {
> +                sinkPad = adoptGRef(gst_pad_get_peer(sourcePad.get()));
> +                gst_pad_unlink(sourcePad.get(), sinkPad.get());
> +            }
> +        }

About this piece of code, I think you can begin with the src pad of the source, check if it is linked, get the peer pad of the src, which would be the "sink" of the next element, then you can unlink and gst_pad_get_parent_element of the "sink" pad to begin the operation again until there is no "sink" pad, meaning that you reached the appsink.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180514/d2cf5900/attachment.html>


More information about the webkit-unassigned mailing list