mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-04 06:29:31 +00:00
sys/glsink/: Clean up code. Fix a few leaks.
Original commit message from CVS: * sys/glsink/gstglbuffer.c: * sys/glsink/gstgldownload.c: * sys/glsink/gstglfilter.c: Clean up code. Fix a few leaks.
This commit is contained in:
parent
6899b8bb6d
commit
9222358367
4 changed files with 11 additions and 31 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2007-12-24 David Schleef <ds@schleef.org>
|
||||||
|
|
||||||
|
* sys/glsink/gstglbuffer.c:
|
||||||
|
* sys/glsink/gstgldownload.c:
|
||||||
|
* sys/glsink/gstglfilter.c:
|
||||||
|
Clean up code. Fix a few leaks.
|
||||||
|
|
||||||
2007-12-24 David Schleef <ds@schleef.org>
|
2007-12-24 David Schleef <ds@schleef.org>
|
||||||
|
|
||||||
* sys/glsink/Makefile.am:
|
* sys/glsink/Makefile.am:
|
||||||
|
|
|
@ -125,25 +125,17 @@ gst_gl_buffer_new (GstGLDisplay * display, GstVideoFormat format,
|
||||||
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, fbo);
|
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, fbo);
|
||||||
|
|
||||||
glGenRenderbuffersEXT (1, &buffer->rbo);
|
glGenRenderbuffersEXT (1, &buffer->rbo);
|
||||||
gst_gl_display_check_error (buffer->display, __LINE__);
|
|
||||||
glBindRenderbufferEXT (GL_RENDERBUFFER_EXT, buffer->rbo);
|
glBindRenderbufferEXT (GL_RENDERBUFFER_EXT, buffer->rbo);
|
||||||
gst_gl_display_check_error (buffer->display, __LINE__);
|
|
||||||
|
|
||||||
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT,
|
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT,
|
||||||
GL_COLOR_ATTACHMENT1_EXT, GL_RENDERBUFFER_EXT, buffer->rbo);
|
GL_COLOR_ATTACHMENT1_EXT, GL_RENDERBUFFER_EXT, buffer->rbo);
|
||||||
gst_gl_display_check_error (buffer->display, __LINE__);
|
|
||||||
glRenderbufferStorageEXT (GL_RENDERBUFFER_EXT, GL_RGB,
|
glRenderbufferStorageEXT (GL_RENDERBUFFER_EXT, GL_RGB,
|
||||||
buffer->width, buffer->height);
|
buffer->width, buffer->height);
|
||||||
gst_gl_display_check_error (buffer->display, __LINE__);
|
|
||||||
|
|
||||||
glDrawBuffer (GL_COLOR_ATTACHMENT1_EXT);
|
glDrawBuffer (GL_COLOR_ATTACHMENT1_EXT);
|
||||||
glReadBuffer (GL_COLOR_ATTACHMENT1_EXT);
|
glReadBuffer (GL_COLOR_ATTACHMENT1_EXT);
|
||||||
{
|
g_assert (glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT) ==
|
||||||
GLint status;
|
GL_FRAMEBUFFER_COMPLETE_EXT);
|
||||||
|
|
||||||
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
|
|
||||||
g_assert (status == GL_FRAMEBUFFER_COMPLETE_EXT);
|
|
||||||
}
|
|
||||||
|
|
||||||
glDeleteFramebuffersEXT (1, &fbo);
|
glDeleteFramebuffersEXT (1, &fbo);
|
||||||
|
|
||||||
|
@ -209,33 +201,12 @@ gst_gl_buffer_upload (GstGLBuffer * buffer, void *data)
|
||||||
g_assert (glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT) ==
|
g_assert (glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT) ==
|
||||||
GL_FRAMEBUFFER_COMPLETE_EXT);
|
GL_FRAMEBUFFER_COMPLETE_EXT);
|
||||||
|
|
||||||
#if 0
|
|
||||||
{
|
|
||||||
void *newdata;
|
|
||||||
|
|
||||||
/* FIXME: Some timing issue causes this to work. Note that
|
|
||||||
* we're not actually using the copied buffer. */
|
|
||||||
|
|
||||||
gst_gl_display_check_error (buffer->display, __LINE__);
|
|
||||||
glWindowPos2iARB (0, 0);
|
|
||||||
glDrawPixels (buffer->width, buffer->height, GL_RGB,
|
|
||||||
GL_UNSIGNED_BYTE, data);
|
|
||||||
|
|
||||||
newdata = malloc (4 * buffer->width * buffer->height);
|
|
||||||
//memcpy (newdata, data, 1*buffer->width*buffer->height);
|
|
||||||
memset (newdata, 255, 3 * buffer->width * buffer->height);
|
|
||||||
free (newdata);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
gst_gl_display_check_error (buffer->display, __LINE__);
|
gst_gl_display_check_error (buffer->display, __LINE__);
|
||||||
glWindowPos2iARB (0, 0);
|
glWindowPos2iARB (0, 0);
|
||||||
glDrawPixels (buffer->width, buffer->height, GL_RGB,
|
glDrawPixels (buffer->width, buffer->height, GL_RGB,
|
||||||
GL_UNSIGNED_BYTE, data);
|
GL_UNSIGNED_BYTE, data);
|
||||||
#endif
|
|
||||||
gst_gl_display_check_error (buffer->display, __LINE__);
|
|
||||||
|
|
||||||
glDeleteFramebuffersEXT (1, &fbo);
|
glDeleteFramebuffersEXT (1, &fbo);
|
||||||
gst_gl_display_check_error (buffer->display, __LINE__);
|
|
||||||
|
|
||||||
g_assert (glIsRenderbufferEXT (buffer->rbo));
|
g_assert (glIsRenderbufferEXT (buffer->rbo));
|
||||||
|
|
||||||
|
|
|
@ -250,6 +250,7 @@ gst_gl_download_chain (GstPad * pad, GstBuffer * buf)
|
||||||
|
|
||||||
gst_pad_push (download->srcpad, GST_BUFFER (outbuf));
|
gst_pad_push (download->srcpad, GST_BUFFER (outbuf));
|
||||||
|
|
||||||
|
gst_buffer_unref (buf);
|
||||||
gst_object_unref (download);
|
gst_object_unref (download);
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -246,6 +246,7 @@ gst_gl_filter_chain (GstPad * pad, GstBuffer * buf)
|
||||||
|
|
||||||
gst_pad_push (filter->srcpad, GST_BUFFER (outbuf));
|
gst_pad_push (filter->srcpad, GST_BUFFER (outbuf));
|
||||||
|
|
||||||
|
gst_buffer_unref (buf);
|
||||||
gst_object_unref (filter);
|
gst_object_unref (filter);
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue