diff --git a/gst-libs/gst/gl/gstgldisplay.c b/gst-libs/gst/gl/gstgldisplay.c index d73d7cf991..5b9cc9e22a 100644 --- a/gst-libs/gst/gl/gstgldisplay.c +++ b/gst-libs/gst/gl/gstgldisplay.c @@ -13,7 +13,7 @@ //------------------------------------------------------------ -//-------------------- Private déclarations ------------------ +//-------------------- Private d�clarations ------------------ //------------------------------------------------------------ static void gst_gl_display_finalize (GObject * object); static gpointer gst_gl_display_glutThreadFunc (GstGLDisplay* display); @@ -371,15 +371,19 @@ gst_gl_display_glutCreateWindow (GstGLDisplay *display) gint glutWinId = 0; GList *keys = NULL; gchar buffer[5]; - GLenum err = 0; + GLenum err = 0; //prepare opengl context - glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH); + glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH); glutInitWindowPosition(display->win_xpos, display->win_ypos); glutInitWindowSize(display->glcontext_width, display->glcontext_height); //create opengl context - sprintf_s(buffer, 5, "%d", glutWinId); +#if WIN32 + sprintf_s(buffer, 5, "%d", glutWinId); +#else + sprintf(buffer, "%d", glutWinId); +#endif display->title = g_string_append (display->title, buffer); glutWinId = glutCreateWindow (display->title->str, display->winId); @@ -388,27 +392,27 @@ gst_gl_display_glutCreateWindow (GstGLDisplay *display) else glutHideWindow (); - //Init glew + //Init glew err = glewInit(); if (err != GLEW_OK) - g_print ("Error: %s\n", glewGetErrorString(err)); - else - g_print ("Context %d, Using GLEW %s\n", glutWinId, glewGetString(GLEW_VERSION)); + g_print ("Error: %s\n", glewGetErrorString(err)); + else + g_print ("Context %d, Using GLEW %s\n", glutWinId, glewGetString(GLEW_VERSION)); if (GLEW_EXT_framebuffer_object) { g_print ("Context %d, EXT_framebuffer_object supported: yes\n", glutWinId); //-- init intput frame buffer object (video -> GL) - + //setup FBO glGenFramebuffersEXT (1, &display->fbo); glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, display->fbo); //setup the render buffer for depth glGenRenderbuffersEXT(1, &display->depthBuffer); - glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, display->depthBuffer); - glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, + glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, display->depthBuffer); + glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, display->textureFBOWidth, display->textureFBOHeight); //setup a texture to render to @@ -559,11 +563,18 @@ gst_gl_display_glutCreateWindow (GstGLDisplay *display) g_print ("Context %d, ARB_fragment_program supported: yes\n", glutWinId); //from video to texture - +#if WIN32 sprintf_s (program, 2048, display->textFProgram_YUY2_UYVY, 'r', 'g', 'a'); +#else + sprintf (program, display->textFProgram_YUY2_UYVY, 'r', 'g', 'a'); +#endif display->GLSLProgram_YUY2 = gst_gl_display_loadGLSLprogram (program); +#if WIN32 sprintf_s (program, 2048, display->textFProgram_YUY2_UYVY, 'a', 'b', 'r'); +#else + sprintf (program, display->textFProgram_YUY2_UYVY, 'a', 'b', 'r'); +#endif display->GLSLProgram_UYVY = gst_gl_display_loadGLSLprogram (program); display->GLSLProgram_I420_YV12 = gst_gl_display_loadGLSLprogram (display->textFProgram_I420_YV12); @@ -572,10 +583,10 @@ gst_gl_display_glutCreateWindow (GstGLDisplay *display) //from texture to video - sprintf_s (program, 2048, display->textFProgram_to_YUY2_UYVY, "y2,u,y1,v"); + sprintf (program, display->textFProgram_to_YUY2_UYVY, "y2,u,y1,v"); display->GLSLProgram_to_YUY2 = gst_gl_display_loadGLSLprogram (program); - sprintf_s (program, 2048, display->textFProgram_to_YUY2_UYVY, "v,y1,u,y2"); + sprintf (program, display->textFProgram_to_YUY2_UYVY, "v,y1,u,y2"); display->GLSLProgram_to_UYVY = gst_gl_display_loadGLSLprogram (program); display->GLSLProgram_to_I420_YV12 = gst_gl_display_loadGLSLprogram (display->textFProgram_to_I420_YV12); diff --git a/gst/gl/Makefile.am b/gst/gl/Makefile.am index 6938156fca..fd1ea5987a 100644 --- a/gst/gl/Makefile.am +++ b/gst/gl/Makefile.am @@ -6,8 +6,8 @@ AM_LIBS = $(GST_BASE_LIBS) libgstopengl_la_SOURCES = \ gstopengl.c \ - glimagesink.c \ - glimagesink.h \ + gstglimagesink.c \ + gstglimagesink.h \ gstglgraphicmaker.c \ gstglgraphicmaker.h \ gstglvideomaker.c \ @@ -21,6 +21,7 @@ libgstopengl_la_CFLAGS = $(GST_CFLAGS) $(X_CFLAGS) $(GST_BASE_CFLAGS) \ -I$(top_srcdir)/gst-libs/gst/freeglut \ -I$(top_srcdir)/gst-libs/gst/gl libgstopengl_la_LIBADD = \ + $(top_builddir)/gst-libs/gst/freeglut/libgstfreeglut-$(GST_MAJORMINOR).la \ $(top_builddir)/gst-libs/gst/gl/libgstgl-$(GST_MAJORMINOR).la \ $(GST_BASE_LIBS) \ $(GST_PLUGINS_BASE_LIBS) -lgstinterfaces-$(GST_MAJORMINOR) diff --git a/gst/gl/gstglgraphicmaker.c b/gst/gl/gstglgraphicmaker.c index 2a40906370..899096d453 100644 --- a/gst/gl/gstglgraphicmaker.c +++ b/gst/gl/gstglgraphicmaker.c @@ -196,7 +196,7 @@ gst_gl_graphicmaker_reset (GstGLGraphicmaker* graphicmaker) static gboolean gst_gl_graphicmaker_start (GstBaseTransform * bt) { - GstGLGraphicmaker* graphicmaker = GST_GL_GRAPHICMAKER (bt); + //GstGLGraphicmaker* graphicmaker = GST_GL_GRAPHICMAKER (bt); return TRUE; } diff --git a/gst/gl/gstglimagesink.c b/gst/gl/gstglimagesink.c index 75cc4f0680..4a1e8418a2 100644 --- a/gst/gl/gstglimagesink.c +++ b/gst/gl/gstglimagesink.c @@ -22,7 +22,7 @@ gst_glimage_sink_change_state (GstElement * element, GstStateChange transition); static void gst_glimage_sink_get_times (GstBaseSink * bsink, GstBuffer * buf, GstClockTime * start, GstClockTime * end); -static GstCaps *gst_glimage_sink_get_caps (GstBaseSink * bsink); +//static GstCaps *gst_glimage_sink_get_caps (GstBaseSink * bsink); static gboolean gst_glimage_sink_set_caps (GstBaseSink * bsink, GstCaps * caps); static GstFlowReturn gst_glimage_sink_render (GstBaseSink * bsink, GstBuffer * buf); diff --git a/gst/gl/gstglvideomaker.c b/gst/gl/gstglvideomaker.c index 9db292b910..6acc2932f7 100644 --- a/gst/gl/gstglvideomaker.c +++ b/gst/gl/gstglvideomaker.c @@ -142,7 +142,7 @@ gst_gl_videomaker_reset (GstGLVideomaker* videomaker) static gboolean gst_gl_videomaker_start (GstBaseTransform* bt) { - GstGLVideomaker* videomaker = GST_GL_VIDEOMAKER (bt); + //GstGLVideomaker* videomaker = GST_GL_VIDEOMAKER (bt); return TRUE; } diff --git a/gst/gl/gstglvideomaker.h b/gst/gl/gstglvideomaker.h index 1b0ec7d506..b9a6869f95 100644 --- a/gst/gl/gstglvideomaker.h +++ b/gst/gl/gstglvideomaker.h @@ -36,10 +36,6 @@ struct _GstGLVideomakerClass GstBaseTransformClass base_transform_class; }; -typedef struct _GstGLVideomaker GstGLVideomaker; -typedef struct _GstGLVideomakerClass GstGLVideomakerClass; - - GType gst_gl_videomaker_get_type (void); G_END_DECLS