3 * Copyright (C) 2003 Julien Moutte <julien@moutte.net>
4 * Copyright (C) 2005,2006,2007 David A. Schleef <ds@schleef.org>
5 * Copyright (C) 2008 Julien Isorce <julien.isorce@gmail.com>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
23 #ifndef _GLIMAGESINK_H_
24 #define _GLIMAGESINK_H_
27 #include <gst/video/gstvideosink.h>
28 #include <gst/video/video.h>
30 #include <gst/gl/gl.h>
34 GST_DEBUG_CATEGORY_EXTERN (gst_debug_glimage_sink);
36 #define GST_TYPE_GLIMAGE_SINK \
37 (gst_glimage_sink_get_type())
38 #define GST_GLIMAGE_SINK(obj) \
39 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GLIMAGE_SINK,GstGLImageSink))
40 #define GST_GLIMAGE_SINK_CLASS(klass) \
41 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_GLIMAGE_SINK,GstGLImageSinkClass))
42 #define GST_IS_GLIMAGE_SINK(obj) \
43 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GLIMAGE_SINK))
44 #define GST_IS_GLIMAGE_SINK_CLASS(klass) \
45 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GLIMAGE_SINK))
47 typedef struct _GstGLImageSink GstGLImageSink;
48 typedef struct _GstGLImageSinkClass GstGLImageSinkClass;
50 struct _GstGLImageSink
52 GstVideoSink video_sink;
58 guintptr new_window_id;
66 GstGLDisplay *display;
67 GstGLContext *context;
68 GstGLContext *other_context;
69 gboolean handle_events;
73 GstBuffer *next_buffer;
75 volatile gint to_quit;
76 gboolean keep_aspect_ratio;
81 /* avoid replacing the stored_buffer while drawing */
83 GstBuffer *stored_buffer;
84 GLuint redisplay_texture;
91 GstGLShader *redisplay_shader;
92 GLint redisplay_attr_position_loc;
93 GLint redisplay_attr_texture_loc;
98 struct _GstGLImageSinkClass
100 GstVideoSinkClass video_sink_class;
103 GType gst_glimage_sink_get_type(void);