Changeset 230540 in webkit


Ignore:
Timestamp:
Apr 11, 2018 11:33:39 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

[GStreamer] Use of playbin3 when USE_PLAYBIN3 environment variable is set
https://bugs.webkit.org/show_bug.cgi?id=184498

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-04-11
Reviewed by Philippe Normand.

.:

This is the same behaviour as with playbin itself.

Make sure to keep using "playbin" for MediaSource.

  • Source/cmake/GStreamerDefinitions.cmake:

Source/WebCore:

[GStreamer] Use of playbin3 when USE_PLAYBIN3 environment variable is set

This is the same behaviour as with playbin itself.

Make sure to keep using "playbin" for MediaSource.

No test added as this is basically a small rework of the way we expose a feature.

  • platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
  • platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
  • platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
  • platform/graphics/gstreamer/GRefPtrGStreamer.h:
  • platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
  • platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:

(WebCore::MediaPlayerPrivateGStreamer::load):
(WebCore::MediaPlayerPrivateGStreamer::enableTrack):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):

  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
  • platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:

(WebCore::TrackPrivateBaseGStreamer::disconnect):
(WebCore::TrackPrivateBaseGStreamer::tagsChanged):

  • platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
  • platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
  • platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
Location:
trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r230429 r230540  
     12018-04-11  Thibault Saunier  <tsaunier@igalia.com>
     2
     3        [GStreamer] Use of playbin3 when USE_PLAYBIN3 environment variable is set
     4        https://bugs.webkit.org/show_bug.cgi?id=184498
     5
     6        Reviewed by Philippe Normand.
     7
     8        This is the same behaviour as with playbin itself.
     9
     10        Make sure to keep using "playbin" for MediaSource.
     11
     12        * Source/cmake/GStreamerDefinitions.cmake:
     13
    1142018-04-09  Michael Catanzaro  <mcatanzaro@igalia.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r230533 r230540  
     12018-04-11  Thibault Saunier  <tsaunier@igalia.com>
     2
     3        [GStreamer] Use of playbin3 when USE_PLAYBIN3 environment variable is set
     4        https://bugs.webkit.org/show_bug.cgi?id=184498
     5
     6        Reviewed by Philippe Normand.
     7
     8        [GStreamer] Use of playbin3 when USE_PLAYBIN3 environment variable is set
     9
     10        This is the same behaviour as with playbin itself.
     11
     12        Make sure to keep using "playbin" for MediaSource.
     13
     14        No test added as this is basically a small rework of the way we expose a feature.
     15
     16        * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
     17        * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
     18        * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
     19        * platform/graphics/gstreamer/GRefPtrGStreamer.h:
     20        * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
     21        * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
     22        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
     23        (WebCore::MediaPlayerPrivateGStreamer::load):
     24        (WebCore::MediaPlayerPrivateGStreamer::enableTrack):
     25        (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
     26        (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
     27        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
     28        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
     29        * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
     30        (WebCore::TrackPrivateBaseGStreamer::disconnect):
     31        (WebCore::TrackPrivateBaseGStreamer::tagsChanged):
     32        * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
     33        * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
     34        * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
     35
    1362018-04-10  Alex Christensen  <achristensen@webkit.org>
    237
  • trunk/Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp

    r228617 r230540  
    4444}
    4545
    46 #if USE(GSTREAMER_PLAYBIN3)
     46#if GST_CHECK_VERSION(1, 10, 0)
    4747AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer(WeakPtr<MediaPlayerPrivateGStreamer> player, gint index, GRefPtr<GstStream> stream)
    4848    : TrackPrivateBaseGStreamer(this, index, stream)
  • trunk/Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h

    r228617 r230540  
    4444    }
    4545
    46 #if USE(GSTREAMER_PLAYBIN3)
     46#if GST_CHECK_VERSION(1, 10, 0)
    4747    static RefPtr<AudioTrackPrivateGStreamer> create(WeakPtr<MediaPlayerPrivateGStreamer> player, gint index, GRefPtr<GstStream> stream)
    4848    {
     
    6565private:
    6666    AudioTrackPrivateGStreamer(WeakPtr<MediaPlayerPrivateGStreamer>, gint index, GRefPtr<GstPad>);
    67 #if USE(GSTREAMER_PLAYBIN3)
     67#if GST_CHECK_VERSION(1, 10, 0)
    6868    AudioTrackPrivateGStreamer(WeakPtr<MediaPlayerPrivateGStreamer>, gint index, GRefPtr<GstStream>);
    6969#endif
  • trunk/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp

    r228617 r230540  
    354354}
    355355
    356 #if USE(GSTREAMER_PLAYBIN3)
     356#if GST_CHECK_VERSION(1, 10, 0)
    357357template <> GRefPtr<GstStream> adoptGRef(GstStream* ptr)
    358358{
  • trunk/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.h

    r228617 r230540  
    2222#if USE(GSTREAMER)
    2323
     24#include <gst/gst.h>
    2425#include <wtf/glib/GRefPtr.h>
    2526
    26 typedef struct _GstElement GstElement;
    27 typedef struct _GstPad GstPad;
    28 typedef struct _GstPadTemplate GstPadTemplate;
    29 typedef struct _GstCaps GstCaps;
    30 typedef struct _GstContext GstContext;
    31 typedef struct _GstTask GstTask;
    32 typedef struct _GstBus GstBus;
    33 typedef struct _GstElementFactory GstElementFactory;
    34 typedef struct _GstBuffer GstBuffer;
    35 typedef struct _GstBufferList GstBufferList;
    36 typedef struct _GstBufferPool GstBufferPool;
    37 typedef struct _GstSample GstSample;
    38 typedef struct _GstTagList GstTagList;
    39 typedef struct _GstEvent GstEvent;
    40 typedef struct _GstToc GstToc;
    41 typedef struct _GstMessage GstMessage;
    42 typedef struct _GstQuery GstQuery;
    4327typedef struct _WebKitVideoSink WebKitVideoSink;
    4428typedef struct _WebKitWebSrc WebKitWebSrc;
    45 
    46 #if USE(GSTREAMER_PLAYBIN3)
    47 typedef struct _GstStream GstStream;
    48 typedef struct _GstStreamCollection GstStreamCollection;
    49 #endif
    5029
    5130#if USE(GSTREAMER_GL)
     
    133112template<> void derefGPtr<WebKitWebSrc>(WebKitWebSrc* ptr);
    134113
    135 #if USE(GSTREAMER_PLAYBIN3)
     114#if GST_CHECK_VERSION(1, 10, 0)
    136115template<> GRefPtr<GstStream> adoptGRef(GstStream*);
    137116template<> GstStream* refGPtr<GstStream>(GstStream*);
  • trunk/Source/WebCore/platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp

    r228617 r230540  
    5959}
    6060
    61 #if USE(GSTREAMER_PLAYBIN3)
     61#if GST_CHECK_VERSION(1, 10, 0)
    6262InbandTextTrackPrivateGStreamer::InbandTextTrackPrivateGStreamer(gint index, GRefPtr<GstStream> stream)
    6363    : InbandTextTrackPrivate(WebVTT)
  • trunk/Source/WebCore/platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h

    r228617 r230540  
    4545    }
    4646
    47 #if USE(GSTREAMER_PLAYBIN3)
     47#if GST_CHECK_VERSION(1, 10, 0)
    4848    static Ref<InbandTextTrackPrivateGStreamer> create(gint index, GRefPtr<GstStream> stream)
    4949    {
     
    6464private:
    6565    InbandTextTrackPrivateGStreamer(gint index, GRefPtr<GstPad>);
    66 #if USE(GSTREAMER_PLAYBIN3)
     66#if GST_CHECK_VERSION(1, 10, 0)
    6767    InbandTextTrackPrivateGStreamer(gint index, GRefPtr<GstStream>);
    6868#endif
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp

    r229127 r230540  
    253253
    254254    if (!m_pipeline)
    255         createGSTPlayBin();
     255        createGSTPlayBin(isMediaSource() ? "playbin" : nullptr);
    256256
    257257    if (m_fillTimer.isActive())
     
    622622}
    623623
    624 #if USE(GSTREAMER_PLAYBIN3)
     624#if GST_CHECK_VERSION(1, 10, 0)
    625625void MediaPlayerPrivateGStreamer::updateTracks()
    626626{
     
    756756        g_object_set(element, propertyName, index, nullptr);
    757757    }
    758 #if USE(GSTREAMER_PLAYBIN3)
     758#if GST_CHECK_VERSION(1, 10, 0)
    759759    else {
    760760        GstStream* stream = gst_stream_collection_get_stream(m_streamCollection.get(), index);
     
    12811281        break;
    12821282    }
    1283 #if USE(GSTREAMER_PLAYBIN3)
     1283#if GST_CHECK_VERSION(1, 10, 0)
    12841284    case GST_MESSAGE_STREAM_COLLECTION: {
    12851285        GRefPtr<GstStreamCollection> collection;
     
    24002400#endif
    24012401
    2402 void MediaPlayerPrivateGStreamer::createGSTPlayBin()
    2403 {
     2402void MediaPlayerPrivateGStreamer::createGSTPlayBin(const gchar* playbinName)
     2403{
     2404    if (m_pipeline) {
     2405        if (!playbinName) {
     2406            GST_INFO_OBJECT(pipeline(), "Keeping same playbin as nothing forced");
     2407            return;
     2408        }
     2409
     2410        if (!g_strcmp0(GST_OBJECT_NAME(gst_element_get_factory(m_pipeline.get())), playbinName)) {
     2411            GST_INFO_OBJECT(pipeline(), "Already using %s", playbinName);
     2412            return;
     2413        }
     2414
     2415        GST_INFO_OBJECT(pipeline(), "Tearing down as we need to use %s now.",
     2416            playbinName);
     2417        changePipelineState(GST_STATE_NULL);
     2418        m_pipeline = nullptr;
     2419    }
     2420
    24042421    ASSERT(!m_pipeline);
     2422
     2423#if GST_CHECK_VERSION(1, 10, 0)
     2424    m_isLegacyPlaybin = !g_getenv("USE_PLAYBIN3");
     2425    if (!m_isLegacyPlaybin)
     2426        playbinName = "playbin3";
     2427#endif
     2428
     2429    if (!playbinName)
     2430        playbinName = "playbin";
    24052431
    24062432    // gst_element_factory_make() returns a floating reference so
    24072433    // we should not adopt.
    2408 #if USE(GSTREAMER_PLAYBIN3)
    2409     m_isLegacyPlaybin = false;
    2410     setPipeline(gst_element_factory_make("playbin3", "play"));
    2411 #else
    2412     m_isLegacyPlaybin = true;
    2413     setPipeline(gst_element_factory_make("playbin", "play"));
    2414 #endif
     2434    setPipeline(gst_element_factory_make(playbinName, "play"));
    24152435    setStreamVolumeElement(GST_STREAM_VOLUME(m_pipeline.get()));
    24162436
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h

    r228639 r230540  
    147147    virtual void asyncStateChangeDone();
    148148
    149     void createGSTPlayBin();
     149    void createGSTPlayBin(const gchar* playbinName);
    150150
    151151    bool loadNextLocation();
     
    179179    void setPlaybinURL(const URL& urlString);
    180180
    181 #if USE(GSTREAMER_PLAYBIN3)
     181#if GST_CHECK_VERSION(1, 10, 0)
    182182    void updateTracks();
    183183#endif
     
    258258    bool m_preservesPitch;
    259259    bool m_isLegacyPlaybin;
    260 #if USE(GSTREAMER_PLAYBIN3)
     260#if GST_CHECK_VERSION(1, 10, 0)
    261261    GRefPtr<GstStreamCollection> m_streamCollection;
    262262#endif
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h

    r230147 r230540  
    212212#endif
    213213        SizeChanged = 1 << 6,
    214 #if USE(GSTREAMER_PLAYBIN3)
     214#if GST_CHECK_VERSION(1, 10, 0)
    215215        StreamCollectionChanged = 1 << 7
    216216#endif
  • trunk/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp

    r228870 r230540  
    5959}
    6060
    61 #if USE(GSTREAMER_PLAYBIN3)
     61#if GST_CHECK_VERSION(1, 10, 0)
    6262TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer(TrackPrivateBase* owner, gint index, GRefPtr<GstStream> stream)
    6363    : m_notifier(MainThreadNotifier<MainThreadNotification>::create())
     
    8383    m_tags.clear();
    8484
    85 #if USE(GSTREAMER_PLAYBIN3)
     85#if GST_CHECK_VERSION(1, 10, 0)
    8686    if (m_stream)
    8787        m_stream.clear();
     
    116116            tags = adoptGRef(gst_tag_list_new_empty());
    117117    }
    118 #if USE(GSTREAMER_PLAYBIN3)
     118#if GST_CHECK_VERSION(1, 10, 0)
    119119    else if (m_stream)
    120120        tags = adoptGRef(gst_stream_get_tags(m_stream.get()));
  • trunk/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h

    r228617 r230540  
    5959protected:
    6060    TrackPrivateBaseGStreamer(TrackPrivateBase* owner, gint index, GRefPtr<GstPad>);
    61 #if USE(GSTREAMER_PLAYBIN3)
     61#if GST_CHECK_VERSION(1, 10, 0)
    6262    TrackPrivateBaseGStreamer(TrackPrivateBase* owner, gint index, GRefPtr<GstStream>);
    6363#endif
     
    7777    AtomicString m_language;
    7878    GRefPtr<GstPad> m_pad;
    79 #if USE(GSTREAMER_PLAYBIN3)
     79#if GST_CHECK_VERSION(1, 10, 0)
    8080    GRefPtr<GstStream> m_stream;
    8181#endif
  • trunk/Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp

    r228617 r230540  
    4444}
    4545
    46 #if USE(GSTREAMER_PLAYBIN3)
     46#if GST_CHECK_VERSION(1, 10, 0)
    4747VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer(WeakPtr<MediaPlayerPrivateGStreamer> player, gint index, GRefPtr<GstStream> stream)
    4848    : TrackPrivateBaseGStreamer(this, index, stream)
  • trunk/Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h

    r228617 r230540  
    4444        return adoptRef(*new VideoTrackPrivateGStreamer(player, index, pad));
    4545    }
    46 #if USE(GSTREAMER_PLAYBIN3)
     46#if GST_CHECK_VERSION(1, 10, 0)
    4747    static Ref<VideoTrackPrivateGStreamer> create(WeakPtr<MediaPlayerPrivateGStreamer> player, gint index, GRefPtr<GstStream> stream)
    4848    {
     
    6565private:
    6666    VideoTrackPrivateGStreamer(WeakPtr<MediaPlayerPrivateGStreamer>, gint index, GRefPtr<GstPad>);
    67 #if USE(GSTREAMER_PLAYBIN3)
     67#if GST_CHECK_VERSION(1, 10, 0)
    6868    VideoTrackPrivateGStreamer(WeakPtr<MediaPlayerPrivateGStreamer>, gint index, GRefPtr<GstStream>);
    6969#endif
  • trunk/Source/cmake/GStreamerDefinitions.cmake

    r228617 r230540  
    66WEBKIT_OPTION_DEFINE(USE_GSTREAMER_GL "Whether to enable support for GStreamer GL" PRIVATE ON)
    77WEBKIT_OPTION_DEFINE(USE_GSTREAMER_MPEGTS "Whether to enable support for MPEG-TS" PRIVATE OFF)
    8 WEBKIT_OPTION_DEFINE(USE_GSTREAMER_PLAYBIN3 "Whether to enable support for GStreamer's playbin3 element" PRIVATE OFF)
Note: See TracChangeset for help on using the changeset viewer.