[085/906] fix regressions about glvideomaker.

git-svn-id: svn://svn.wobow.com/GStreamer_playground/gst-plugins-gl@497 93df14bb-0f41-7a43-8087-d3e2a2f0e464
This commit is contained in:
Julien Isorce 2008-06-08 13:15:12 +00:00 committed by Tim-Philipp Müller
parent 7973568f07
commit 4fb5b5bde1
2 changed files with 21 additions and 9 deletions

View file

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

View file

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