From 71c6aae707408cf2ee5abae13ca49d070f3fb153 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Tue, 19 Jun 2012 18:40:28 +1000 Subject: [PATCH] [513/906] Remove GstGLBuffer (to be replaced by GstGLMeta) --- gst-libs/gst/gl/Makefile.am | 2 - gst-libs/gst/gl/gstglbuffer.c | 134 ---------------------------------------- gst-libs/gst/gl/gstglbuffer.h | 73 ---------------------- gst-libs/gst/gl/gstglfilter.h | 2 +- gst-libs/gst/gl/gstglmixerpad.h | 2 +- gst/gl/gltestsrc.h | 1 - gst/gl/gstglcolorscale.h | 2 +- gst/gl/gstgldownload.h | 2 +- gst/gl/gstglimagesink.h | 2 +- gst/gl/gstgltestsrc.h | 2 +- gst/gl/gstglupload.h | 2 +- 11 files changed, 7 insertions(+), 217 deletions(-) delete mode 100644 gst-libs/gst/gl/gstglbuffer.c delete mode 100644 gst-libs/gst/gl/gstglbuffer.h diff --git a/gst-libs/gst/gl/Makefile.am b/gst-libs/gst/gl/Makefile.am index 64f0548..333e801 100644 --- a/gst-libs/gst/gl/Makefile.am +++ b/gst-libs/gst/gl/Makefile.am @@ -10,7 +10,6 @@ EXTRA_DIST = \ libgstgl_@GST_API_VERSION@_la_SOURCES = \ gstgldisplay.c \ - gstglbuffer.c \ gstglfilter.c \ gstglmixer.c \ gstglshader.c \ @@ -33,7 +32,6 @@ libgstgl_@GST_API_VERSION@includedir = $(includedir)/gstreamer-@GST_API_VERSION@ libgstgl_@GST_API_VERSION@include_HEADERS = \ gstglwindow.h \ gstgldisplay.h \ - gstglbuffer.h \ gstgles2.h \ gstglfilter.h \ gstglmixer.h \ diff --git a/gst-libs/gst/gl/gstglbuffer.c b/gst-libs/gst/gl/gstglbuffer.c deleted file mode 100644 index 8df84bb..0000000 --- a/gst-libs/gst/gl/gstglbuffer.c +++ /dev/null @@ -1,134 +0,0 @@ -/* - * GStreamer - * Copyright (C) 2007 David Schleef - * Copyright (C) 2008 Julien Isorce - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "gstglbuffer.h" - -static GObjectClass *gst_gl_buffer_parent_class; - -static void -gst_gl_buffer_finalize (GstGLBuffer * buffer) -{ - //blocking call, put the texture in the pool - gst_gl_display_del_texture (buffer->display, buffer->texture, - buffer->width, buffer->height); - - g_object_unref (buffer->display); - - GST_MINI_OBJECT_CLASS (gst_gl_buffer_parent_class)->finalize (GST_MINI_OBJECT - (buffer)); -} - -static void -gst_gl_buffer_init (GstGLBuffer * buffer, gpointer g_class) -{ - buffer->display = NULL; - - buffer->width = 0; - buffer->height = 0; - buffer->texture = 0; -} - -static void -gst_gl_buffer_class_init (gpointer g_class, gpointer class_data) -{ - GstMiniObjectClass *mini_object_class = GST_MINI_OBJECT_CLASS (g_class); - - gst_gl_buffer_parent_class = g_type_class_peek_parent (g_class); - - mini_object_class->finalize = (GstMiniObjectFinalizeFunction) - gst_gl_buffer_finalize; -} - - -GType -gst_gl_buffer_get_type (void) -{ - static GType _gst_gl_buffer_type; - - if (G_UNLIKELY (_gst_gl_buffer_type == 0)) { - static const GTypeInfo info = { - sizeof (GstBufferClass), - NULL, - NULL, - gst_gl_buffer_class_init, - NULL, - NULL, - sizeof (GstGLBuffer), - 0, - (GInstanceInitFunc) gst_gl_buffer_init, - NULL - }; - _gst_gl_buffer_type = g_type_register_static (GST_TYPE_BUFFER, - "GstGLBuffer", &info, 0); - } - return _gst_gl_buffer_type; -} - - -GstGLBuffer * -gst_gl_buffer_new (GstGLDisplay * display, gint gl_width, gint gl_height) -{ - GstGLBuffer *gl_buffer = - (GstGLBuffer *) gst_mini_object_new (GST_TYPE_GL_BUFFER); - - gl_buffer->display = g_object_ref (display); - gl_buffer->width = gl_width; - gl_buffer->height = gl_height; - - //it does not depends on the video format because gl buffer has always one texture. - //the one attached to the upload FBO - GST_BUFFER_SIZE (gl_buffer) = gst_gl_buffer_get_size (gl_width, gl_height); - - //blocking call, generate a texture using the pool - gst_gl_display_gen_texture (gl_buffer->display, &gl_buffer->texture, gl_width, - gl_height); - - return gl_buffer; -} - - -gint -gst_gl_buffer_get_size (gint width, gint height) -{ - //this is not strictly true, but it's used for compatibility with - //queue and BaseTransform - return width * height * 4; -} - - -gboolean -gst_gl_buffer_parse_caps (GstCaps * caps, gint * width, gint * height) -{ - GstStructure *structure = gst_caps_get_structure (caps, 0); - gboolean ret = gst_structure_has_name (structure, "video/x-raw-gl"); - - if (!ret) - return ret; - - ret = gst_structure_get_int (structure, "width", width); - ret &= gst_structure_get_int (structure, "height", height); - - return ret; -} diff --git a/gst-libs/gst/gl/gstglbuffer.h b/gst-libs/gst/gl/gstglbuffer.h deleted file mode 100644 index 39690df..0000000 --- a/gst-libs/gst/gl/gstglbuffer.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * GStreame - * Copyright (C) 2007 David Schleef - * Copyright (C) 2008 Julien Isorce - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef _GST_GL_BUFFER_H_ -#define _GST_GL_BUFFER_H_ - -#include -#include - -#include "gstgldisplay.h" - -G_BEGIN_DECLS - -typedef struct _GstGLBuffer GstGLBuffer; - -#define GST_TYPE_GL_BUFFER (gst_gl_buffer_get_type()) - -#define GST_IS_GL_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GL_BUFFER)) -#define GST_GL_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_GL_BUFFER, GstGLBuffer)) - -//A gl buffer has only one texture. -//Note that when a gl buffer is created by the upload filter, -//the colorspace conversion is made using a FBO. -//And so the texture attached to this FBO is the one managed by the gl buffer. - -struct _GstGLBuffer { - GstBuffer buffer; - - GstGLDisplay *display; - - gint width; - gint height; - GLuint texture; -}; - -GType gst_gl_buffer_get_type (void); - -#define gst_gl_buffer_ref(x) ((GstGLBuffer *)(gst_buffer_ref((GstBuffer *)(x)))) -#define gst_gl_buffer_unref(x) (gst_buffer_unref((GstBuffer *)(x))) - -GstGLBuffer* gst_gl_buffer_new (GstGLDisplay* display, gint gl_width, gint gl_height); -gint gst_gl_buffer_get_size (gint width, gint height); -gboolean gst_gl_buffer_parse_caps (GstCaps* caps, gint* width, gint* height); - - -#define GST_GL_VIDEO_CAPS \ - "video/x-raw-gl," \ - "width=(int)[1,8000]," \ - "height=(int)[1,6000]," \ - "pixel-aspect-ratio=(fraction)1/1," \ - "framerate=(fraction)[0/1,100/1]" - -G_END_DECLS - -#endif /* _GST_GL_BUFFER_H_ */ diff --git a/gst-libs/gst/gl/gstglfilter.h b/gst-libs/gst/gl/gstglfilter.h index 1ee9d7e..6a0eadc 100644 --- a/gst-libs/gst/gl/gstglfilter.h +++ b/gst-libs/gst/gl/gstglfilter.h @@ -27,7 +27,7 @@ #include #include -#include "gstglbuffer.h" +#include "gstglmeta.h" G_BEGIN_DECLS diff --git a/gst-libs/gst/gl/gstglmixerpad.h b/gst-libs/gst/gl/gstglmixerpad.h index d3ec5f2..3127822 100644 --- a/gst-libs/gst/gl/gstglmixerpad.h +++ b/gst-libs/gst/gl/gstglmixerpad.h @@ -24,7 +24,7 @@ #include #include -#include "gstglbuffer.h" +#include "gstglmeta.h" G_BEGIN_DECLS diff --git a/gst/gl/gltestsrc.h b/gst/gl/gltestsrc.h index 86bda92..0a623ca 100644 --- a/gst/gl/gltestsrc.h +++ b/gst/gl/gltestsrc.h @@ -21,7 +21,6 @@ #define __GL_TEST_SRC_H__ #include -#include "gstglbuffer.h" #include "gstgltestsrc.h" struct vts_color_struct { diff --git a/gst/gl/gstglcolorscale.h b/gst/gl/gstglcolorscale.h index 7699d22..57939fd0 100644 --- a/gst/gl/gstglcolorscale.h +++ b/gst/gl/gstglcolorscale.h @@ -25,7 +25,7 @@ #include #include -#include "gstglbuffer.h" +#include "gstglmeta.h" G_BEGIN_DECLS diff --git a/gst/gl/gstgldownload.h b/gst/gl/gstgldownload.h index 58c652a..114e52e 100644 --- a/gst/gl/gstgldownload.h +++ b/gst/gl/gstgldownload.h @@ -25,7 +25,7 @@ #include #include -#include "gstglbuffer.h" +#include "gstglmeta.h" G_BEGIN_DECLS diff --git a/gst/gl/gstglimagesink.h b/gst/gl/gstglimagesink.h index f50cf42..6df633e 100644 --- a/gst/gl/gstglimagesink.h +++ b/gst/gl/gstglimagesink.h @@ -27,7 +27,7 @@ #include #include -#include "gstglbuffer.h" +#include "gstglmeta.h" G_BEGIN_DECLS diff --git a/gst/gl/gstgltestsrc.h b/gst/gl/gstgltestsrc.h index a8f8623..a76ee16 100644 --- a/gst/gl/gstgltestsrc.h +++ b/gst/gl/gstgltestsrc.h @@ -26,7 +26,7 @@ #include #include -#include "gstglbuffer.h" +#include "gstglmeta.h" G_BEGIN_DECLS diff --git a/gst/gl/gstglupload.h b/gst/gl/gstglupload.h index 53cc283..60e4a5d 100644 --- a/gst/gl/gstglupload.h +++ b/gst/gl/gstglupload.h @@ -25,7 +25,7 @@ #include #include -#include "gstglbuffer.h" +#include "gstglmeta.h" G_BEGIN_DECLS -- 2.7.4