Diff
Modified: trunk/ChangeLog (230539 => 230540)
--- trunk/ChangeLog 2018-04-11 18:15:06 UTC (rev 230539)
+++ trunk/ChangeLog 2018-04-11 18:33:39 UTC (rev 230540)
@@ -1,3 +1,16 @@
+2018-04-11 Thibault Saunier <tsaun...@igalia.com>
+
+ [GStreamer] Use of playbin3 when USE_PLAYBIN3 environment variable is set
+ https://bugs.webkit.org/show_bug.cgi?id=184498
+
+ 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:
+
2018-04-09 Michael Catanzaro <mcatanz...@igalia.com>
[WPE] Use GNU install directories
Modified: trunk/Source/WebCore/ChangeLog (230539 => 230540)
--- trunk/Source/WebCore/ChangeLog 2018-04-11 18:15:06 UTC (rev 230539)
+++ trunk/Source/WebCore/ChangeLog 2018-04-11 18:33:39 UTC (rev 230540)
@@ -1,3 +1,38 @@
+2018-04-11 Thibault Saunier <tsaun...@igalia.com>
+
+ [GStreamer] Use of playbin3 when USE_PLAYBIN3 environment variable is set
+ https://bugs.webkit.org/show_bug.cgi?id=184498
+
+ Reviewed by Philippe Normand.
+
+ [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:
+
2018-04-10 Alex Christensen <achristen...@webkit.org>
IDN spoofing with Hebrew combining characters
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp (230539 => 230540)
--- trunk/Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp 2018-04-11 18:15:06 UTC (rev 230539)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp 2018-04-11 18:33:39 UTC (rev 230540)
@@ -43,7 +43,7 @@
notifyTrackOfActiveChanged();
}
-#if USE(GSTREAMER_PLAYBIN3)
+#if GST_CHECK_VERSION(1, 10, 0)
AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer(WeakPtr<MediaPlayerPrivateGStreamer> player, gint index, GRefPtr<GstStream> stream)
: TrackPrivateBaseGStreamer(this, index, stream)
, m_player(player)
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h (230539 => 230540)
--- trunk/Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h 2018-04-11 18:15:06 UTC (rev 230539)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h 2018-04-11 18:33:39 UTC (rev 230540)
@@ -43,7 +43,7 @@
return adoptRef(*new AudioTrackPrivateGStreamer(player, index, pad));
}
-#if USE(GSTREAMER_PLAYBIN3)
+#if GST_CHECK_VERSION(1, 10, 0)
static RefPtr<AudioTrackPrivateGStreamer> create(WeakPtr<MediaPlayerPrivateGStreamer> player, gint index, GRefPtr<GstStream> stream)
{
return adoptRef(*new AudioTrackPrivateGStreamer(player, index, stream));
@@ -64,7 +64,7 @@
private:
AudioTrackPrivateGStreamer(WeakPtr<MediaPlayerPrivateGStreamer>, gint index, GRefPtr<GstPad>);
-#if USE(GSTREAMER_PLAYBIN3)
+#if GST_CHECK_VERSION(1, 10, 0)
AudioTrackPrivateGStreamer(WeakPtr<MediaPlayerPrivateGStreamer>, gint index, GRefPtr<GstStream>);
#endif
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp (230539 => 230540)
--- trunk/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp 2018-04-11 18:15:06 UTC (rev 230539)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp 2018-04-11 18:33:39 UTC (rev 230540)
@@ -353,7 +353,7 @@
gst_query_unref(ptr);
}
-#if USE(GSTREAMER_PLAYBIN3)
+#if GST_CHECK_VERSION(1, 10, 0)
template <> GRefPtr<GstStream> adoptGRef(GstStream* ptr)
{
ASSERT(!ptr || !g_object_is_floating(ptr));
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.h (230539 => 230540)
--- trunk/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.h 2018-04-11 18:15:06 UTC (rev 230539)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.h 2018-04-11 18:33:39 UTC (rev 230540)
@@ -21,33 +21,12 @@
#if USE(GSTREAMER)
+#include <gst/gst.h>
#include <wtf/glib/GRefPtr.h>
-typedef struct _GstElement GstElement;
-typedef struct _GstPad GstPad;
-typedef struct _GstPadTemplate GstPadTemplate;
-typedef struct _GstCaps GstCaps;
-typedef struct _GstContext GstContext;
-typedef struct _GstTask GstTask;
-typedef struct _GstBus GstBus;
-typedef struct _GstElementFactory GstElementFactory;
-typedef struct _GstBuffer GstBuffer;
-typedef struct _GstBufferList GstBufferList;
-typedef struct _GstBufferPool GstBufferPool;
-typedef struct _GstSample GstSample;
-typedef struct _GstTagList GstTagList;
-typedef struct _GstEvent GstEvent;
-typedef struct _GstToc GstToc;
-typedef struct _GstMessage GstMessage;
-typedef struct _GstQuery GstQuery;
typedef struct _WebKitVideoSink WebKitVideoSink;
typedef struct _WebKitWebSrc WebKitWebSrc;
-#if USE(GSTREAMER_PLAYBIN3)
-typedef struct _GstStream GstStream;
-typedef struct _GstStreamCollection GstStreamCollection;
-#endif
-
#if USE(GSTREAMER_GL)
typedef struct _GstGLDisplay GstGLDisplay;
typedef struct _GstGLContext GstGLContext;
@@ -132,7 +111,7 @@
template<> WebKitWebSrc* refGPtr<WebKitWebSrc>(WebKitWebSrc* ptr);
template<> void derefGPtr<WebKitWebSrc>(WebKitWebSrc* ptr);
-#if USE(GSTREAMER_PLAYBIN3)
+#if GST_CHECK_VERSION(1, 10, 0)
template<> GRefPtr<GstStream> adoptGRef(GstStream*);
template<> GstStream* refGPtr<GstStream>(GstStream*);
template<> void derefGPtr<GstStream>(GstStream*);
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp (230539 => 230540)
--- trunk/Source/WebCore/platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp 2018-04-11 18:15:06 UTC (rev 230539)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp 2018-04-11 18:33:39 UTC (rev 230540)
@@ -58,7 +58,7 @@
notifyTrackOfStreamChanged();
}
-#if USE(GSTREAMER_PLAYBIN3)
+#if GST_CHECK_VERSION(1, 10, 0)
InbandTextTrackPrivateGStreamer::InbandTextTrackPrivateGStreamer(gint index, GRefPtr<GstStream> stream)
: InbandTextTrackPrivate(WebVTT)
, TrackPrivateBaseGStreamer(this, index, stream)
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h (230539 => 230540)
--- trunk/Source/WebCore/platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h 2018-04-11 18:15:06 UTC (rev 230539)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h 2018-04-11 18:33:39 UTC (rev 230540)
@@ -44,7 +44,7 @@
return adoptRef(*new InbandTextTrackPrivateGStreamer(index, pad));
}
-#if USE(GSTREAMER_PLAYBIN3)
+#if GST_CHECK_VERSION(1, 10, 0)
static Ref<InbandTextTrackPrivateGStreamer> create(gint index, GRefPtr<GstStream> stream)
{
return adoptRef(*new InbandTextTrackPrivateGStreamer(index, stream));
@@ -63,7 +63,7 @@
private:
InbandTextTrackPrivateGStreamer(gint index, GRefPtr<GstPad>);
-#if USE(GSTREAMER_PLAYBIN3)
+#if GST_CHECK_VERSION(1, 10, 0)
InbandTextTrackPrivateGStreamer(gint index, GRefPtr<GstStream>);
#endif
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (230539 => 230540)
--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp 2018-04-11 18:15:06 UTC (rev 230539)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp 2018-04-11 18:33:39 UTC (rev 230540)
@@ -252,7 +252,7 @@
return;
if (!m_pipeline)
- createGSTPlayBin();
+ createGSTPlayBin(isMediaSource() ? "playbin" : nullptr);
if (m_fillTimer.isActive())
m_fillTimer.stop();
@@ -621,7 +621,7 @@
return m_seeking;
}
-#if USE(GSTREAMER_PLAYBIN3)
+#if GST_CHECK_VERSION(1, 10, 0)
void MediaPlayerPrivateGStreamer::updateTracks()
{
ASSERT(!m_isLegacyPlaybin);
@@ -755,7 +755,7 @@
GstElement* element = isMediaSource() ? m_source.get() : m_pipeline.get();
g_object_set(element, propertyName, index, nullptr);
}
-#if USE(GSTREAMER_PLAYBIN3)
+#if GST_CHECK_VERSION(1, 10, 0)
else {
GstStream* stream = gst_stream_collection_get_stream(m_streamCollection.get(), index);
if (stream) {
@@ -1280,7 +1280,7 @@
gst_tag_list_unref(tags);
break;
}
-#if USE(GSTREAMER_PLAYBIN3)
+#if GST_CHECK_VERSION(1, 10, 0)
case GST_MESSAGE_STREAM_COLLECTION: {
GRefPtr<GstStreamCollection> collection;
gst_message_parse_stream_collection(message, &collection.outPtr());
@@ -2399,19 +2399,39 @@
}
#endif
-void MediaPlayerPrivateGStreamer::createGSTPlayBin()
+void MediaPlayerPrivateGStreamer::createGSTPlayBin(const gchar* playbinName)
{
+ if (m_pipeline) {
+ if (!playbinName) {
+ GST_INFO_OBJECT(pipeline(), "Keeping same playbin as nothing forced");
+ return;
+ }
+
+ if (!g_strcmp0(GST_OBJECT_NAME(gst_element_get_factory(m_pipeline.get())), playbinName)) {
+ GST_INFO_OBJECT(pipeline(), "Already using %s", playbinName);
+ return;
+ }
+
+ GST_INFO_OBJECT(pipeline(), "Tearing down as we need to use %s now.",
+ playbinName);
+ changePipelineState(GST_STATE_NULL);
+ m_pipeline = nullptr;
+ }
+
ASSERT(!m_pipeline);
+#if GST_CHECK_VERSION(1, 10, 0)
+ m_isLegacyPlaybin = !g_getenv("USE_PLAYBIN3");
+ if (!m_isLegacyPlaybin)
+ playbinName = "playbin3";
+#endif
+
+ if (!playbinName)
+ playbinName = "playbin";
+
// gst_element_factory_make() returns a floating reference so
// we should not adopt.
-#if USE(GSTREAMER_PLAYBIN3)
- m_isLegacyPlaybin = false;
- setPipeline(gst_element_factory_make("playbin3", "play"));
-#else
- m_isLegacyPlaybin = true;
- setPipeline(gst_element_factory_make("playbin", "play"));
-#endif
+ setPipeline(gst_element_factory_make(playbinName, "play"));
setStreamVolumeElement(GST_STREAM_VOLUME(m_pipeline.get()));
GST_INFO("Using legacy playbin element: %s", boolForPrinting(m_isLegacyPlaybin));
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h (230539 => 230540)
--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h 2018-04-11 18:15:06 UTC (rev 230539)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h 2018-04-11 18:33:39 UTC (rev 230540)
@@ -146,7 +146,7 @@
virtual void updateStates();
virtual void asyncStateChangeDone();
- void createGSTPlayBin();
+ void createGSTPlayBin(const gchar* playbinName);
bool loadNextLocation();
void mediaLocationChanged(GstMessage*);
@@ -178,7 +178,7 @@
void setPlaybinURL(const URL& urlString);
-#if USE(GSTREAMER_PLAYBIN3)
+#if GST_CHECK_VERSION(1, 10, 0)
void updateTracks();
#endif
@@ -257,7 +257,7 @@
URL m_url;
bool m_preservesPitch;
bool m_isLegacyPlaybin;
-#if USE(GSTREAMER_PLAYBIN3)
+#if GST_CHECK_VERSION(1, 10, 0)
GRefPtr<GstStreamCollection> m_streamCollection;
#endif
String m_currentAudioStreamId;
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h (230539 => 230540)
--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h 2018-04-11 18:15:06 UTC (rev 230539)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h 2018-04-11 18:33:39 UTC (rev 230540)
@@ -211,7 +211,7 @@
TextChanged = 1 << 5,
#endif
SizeChanged = 1 << 6,
-#if USE(GSTREAMER_PLAYBIN3)
+#if GST_CHECK_VERSION(1, 10, 0)
StreamCollectionChanged = 1 << 7
#endif
};
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp (230539 => 230540)
--- trunk/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp 2018-04-11 18:15:06 UTC (rev 230539)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp 2018-04-11 18:33:39 UTC (rev 230540)
@@ -58,7 +58,7 @@
tagsChanged();
}
-#if USE(GSTREAMER_PLAYBIN3)
+#if GST_CHECK_VERSION(1, 10, 0)
TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer(TrackPrivateBase* owner, gint index, GRefPtr<GstStream> stream)
: m_notifier(MainThreadNotifier<MainThreadNotification>::create())
, m_index(index)
@@ -82,7 +82,7 @@
{
m_tags.clear();
-#if USE(GSTREAMER_PLAYBIN3)
+#if GST_CHECK_VERSION(1, 10, 0)
if (m_stream)
m_stream.clear();
#endif
@@ -115,7 +115,7 @@
else
tags = adoptGRef(gst_tag_list_new_empty());
}
-#if USE(GSTREAMER_PLAYBIN3)
+#if GST_CHECK_VERSION(1, 10, 0)
else if (m_stream)
tags = adoptGRef(gst_stream_get_tags(m_stream.get()));
#endif
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h (230539 => 230540)
--- trunk/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h 2018-04-11 18:15:06 UTC (rev 230539)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h 2018-04-11 18:33:39 UTC (rev 230540)
@@ -58,7 +58,7 @@
protected:
TrackPrivateBaseGStreamer(TrackPrivateBase* owner, gint index, GRefPtr<GstPad>);
-#if USE(GSTREAMER_PLAYBIN3)
+#if GST_CHECK_VERSION(1, 10, 0)
TrackPrivateBaseGStreamer(TrackPrivateBase* owner, gint index, GRefPtr<GstStream>);
#endif
void notifyTrackOfActiveChanged();
@@ -76,7 +76,7 @@
AtomicString m_label;
AtomicString m_language;
GRefPtr<GstPad> m_pad;
-#if USE(GSTREAMER_PLAYBIN3)
+#if GST_CHECK_VERSION(1, 10, 0)
GRefPtr<GstStream> m_stream;
#endif
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp (230539 => 230540)
--- trunk/Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp 2018-04-11 18:15:06 UTC (rev 230539)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp 2018-04-11 18:33:39 UTC (rev 230540)
@@ -43,7 +43,7 @@
notifyTrackOfActiveChanged();
}
-#if USE(GSTREAMER_PLAYBIN3)
+#if GST_CHECK_VERSION(1, 10, 0)
VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer(WeakPtr<MediaPlayerPrivateGStreamer> player, gint index, GRefPtr<GstStream> stream)
: TrackPrivateBaseGStreamer(this, index, stream)
, m_player(player)
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h (230539 => 230540)
--- trunk/Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h 2018-04-11 18:15:06 UTC (rev 230539)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h 2018-04-11 18:33:39 UTC (rev 230540)
@@ -43,7 +43,7 @@
{
return adoptRef(*new VideoTrackPrivateGStreamer(player, index, pad));
}
-#if USE(GSTREAMER_PLAYBIN3)
+#if GST_CHECK_VERSION(1, 10, 0)
static Ref<VideoTrackPrivateGStreamer> create(WeakPtr<MediaPlayerPrivateGStreamer> player, gint index, GRefPtr<GstStream> stream)
{
return adoptRef(*new VideoTrackPrivateGStreamer(player, index, stream));
@@ -64,7 +64,7 @@
private:
VideoTrackPrivateGStreamer(WeakPtr<MediaPlayerPrivateGStreamer>, gint index, GRefPtr<GstPad>);
-#if USE(GSTREAMER_PLAYBIN3)
+#if GST_CHECK_VERSION(1, 10, 0)
VideoTrackPrivateGStreamer(WeakPtr<MediaPlayerPrivateGStreamer>, gint index, GRefPtr<GstStream>);
#endif
AtomicString m_id;
Modified: trunk/Source/cmake/GStreamerDefinitions.cmake (230539 => 230540)
--- trunk/Source/cmake/GStreamerDefinitions.cmake 2018-04-11 18:15:06 UTC (rev 230539)
+++ trunk/Source/cmake/GStreamerDefinitions.cmake 2018-04-11 18:33:39 UTC (rev 230540)
@@ -5,4 +5,3 @@
WEBKIT_OPTION_DEFINE(USE_GSTREAMER_GL "Whether to enable support for GStreamer GL" PRIVATE ON)
WEBKIT_OPTION_DEFINE(USE_GSTREAMER_MPEGTS "Whether to enable support for MPEG-TS" PRIVATE OFF)
-WEBKIT_OPTION_DEFINE(USE_GSTREAMER_PLAYBIN3 "Whether to enable support for GStreamer's playbin3 element" PRIVATE OFF)