summaryrefslogtreecommitdiffstats
path: root/sys/glsink
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2007-12-24 21:26:40 +0000
committerDavid Schleef <ds@schleef.org>2007-12-24 21:26:40 +0000
commit9222358367f769105de122803bddfe49f6c680e4 (patch)
treecdda424efe7a7a27d44d74f1ae12241653a19561 /sys/glsink
parent6899b8bb6d8ef5b3a0e5b702595f2a0cb28a194d (diff)
downloadgst-plugins-bad-9222358367f769105de122803bddfe49f6c680e4.tar.gz
gst-plugins-bad-9222358367f769105de122803bddfe49f6c680e4.tar.bz2
gst-plugins-bad-9222358367f769105de122803bddfe49f6c680e4.zip
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.
Diffstat (limited to 'sys/glsink')
-rw-r--r--sys/glsink/gstglbuffer.c33
-rw-r--r--sys/glsink/gstgldownload.c1
-rw-r--r--sys/glsink/gstglfilter.c1
3 files changed, 4 insertions, 31 deletions
diff --git a/sys/glsink/gstglbuffer.c b/sys/glsink/gstglbuffer.c
index 9285a7af..048ad993 100644
--- a/sys/glsink/gstglbuffer.c
+++ b/sys/glsink/gstglbuffer.c
@@ -125,25 +125,17 @@ gst_gl_buffer_new (GstGLDisplay * display, GstVideoFormat format,
glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, fbo);
glGenRenderbuffersEXT (1, &buffer->rbo);
- gst_gl_display_check_error (buffer->display, __LINE__);
glBindRenderbufferEXT (GL_RENDERBUFFER_EXT, buffer->rbo);
- gst_gl_display_check_error (buffer->display, __LINE__);
glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT,
GL_COLOR_ATTACHMENT1_EXT, GL_RENDERBUFFER_EXT, buffer->rbo);
- gst_gl_display_check_error (buffer->display, __LINE__);
glRenderbufferStorageEXT (GL_RENDERBUFFER_EXT, GL_RGB,
buffer->width, buffer->height);
- gst_gl_display_check_error (buffer->display, __LINE__);
glDrawBuffer (GL_COLOR_ATTACHMENT1_EXT);
glReadBuffer (GL_COLOR_ATTACHMENT1_EXT);
- {
- GLint status;
-
- status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
- g_assert (status == GL_FRAMEBUFFER_COMPLETE_EXT);
- }
+ g_assert (glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT) ==
+ GL_FRAMEBUFFER_COMPLETE_EXT);
glDeleteFramebuffersEXT (1, &fbo);
@@ -209,33 +201,12 @@ gst_gl_buffer_upload (GstGLBuffer * buffer, void *data)
g_assert (glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_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__);
glWindowPos2iARB (0, 0);
glDrawPixels (buffer->width, buffer->height, GL_RGB,
GL_UNSIGNED_BYTE, data);
-#endif
- gst_gl_display_check_error (buffer->display, __LINE__);
glDeleteFramebuffersEXT (1, &fbo);
- gst_gl_display_check_error (buffer->display, __LINE__);
g_assert (glIsRenderbufferEXT (buffer->rbo));
diff --git a/sys/glsink/gstgldownload.c b/sys/glsink/gstgldownload.c
index eb7ac744..23b45132 100644
--- a/sys/glsink/gstgldownload.c
+++ b/sys/glsink/gstgldownload.c
@@ -250,6 +250,7 @@ gst_gl_download_chain (GstPad * pad, GstBuffer * buf)
gst_pad_push (download->srcpad, GST_BUFFER (outbuf));
+ gst_buffer_unref (buf);
gst_object_unref (download);
return GST_FLOW_OK;
}
diff --git a/sys/glsink/gstglfilter.c b/sys/glsink/gstglfilter.c
index f6386dc3..d5c3f60e 100644
--- a/sys/glsink/gstglfilter.c
+++ b/sys/glsink/gstglfilter.c
@@ -246,6 +246,7 @@ gst_gl_filter_chain (GstPad * pad, GstBuffer * buf)
gst_pad_push (filter->srcpad, GST_BUFFER (outbuf));
+ gst_buffer_unref (buf);
gst_object_unref (filter);
return GST_FLOW_OK;
}