From 9062658bc778592c45cc84a94e1e68375a5468c8 Mon Sep 17 00:00:00 2001 From: Julien Isorce Date: Sun, 13 Apr 2014 00:21:00 +0100 Subject: [PATCH] gl/color: restore viewport dimensions when fbo done Regression introduced by 95abfda1399bcddbee345d4542e857d743965477. It caused to display the wrong frame size when resizing the window. --- gst-libs/gst/gl/gstglcolorconvert.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gst-libs/gst/gl/gstglcolorconvert.c b/gst-libs/gst/gl/gstglcolorconvert.c index 26d28d66c1..220b3f98f0 100644 --- a/gst-libs/gst/gl/gstglcolorconvert.c +++ b/gst-libs/gst/gl/gstglcolorconvert.c @@ -1257,6 +1257,8 @@ _do_convert_draw (GstGLContext * context, GstGLColorConvert * convert) guint out_width, out_height; gint i; + GLint viewport_dim[4]; + const GLfloat vVertices[] = { 1.0f, -1.0f, 0.0f, 1.0f, 0.0f, -1.0f, -1.0f, 0.0f, @@ -1303,6 +1305,8 @@ _do_convert_draw (GstGLContext * context, GstGLColorConvert * convert) else if (gl->DrawBuffer) gl->DrawBuffer (GL_COLOR_ATTACHMENT0); + gl->GetIntegerv (GL_VIEWPORT, viewport_dim); + gl->Viewport (0, 0, out_width, out_height); gl->ClearColor (0.0, 0.0, 0.0, 0.0); @@ -1344,6 +1348,9 @@ _do_convert_draw (GstGLContext * context, GstGLColorConvert * convert) /* we are done with the shader */ gst_gl_context_clear_shader (context); + gl->Viewport (viewport_dim[0], viewport_dim[1], viewport_dim[2], + viewport_dim[3]); + gst_gl_context_check_framebuffer_status (context); gl->BindFramebuffer (GL_FRAMEBUFFER, 0);