From 4fb5b5bde1ecebc97a762319b77e7a88dfe06027 Mon Sep 17 00:00:00 2001 From: Julien Isorce Date: Sun, 8 Jun 2008 13:15:12 +0000 Subject: [PATCH] [085/906] fix regressions about glvideomaker. git-svn-id: svn://svn.wobow.com/GStreamer_playground/gst-plugins-gl@497 93df14bb-0f41-7a43-8087-d3e2a2f0e464 --- gst-libs/gst/gl/gstgldisplay.c | 21 ++++++++++++++------- gst-libs/gst/gl/gstgldisplay.h | 9 +++++++-- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/gst-libs/gst/gl/gstgldisplay.c b/gst-libs/gst/gl/gstgldisplay.c index 9c3adc5..4369faa 100644 --- a/gst-libs/gst/gl/gstgldisplay.c +++ b/gst-libs/gst/gl/gstgldisplay.c @@ -170,6 +170,10 @@ gst_gl_display_init (GstGLDisplay *display, GstGLDisplayClass *klass) display->outputVideo_format = 0; display->outputData = NULL; + display->recordedTexture = 0; + display->recordedTextureWidth = 0; + display->recordedTextureHeight = 0; + display->glutWinId = -1; display->winId = 0; display->win_xpos = 0; @@ -1216,12 +1220,15 @@ gst_gl_display_clearTexture (GstGLDisplay* display, guint texture, /* Called by gst_gl elements */ void gst_gl_display_videoChanged (GstGLDisplay* display, GstVideoFormat video_format, - gpointer data) + gint width, gint height, GLuint recordedTexture, gpointer data) { gst_gl_display_lock (display); //data size is aocciated to the glcontext size display->outputVideo_format = video_format; display->outputData = data; + display->recordedTexture = recordedTexture; + display->recordedTextureWidth = width; + display->recordedTextureHeight = height; gst_gl_display_postMessage (GST_GL_DISPLAY_ACTION_VIDEO, display); g_cond_wait (display->cond_video, display->mutex); gst_gl_display_unlock (display); @@ -1890,25 +1897,25 @@ gst_gl_display_draw_graphic (GstGLDisplay* display) //check if a client draw callback is registered if (display->clientDrawCallback) { - display->clientDrawCallback(display->textureFBO, - display->textureFBOWidth, display->textureFBOHeight); + display->clientDrawCallback(display->recordedTexture, + display->recordedTextureWidth, display->recordedTextureHeight); } else { glMatrixMode (GL_PROJECTION); glLoadIdentity (); - glBindTexture (GL_TEXTURE_RECTANGLE_ARB, display->textureFBO); + glBindTexture (GL_TEXTURE_RECTANGLE_ARB, display->recordedTexture); glEnable (GL_TEXTURE_RECTANGLE_ARB); glBegin (GL_QUADS); - glTexCoord2i (display->textureFBOWidth, 0); + glTexCoord2i (display->recordedTextureWidth, 0); glVertex2f (1.0f, 1.0f); glTexCoord2i (0, 0); glVertex2f (-1.0f, 1.0f); - glTexCoord2i (0, display->textureFBOHeight); + glTexCoord2i (0, display->recordedTextureHeight); glVertex2f (-1.0f, -1.0f); - glTexCoord2i (display->textureFBOWidth, display->textureFBOHeight); + glTexCoord2i (display->recordedTextureWidth, display->recordedTextureHeight); glVertex2f (1.0f, -1.0f); glEnd (); } diff --git a/gst-libs/gst/gl/gstgldisplay.h b/gst-libs/gst/gl/gstgldisplay.h index 8bd0572..2496923 100644 --- a/gst-libs/gst/gl/gstgldisplay.h +++ b/gst-libs/gst/gl/gstgldisplay.h @@ -182,6 +182,11 @@ struct _GstGLDisplay { gpointer outputData; GLenum multipleRT[3]; + //recorded texture + GLuint recordedTexture; + GLuint recordedTextureWidth; + GLuint recordedTextureHeight; + //from video to texture gchar* textFProgram_YUY2_UYVY; @@ -241,8 +246,8 @@ void gst_gl_display_textureChanged (GstGLDisplay* display, GstVideoFormat video_ void gst_gl_display_clearTexture (GstGLDisplay* display, guint texture, guint texture_u, guint texture_v); -void gst_gl_display_videoChanged (GstGLDisplay* display, GstVideoFormat video_format, - gpointer data); +void gst_gl_display_videoChanged (GstGLDisplay* display, GstVideoFormat video_format, + gint width, gint height, GLuint recordedTexture, gpointer data); gboolean gst_gl_display_postRedisplay (GstGLDisplay* display, GLuint texture, gint width, gint height); void gst_gl_display_requestFBO (GstGLDisplay* display, gint width, gint height, guint* fbo, guint* depthbuffer, guint* texture); -- 2.7.4