<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - [GStreamer] A video element isn't drawn onto the canvas."
href="https://bugs.webkit.org/show_bug.cgi?id=132671#c26">Comment # 26</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [GStreamer] A video element isn't drawn onto the canvas."
href="https://bugs.webkit.org/show_bug.cgi?id=132671">bug 132671</a>
from <span class="vcard"><a class="email" href="mailto:cgarcia@igalia.com" title="Carlos Garcia Campos <cgarcia@igalia.com>"> <span class="fn">Carlos Garcia Campos</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=249918&action=diff" name="attach_249918" title="patch">attachment 249918</a> <a href="attachment.cgi?id=249918&action=edit" title="patch">[details]</a></span>
patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=249918&action=review">https://bugs.webkit.org/attachment.cgi?id=249918&action=review</a>
<span class="quote">> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:83
> +#if USE(CAIRO)
> +#include <cairo-gl.h>
> +#endif</span >
We can compile with cairo, but without cairo gl. We should expose those to the build somehow, or use ENABLE(ACCELERATED_2D_CANVAS) && USE(CAIRO)
<span class="quote">> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:579
> +PassNativeImagePtr MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime()
> +{
> +#if !USE(GSTREAMER_GL)
> + return nullptr;
> +#endif</span >
This function is called inside a #if USE(GSTREAMER_GL) block, right? I think we could just defined it only in such case
<span class="quote">> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:595
> + if (!GST_IS_SAMPLE(m_sample.get()))
> + return nullptr;
> +
> + GstCaps* caps = gst_sample_get_caps(m_sample.get());
> + if (!caps)
> + return nullptr;
> +
> + GstVideoInfo videoInfo;
> + gst_video_info_init(&videoInfo);
> + if (!gst_video_info_from_caps(&videoInfo, caps))
> + return nullptr;</span >
It seems to me this code is duplicated in several places already, maybe we could move it to a helper function, something like bool getSampleVideoInfo(GstSmaple* sample, GstVideoInfo& videoInfo);
<span class="quote">> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:602
> +#if USE(CAIRO)</span >
Do we need previous stuff (gst_video_frame_map) when not using cairo?
<span class="quote">> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:604
> + GLContext::sharingContext()->makeContextCurrent();
> + GLContext* context = GLContext::sharingContext();</span >
Why getting the sharing context twice? Can we get the context first and then calling context->makeContextCurrent() ?
<span class="quote">> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:611
> + FloatSize size = FloatSize(GST_VIDEO_INFO_WIDTH(&videoInfo), GST_VIDEO_INFO_HEIGHT(&videoInfo));</span >
Why FloatSize? cairo expects integers</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>