glviewconvert: fix output when a transformation matrix is used
authorMatthew Waters <matthew@centricular.com>
Fri, 10 Aug 2018 12:44:12 +0000 (22:44 +1000)
committerMatthew Waters <matthew@centricular.com>
Fri, 10 Aug 2018 12:46:34 +0000 (22:46 +1000)
If we have a transformation matrix, we have no idea where in the output
the video is going to endup.  It might also be different and not cover
the entire output.

We need to clear the output to remove any previous data in the backing
texture.

Found from
https://stackoverflow.com/questions/51707229/python-gstreamer-for-dynamic-control-of-element-properties

gst-libs/gst/gl/gstglviewconvert.c

index d032c21..ae7bb1f 100644 (file)
@@ -1949,6 +1949,9 @@ _do_view_convert_draw (GstGLContext * context, GstGLViewConvert * viewconvert)
   gl->ActiveTexture (GL_TEXTURE0);
   gl->BindTexture (from_gl_target, priv->in_tex[0]->tex_id);
 
+  gl->ClearColor (0.0, 0.0, 0.0, 1.0);
+  gl->Clear (GL_COLOR_BUFFER_BIT);
+
   gl->DrawElements (GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, NULL);
 
   if (gl->BindVertexArray)