[066/906] up

git-svn-id: svn://svn.wobow.com/GStreamer_playground/gst-plugins-gl@430 93df14bb-0f41-7a43-8087-d3e2a2f0e464
This commit is contained in:
Julien Isorce 2008-05-18 19:18:04 +00:00 committed by Matthew Waters
parent 4511a3c0bd
commit f509c88675
6 changed files with 31 additions and 23 deletions

View file

@ -13,7 +13,7 @@
//------------------------------------------------------------
//-------------------- Private déclarations ------------------
//-------------------- Private d<EFBFBD>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);

View file

@ -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)

View file

@ -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;
}

View file

@ -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);

View file

@ -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;
}

View file

@ -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