Skip to content
Permalink
Browse files
[GStreamer] fast/canvas/canvas-createPattern-video-loading.html is fa…
…iling since r218170

https://bugs.webkit.org/show_bug.cgi?id=173410

Patch by Philippe Normand <pnormand@igalia.com> 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.

Canonical link: https://commits.webkit.org/236333@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275755 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
philn authored and webkit-commit-queue committed Apr 9, 2021
1 parent 5cb4577 commit cea6d9dfcc40f3cde9c8c00e4979a8ba22f5be3d
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 6 deletions.
@@ -1,3 +1,12 @@
2021-04-09 Philippe Normand <pnormand@igalia.com>

[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 <graouts@webkit.org>

[ Mac WK2 ] compositing/animation/keyframe-order.html is a flakey image failure
@@ -2212,8 +2212,6 @@ webkit.org/b/172811 fast/forms/number/number-appearance-rtl.html [ Failure ]
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 ]
@@ -1,3 +1,20 @@
2021-04-09 Philippe Normand <pnormand@igalia.com>

[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 <zsun@igalia.com>

[css-grid] Fix min/max widths of grid affected by ancestor
@@ -3160,10 +3160,13 @@ void MediaPlayerPrivateGStreamer::flushCurrentBuffer()
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 @@ void MediaPlayerPrivateGStreamer::paint(GraphicsContext& context, const FloatRec
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)

0 comments on commit cea6d9d

Please sign in to comment.