[284/906] workaround about the ATI shader compiler on linux (setlocale)

This commit is contained in:
Julien Isorce 2008-11-29 22:16:44 +01:00 committed by Tim-Philipp Müller
parent 1087da7753
commit 0867343017
2 changed files with 18 additions and 29 deletions

View file

@ -258,7 +258,7 @@ gst_gl_display_init (GstGLDisplay *display, GstGLDisplayClass *klass)
" y=1.1643*(y-0.0625);\n" " y=1.1643*(y-0.0625);\n"
" u=u-0.5;\n" " u=u-0.5;\n"
" v=v-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" " g=clamp(y-0.39173*u-0.81290*v, 0, 1);\n"
" b=clamp(y+2.017*u, 0, 1);\n" " b=clamp(y+2.017*u, 0, 1);\n"
" gl_FragColor=vec4(r,g,b,1.0);\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); glDeleteTextures (1, &display->upload_intex);
display->upload_intex = 0; display->upload_intex = 0;
} }
if (display->upload_intex_v != 0) if (display->upload_intex_u != 0)
{ {
glDeleteTextures (1, &display->upload_intex_v); glDeleteTextures (1, &display->upload_intex_u);
display->upload_intex = 0; display->upload_intex_u = 0;
} }
if (display->upload_intex_v != 0) if (display->upload_intex_v != 0)
{ {
glDeleteTextures (1, &display->upload_intex_v); glDeleteTextures (1, &display->upload_intex_v);
display->upload_intex = 0; display->upload_intex_v = 0;
} }
GST_INFO ("Cleaning texture pool"); GST_INFO ("Cleaning texture pool");
@ -2201,22 +2201,15 @@ gst_gl_display_thread_do_upload_fill (GstGLDisplay *display)
offsetV = 2; offsetV = 2;
break; break;
case GST_VIDEO_FORMAT_YV12: case GST_VIDEO_FORMAT_YV12:
//WIN32
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) #if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__)
//WIN32
offsetU = 2; offsetU = 2;
offsetV = 1; offsetV = 1;
//LINUX
#else #else
if (g_ascii_strncasecmp ("ATI", (gchar *) glGetString (GL_VENDOR), 3) == 0) //LINUX
{
offsetU = 2;
offsetV = 1;
}
else
{
offsetU = 1; offsetU = 1;
offsetV = 2; offsetV = 2;
}
#endif #endif
break; break;
default: default:
@ -2661,22 +2654,14 @@ gst_gl_display_thread_do_download_draw_yuv (GstGLDisplay *display)
offsetV = 2; offsetV = 2;
break; break;
case GST_VIDEO_FORMAT_YV12: case GST_VIDEO_FORMAT_YV12:
//WIN32
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) #if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__)
//WIN32
offsetU = 2; offsetU = 2;
offsetV = 1; offsetV = 1;
//LINUX
#else #else
if (g_ascii_strncasecmp ("ATI", (gchar *) glGetString (GL_VENDOR), 3) == 0) //LINUX
{
offsetU = 2;
offsetV = 1;
}
else
{
offsetU = 1; offsetU = 1;
offsetV = 2; offsetV = 2;
}
#endif #endif
break; break;
default: default:

View file

@ -24,6 +24,8 @@
#include "gstglwindow.h" #include "gstglwindow.h"
#include <locale.h>
#include <GL/glx.h> #include <GL/glx.h>
#define GST_GL_WINDOW_GET_PRIVATE(o) \ #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 x = 0;
static gint y = 0; static gint y = 0;
setlocale(LC_NUMERIC, "C");
priv->x_lock = g_mutex_new (); priv->x_lock = g_mutex_new ();
priv->cond_send_message = g_cond_new (); priv->cond_send_message = g_cond_new ();
priv->running = TRUE; priv->running = TRUE;