Changeset 233797 in webkit


Ignore:
Timestamp:
Jul 13, 2018 3:47:10 AM (6 years ago)
Author:
calvaris@igalia.com
Message:

[GStreamer][MSE] Add GstFlowCombiner to handle non-linked inactive branches
https://bugs.webkit.org/show_bug.cgi?id=187636

Reviewed by Carlos Garcia Campos.

When we have more than one source buffer, only one will be
rendered and the inactive branch will report linking errors that
we have to deal with.

  • platform/graphics/gstreamer/GUniquePtrGStreamer.h: Added GstFlowCombiner.
  • platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:

(webkitMediaSrcChain): Combine the flow in the flow combiner.
(webkit_media_src_init): Initialize the flow combiner.
(webKitMediaSrcLinkStreamToSrcPad): Add the proxypad to the
combiner and set the chain function.

  • platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h:

Declare the flow combiner.

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r233796 r233797  
     12018-07-13  Xabier Rodriguez Calvar  <calvaris@igalia.com>
     2
     3        [GStreamer][MSE] Add GstFlowCombiner to handle non-linked inactive branches
     4        https://bugs.webkit.org/show_bug.cgi?id=187636
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        When we have more than one source buffer, only one will be
     9        rendered and the inactive branch will report linking errors that
     10        we have to deal with.
     11
     12        * platform/graphics/gstreamer/GUniquePtrGStreamer.h: Added GstFlowCombiner.
     13        * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
     14        (webkitMediaSrcChain): Combine the flow in the flow combiner.
     15        (webkit_media_src_init): Initialize the flow combiner.
     16        (webKitMediaSrcLinkStreamToSrcPad): Add the proxypad to the
     17        combiner and set the chain function.
     18        * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h:
     19        Declare the flow combiner.
     20
    1212018-07-13  Charlie Turner  <cturner@igalia.com>
    222
  • trunk/Source/WebCore/platform/graphics/gstreamer/GUniquePtrGStreamer.h

    r213572 r233797  
    2222#if USE(GSTREAMER)
    2323
     24#include <gst/base/gstflowcombiner.h>
    2425#include <gst/gstsegment.h>
    2526#include <gst/gststructure.h>
     
    3233WTF_DEFINE_GPTR_DELETER(GstInstallPluginsContext, gst_install_plugins_context_free)
    3334WTF_DEFINE_GPTR_DELETER(GstSegment, gst_segment_free)
     35WTF_DEFINE_GPTR_DELETER(GstFlowCombiner, gst_flow_combiner_free)
    3436
    3537}
  • trunk/Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp

    r232058 r233797  
    4949#include <wtf/Condition.h>
    5050#include <wtf/MainThread.h>
    51 #include <wtf/glib/GUniquePtr.h>
    5251#include <wtf/text/CString.h>
    5352
     
    250249}
    251250
     251static GstFlowReturn webkitMediaSrcChain(GstPad* pad, GstObject* parent, GstBuffer* buffer)
     252{
     253    GRefPtr<WebKitMediaSrc> self = adoptGRef(WEBKIT_MEDIA_SRC(gst_object_get_parent(parent)));
     254
     255    return gst_flow_combiner_update_pad_flow(self->priv->flowCombiner.get(), pad, gst_proxy_pad_chain_default(pad, GST_OBJECT(self.get()), buffer));
     256}
     257
    252258static void webkit_media_src_init(WebKitMediaSrc* source)
    253259{
     
    258264    source->priv->appsrcNeedDataCount = 0;
    259265    source->priv->appsrcSeekDataNextAction = Nothing;
     266    source->priv->flowCombiner = GUniquePtr<GstFlowCombiner>(gst_flow_combiner_new());
    260267
    261268    // No need to reset Stream.appsrcNeedDataFlag because there are no Streams at this point yet.
     
    475482    GstPad* ghostpad = WebCore::webkitGstGhostPadFromStaticTemplate(&srcTemplate, padName.get(), sourcePad);
    476483
     484    auto proxypad = adoptGRef(GST_PAD(gst_proxy_pad_get_internal(GST_PROXY_PAD(ghostpad))));
     485    gst_flow_combiner_add_pad(stream->parent->priv->flowCombiner.get(), proxypad.get());
     486    gst_pad_set_chain_function(proxypad.get(), static_cast<GstPadChainFunction>(webkitMediaSrcChain));
    477487    gst_pad_set_query_function(ghostpad, webKitMediaSrcQueryWithParent);
    478488
  • trunk/Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h

    r232015 r233797  
    2424
    2525#include "AudioTrackPrivateGStreamer.h"
     26#include "GUniquePtrGStreamer.h"
    2627#include "SourceBufferPrivateGStreamer.h"
    2728#include "VideoTrackPrivateGStreamer.h"
     
    122123    GRefPtr<GstBus> bus;
    123124    WebCore::MediaPlayerPrivateGStreamerMSE* mediaPlayerPrivate;
     125
     126    GUniquePtr<GstFlowCombiner> flowCombiner;
    124127};
    125128
Note: See TracChangeset for help on using the changeset viewer.