Title: [275755] trunk
Revision
275755
Author
[email protected]
Date
2021-04-09 02:29:51 -0700 (Fri, 09 Apr 2021)

Log Message

[GStreamer] fast/canvas/canvas-createPattern-video-loading.html is failing since r218170
https://bugs.webkit.org/show_bug.cgi?id=173410

Patch by Philippe Normand <[email protected]> on 2021-04-09
Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

When a flush has been requested by the GL video sink, allocate a new copy of the sample
which has to be released. The copy is necessary so that the video dimensions can still be
fetched and also for canvas rendering. The release is necessary because the sample might
have been allocated by a hardware decoder and memory might have to be reclaimed by a
non-sysmem buffer pool.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::flushCurrentBuffer):
(WebCore::MediaPlayerPrivateGStreamer::paint):

LayoutTests:

* platform/gtk/TestExpectations: Unflag now-passing test.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (275754 => 275755)


--- trunk/LayoutTests/ChangeLog	2021-04-09 09:17:59 UTC (rev 275754)
+++ trunk/LayoutTests/ChangeLog	2021-04-09 09:29:51 UTC (rev 275755)
@@ -1,3 +1,12 @@
+2021-04-09  Philippe Normand  <[email protected]>
+
+        [GStreamer] fast/canvas/canvas-createPattern-video-loading.html is failing since r218170
+        https://bugs.webkit.org/show_bug.cgi?id=173410
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        * platform/gtk/TestExpectations: Unflag now-passing test.
+
 2021-04-09  Antoine Quint  <[email protected]>
 
         [ Mac WK2 ] compositing/animation/keyframe-order.html is a flakey image failure

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (275754 => 275755)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2021-04-09 09:17:59 UTC (rev 275754)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2021-04-09 09:29:51 UTC (rev 275755)
@@ -2212,8 +2212,6 @@
 webkit.org/b/172811 fast/forms/number/number-appearance-spinbutton-disabled-readonly.html [ Failure ]
 webkit.org/b/172811 fast/forms/number/number-appearance-spinbutton-layer.html [ Failure ]
 
-webkit.org/b/173410 fast/canvas/canvas-createPattern-video-loading.html [ Failure ]
-
 webkit.org/b/173413 imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/selection-after-content-change.html [ Failure ]
 
 webkit.org/b/143702 media/progress-events-generated-correctly.html [ Timeout Failure Pass Crash ]

Modified: trunk/Source/WebCore/ChangeLog (275754 => 275755)


--- trunk/Source/WebCore/ChangeLog	2021-04-09 09:17:59 UTC (rev 275754)
+++ trunk/Source/WebCore/ChangeLog	2021-04-09 09:29:51 UTC (rev 275755)
@@ -1,3 +1,20 @@
+2021-04-09  Philippe Normand  <[email protected]>
+
+        [GStreamer] fast/canvas/canvas-createPattern-video-loading.html is failing since r218170
+        https://bugs.webkit.org/show_bug.cgi?id=173410
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        When a flush has been requested by the GL video sink, allocate a new copy of the sample
+        which has to be released. The copy is necessary so that the video dimensions can still be
+        fetched and also for canvas rendering. The release is necessary because the sample might
+        have been allocated by a hardware decoder and memory might have to be reclaimed by a
+        non-sysmem buffer pool.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::flushCurrentBuffer):
+        (WebCore::MediaPlayerPrivateGStreamer::paint):
+
 2021-04-09  Ziran Sun  <[email protected]>
 
         [css-grid] Fix min/max widths of grid affected by ancestor

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (275754 => 275755)


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2021-04-09 09:17:59 UTC (rev 275754)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2021-04-09 09:29:51 UTC (rev 275755)
@@ -3160,10 +3160,13 @@
     auto sampleLocker = holdLock(m_sampleMutex);
 
     if (m_sample) {
-        // 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.
+        // Allocate a new copy of the sample which has to be released. The copy is necessary so that
+        // the video dimensions can still be fetched and also for canvas rendering. The release is
+        // necessary because the sample might have been allocated by a hardware decoder and memory
+        // might have to be reclaimed by a non-sysmem buffer pool.
         const GstStructure* info = gst_sample_get_info(m_sample.get());
-        m_sample = adoptGRef(gst_sample_new(nullptr, gst_sample_get_caps(m_sample.get()),
+        auto buffer = adoptGRef(gst_buffer_copy_deep(gst_sample_get_buffer(m_sample.get())));
+        m_sample = adoptGRef(gst_sample_new(buffer.get(), gst_sample_get_caps(m_sample.get()),
             gst_sample_get_segment(m_sample.get()), info ? gst_structure_copy(info) : nullptr));
     }
 
@@ -3252,7 +3255,7 @@
     if (!gstImage)
         return;
 
-    context.drawImage(gstImage->image(), rect, gstImage->rect(), { CompositeOperator::Copy, m_canRenderingBeAccelerated ? m_videoSourceOrientation : ImageOrientation() });
+    context.drawImage(gstImage->image(), rect, gstImage->rect(), { CompositeOperator::Copy, m_shouldHandleOrientationTags ? m_videoSourceOrientation : ImageOrientation() });
 }
 
 #if USE(GSTREAMER_GL)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to