WebKit Bugzilla
Attachment 342928 Details for
Bug 129774
: [GStreamer] Disable video and/or audio if all tracks are deselected
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-129774-20180618142947.patch (text/plain), 43.22 KB, created by
Philippe Normand
on 2018-06-18 06:29:49 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Philippe Normand
Created:
2018-06-18 06:29:49 PDT
Size:
43.22 KB
patch
obsolete
>Subversion Revision: 232925 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index f84388bac660b5cae0b6fa92a35ef2f7924cfd45..739a79851b2670d96e5b53e3213e41aaed1b7aa2 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,60 @@ >+2018-02-28 Philippe Normand <pnormand@igalia.com> >+ >+ [GStreamer] Disable video and/or audio if all tracks are deselected >+ https://bugs.webkit.org/show_bug.cgi?id=129774 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Original patch by: Brendan Long <b.long@cablelabs.com> >+ >+ * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp: >+ (WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer): Pass player to parent class. >+ (WebCore::AudioTrackPrivateGStreamer::setEnabled): Set track state using parent class. >+ * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h: Move player management to parent class. >+ * platform/graphics/gstreamer/GStreamerUtilities.cpp: >+ (WebCore::getGstPlayFlag): Update signature to be consistent with setGstPlayFlag. >+ (WebCore::setGstPlayFlag): New utility method to configure playflags >+ * platform/graphics/gstreamer/GStreamerUtilities.h: >+ * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp: >+ Parent class signature update, this implementation doesn't need to >+ hold a player because text track state is managed differently. >+ (WebCore::InbandTextTrackPrivateGStreamer::InbandTextTrackPrivateGStreamer): >+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: >+ (WebCore::MediaPlayerPrivateGStreamer::doSeek): No need for >+ repaint after flushing seek because paint will be done again once >+ the first buffer reaches the sink. >+ (WebCore::MediaPlayerPrivateGStreamer::setTrackEnabled): Ensure >+ the playflags are correctly synchronized with the enabled tracks. >+ For instance if no video track is enabled the corresponding flag >+ should be unset. Also make sure to flush the pipeline when >+ disabling video so that a black frame will then be rendered >+ instead of the last frame before disabling the track. >+ (WebCore::MediaPlayerPrivateGStreamer::handleMessage): When >+ handling clock-lost messages set a flag to indicate the >+ updateStates() method should restart playback. >+ (WebCore::MediaPlayerPrivateGStreamer::updateStates): Restart >+ playback to recover from clock-lost. >+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: >+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: >+ (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor): >+ When no sample is available, render a black frame. >+ (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer): >+ Optionally trigger a repaint. This allows us to clear the texture >+ instead of rendering the last frame forever. >+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: >+ * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp: >+ (WebCore::initDebugCategory): New webkitmediatrack gst debug category. >+ (WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer): >+ Receive a pointer to the player. >+ (WebCore::TrackPrivateBaseGStreamer::disconnect): Clear player pointer. >+ (WebCore::TrackPrivateBaseGStreamer::setTrackEnabled): Chain to player. >+ * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h: >+ * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp: >+ (WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer): >+ Pass player to parent class. >+ (WebCore::VideoTrackPrivateGStreamer::setSelected): Set track state using parent class. >+ * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h: >+ > 2018-06-18 Philippe Normand <pnormand@igalia.com> > > [GStreamer] Crash when adding in-band text track with playbin3 enabled >diff --git a/Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp >index dd1f3bb250bf3078791ad9c33044a8f6ba29ec0f..bb2e0c49d436ab01d8f7377fb9960068b916f024 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp >@@ -29,14 +29,10 @@ > > #include "AudioTrackPrivateGStreamer.h" > >-#include "MediaPlayerPrivateGStreamer.h" >-#include <glib-object.h> >- > namespace WebCore { > > AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer(WeakPtr<MediaPlayerPrivateGStreamer> player, gint index, GRefPtr<GstPad> pad) >- : TrackPrivateBaseGStreamer(this, index, pad) >- , m_player(player) >+ : TrackPrivateBaseGStreamer(this, player, MediaPlayerPrivateGStreamer::TrackType::Audio, index, pad) > { > // FIXME: Get a real ID from the tkhd atom. > m_id = "A" + String::number(index); >@@ -45,8 +41,7 @@ AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer(WeakPtr<MediaPlayerPrivat > > #if GST_CHECK_VERSION(1, 10, 0) > AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer(WeakPtr<MediaPlayerPrivateGStreamer> player, gint index, GRefPtr<GstStream> stream) >- : TrackPrivateBaseGStreamer(this, index, stream) >- , m_player(player) >+ : TrackPrivateBaseGStreamer(this, player, MediaPlayerPrivateGStreamer::TrackType::Audio, index, stream) > { > m_id = gst_stream_get_stream_id(stream.get()); > setActive(gst_stream_get_stream_flags(stream.get()) & GST_STREAM_FLAG_SELECT); >@@ -62,12 +57,6 @@ AudioTrackPrivate::Kind AudioTrackPrivateGStreamer::kind() const > } > #endif > >-void AudioTrackPrivateGStreamer::disconnect() >-{ >- m_player = nullptr; >- TrackPrivateBaseGStreamer::disconnect(); >-} >- > void AudioTrackPrivateGStreamer::markAsActive() > { > AudioTrackPrivate::setEnabled(true); >@@ -78,9 +67,7 @@ void AudioTrackPrivateGStreamer::setEnabled(bool enabled) > if (enabled == this->enabled()) > return; > AudioTrackPrivate::setEnabled(enabled); >- >- if (enabled && m_player) >- m_player->enableTrack(TrackPrivateBaseGStreamer::TrackType::Audio, m_index); >+ TrackPrivateBaseGStreamer::setTrackEnabled(enabled); > } > > } // namespace WebCore >diff --git a/Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h b/Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h >index 8b954ae609f807c6ff48089d2fa085f9aaa8d8c3..a6e395ac772b407f8d8e8bca3dc0291b84e2c82c 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h >+++ b/Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h >@@ -27,14 +27,9 @@ > > #if ENABLE(VIDEO) && USE(GSTREAMER) && ENABLE(VIDEO_TRACK) > >-#include "AudioTrackPrivate.h" >-#include "GStreamerCommon.h" > #include "TrackPrivateBaseGStreamer.h" >-#include <gst/gst.h> >-#include <wtf/WeakPtr.h> > > namespace WebCore { >-class MediaPlayerPrivateGStreamer; > > class AudioTrackPrivateGStreamer final : public AudioTrackPrivate, public TrackPrivateBaseGStreamer { > public: >@@ -52,8 +47,6 @@ public: > Kind kind() const final; > #endif > >- void disconnect() override; >- > void setEnabled(bool) override; > void markAsActive(); > void setActive(bool enabled) override { setEnabled(enabled); } >@@ -69,9 +62,7 @@ private: > #if GST_CHECK_VERSION(1, 10, 0) > AudioTrackPrivateGStreamer(WeakPtr<MediaPlayerPrivateGStreamer>, gint index, GRefPtr<GstStream>); > #endif >- > AtomicString m_id; >- WeakPtr<MediaPlayerPrivateGStreamer> m_player; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp >index d5475b74cddcfad10a0ed982299fdac42d4b1aa1..9b67ac84b8a32caf19ccf8c2107deb602b394249 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp >@@ -28,6 +28,7 @@ > #include <gst/audio/audio-info.h> > #include <gst/gst.h> > #include <mutex> >+#include <wtf/PrintStream.h> > #include <wtf/glib/GLibUtilities.h> > #include <wtf/glib/GUniquePtr.h> > #include <wtf/glib/RunLoopSourcePriority.h> >@@ -38,6 +39,9 @@ > #undef GST_USE_UNSTABLE_API > #endif > >+GST_DEBUG_CATEGORY_EXTERN(webkit_media_player_debug); >+#define GST_CAT_DEFAULT webkit_media_player_debug >+ > namespace WebCore { > > const char* webkitGstMapInfoQuarkString = "webkit-gst-map-info"; >@@ -288,18 +292,38 @@ bool initializeGStreamer(std::optional<Vector<String>>&& options) > return isGStreamerInitialized; > } > >-unsigned getGstPlayFlag(const char* nick) >+unsigned getGstPlayFlag(const char* flagName) > { > static GFlagsClass* flagsClass = static_cast<GFlagsClass*>(g_type_class_ref(g_type_from_name("GstPlayFlags"))); > ASSERT(flagsClass); > >- GFlagsValue* flag = g_flags_get_value_by_nick(flagsClass, nick); >- if (!flag) >+ GFlagsValue* flag = g_flags_get_value_by_nick(flagsClass, flagName); >+ if (!flag) { >+ GST_WARNING("Unknown GstPlayFlag: %s", flagName); > return 0; >+ } > > return flag->value; > } > >+void setGstPlayFlag(GstElement* playbin, const char* flagName, bool enabled) >+{ >+ unsigned flag = getGstPlayFlag(flagName); >+ unsigned flags; >+ >+ g_object_get(playbin, "flags", &flags, nullptr); >+ if (enabled == static_cast<bool>(flags & flag)) >+ return; >+ >+ if (enabled) >+ flags |= flag; >+ else >+ flags &= ~flag; >+ >+ GST_DEBUG("Setting %s flag to %s", flagName, boolForPrinting(enabled)); >+ g_object_set(playbin, "flags", flags, nullptr); >+} >+ > // Convert a MediaTime in seconds to a GstClockTime. Note that we can get MediaTime objects with a time scale that isn't a GST_SECOND, since they can come to > // us through the internal testing API, the DOM and internally. It would be nice to assert the format of the incoming time, but all the media APIs assume time > // is passed around in fractional seconds, so we'll just have to assume the same. >diff --git a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h >index cbb49323a68d21be9567a1ef1ca7bb656dfde620..bb9d62368f8f1ad0d94237c895a458b815e8fa2a 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h >+++ b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h >@@ -73,7 +73,8 @@ void mapGstBuffer(GstBuffer*, uint32_t); > void unmapGstBuffer(GstBuffer*); > Vector<String> extractGStreamerOptionsFromCommandLine(); > bool initializeGStreamer(std::optional<Vector<String>>&& = std::nullopt); >-unsigned getGstPlayFlag(const char* nick); >+unsigned getGstPlayFlag(const char* flagName); >+void setGstPlayFlag(GstElement*, const char* flagName, bool enabled); > uint64_t toGstUnsigned64Time(const MediaTime&); > > inline GstClockTime toGstClockTime(const MediaTime &mediaTime) >diff --git a/Source/WebCore/platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp >index 98270957d19271838ef4c5eb6ea17c41bd68b6cd..c6183ae880eb6659bad527d83e5c2d0affd47f4d 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp >@@ -29,19 +29,14 @@ > > #include "InbandTextTrackPrivateGStreamer.h" > >-#include "GStreamerCommon.h" >-#include "Logging.h" >-#include <glib-object.h> >-#include <gst/gst.h> >- >-GST_DEBUG_CATEGORY_EXTERN(webkit_media_player_debug); >-#define GST_CAT_DEFAULT webkit_media_player_debug >+GST_DEBUG_CATEGORY_EXTERN(webkit_media_track_debug); >+#define GST_CAT_DEFAULT webkit_media_track_debug > > namespace WebCore { > > InbandTextTrackPrivateGStreamer::InbandTextTrackPrivateGStreamer(gint index, GRefPtr<GstPad> pad) > : InbandTextTrackPrivate(WebVTT) >- , TrackPrivateBaseGStreamer(this, index, pad) >+ , TrackPrivateBaseGStreamer(this, nullptr, MediaPlayerPrivateGStreamer::TrackType::Text, index, pad) > { > m_eventProbe = gst_pad_add_probe(m_pad.get(), GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM, [] (GstPad*, GstPadProbeInfo* info, gpointer userData) -> GstPadProbeReturn { > auto* track = static_cast<InbandTextTrackPrivateGStreamer*>(userData); >@@ -61,7 +56,7 @@ InbandTextTrackPrivateGStreamer::InbandTextTrackPrivateGStreamer(gint index, GRe > #if GST_CHECK_VERSION(1, 10, 0) > InbandTextTrackPrivateGStreamer::InbandTextTrackPrivateGStreamer(gint index, GRefPtr<GstStream> stream) > : InbandTextTrackPrivate(WebVTT) >- , TrackPrivateBaseGStreamer(this, index, stream) >+ , TrackPrivateBaseGStreamer(this, nullptr, MediaPlayerPrivateGStreamer::TrackType::Text, index, stream) > { > m_streamId = gst_stream_get_stream_id(stream.get()); > GST_INFO("Track %d got stream start for stream %s.", m_index, m_streamId.utf8().data()); >diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >index 9a0711e73dda006805543318e3970a445a03e4ba..2a3c06de866de5cbde2c4065a3c25aef444f1027 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >@@ -577,6 +577,7 @@ bool MediaPlayerPrivateGStreamer::doSeek(const MediaTime& position, float rate, > if (!rate) > rate = 1.0; > >+ m_repaintAfterFlush = false; > return gst_element_seek(m_pipeline.get(), rate, GST_FORMAT_TIME, seekType, > GST_SEEK_TYPE_SET, toGstClockTime(startTime), GST_SEEK_TYPE_SET, toGstClockTime(endTime)); > } >@@ -737,61 +738,83 @@ void MediaPlayerPrivateGStreamer::updateTracks() > } > #endif // GST_CHECK_VERSION(1, 10, 0) > >-void MediaPlayerPrivateGStreamer::enableTrack(TrackPrivateBaseGStreamer::TrackType trackType, unsigned index) >+void MediaPlayerPrivateGStreamer::setTrackEnabled(MediaPlayerPrivateGStreamer::TrackType trackType, unsigned index, bool enabled) > { > const char* propertyName; >- const char* trackTypeAsString; >+ const char* flagName; > GList* selectedStreams = nullptr; > > switch (trackType) { >- case TrackPrivateBaseGStreamer::TrackType::Audio: >+ case MediaPlayerPrivateGStreamer::TrackType::Audio: > propertyName = "current-audio"; >- trackTypeAsString = "audio"; >+ flagName = "audio"; > if (!m_currentTextStreamId.isEmpty()) > selectedStreams = g_list_append(selectedStreams, g_strdup(m_currentTextStreamId.utf8().data())); > if (!m_currentVideoStreamId.isEmpty()) > selectedStreams = g_list_append(selectedStreams, g_strdup(m_currentVideoStreamId.utf8().data())); > break; >- case TrackPrivateBaseGStreamer::TrackType::Video: >+ case MediaPlayerPrivateGStreamer::TrackType::Video: > propertyName = "current-video"; >- trackTypeAsString = "video"; >+ flagName = "video"; > if (!m_currentAudioStreamId.isEmpty()) > selectedStreams = g_list_append(selectedStreams, g_strdup(m_currentAudioStreamId.utf8().data())); > if (!m_currentTextStreamId.isEmpty()) > selectedStreams = g_list_append(selectedStreams, g_strdup(m_currentTextStreamId.utf8().data())); >+ // if (!enabled && !m_currentVideoStreamId.isEmpty()) > break; >- case TrackPrivateBaseGStreamer::TrackType::Text: >+ case MediaPlayerPrivateGStreamer::TrackType::Text: > propertyName = "current-text"; >- trackTypeAsString = "text"; >+ flagName = "text"; > if (!m_currentAudioStreamId.isEmpty()) > selectedStreams = g_list_append(selectedStreams, g_strdup(m_currentAudioStreamId.utf8().data())); > if (!m_currentVideoStreamId.isEmpty()) > selectedStreams = g_list_append(selectedStreams, g_strdup(m_currentVideoStreamId.utf8().data())); > break; >- case TrackPrivateBaseGStreamer::TrackType::Unknown: > default: > ASSERT_NOT_REACHED(); > } > >- GST_INFO("Enabling %s track with index: %u", trackTypeAsString, index); >+ GST_INFO_OBJECT(pipeline(), "%s %s track with index: %u", enabled ? "Enabling":"Disabling", flagName, index); >+ > // FIXME: Remove isMediaSource() test below when fixing https://bugs.webkit.org/show_bug.cgi?id=182531 > if (m_isLegacyPlaybin || isMediaSource()) { > GstElement* element = isMediaSource() ? m_source.get() : m_pipeline.get(); >- g_object_set(element, propertyName, index, nullptr); >+ if (enabled) { >+ g_object_set(element, propertyName, index, nullptr); >+ setGstPlayFlag(element, flagName, enabled); >+ } else { >+ int currentAudio, currentVideo, currentText, nAudio, nVideo, nText; >+ int currentStream; >+ g_object_get(element, propertyName, ¤tStream, >+ "current-audio", ¤tAudio, >+ "current-video", ¤tVideo, "current-text", ¤tText, >+ "n-audio", &nAudio, "n-video", &nVideo, "n-text", &nText, nullptr); >+ g_printerr("audio: %d, video: %d, text: %d, total: %d, %d, %d\n", currentAudio, currentVideo, currentText, nAudio, nVideo, nText); >+ GST_DEBUG_OBJECT(pipeline(), "Current %s stream is %d", flagName, currentStream); >+ if (static_cast<unsigned>(currentStream) == index) { >+ setGstPlayFlag(element, flagName, false); >+ } >+ } > } > #if GST_CHECK_VERSION(1, 10, 0) > else { >- GstStream* stream = gst_stream_collection_get_stream(m_streamCollection.get(), index); >- if (stream) { >- String streamId = gst_stream_get_stream_id(stream); >- selectedStreams = g_list_append(selectedStreams, g_strdup(streamId.utf8().data())); >- } else >- GST_WARNING("%s stream %u not found", trackTypeAsString, index); >- >+ if (enabled) { >+ GstStream* stream = gst_stream_collection_get_stream(m_streamCollection.get(), index); >+ if (stream) { >+ String streamId = gst_stream_get_stream_id(stream); >+ selectedStreams = g_list_append(selectedStreams, g_strdup(streamId.utf8().data())); >+ } else >+ GST_WARNING_OBJECT(pipeline(), "%s stream %u not found", flagName, index); >+ } > // TODO: MSE GstStream API support: https://bugs.webkit.org/show_bug.cgi?id=182531 >- gst_element_send_event(m_pipeline.get(), gst_event_new_select_streams(selectedStreams)); >+ if (selectedStreams) >+ gst_element_send_event(m_pipeline.get(), gst_event_new_select_streams(selectedStreams)); >+ else >+ GST_WARNING_OBJECT(pipeline(), "All streams can't be disabled."); > } > #endif >+ if (!enabled && !strcmp(flagName, "video")) >+ scheduleVideoFrameFlush(); > > if (selectedStreams) > g_list_free_full(selectedStreams, reinterpret_cast<GDestroyNotify>(g_free)); >@@ -1238,8 +1261,8 @@ void MediaPlayerPrivateGStreamer::handleMessage(GstMessage* message) > // is disabled. It also happens relatively often with > // HTTP adaptive streams when switching between different > // variants of a stream. >+ m_fixingClock = true; > gst_element_set_state(m_pipeline.get(), GST_STATE_PAUSED); >- gst_element_set_state(m_pipeline.get(), GST_STATE_PLAYING); > break; > case GST_MESSAGE_LATENCY: > // Recalculate the latency, we don't need any special handling >@@ -1363,6 +1386,9 @@ void MediaPlayerPrivateGStreamer::handleMessage(GstMessage* message) > m_currentTextStreamId = streamId; > else > GST_WARNING("Unknown stream type with stream-id %s", streamId.utf8().data()); >+ >+ if (m_currentVideoStreamId.isEmpty()) >+ scheduleVideoFrameFlush(); > } > break; > } >@@ -1909,8 +1935,9 @@ void MediaPlayerPrivateGStreamer::updateStates() > m_volumeAndMuteInitialized = true; > } > >- if (didBuffering && !m_buffering && !m_paused && m_playbackRate) { >- GST_DEBUG("[Buffering] Restarting playback."); >+ if (m_fixingClock || (didBuffering && !m_buffering && !m_paused && m_playbackRate)) { >+ GST_DEBUG("%s Restarting playback", m_fixingClock ? "[Clock changed]" : "[Buffering]"); >+ m_fixingClock = false; > changePipelineState(GST_STATE_PLAYING); > } > } else if (m_currentState == GST_STATE_PLAYING) { >diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h >index ad67d24f3a9e33d65babf3f6f01c74ca5445b9e0..82db12a00e30501eaac5ae05b9add8cbbed13b0f 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h >+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h >@@ -37,7 +37,6 @@ > #include <wtf/WeakPtr.h> > > #if ENABLE(VIDEO_TRACK) >-#include "TrackPrivateBaseGStreamer.h" > #include <wtf/text/AtomicStringHash.h> > #endif > >@@ -129,7 +128,14 @@ public: > > bool isLiveStream() const override { return m_isStreaming; } > >- void enableTrack(TrackPrivateBaseGStreamer::TrackType, unsigned index); >+ enum TrackType { >+ Audio, >+ Video, >+ Text, >+ Unknown >+ }; >+ >+ void setTrackEnabled(TrackType, unsigned index, bool enabled); > > bool handleSyncMessage(GstMessage*) override; > >@@ -258,6 +264,7 @@ private: > URL m_url; > bool m_preservesPitch; > bool m_isLegacyPlaybin; >+ bool m_fixingClock; > #if GST_CHECK_VERSION(1, 10, 0) > GRefPtr<GstStreamCollection> m_streamCollection; > FloatSize naturalSize() const final; >diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp >index 16d23407c66496f0d7d1a4882b59545fe8d3ea3d..8e0cf034aa64d41f379bf9a37fa2a86dc37d2708 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp >@@ -211,8 +211,10 @@ public: > m_size = IntSize(GST_VIDEO_INFO_WIDTH(&videoInfo), GST_VIDEO_INFO_HEIGHT(&videoInfo)); > m_hasAlphaChannel = GST_VIDEO_INFO_HAS_ALPHA(&videoInfo); > m_buffer = gst_sample_get_buffer(sample); >- if (UNLIKELY(!GST_IS_BUFFER(m_buffer))) >+ if (UNLIKELY(!GST_IS_BUFFER(m_buffer))) { >+ GST_INFO("Black frame"); > return; >+ } > > #if USE(GSTREAMER_GL) > m_flags = flags | (m_hasAlphaChannel ? TextureMapperGL::ShouldBlend : 0) | TEXTURE_MAPPER_COLOR_CONVERT_FLAG; >@@ -222,6 +224,8 @@ public: > if (m_isMapped) > m_textureID = *reinterpret_cast<GLuint*>(m_videoFrame.data[0]); > } else >+#else >+ UNUSED_PARAM(gstGLEnabled); > #endif // USE(GSTREAMER_GL) > > { >@@ -232,6 +236,7 @@ public: > ASSERT(GST_VIDEO_INFO_N_PLANES(&videoInfo) == 1); > } > } >+ GST_INFO("Video frame mapped: %d, textureID: %u", m_isMapped, m_textureID); > } > > virtual ~GstVideoFrameHolder() >@@ -247,22 +252,28 @@ public: > TextureMapperGL::Flags flags() const { return m_flags; } > GLuint textureID() const { return m_textureID; } > >- void updateTexture(BitmapTextureGL& texture) >+ bool updateTexture(BitmapTextureGL& texture) > { > ASSERT(!m_textureID); >+ if (!m_isMapped) { >+ texture.reset(m_size, BitmapTexture::NoFlag); >+ return false; >+ } >+ > GstVideoGLTextureUploadMeta* meta; > if ((meta = gst_buffer_get_video_gl_texture_upload_meta(m_buffer))) { > if (meta->n_textures == 1) { // BRGx & BGRA formats use only one texture. > guint ids[4] = { texture.id(), 0, 0, 0 }; > > if (gst_video_gl_texture_upload_meta_upload(meta, ids)) >- return; >+ return true; > } > } > > int stride = GST_VIDEO_FRAME_PLANE_STRIDE(&m_videoFrame, 0); > const void* srcData = GST_VIDEO_FRAME_PLANE_DATA(&m_videoFrame, 0); > texture.updateContents(srcData, WebCore::IntRect(0, 0, m_size.width(), m_size.height()), WebCore::IntPoint(0, 0), stride); >+ return true; > } > > private: >@@ -758,25 +769,80 @@ void MediaPlayerPrivateGStreamerBase::pushTextureToCompositor() > > std::unique_ptr<GstVideoFrameHolder> frameHolder = std::make_unique<GstVideoFrameHolder>(m_sample.get(), texMapFlagFromOrientation(m_videoSourceOrientation), !m_usingFallbackVideoSink); > >+ std::unique_ptr<TextureMapperPlatformLayerBuffer> layerBuffer; > #if USE(GSTREAMER_GL) > GLuint textureID = frameHolder->textureID(); > if (textureID) { >- std::unique_ptr<TextureMapperPlatformLayerBuffer> layerBuffer = std::make_unique<TextureMapperPlatformLayerBuffer>(textureID, frameHolder->size(), frameHolder->flags(), GraphicsContext3D::RGBA); >+ layerBuffer = std::make_unique<TextureMapperPlatformLayerBuffer>(textureID, frameHolder->size(), frameHolder->flags(), GraphicsContext3D::RGBA); > layerBuffer->setUnmanagedBufferDataHolder(WTFMove(frameHolder)); >- m_platformLayerProxy->pushNextBuffer(WTFMove(layerBuffer)); > } else > #endif > { >- std::unique_ptr<TextureMapperPlatformLayerBuffer> buffer = m_platformLayerProxy->getAvailableBuffer(frameHolder->size(), GL_DONT_CARE); >- if (UNLIKELY(!buffer)) { >+ layerBuffer = m_platformLayerProxy->getAvailableBuffer(frameHolder->size(), GL_DONT_CARE); >+ if (UNLIKELY(!layerBuffer)) { > auto texture = BitmapTextureGL::create(TextureMapperContextAttributes::get()); > texture->reset(frameHolder->size(), frameHolder->hasAlphaChannel() ? BitmapTexture::SupportsAlpha : BitmapTexture::NoFlag); >- buffer = std::make_unique<TextureMapperPlatformLayerBuffer>(WTFMove(texture)); >+ layerBuffer = std::make_unique<TextureMapperPlatformLayerBuffer>(WTFMove(texture)); > } >- frameHolder->updateTexture(buffer->textureGL()); >- buffer->setExtraFlags(texMapFlagFromOrientation(m_videoSourceOrientation) | (frameHolder->hasAlphaChannel() ? TextureMapperGL::ShouldBlend : 0)); >- m_platformLayerProxy->pushNextBuffer(WTFMove(buffer)); >+ if (frameHolder->updateTexture(layerBuffer->textureGL())) >+ layerBuffer->setExtraFlags(texMapFlagFromOrientation(m_videoSourceOrientation) | (frameHolder->hasAlphaChannel() ? TextureMapperGL::ShouldBlend : 0)); >+ } >+ m_platformLayerProxy->pushNextBuffer(WTFMove(layerBuffer)); >+ >+#if 0 >+ std::unique_ptr<TextureMapperPlatformLayerBuffer> layerBuffer; >+ >+#if USE(GSTREAMER_GL) >+ GST_TRACE("Rendering %s frame", GST_IS_SAMPLE(m_sample.get()) ? "valid":"black"); >+ if (GST_IS_SAMPLE(m_sample.get())) { >+ std::unique_ptr<GstVideoFrameHolder> frameHolder = std::make_unique<GstVideoFrameHolder>(m_sample.get(), texMapFlagFromOrientation(m_videoSourceOrientation)); >+ if (UNLIKELY(!frameHolder->isValid())) >+ return; >+ >+ layerBuffer = std::make_unique<TextureMapperPlatformLayerBuffer>(frameHolder->textureID(), frameHolder->size(), frameHolder->flags(), GraphicsContext3D::RGBA); >+ layerBuffer->setUnmanagedBufferDataHolder(WTFMove(frameHolder)); >+ } else { >+ // No video frame to render, so paint a black frame. >+ TextureMapperContextAttributes contextAttributes; >+ contextAttributes.initialize(); >+ >+ auto texture = BitmapTextureGL::create(contextAttributes); >+ texture->reset(m_size, BitmapTexture::NoFlag); >+ layerBuffer = std::make_unique<TextureMapperPlatformLayerBuffer>(WTFMove(texture)); >+ } >+#else >+ >+ IntSize size = m_size; >+ GstVideoInfo videoInfo; >+ bool validFrame = getSampleVideoInfo(m_sample.get(), videoInfo); >+ GST_TRACE("Rendering %s frame", validFrame ? "valid":"black"); >+ >+ if (validFrame) >+ size = IntSize(GST_VIDEO_INFO_WIDTH(&videoInfo), GST_VIDEO_INFO_HEIGHT(&videoInfo)); >+ >+ layerBuffer = m_platformLayerProxy->getAvailableBuffer(size, GL_DONT_CARE); >+ if (UNLIKELY(!layerBuffer)) { >+ TextureMapperContextAttributes contextAttributes; >+ contextAttributes.initialize(); >+ >+ auto texture = BitmapTextureGL::create(contextAttributes); >+ >+ if (validFrame) >+ texture->reset(size, GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? BitmapTexture::SupportsAlpha : BitmapTexture::NoFlag); >+ layerBuffer = std::make_unique<TextureMapperPlatformLayerBuffer>(WTFMove(texture)); >+ } >+ >+ if (validFrame) { >+ updateTexture(layerBuffer->textureGL(), videoInfo); >+ layerBuffer->setExtraFlags(texMapFlagFromOrientation(m_videoSourceOrientation) | (GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? TextureMapperGL::ShouldBlend : 0)); >+ } else { >+ // No video frame to render, so paint a black frame. >+ layerBuffer->textureGL().reset(size, BitmapTexture::NoFlag); > } >+#endif // USE(GSTREAMER_GL) >+ >+ m_platformLayerProxy->pushNextBuffer(WTFMove(layerBuffer)); >+#endif > } > #endif // USE(TEXTURE_MAPPER_GL) > >@@ -856,6 +922,19 @@ void MediaPlayerPrivateGStreamerBase::repaintCancelledCallback(MediaPlayerPrivat > player->cancelRepaint(); > } > >+void MediaPlayerPrivateGStreamerBase::scheduleVideoFrameFlush() >+{ >+ m_repaintAfterFlush = true; >+ // FIXME: Flushing works correctly only for the gst-gl code >+ // path. With the legacy non-gl video sink code path the >+ // last frame before disabling the video track remains >+ // visible. >+#if USE(GSTREAMER_GL) >+ gst_element_send_event(m_videoSink.get(), gst_event_new_flush_start()); >+ gst_element_send_event(m_videoSink.get(), gst_event_new_flush_stop(FALSE)); >+#endif >+} >+ > #if USE(GSTREAMER_GL) > GstFlowReturn MediaPlayerPrivateGStreamerBase::newSampleCallback(GstElement* sink, MediaPlayerPrivateGStreamerBase* player) > { >@@ -874,20 +953,25 @@ GstFlowReturn MediaPlayerPrivateGStreamerBase::newPrerollCallback(GstElement* si > void MediaPlayerPrivateGStreamerBase::flushCurrentBuffer() > { > GST_DEBUG_OBJECT(pipeline(), "Flushing video sample"); >- auto sampleLocker = holdLock(m_sampleMutex); >+ { >+ auto sampleLocker = holdLock(m_sampleMutex); > >- // Replace by a new sample having only the caps, so this dummy sample is still useful to get the dimensions. >- // This prevents resizing problems when the video changes its quality and a DRAIN is performed. >- const GstStructure* info = gst_sample_get_info(m_sample.get()); >- m_sample = adoptGRef(gst_sample_new(nullptr, gst_sample_get_caps(m_sample.get()), >- gst_sample_get_segment(m_sample.get()), info ? gst_structure_copy(info) : nullptr)); >+ // Replace by a new sample having only the caps, so this dummy sample is still useful to get the dimensions. >+ // This prevents resizing problems when the video changes its quality and a DRAIN is performed. >+ const GstStructure* info = gst_sample_get_info(m_sample.get()); >+ m_sample = adoptGRef(gst_sample_new(nullptr, gst_sample_get_caps(m_sample.get()), >+ gst_sample_get_segment(m_sample.get()), info ? gst_structure_copy(info) : nullptr)); > >- { >- LockHolder locker(m_platformLayerProxy->lock()); >+ { >+ LockHolder locker(m_platformLayerProxy->lock()); > >- if (m_platformLayerProxy->isActive()) >- m_platformLayerProxy->dropCurrentBufferWhilePreservingTexture(); >+ if (m_platformLayerProxy->isActive()) >+ m_platformLayerProxy->dropCurrentBufferWhilePreservingTexture(); >+ } > } >+ >+ if (m_repaintAfterFlush) >+ m_notifier->notify(MainThreadNotification::TriggerRepaint, [this] { triggerRepaint(m_sample.get()); }); > } > #endif > >diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h >index 30ca02e29d7a326c6d2b71a338bb194fa43b5e75..53adb723c6f9511251682e18d72d93b26b83eed8 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h >+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h >@@ -163,6 +163,8 @@ protected: > MediaPlayerPrivateGStreamerBase(MediaPlayer*); > virtual GstElement* createVideoSink(); > >+ void scheduleVideoFrameFlush(); >+ > #if USE(GSTREAMER_GL) > static GstFlowReturn newSampleCallback(GstElement*, MediaPlayerPrivateGStreamerBase*); > static GstFlowReturn newPrerollCallback(GstElement*, MediaPlayerPrivateGStreamerBase*); >@@ -212,8 +214,9 @@ protected: > #endif > SizeChanged = 1 << 6, > #if GST_CHECK_VERSION(1, 10, 0) >- StreamCollectionChanged = 1 << 7 >+ StreamCollectionChanged = 1 << 7, > #endif >+ TriggerRepaint = 1 << 8 > }; > > Ref<MainThreadNotifier<MainThreadNotification>> m_notifier; >@@ -231,6 +234,7 @@ protected: > mutable FloatSize m_videoSize; > bool m_usingFallbackVideoSink { false }; > bool m_renderingCanBeAccelerated { false }; >+ bool m_repaintAfterFlush { false }; > > Condition m_drawCondition; > Lock m_drawMutex; >diff --git a/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp >index 05ba1e5b12383d127ec0d655377bfaaf6dfd9758..b1a4d7368bc538a7c0e88ad066f97dc245043285 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp >@@ -30,27 +30,37 @@ > #include "TrackPrivateBaseGStreamer.h" > > #include "GStreamerCommon.h" >-#include "Logging.h" > #include "TrackPrivateBase.h" >-#include <glib-object.h> > #include <gst/gst.h> > #include <gst/tag/tag.h> > #include <wtf/glib/GUniquePtr.h> > #include <wtf/text/CString.h> > >-GST_DEBUG_CATEGORY_EXTERN(webkit_media_player_debug); >-#define GST_CAT_DEFAULT webkit_media_player_debug >+GST_DEBUG_CATEGORY(webkit_media_track_debug); >+#define GST_CAT_DEFAULT webkit_media_track_debug > > namespace WebCore { > >-TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer(TrackPrivateBase* owner, gint index, GRefPtr<GstPad> pad) >+static void initDebugCategory() >+{ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ GST_DEBUG_CATEGORY_INIT(webkit_media_track_debug, "webkitmediatrack", 0, "WebKit media track"); >+ }); >+} >+ >+TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer(TrackPrivateBase* owner, WeakPtr<MediaPlayerPrivateGStreamer> player, MediaPlayerPrivateGStreamer::TrackType trackType, gint index, GRefPtr<GstPad> pad) > : m_notifier(MainThreadNotifier<MainThreadNotification>::create()) > , m_index(index) > , m_pad(pad) > , m_owner(owner) >+ , m_player(player) >+ , m_trackType(trackType) > { > ASSERT(m_pad); > >+ initDebugCategory(); >+ > g_signal_connect_swapped(m_pad.get(), "notify::active", G_CALLBACK(activeChangedCallback), this); > g_signal_connect_swapped(m_pad.get(), "notify::tags", G_CALLBACK(tagsChangedCallback), this); > >@@ -59,14 +69,18 @@ TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer(TrackPrivateBase* owner, gi > } > > #if GST_CHECK_VERSION(1, 10, 0) >-TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer(TrackPrivateBase* owner, gint index, GRefPtr<GstStream> stream) >+TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer(TrackPrivateBase* owner, WeakPtr<MediaPlayerPrivateGStreamer> player, MediaPlayerPrivateGStreamer::TrackType trackType, gint index, GRefPtr<GstStream> stream) > : m_notifier(MainThreadNotifier<MainThreadNotification>::create()) > , m_index(index) > , m_stream(stream) > , m_owner(owner) >+ , m_player(player) >+ , m_trackType(trackType) > { > ASSERT(m_stream); > >+ initDebugCategory(); >+ > // We can't call notifyTrackOfTagsChanged() directly, because we need tagsChanged() to setup m_tags. > tagsChanged(); > } >@@ -81,6 +95,7 @@ TrackPrivateBaseGStreamer::~TrackPrivateBaseGStreamer() > void TrackPrivateBaseGStreamer::disconnect() > { > m_tags.clear(); >+ m_player.clear(); > > #if GST_CHECK_VERSION(1, 10, 0) > if (m_stream) >@@ -197,6 +212,14 @@ void TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged() > client->languageChanged(m_language); > } > >+void TrackPrivateBaseGStreamer::setTrackEnabled(bool enabled) >+{ >+ if (!m_player) >+ return; >+ >+ m_player->setTrackEnabled(m_trackType, m_index, enabled); >+} >+ > } // namespace WebCore > > #endif // ENABLE(VIDEO) && USE(GSTREAMER) && ENABLE(VIDEO_TRACK) >diff --git a/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h b/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h >index e80576d91bd3e8c0370a1130512aa6e050bb89fa..d73187537bbab087b99603bcedafa8f6b6d2d5b4 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h >+++ b/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h >@@ -27,9 +27,7 @@ > > #if ENABLE(VIDEO) && USE(GSTREAMER) && ENABLE(VIDEO_TRACK) > >-#include "GStreamerCommon.h" >-#include "MainThreadNotifier.h" >-#include <gst/gst.h> >+#include "MediaPlayerPrivateGStreamer.h" > #include <wtf/Lock.h> > #include <wtf/text/WTFString.h> > >@@ -41,13 +39,6 @@ class TrackPrivateBaseGStreamer { > public: > virtual ~TrackPrivateBaseGStreamer(); > >- enum TrackType { >- Audio, >- Video, >- Text, >- Unknown >- }; >- > GstPad* pad() const { return m_pad.get(); } > > virtual void disconnect(); >@@ -57,16 +48,15 @@ public: > void setIndex(int index) { m_index = index; } > > #if GST_CHECK_VERSION(1, 10, 0) >- GstStream* stream() >- { >- return m_stream.get(); >- } >+ GstStream* stream() { return m_stream.get(); } > #endif > >+ void setTrackEnabled(bool); >+ > protected: >- TrackPrivateBaseGStreamer(TrackPrivateBase* owner, gint index, GRefPtr<GstPad>); >+ TrackPrivateBaseGStreamer(TrackPrivateBase* owner, WeakPtr<MediaPlayerPrivateGStreamer>, MediaPlayerPrivateGStreamer::TrackType, gint index, GRefPtr<GstPad>); > #if GST_CHECK_VERSION(1, 10, 0) >- TrackPrivateBaseGStreamer(TrackPrivateBase* owner, gint index, GRefPtr<GstStream>); >+ TrackPrivateBaseGStreamer(TrackPrivateBase* owner, WeakPtr<MediaPlayerPrivateGStreamer>, MediaPlayerPrivateGStreamer::TrackType, gint index, GRefPtr<GstStream>); > #endif > void notifyTrackOfActiveChanged(); > void notifyTrackOfTagsChanged(); >@@ -101,6 +91,8 @@ private: > TrackPrivateBase* m_owner; > Lock m_tagMutex; > GRefPtr<GstTagList> m_tags; >+ WeakPtr<MediaPlayerPrivateGStreamer> m_player; >+ MediaPlayerPrivateGStreamer::TrackType m_trackType; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp >index 4d99786e0120017081fc24e2f8928bd46512c497..d194ceccb4d65a9472c49b322a11dde80b87b8b6 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp >@@ -29,14 +29,10 @@ > > #include "VideoTrackPrivateGStreamer.h" > >-#include "MediaPlayerPrivateGStreamer.h" >-#include <glib-object.h> >- > namespace WebCore { > > VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer(WeakPtr<MediaPlayerPrivateGStreamer> player, gint index, GRefPtr<GstPad> pad) >- : TrackPrivateBaseGStreamer(this, index, pad) >- , m_player(player) >+ : TrackPrivateBaseGStreamer(this, player, MediaPlayerPrivateGStreamer::TrackType::Video, index, pad) > { > // FIXME: Get a real ID from the tkhd atom. > m_id = "V" + String::number(index); >@@ -45,8 +41,7 @@ VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer(WeakPtr<MediaPlayerPrivat > > #if GST_CHECK_VERSION(1, 10, 0) > VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer(WeakPtr<MediaPlayerPrivateGStreamer> player, gint index, GRefPtr<GstStream> stream) >- : TrackPrivateBaseGStreamer(this, index, stream) >- , m_player(player) >+ : TrackPrivateBaseGStreamer(this, player, MediaPlayerPrivateGStreamer::TrackType::Video, index, stream) > { > gint kind; > auto tags = gst_stream_get_tags(m_stream.get()); >@@ -70,12 +65,6 @@ VideoTrackPrivate::Kind VideoTrackPrivateGStreamer::kind() const > } > #endif > >-void VideoTrackPrivateGStreamer::disconnect() >-{ >- m_player = nullptr; >- TrackPrivateBaseGStreamer::disconnect(); >-} >- > void VideoTrackPrivateGStreamer::markAsActive() > { > VideoTrackPrivate::setSelected(true); >@@ -86,9 +75,7 @@ void VideoTrackPrivateGStreamer::setSelected(bool selected) > if (selected == this->selected()) > return; > VideoTrackPrivate::setSelected(selected); >- >- if (selected && m_player) >- m_player->enableTrack(TrackPrivateBaseGStreamer::TrackType::Video, m_index); >+ TrackPrivateBaseGStreamer::setTrackEnabled(selected); > } > > } // namespace WebCore >diff --git a/Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h b/Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h >index 74ba71762001d052046d9294ecc5cf1545628703..2675de8718cd21c2036dafdc53851dd0b35c7b86 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h >+++ b/Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h >@@ -27,15 +27,9 @@ > > #if ENABLE(VIDEO) && USE(GSTREAMER) && ENABLE(VIDEO_TRACK) > >-#include "GStreamerCommon.h" > #include "TrackPrivateBaseGStreamer.h" >-#include "VideoTrackPrivate.h" >- >-#include <gst/gst.h> >-#include <wtf/WeakPtr.h> > > namespace WebCore { >-class MediaPlayerPrivateGStreamer; > > class VideoTrackPrivateGStreamer final : public VideoTrackPrivate, public TrackPrivateBaseGStreamer { > public: >@@ -51,8 +45,6 @@ public: > Kind kind() const final; > #endif > >- void disconnect() override; >- > void markAsActive(); > void setSelected(bool) override; > void setActive(bool enabled) override { setSelected(enabled); } >@@ -69,7 +61,6 @@ private: > VideoTrackPrivateGStreamer(WeakPtr<MediaPlayerPrivateGStreamer>, gint index, GRefPtr<GstStream>); > #endif > AtomicString m_id; >- WeakPtr<MediaPlayerPrivateGStreamer> m_player; > }; > > } // namespace WebCore >diff --git a/LayoutTests/platform/gtk/TestExpectations b/LayoutTests/platform/gtk/TestExpectations >index c73aef78b2867533f52a1486a4f70988bec6341c..e888ac1ca80c2427e3ed8ccb66f65eb79766510d 100644 >--- a/LayoutTests/platform/gtk/TestExpectations >+++ b/LayoutTests/platform/gtk/TestExpectations >@@ -1589,7 +1589,7 @@ webkit.org/b/132271 media/controls-strict.html [ ImageOnlyFailure Timeout Pass ] > webkit.org/b/132271 media/media-controls-timeline-updates.html [ Timeout Pass ] > webkit.org/b/132271 media/media-controller-playbackrate.html [ Timeout Pass Crash ] > webkit.org/b/132271 media/media-controller-time-clamp.html [ Timeout Pass ] >-webkit.org/b/132271 media/track/add-and-remove-track.html [ Timeout Pass ] >+#webkit.org/b/132271 media/track/add-and-remove-track.html [ Timeout Pass ] > webkit.org/b/132271 media/controls-without-preload.html [ Failure Timeout Pass ] > webkit.org/b/145251 media/controls-right-click-on-timebar.html [ Timeout Pass Failure Crash ] > >@@ -1627,7 +1627,7 @@ webkit.org/b/36642 fast/replaced/border-radius-clip.html [ Failure Pass Crash ] > webkit.org/b/134573 media/track/audio-track.html [ Failure Timeout Pass ] > webkit.org/b/134576 media/track/audio/audio-track-mkv-vorbis-language.html [ Failure Timeout Pass ] > webkit.org/b/134576 media/track/track-cue-rendering.html [ Failure Timeout Pass ] >-webkit.org/b/134576 media/track/video/video-track-mkv-theora-selected.html [ Failure Timeout Pass ] >+#webkit.org/b/134576 media/track/video/video-track-mkv-theora-selected.html [ Failure Timeout Pass ] > webkit.org/b/134576 media/track/video/video-track-mkv-theora-language.html [ Failure Timeout Pass ] > webkit.org/b/134577 svg/dom/svg-root-lengths.html [ Failure Timeout Pass ] > webkit.org/b/103383 fast/css/counters/element-removal-crash.xhtml [ Failure Pass ]
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 129774
:
225947
|
242176
|
242201
|
242212
|
242231
|
334743
|
334807
|
334808
|
342928
|
342938
|
378060
|
378061
|
378062
|
378063
|
378066