Title: [276751] releases/WebKitGTK/webkit-2.32
Revision
276751
Author
[email protected]
Date
2021-04-29 00:23:21 -0700 (Thu, 29 Apr 2021)

Log Message

Merge r275755 - [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: releases/WebKitGTK/webkit-2.32/LayoutTests/ChangeLog (276750 => 276751)


--- releases/WebKitGTK/webkit-2.32/LayoutTests/ChangeLog	2021-04-29 07:23:13 UTC (rev 276750)
+++ releases/WebKitGTK/webkit-2.32/LayoutTests/ChangeLog	2021-04-29 07:23:21 UTC (rev 276751)
@@ -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-02  Philippe Normand  <[email protected]>
 
         REGRESSION(r268176): [GStreamer] media/video-orientation-canvas.html fails

Modified: releases/WebKitGTK/webkit-2.32/Source/WebCore/ChangeLog (276750 => 276751)


--- releases/WebKitGTK/webkit-2.32/Source/WebCore/ChangeLog	2021-04-29 07:23:13 UTC (rev 276750)
+++ releases/WebKitGTK/webkit-2.32/Source/WebCore/ChangeLog	2021-04-29 07:23:21 UTC (rev 276751)
@@ -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-02  Philippe Normand  <[email protected]>
 
         REGRESSION(r268176): [GStreamer] media/video-orientation-canvas.html fails

Modified: releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (276750 => 276751)


--- releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2021-04-29 07:23:13 UTC (rev 276750)
+++ releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2021-04-29 07:23:21 UTC (rev 276751)
@@ -3178,10 +3178,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));
     }
 
@@ -3270,7 +3273,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