Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp (206368 => 206369)
--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp 2016-09-26 07:26:59 UTC (rev 206368)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp 2016-09-26 10:20:48 UTC (rev 206369)
@@ -716,7 +716,7 @@
}
// This should be called with the sample mutex locked.
-bool MediaPlayerPrivateGStreamerBase::paintToCairoSurface(cairo_surface_t* outputSurface, cairo_device_t* device, GstVideoInfo& videoInfo, const IntSize& size, const IntSize& rotatedSize)
+bool MediaPlayerPrivateGStreamerBase::paintToCairoSurface(cairo_surface_t* outputSurface, cairo_device_t* device, GstVideoInfo& videoInfo, const IntSize& size, const IntSize& rotatedSize, bool flipY)
{
GstBuffer* buffer = gst_sample_get_buffer(m_sample.get());
GstVideoFrame videoFrame;
@@ -749,6 +749,12 @@
ASSERT_NOT_REACHED();
break;
}
+
+ if (flipY) {
+ cairo_scale(cr.get(), 1.0f, -1.0f);
+ cairo_translate(cr.get(), 0.0f, -size.height());
+ }
+
cairo_set_source_surface(cr.get(), surface.get(), 0, 0);
cairo_set_operator(cr.get(), CAIRO_OPERATOR_SOURCE);
cairo_paint(cr.get());
@@ -767,7 +773,7 @@
if (m_usingFallbackVideoSink)
return false;
- if (flipY || premultiplyAlpha)
+ if (premultiplyAlpha)
return false;
GstVideoInfo videoInfo;
@@ -787,7 +793,7 @@
context->getTexParameteriv(outputTarget, GL_TEXTURE_MAG_FILTER, &magFilter);
RefPtr<cairo_surface_t> outputSurface = adoptRef(cairo_gl_surface_create_for_texture(glContext->cairoDevice(), CAIRO_CONTENT_COLOR_ALPHA, outputTexture, rotatedSize.width(), rotatedSize.height()));
- if (!paintToCairoSurface(outputSurface.get(), glContext->cairoDevice(), videoInfo, size, rotatedSize))
+ if (!paintToCairoSurface(outputSurface.get(), glContext->cairoDevice(), videoInfo, size, rotatedSize, flipY))
return false;
context->bindTexture(outputTarget, outputTexture);
@@ -811,7 +817,7 @@
return nullptr;
RefPtr<cairo_surface_t> rotatedSurface = adoptRef(cairo_gl_surface_create(context->cairoDevice(), CAIRO_CONTENT_COLOR_ALPHA, rotatedSize.width(), rotatedSize.height()));
- if (!paintToCairoSurface(rotatedSurface.get(), context->cairoDevice(), videoInfo, size, rotatedSize))
+ if (!paintToCairoSurface(rotatedSurface.get(), context->cairoDevice(), videoInfo, size, rotatedSize, false))
return nullptr;
return rotatedSurface;
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h (206368 => 206369)
--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h 2016-09-26 07:26:59 UTC (rev 206368)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h 2016-09-26 10:20:48 UTC (rev 206369)
@@ -133,7 +133,7 @@
GstElement* createGLAppSink();
GstElement* createVideoSinkGL();
GLContext* prepareContextForCairoPaint(GstVideoInfo&, IntSize&, IntSize&);
- bool paintToCairoSurface(cairo_surface_t*, cairo_device_t*, GstVideoInfo&, const IntSize&, const IntSize&);
+ bool paintToCairoSurface(cairo_surface_t*, cairo_device_t*, GstVideoInfo&, const IntSize&, const IntSize&, bool);
#endif
void setStreamVolumeElement(GstStreamVolume*);