[284/906] workaround about the ATI shader compiler on linux (setlocale)
authorJulien Isorce <julien.isorce@gmail.com>
Sat, 29 Nov 2008 21:16:44 +0000 (22:16 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:31:20 +0000 (19:31 +0000)
gst-libs/gst/gl/gstgldisplay.c
gst-libs/gst/gl/gstglwindow_x11.c

index 5007326..b0afacb 100644 (file)
@@ -258,7 +258,7 @@ gst_gl_display_init (GstGLDisplay *display, GstGLDisplayClass *klass)
     "  y=1.1643*(y-0.0625);\n"
     "  u=u-0.5;\n"
     "  v=v-0.5;\n"
-    "  r=clamp(y+1.5958*v+0.8, 0, 1);\n"
+    "  r=clamp(y+1.5958*v, 0, 1);\n"
     "  g=clamp(y-0.39173*u-0.81290*v, 0, 1);\n"
     "  b=clamp(y+2.017*u, 0, 1);\n"
     "  gl_FragColor=vec4(r,g,b,1.0);\n"
@@ -584,15 +584,15 @@ gst_gl_display_thread_destroy_context (GstGLDisplay *display)
     glDeleteTextures (1, &display->upload_intex);
     display->upload_intex = 0;
   }
-  if (display->upload_intex_v != 0)
+  if (display->upload_intex_u != 0)
   {
-    glDeleteTextures (1, &display->upload_intex_v);
-    display->upload_intex = 0;
+    glDeleteTextures (1, &display->upload_intex_u);
+    display->upload_intex_u = 0;
   }
   if (display->upload_intex_v != 0)
   {
     glDeleteTextures (1, &display->upload_intex_v);
-    display->upload_intex = 0;
+    display->upload_intex_v = 0;
   }
 
   GST_INFO ("Cleaning texture pool");
@@ -2201,22 +2201,15 @@ gst_gl_display_thread_do_upload_fill (GstGLDisplay *display)
       offsetV = 2;
       break;
     case GST_VIDEO_FORMAT_YV12:
-      //WIN32
+
 #if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__)
+      //WIN32
       offsetU = 2;
       offsetV = 1;
-      //LINUX
 #else
-      if (g_ascii_strncasecmp ("ATI", (gchar *) glGetString (GL_VENDOR), 3) == 0)
-      {
-        offsetU = 2;
-        offsetV = 1;
-      }
-      else
-      {
-        offsetU = 1;
-        offsetV = 2;
-      }
+      //LINUX
+      offsetU = 1;
+      offsetV = 2;
 #endif
       break;
     default:
@@ -2661,22 +2654,14 @@ gst_gl_display_thread_do_download_draw_yuv (GstGLDisplay *display)
       offsetV = 2;
       break;
     case GST_VIDEO_FORMAT_YV12:
-      //WIN32
 #if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__)
+      //WIN32
       offsetU = 2;
       offsetV = 1;
-      //LINUX
 #else
-      if (g_ascii_strncasecmp ("ATI", (gchar *) glGetString (GL_VENDOR), 3) == 0)
-      {
-        offsetU = 2;
-        offsetV = 1;
-      }
-      else
-      {
-        offsetU = 1;
-        offsetV = 2;
-      }
+      //LINUX
+      offsetU = 1;
+      offsetV = 2;
 #endif
       break;
     default:
index d9be57e..9c5af6a 100644 (file)
@@ -24,6 +24,8 @@
 
 #include "gstglwindow.h"
 
+#include <locale.h>
+
 #include <GL/glx.h>
 
 #define GST_GL_WINDOW_GET_PRIVATE(o)  \
@@ -276,6 +278,8 @@ gst_gl_window_new (gint width, gint height)
   static gint x = 0;
   static gint y = 0;
 
+  setlocale(LC_NUMERIC, "C");
+
   priv->x_lock = g_mutex_new ();
   priv->cond_send_message = g_cond_new ();
   priv->running = TRUE;