[787/906] gl: The GLSL rectangle resampler does not always work with int tex coords
authorTonu Jaansoo <chain@bsd.ee>
Wed, 7 Aug 2013 09:42:46 +0000 (11:42 +0200)
committerMatthew Waters <ystreet00@gmail.com>
Sat, 15 Mar 2014 17:37:00 +0000 (18:37 +0100)
Use floats instead.

gst-libs/gst/gl/gstglfilter.c
gst-libs/gst/gl/gstglupload.c
gst/gl/gstgldeinterlace.c
gst/gl/gstgleffects.c
gst/gl/gstglimagesink.c

index 65a4796..b6743dc 100644 (file)
@@ -1168,12 +1168,12 @@ gst_gl_filter_draw_texture (GstGLFilter * filter, GLuint texture,
 {
   GstGLFuncs *gl = filter->display->gl_vtable;
 
-  gfloat verts[] = { -1.0f, -1.0f,
+  GLfloat verts[] = { -1.0f, -1.0f,
     1.0f, -1.0f,
     1.0f, 1.0f,
     -1.0f, 1.0f
   };
-  gint texcoords[] = { 0, 0,
+  GLfloat texcoords[] = { 0, 0,
     width, 0,
     width, height,
     0, height
@@ -1191,7 +1191,7 @@ gst_gl_filter_draw_texture (GstGLFilter * filter, GLuint texture,
   gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);
 
   gl->VertexPointer (2, GL_FLOAT, 0, &verts);
-  gl->TexCoordPointer (2, GL_INT, 0, &texcoords);
+  gl->TexCoordPointer (2, GL_FLOAT, 0, &texcoords);
 
   gl->DrawArrays (GL_TRIANGLE_FAN, 0, 4);
 
index 5c220c5..bf41f23 100644 (file)
@@ -1207,12 +1207,12 @@ _do_upload_draw_opengl (GstGLDisplay * display, GstGLUpload * upload)
   gint i;
   gfloat tex_scaling[6] = { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 };
 
-  gfloat verts[8] = { 1.0f, -1.0f,
+  GLfloat verts[8] = { 1.0f, -1.0f,
     -1.0f, -1.0f,
     -1.0f, 1.0f,
     1.0f, 1.0f
   };
-  gint texcoords[8] = { in_width, 0,
+  GLfloat texcoords[8] = { in_width, 0,
     0, 0,
     0, in_height,
     in_width, in_height
@@ -1337,7 +1337,7 @@ _do_upload_draw_opengl (GstGLDisplay * display, GstGLUpload * upload)
   gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);
 
   gl->VertexPointer (2, GL_FLOAT, 0, &verts);
-  gl->TexCoordPointer (2, GL_INT, 0, &texcoords);
+  gl->TexCoordPointer (2, GL_FLOAT, 0, &texcoords);
 
   gl->DrawArrays (GL_TRIANGLE_FAN, 0, 4);
 
index 26820f8..6edd177 100644 (file)
@@ -267,17 +267,17 @@ gst_gl_deinterlace_callback (gint width, gint height, guint texture,
   GstGLFuncs *gl = filter->display->gl_vtable;
   guint temp;
 
-  gfloat verts[] = { -1.0, -1.0,
+  GLfloat verts[] = { -1.0, -1.0,
     1.0, -1.0,
     1.0, 1.0,
     -1.0, 1.0
   };
-  gint texcoords0[] = { 0, 0,
+  GLfloat texcoords0[] = { 0, 0,
     width, 0,
     width, height,
     0, height
   };
-  gint texcoords1[] = { 0, 0,
+  GLfloat texcoords1[] = { 0, 0,
     width, 0,
     width, height,
     0, height
@@ -324,7 +324,7 @@ gst_gl_deinterlace_callback (gint width, gint height, guint texture,
   gl->EnableClientState (GL_VERTEX_ARRAY);
 
   gl->VertexPointer (2, GL_FLOAT, 0, &verts);
-  gl->TexCoordPointer (2, GL_INT, 0, &texcoords0);
+  gl->TexCoordPointer (2, GL_FLOAT, 0, &texcoords0);
 
   gl->ClientActiveTexture (GL_TEXTURE1);
   gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);
index 4f6582c..6649b71 100644 (file)
@@ -280,12 +280,12 @@ gst_gl_effects_draw_texture (GstGLEffects * effects, GLuint tex, guint width,
 
 #if GST_GL_HAVE_OPENGL
   if (gst_gl_display_get_gl_api (display) & GST_GL_API_OPENGL) {
-    gfloat verts[] = { -1.0f, -1.0f,
+    GLfloat verts[] = { -1.0f, -1.0f,
       1.0f, -1.0f,
       1.0f, 1.0f,
       -1.0f, 1.0f
     };
-    gint texcoords[] = { 0, 0,
+    GLfloat texcoords[] = { 0, 0,
       width, 0,
       width, height,
       0, height
@@ -300,7 +300,7 @@ gst_gl_effects_draw_texture (GstGLEffects * effects, GLuint tex, guint width,
     gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);
 
     gl->VertexPointer (2, GL_FLOAT, 0, &verts);
-    gl->TexCoordPointer (2, GL_INT, 0, &texcoords);
+    gl->TexCoordPointer (2, GL_FLOAT, 0, &texcoords);
 
     gl->DrawArrays (GL_TRIANGLE_FAN, 0, 4);
 
index 40e0ec0..3cae93e 100644 (file)
@@ -977,12 +977,12 @@ gst_glimage_sink_on_draw (GstGLImageSink * gl_sink)
   else {
 #if GST_GL_HAVE_OPENGL
     if (USING_OPENGL (gl_sink->display)) {
-      gfloat verts[8] = { 1.0f, 1.0f,
+      GLfloat verts[8] = { 1.0f, 1.0f,
         -1.0f, 1.0f,
         -1.0f, -1.0f,
         1.0f, -1.0f
       };
-      gint texcoords[8] = { gl_sink->redisplay_texture_width, 0,
+      GLfloat texcoords[8] = { gl_sink->redisplay_texture_width, 0,
         0, 0,
         0, gl_sink->redisplay_texture_height,
         gl_sink->redisplay_texture_width,
@@ -999,7 +999,7 @@ gst_glimage_sink_on_draw (GstGLImageSink * gl_sink)
       gl->EnableClientState (GL_VERTEX_ARRAY);
       gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);
       gl->VertexPointer (2, GL_FLOAT, 0, &verts);
-      gl->TexCoordPointer (2, GL_INT, 0, &texcoords);
+      gl->TexCoordPointer (2, GL_FLOAT, 0, &texcoords);
 
       gl->DrawArrays (GL_TRIANGLE_FAN, 0, 4);