WebKit Bugzilla
Attachment 342415 Details for
Bug 186481
: [GStreamer] flush video sample upon DRAIN query
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186481-20180611112641.patch (text/plain), 3.62 KB, created by
Philippe Normand
on 2018-06-11 03:26:42 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Philippe Normand
Created:
2018-06-11 03:26:42 PDT
Size:
3.62 KB
patch
obsolete
>Subversion Revision: 232699 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index b789dadbb8f59e04b4f642346430e60b422c3b21..d319a30b5068189f5603d722db11855d73870239 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2018-06-11 Philippe Normand <philn@igalia.com> >+ >+ [GStreamer] flush video sample upon DRAIN query >+ https://bugs.webkit.org/show_bug.cgi?id=186481 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Use the appsink sink pad pad probe for both event and drain query >+ management. This patch is partially based on >+ https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/d3a336523d123119fe1dd53da5d9006c92cf078c >+ by Enrique Ocaña González <eocanha@igalia.com>. >+ >+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: >+ (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer): >+ (WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink): >+ > 2018-06-10 Carlos Garcia Campos <cgarcia@igalia.com> > > [GTK][WPE] Add API run run javascript from a WebKitWebView in an isolated world >diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp >index cfeb3e0b7074f9e5a1751e6b8324ae2c85e630e5..041105840aba7ac0a40adba9643226e65e2f3349 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp >@@ -890,7 +890,12 @@ void MediaPlayerPrivateGStreamerBase::flushCurrentBuffer() > { > GST_DEBUG_OBJECT(pipeline(), "Flushing video sample"); > auto sampleLocker = holdLock(m_sampleMutex); >- m_sample.clear(); >+ >+ // 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()); >@@ -1047,9 +1052,17 @@ GstElement* MediaPlayerPrivateGStreamerBase::createGLAppSink() > g_signal_connect(appsink, "new-preroll", G_CALLBACK(newPrerollCallback), this); > > GRefPtr<GstPad> pad = adoptGRef(gst_element_get_static_pad(appsink, "sink")); >- gst_pad_add_probe (pad.get(), GST_PAD_PROBE_TYPE_EVENT_FLUSH, [] (GstPad*, GstPadProbeInfo* info, gpointer userData) -> GstPadProbeReturn { >- if (GST_EVENT_TYPE (GST_PAD_PROBE_INFO_EVENT (info)) != GST_EVENT_FLUSH_START) >- return GST_PAD_PROBE_OK; >+ gst_pad_add_probe(pad.get(), static_cast<GstPadProbeType>(GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM | GST_PAD_PROBE_TYPE_EVENT_FLUSH), [] (GstPad*, GstPadProbeInfo* info, gpointer userData) -> GstPadProbeReturn { >+ if (info->type & GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM) { >+ if (GST_QUERY_TYPE(GST_PAD_PROBE_INFO_QUERY(info)) != GST_QUERY_DRAIN) >+ return GST_PAD_PROBE_OK; >+ GST_DEBUG("Acting upon DRAIN query"); >+ } >+ if (info->type & GST_PAD_PROBE_TYPE_EVENT_FLUSH) { >+ if (GST_EVENT_TYPE(GST_PAD_PROBE_INFO_EVENT(info)) != GST_EVENT_FLUSH_START) >+ return GST_PAD_PROBE_OK; >+ GST_DEBUG("Acting upon flush-start event"); >+ } > > auto* player = static_cast<MediaPlayerPrivateGStreamerBase*>(userData); > player->flushCurrentBuffer();
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
Flags:
calvaris
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186481
: 342415 |
342435