static GstGLPlatform gst_gl_context_cocoa_get_gl_platform (GstGLContext * context);
static void gst_gl_context_cocoa_swap_buffers (GstGLContext * context);
-#define GST_GL_CONTEXT_COCOA_GET_PRIVATE(o) \
- (G_TYPE_INSTANCE_GET_PRIVATE((o), GST_TYPE_GL_CONTEXT_COCOA, GstGLContextCocoaPrivate))
-
GST_DEBUG_CATEGORY_STATIC (gst_gl_context_cocoa_debug);
#define GST_CAT_DEFAULT gst_gl_context_cocoa_debug
G_DEFINE_TYPE_WITH_CODE (GstGLContextCocoa, gst_gl_context_cocoa,
- GST_TYPE_GL_CONTEXT, GST_DEBUG_CATEGORY_INIT (gst_gl_context_cocoa_debug, "glcontext_cocoa", 0, "Cocoa GL Context"); );
+ GST_TYPE_GL_CONTEXT,
+ G_ADD_PRIVATE (GstGLContextCocoa)
+ GST_DEBUG_CATEGORY_INIT (gst_gl_context_cocoa_debug, "glcontext_cocoa", 0, "Cocoa GL Context"); );
static void
gst_gl_context_cocoa_class_init (GstGLContextCocoaClass * klass)
{
GstGLContextClass *context_class = (GstGLContextClass *) klass;
- g_type_class_add_private (klass, sizeof (GstGLContextCocoaPrivate));
-
context_class->swap_buffers =
GST_DEBUG_FUNCPTR (gst_gl_context_cocoa_swap_buffers);
context_class->destroy_context =
static void
gst_gl_context_cocoa_init (GstGLContextCocoa * context)
{
- context->priv = GST_GL_CONTEXT_COCOA_GET_PRIVATE (context);
+ context->priv = gst_gl_context_cocoa_get_instance_private (context);
}
/* Must be called in the gl thread */
/* */
/* =============================================================*/
-#define GST_GL_WINDOW_COCOA_GET_PRIVATE(o) \
- (G_TYPE_INSTANCE_GET_PRIVATE((o), GST_TYPE_GL_WINDOW_COCOA, GstGLWindowCocoaPrivate))
-
#define GST_CAT_DEFAULT gst_gl_window_cocoa_debug
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
-#define DEBUG_INIT \
- GST_DEBUG_CATEGORY_GET (GST_CAT_DEFAULT, "glwindow");
-#define gst_gl_window_cocoa_parent_class parent_class
-G_DEFINE_TYPE_WITH_CODE (GstGLWindowCocoa, gst_gl_window_cocoa, GST_TYPE_GL_WINDOW, DEBUG_INIT);
static void gst_gl_window_cocoa_finalize (GObject * object);
static gboolean gst_gl_window_cocoa_open (GstGLWindow *window, GError **err);
gpointer gl_queue;
};
+#define DEBUG_INIT \
+ GST_DEBUG_CATEGORY_GET (GST_CAT_DEFAULT, "glwindow");
+
+#define gst_gl_window_cocoa_parent_class parent_class
+G_DEFINE_TYPE_WITH_CODE (GstGLWindowCocoa, gst_gl_window_cocoa, GST_TYPE_GL_WINDOW,
+ G_ADD_PRIVATE (GstGLWindowCocoa)
+ DEBUG_INIT);
+
static void
gst_gl_window_cocoa_class_init (GstGLWindowCocoaClass * klass)
{
GstGLWindowClass *window_class = (GstGLWindowClass *) klass;
GObjectClass *gobject_class = (GObjectClass *) klass;
- g_type_class_add_private (klass, sizeof (GstGLWindowCocoaPrivate));
-
window_class->open = GST_DEBUG_FUNCPTR (gst_gl_window_cocoa_open);
window_class->close = GST_DEBUG_FUNCPTR (gst_gl_window_cocoa_close);
window_class->get_window_handle =
static void
gst_gl_window_cocoa_init (GstGLWindowCocoa * window)
{
- window->priv = GST_GL_WINDOW_COCOA_GET_PRIVATE (window);
+ window->priv = gst_gl_window_cocoa_get_instance_private (window);
window->priv->preferred_width = 320;
window->priv->preferred_height = 240;
GLuint depth_renderbuffer;
};
-#define GST_GL_CONTEXT_EAGL_GET_PRIVATE(o) \
- (G_TYPE_INSTANCE_GET_PRIVATE((o), GST_TYPE_GL_CONTEXT_EAGL, GstGLContextEaglPrivate))
-
-G_DEFINE_TYPE (GstGLContextEagl, gst_gl_context_eagl, GST_TYPE_GL_CONTEXT);
+G_DEFINE_TYPE_WITH_PRIVATE (GstGLContextEagl, gst_gl_context_eagl,
+ GST_TYPE_GL_CONTEXT);
static void
gst_gl_context_eagl_class_init (GstGLContextEaglClass * klass)
context_class = (GstGLContextClass *) klass;
- g_type_class_add_private (klass, sizeof (GstGLContextEaglPrivate));
-
context_class->destroy_context =
GST_DEBUG_FUNCPTR (gst_gl_context_eagl_destroy_context);
context_class->create_context =
static void
gst_gl_context_eagl_init (GstGLContextEagl * context)
{
- context->priv = GST_GL_CONTEXT_EAGL_GET_PRIVATE (context);
+ context->priv = gst_gl_context_eagl_get_instance_private (context);
}
/* Must be called in the gl thread */
#include "gstglwindow_eagl.h"
#include "gstglcontext_eagl.h"
-#define GST_GL_WINDOW_EAGL_GET_PRIVATE(o) \
- (G_TYPE_INSTANCE_GET_PRIVATE((o), GST_TYPE_GL_WINDOW_EAGL, GstGLWindowEaglPrivate))
-
#define GST_CAT_DEFAULT gst_gl_window_eagl_debug
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
GST_DEBUG_CATEGORY_GET (GST_CAT_DEFAULT, "glwindow");
#define gst_gl_window_eagl_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstGLWindowEagl, gst_gl_window_eagl,
- GST_TYPE_GL_WINDOW, DEBUG_INIT);
+ GST_TYPE_GL_WINDOW, G_ADD_PRIVATE (GstGLWindowEagl) DEBUG_INIT);
+
static void gst_gl_window_eagl_finalize (GObject * object);
static guintptr gst_gl_window_eagl_get_display (GstGLWindow * window);
GObjectClass *gobject_class = (GObjectClass *) klass;
GstGLWindowClass *window_class = (GstGLWindowClass *) klass;
- g_type_class_add_private (klass, sizeof (GstGLWindowEaglPrivate));
-
gobject_class->finalize = gst_gl_window_eagl_finalize;
window_class->get_display =
static void
gst_gl_window_eagl_init (GstGLWindowEagl * window)
{
- window->priv = GST_GL_WINDOW_EAGL_GET_PRIVATE (window);
+ window->priv = gst_gl_window_eagl_get_instance_private (window);
window->priv->gl_queue =
(__bridge_retained gpointer)dispatch_queue_create ("org.freedesktop.gstreamer.glwindow", NULL);
}
#define GST_CAT_DEFAULT gst_gl_base_filter_debug
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
-#define GST_GL_BASE_FILTER_GET_PRIVATE(o) \
- (G_TYPE_INSTANCE_GET_PRIVATE((o), GST_TYPE_GL_BASE_FILTER, GstGLBaseFilterPrivate))
-
struct _GstGLBaseFilterPrivate
{
GstGLContext *other_context;
#define gst_gl_base_filter_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstGLBaseFilter, gst_gl_base_filter,
- GST_TYPE_BASE_TRANSFORM, GST_DEBUG_CATEGORY_INIT (gst_gl_base_filter_debug,
+ GST_TYPE_BASE_TRANSFORM, G_ADD_PRIVATE (GstGLBaseFilter)
+ GST_DEBUG_CATEGORY_INIT (gst_gl_base_filter_debug,
"glbasefilter", 0, "glbasefilter element");
);
GObjectClass *gobject_class;
GstElementClass *element_class;
- g_type_class_add_private (klass, sizeof (GstGLBaseFilterPrivate));
-
gobject_class = (GObjectClass *) klass;
element_class = GST_ELEMENT_CLASS (klass);
{
gst_base_transform_set_qos_enabled (GST_BASE_TRANSFORM (filter), TRUE);
- filter->priv = GST_GL_BASE_FILTER_GET_PRIVATE (filter);
+ filter->priv = gst_gl_base_filter_get_instance_private (filter);
}
static void
GST_DEBUG_CATEGORY_STATIC (GST_CAT_GL_BUFFER_POOL);
#define GST_CAT_DEFAULT GST_CAT_GL_BUFFER_POOL
-#define GST_GL_BUFFER_POOL_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_GL_BUFFER_POOL, GstGLBufferPoolPrivate))
+#define _init \
+ GST_DEBUG_CATEGORY_INIT (GST_CAT_GL_BUFFER_POOL, "glbufferpool", 0, \
+ "GL Buffer Pool");
#define gst_gl_buffer_pool_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstGLBufferPool, gst_gl_buffer_pool,
- GST_TYPE_BUFFER_POOL, GST_DEBUG_CATEGORY_INIT (GST_CAT_GL_BUFFER_POOL,
- "glbufferpool", 0, "GL Buffer Pool"));
+ GST_TYPE_BUFFER_POOL, G_ADD_PRIVATE (GstGLBufferPool)
+ _init);
static const gchar **
gst_gl_buffer_pool_get_options (GstBufferPool * pool)
GObjectClass *gobject_class = (GObjectClass *) klass;
GstBufferPoolClass *gstbufferpool_class = (GstBufferPoolClass *) klass;
- g_type_class_add_private (klass, sizeof (GstGLBufferPoolPrivate));
-
gobject_class->finalize = gst_gl_buffer_pool_finalize;
gstbufferpool_class->get_options = gst_gl_buffer_pool_get_options;
{
GstGLBufferPoolPrivate *priv = NULL;
- pool->priv = GST_GL_BUFFER_POOL_GET_PRIVATE (pool);
+ pool->priv = gst_gl_buffer_pool_get_instance_private (pool);
priv = pool->priv;
priv->allocator = NULL;
GST_DEBUG_CATEGORY_INIT (gst_gl_color_convert_debug, "glconvert", 0, "convert");
G_DEFINE_TYPE_WITH_CODE (GstGLColorConvert, gst_gl_color_convert,
- GST_TYPE_OBJECT, DEBUG_INIT);
+ GST_TYPE_OBJECT, G_ADD_PRIVATE (GstGLColorConvert) DEBUG_INIT);
+
static void gst_gl_color_convert_finalize (GObject * object);
static void gst_gl_color_convert_reset (GstGLColorConvert * convert);
static void
gst_gl_color_convert_class_init (GstGLColorConvertClass * klass)
{
- g_type_class_add_private (klass, sizeof (GstGLColorConvertPrivate));
-
G_OBJECT_CLASS (klass)->finalize = gst_gl_color_convert_finalize;
}
static void
gst_gl_color_convert_init (GstGLColorConvert * convert)
{
- convert->priv = GST_GL_COLOR_CONVERT_GET_PRIVATE (convert);
+ convert->priv = gst_gl_color_convert_get_instance_private (convert);
gst_gl_color_convert_reset (convert);
}
GST_DEBUG_CATEGORY (GST_CAT_DEFAULT);
GST_DEBUG_CATEGORY_STATIC (gst_gl_debug);
-#define gst_gl_context_parent_class parent_class
-G_DEFINE_ABSTRACT_TYPE (GstGLContext, gst_gl_context, GST_TYPE_OBJECT);
-
-#define GST_GL_CONTEXT_GET_PRIVATE(o) \
- (G_TYPE_INSTANCE_GET_PRIVATE((o), GST_TYPE_GL_CONTEXT, GstGLContextPrivate))
-
static void _init_debug (void);
static gpointer gst_gl_context_create_thread (GstGLContext * context);
GstGLContextClass parent;
} GstGLWrappedContextClass;
+#define gst_gl_context_parent_class parent_class
+G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GstGLContext, gst_gl_context,
+ GST_TYPE_OBJECT);
+
#define GST_TYPE_GL_WRAPPED_CONTEXT (gst_gl_wrapped_context_get_type())
static GType gst_gl_wrapped_context_get_type (void);
G_DEFINE_TYPE (GstGLWrappedContext, gst_gl_wrapped_context,
static void
gst_gl_context_init (GstGLContext * context)
{
- context->priv = GST_GL_CONTEXT_GET_PRIVATE (context);
+ context->priv = gst_gl_context_get_instance_private (context);
context->window = NULL;
context->gl_vtable = g_slice_alloc0 (sizeof (GstGLFuncs));
static void
gst_gl_context_class_init (GstGLContextClass * klass)
{
- g_type_class_add_private (klass, sizeof (GstGLContextPrivate));
-
klass->get_proc_address =
GST_DEBUG_FUNCPTR (gst_gl_context_default_get_proc_address);
klass->get_gl_platform_version =
GST_DEBUG_CATEGORY_STATIC (gst_gl_display_debug);
#define GST_CAT_DEFAULT gst_gl_display_debug
-#define DEBUG_INIT \
- GST_DEBUG_CATEGORY_INIT (gst_gl_display_debug, "gldisplay", 0, "opengl display"); \
- GST_DEBUG_CATEGORY_GET (gst_context, "GST_CONTEXT");
-
-G_DEFINE_TYPE_WITH_CODE (GstGLDisplay, gst_gl_display, GST_TYPE_OBJECT,
- DEBUG_INIT);
-
-#define GST_GL_DISPLAY_GET_PRIVATE(o) \
- (G_TYPE_INSTANCE_GET_PRIVATE((o), GST_TYPE_GL_DISPLAY, GstGLDisplayPrivate))
-
enum
{
SIGNAL_0,
GCond thread_cond;
};
+#define DEBUG_INIT \
+ GST_DEBUG_CATEGORY_INIT (gst_gl_display_debug, "gldisplay", 0, "opengl display"); \
+ GST_DEBUG_CATEGORY_GET (gst_context, "GST_CONTEXT");
+
+G_DEFINE_TYPE_WITH_CODE (GstGLDisplay, gst_gl_display, GST_TYPE_OBJECT,
+ G_ADD_PRIVATE (GstGLDisplay)
+ DEBUG_INIT);
+
static gboolean
_unlock_main_thread (GstGLDisplay * display)
{
static void
gst_gl_display_class_init (GstGLDisplayClass * klass)
{
- g_type_class_add_private (klass, sizeof (GstGLDisplayPrivate));
-
/**
* GstGLDisplay::create-context:
* @object: the #GstGLDisplay
static void
gst_gl_display_init (GstGLDisplay * display)
{
- display->priv = GST_GL_DISPLAY_GET_PRIVATE (display);
+ display->priv = gst_gl_display_get_instance_private (display);
display->type = GST_GL_DISPLAY_TYPE_ANY;
display->priv->gl_api = GST_GL_API_ANY;
GST_DEBUG_CATEGORY_STATIC (gst_gl_framebuffer_debug);
#define GST_CAT_DEFAULT gst_gl_framebuffer_debug
-#define DEBUG_INIT \
- GST_DEBUG_CATEGORY_INIT (gst_gl_framebuffer_debug, "glframebuffer", 0, "GL Framebuffer");
-
-G_DEFINE_TYPE_WITH_CODE (GstGLFramebuffer, gst_gl_framebuffer, GST_TYPE_OBJECT,
- DEBUG_INIT);
-
-#define GST_GL_FRAMEBUFFER_GET_PRIVATE(o) \
- (G_TYPE_INSTANCE_GET_PRIVATE((o), GST_TYPE_GL_FRAMEBUFFER, GstGLFramebufferPrivate))
-
static void gst_gl_framebuffer_finalize (GObject * object);
struct _GstGLFramebufferPrivate
guint effective_height;
};
+#define DEBUG_INIT \
+ GST_DEBUG_CATEGORY_INIT (gst_gl_framebuffer_debug, "glframebuffer", 0, "GL Framebuffer");
+
+G_DEFINE_TYPE_WITH_CODE (GstGLFramebuffer, gst_gl_framebuffer, GST_TYPE_OBJECT,
+ G_ADD_PRIVATE (GstGLFramebuffer) DEBUG_INIT);
+
struct fbo_attachment
{
guint attachment_point;
static void
gst_gl_framebuffer_class_init (GstGLFramebufferClass * klass)
{
- g_type_class_add_private (klass, sizeof (GstGLFramebufferPrivate));
-
G_OBJECT_CLASS (klass)->finalize = gst_gl_framebuffer_finalize;
}
static void
gst_gl_framebuffer_init (GstGLFramebuffer * fb)
{
- fb->priv = GST_GL_FRAMEBUFFER_GET_PRIVATE (fb);
+ fb->priv = gst_gl_framebuffer_get_instance_private (fb);
fb->attachments =
g_array_new (FALSE, FALSE, (sizeof (struct fbo_attachment)));
#define GLhandleARB GLuint
#endif
-#define GST_GL_SHADER_GET_PRIVATE(o) \
- (G_TYPE_INSTANCE_GET_PRIVATE((o), GST_TYPE_GL_SHADER, GstGLShaderPrivate))
-
#define USING_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0))
#define USING_OPENGL3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 1))
#define USING_GLES(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES, 1, 0))
#define DEBUG_INIT \
GST_DEBUG_CATEGORY_INIT (gst_gl_shader_debug, "glshader", 0, "shader");
G_DEFINE_TYPE_WITH_CODE (GstGLShader, gst_gl_shader, GST_TYPE_OBJECT,
- DEBUG_INIT);
+ G_ADD_PRIVATE (GstGLShader) DEBUG_INIT);
static void
_cleanup_shader (GstGLContext * context, GstGLShader * shader)
/* bind class methods .. */
GObjectClass *obj_class = G_OBJECT_CLASS (klass);
- g_type_class_add_private (klass, sizeof (GstGLShaderPrivate));
-
obj_class->finalize = gst_gl_shader_finalize;
obj_class->set_property = gst_gl_shader_set_property;
obj_class->get_property = gst_gl_shader_get_property;
/* initialize sources and create program object */
GstGLShaderPrivate *priv;
- priv = self->priv = GST_GL_SHADER_GET_PRIVATE (self);
+ priv = self->priv = gst_gl_shader_get_instance_private (self);
priv->linked = FALSE;
priv->uniform_locations =
GST_DEBUG_CATEGORY_STATIC (gst_glsl_stage_debug);
#define GST_CAT_DEFAULT gst_glsl_stage_debug
-G_DEFINE_TYPE_WITH_CODE (GstGLSLStage, gst_glsl_stage, GST_TYPE_OBJECT,
- GST_DEBUG_CATEGORY_INIT (gst_glsl_stage_debug, "glslstage", 0,
- "GLSL Stage");
- );
-
-#define GST_GLSL_STAGE_GET_PRIVATE(o) \
- (G_TYPE_INSTANCE_GET_PRIVATE((o), GST_TYPE_GLSL_STAGE, GstGLSLStagePrivate))
-
struct _GstGLSLStagePrivate
{
GstGLSLFuncs vtable;
gboolean compiled;
};
+G_DEFINE_TYPE_WITH_CODE (GstGLSLStage, gst_glsl_stage, GST_TYPE_OBJECT,
+ G_ADD_PRIVATE (GstGLSLStage)
+ GST_DEBUG_CATEGORY_INIT (gst_glsl_stage_debug, "glslstage", 0,
+ "GLSL Stage");
+ );
+
static void
gst_glsl_stage_finalize (GObject * object)
{
{
GObjectClass *obj_class = G_OBJECT_CLASS (klass);
- g_type_class_add_private (klass, sizeof (GstGLSLStagePrivate));
-
obj_class->finalize = gst_glsl_stage_finalize;
obj_class->set_property = gst_glsl_stage_set_property;
obj_class->get_property = gst_glsl_stage_get_property;
static void
gst_glsl_stage_init (GstGLSLStage * stage)
{
- stage->priv = GST_GLSL_STAGE_GET_PRIVATE (stage);
+ stage->priv = gst_glsl_stage_get_instance_private (stage);
}
static gboolean
GST_DEBUG_CATEGORY_STATIC (gst_gl_upload_debug);
#define GST_CAT_DEFAULT gst_gl_upload_debug
-#define DEBUG_INIT \
- GST_DEBUG_CATEGORY_INIT (gst_gl_upload_debug, "glupload", 0, "upload");
-
-G_DEFINE_TYPE_WITH_CODE (GstGLUpload, gst_gl_upload, GST_TYPE_OBJECT,
- DEBUG_INIT);
static void gst_gl_upload_finalize (GObject * object);
-#define GST_GL_UPLOAD_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
- GST_TYPE_GL_UPLOAD, GstGLUploadPrivate))
-
static GstGLTextureTarget
_caps_get_texture_target (GstCaps * caps, GstGLTextureTarget default_target)
{
int method_i;
};
+#define DEBUG_INIT \
+ GST_DEBUG_CATEGORY_INIT (gst_gl_upload_debug, "glupload", 0, "upload");
+
+G_DEFINE_TYPE_WITH_CODE (GstGLUpload, gst_gl_upload, GST_TYPE_OBJECT,
+ G_ADD_PRIVATE (GstGLUpload) DEBUG_INIT);
+
static GstCaps *
_set_caps_features_with_passthrough (const GstCaps * caps,
const gchar * feature_name, GstCapsFeatures * passthrough)
static void
gst_gl_upload_class_init (GstGLUploadClass * klass)
{
- g_type_class_add_private (klass, sizeof (GstGLUploadPrivate));
-
G_OBJECT_CLASS (klass)->finalize = gst_gl_upload_finalize;
}
static void
gst_gl_upload_init (GstGLUpload * upload)
{
- upload->priv = GST_GL_UPLOAD_GET_PRIVATE (upload);
+ upload->priv = gst_gl_upload_get_instance_private (upload);
}
/**
GLuint attr_texture;
};
-#define GST_GL_VIEW_CONVERT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
- GST_TYPE_GL_VIEW_CONVERT, GstGLViewConvertPrivate))
-
#define DEBUG_INIT \
GST_DEBUG_CATEGORY_INIT (gst_gl_view_convert_debug, "glviewconvert", 0, "glviewconvert object");
G_DEFINE_TYPE_WITH_CODE (GstGLViewConvert, gst_gl_view_convert,
- GST_TYPE_OBJECT, DEBUG_INIT);
+ GST_TYPE_OBJECT, G_ADD_PRIVATE (GstGLViewConvert) DEBUG_INIT);
static void gst_gl_view_convert_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec);
{
GObjectClass *gobject_class = (GObjectClass *) klass;
- g_type_class_add_private (klass, sizeof (GstGLViewConvertPrivate));
-
gobject_class->set_property = gst_gl_view_convert_set_property;
gobject_class->get_property = gst_gl_view_convert_get_property;
gobject_class->finalize = gst_gl_view_convert_finalize;
static void
gst_gl_view_convert_init (GstGLViewConvert * convert)
{
- convert->priv = GST_GL_VIEW_CONVERT_GET_PRIVATE (convert);
+ convert->priv = gst_gl_view_convert_get_instance_private (convert);
convert->shader = NULL;
convert->downmix_mode = DEFAULT_DOWNMIX;
#define GST_CAT_DEFAULT gst_gl_window_debug
GST_DEBUG_CATEGORY (GST_CAT_DEFAULT);
-#define gst_gl_window_parent_class parent_class
-G_DEFINE_ABSTRACT_TYPE (GstGLWindow, gst_gl_window, GST_TYPE_OBJECT);
-
-#define GST_GL_WINDOW_GET_PRIVATE(o) \
- (G_TYPE_INSTANCE_GET_PRIVATE((o), GST_TYPE_GL_WINDOW, GstGLWindowPrivate))
-
static void gst_gl_window_default_draw (GstGLWindow * window);
static void gst_gl_window_default_run (GstGLWindow * window);
static void gst_gl_window_default_quit (GstGLWindow * window);
GCond sync_message_cond;
};
+#define gst_gl_window_parent_class parent_class
+G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GstGLWindow, gst_gl_window,
+ GST_TYPE_OBJECT);
+
static void gst_gl_window_finalize (GObject * object);
typedef struct _GstGLDummyWindow
static void
gst_gl_window_init (GstGLWindow * window)
{
- GstGLWindowPrivate *priv = GST_GL_WINDOW_GET_PRIVATE (window);
+ GstGLWindowPrivate *priv = gst_gl_window_get_instance_private (window);
window->priv = priv;
g_mutex_init (&window->lock);
static void
gst_gl_window_class_init (GstGLWindowClass * klass)
{
- g_type_class_add_private (klass, sizeof (GstGLWindowPrivate));
-
klass->open = GST_DEBUG_FUNCPTR (gst_gl_window_default_open);
klass->close = GST_DEBUG_FUNCPTR (gst_gl_window_default_close);
klass->run = GST_DEBUG_FUNCPTR (gst_gl_window_default_run);
#define GST_CAT_DEFAULT gst_gl_context_debug
#define gst_gl_context_wgl_parent_class parent_class
-G_DEFINE_TYPE (GstGLContextWGL, gst_gl_context_wgl, GST_TYPE_GL_CONTEXT);
-#define GST_GL_CONTEXT_WGL_GET_PRIVATE(o) \
- (G_TYPE_INSTANCE_GET_PRIVATE((o), GST_TYPE_GL_CONTEXT_WGL, GstGLContextWGLPrivate))
+G_DEFINE_TYPE_PRIVATE (GstGLContextWGL, gst_gl_context_wgl,
+ GST_TYPE_GL_CONTEXT);
static guintptr gst_gl_context_wgl_get_gl_context (GstGLContext * context);
static void gst_gl_context_wgl_swap_buffers (GstGLContext * context);
{
GstGLContextClass *context_class = (GstGLContextClass *) klass;
- g_type_class_add_private (klass, sizeof (GstGLContextWGLPrivate));
-
context_class->get_gl_context =
GST_DEBUG_FUNCPTR (gst_gl_context_wgl_get_gl_context);
context_class->choose_format =
static void
gst_gl_context_wgl_init (GstGLContextWGL * context_wgl)
{
- context_wgl->priv = GST_GL_CONTEXT_WGL_GET_PRIVATE (context_wgl);
+ context_wgl->priv = gst_gl_context_wgl_get_instance_private (context_wgl);
context_wgl->priv->context_api = GST_GL_API_OPENGL | GST_GL_API_OPENGL3;
}
LRESULT FAR PASCAL sub_class_proc (HWND hWnd, UINT uMsg, WPARAM wParam,
LPARAM lParam);
-#define GST_GL_WINDOW_WIN32_GET_PRIVATE(o) \
- (G_TYPE_INSTANCE_GET_PRIVATE((o), GST_TYPE_GL_WINDOW_WIN32, GstGLWindowWin32Private))
-
enum
{
PROP_0
GST_DEBUG_CATEGORY_GET (GST_CAT_DEFAULT, "glwindow");
#define gst_gl_window_win32_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstGLWindowWin32, gst_gl_window_win32,
- GST_TYPE_GL_WINDOW, DEBUG_INIT);
+ GST_TYPE_GL_WINDOW, G_ADD_PRIVATE (GstGLWindowWin32) DEBUG_INIT);
static void gst_gl_window_win32_set_window_handle (GstGLWindow * window,
guintptr handle);
{
GstGLWindowClass *window_class = (GstGLWindowClass *) klass;
- g_type_class_add_private (klass, sizeof (GstGLWindowWin32Private));
-
window_class->set_window_handle =
GST_DEBUG_FUNCPTR (gst_gl_window_win32_set_window_handle);
window_class->draw = GST_DEBUG_FUNCPTR (gst_gl_window_win32_draw);
static void
gst_gl_window_win32_init (GstGLWindowWin32 * window)
{
- window->priv = GST_GL_WINDOW_WIN32_GET_PRIVATE (window);
+ window->priv = gst_gl_window_win32_get_instance_private (window);
}
GstGLWindowWin32 *
#define GST_CAT_DEFAULT gst_gl_context_debug
-#define gst_gl_context_glx_parent_class parent_class
-G_DEFINE_TYPE (GstGLContextGLX, gst_gl_context_glx, GST_TYPE_GL_CONTEXT);
-
-#define GST_GL_CONTEXT_GLX_GET_PRIVATE(o) \
- (G_TYPE_INSTANCE_GET_PRIVATE((o), GST_TYPE_GL_CONTEXT_GLX, GstGLContextGLXPrivate))
-
static guintptr gst_gl_context_glx_get_gl_context (GstGLContext * context);
static void gst_gl_context_glx_swap_buffers (GstGLContext * context);
static gboolean gst_gl_context_glx_activate (GstGLContext * context,
GLXContext, Bool, const int *);
};
+#define gst_gl_context_glx_parent_class parent_class
+G_DEFINE_TYPE_WITH_PRIVATE (GstGLContextGLX, gst_gl_context_glx,
+ GST_TYPE_GL_CONTEXT);
+
static void
gst_gl_context_glx_class_init (GstGLContextGLXClass * klass)
{
GstGLContextClass *context_class = (GstGLContextClass *) klass;
- g_type_class_add_private (klass, sizeof (GstGLContextGLXPrivate));
-
context_class->get_gl_context =
GST_DEBUG_FUNCPTR (gst_gl_context_glx_get_gl_context);
context_class->activate = GST_DEBUG_FUNCPTR (gst_gl_context_glx_activate);
static void
gst_gl_context_glx_init (GstGLContextGLX * context)
{
- context->priv = GST_GL_CONTEXT_GLX_GET_PRIVATE (context);
+ context->priv = gst_gl_context_glx_get_instance_private (context);
}
GstGLContextGLX *
/* for XkbKeycodeToKeysym */
#include <X11/XKBlib.h>
-#define GST_GL_WINDOW_X11_GET_PRIVATE(o) \
- (G_TYPE_INSTANCE_GET_PRIVATE((o), GST_TYPE_GL_WINDOW_X11, GstGLWindowX11Private))
-
#define GST_CAT_DEFAULT gst_gl_window_debug
-#define gst_gl_window_x11_parent_class parent_class
-G_DEFINE_TYPE (GstGLWindowX11, gst_gl_window_x11, GST_TYPE_GL_WINDOW);
-
G_GNUC_INTERNAL
gboolean gst_gl_window_x11_handle_event (GstGLWindowX11 * window_x11,
xcb_generic_event_t * event);
GstVideoRectangle render_rect;
};
+#define gst_gl_window_x11_parent_class parent_class
+G_DEFINE_TYPE_WITH_PRIVATE (GstGLWindowX11, gst_gl_window_x11,
+ GST_TYPE_GL_WINDOW);
+
static guintptr gst_gl_window_x11_get_display (GstGLWindow * window);
guintptr gst_gl_window_x11_get_gl_context (GstGLWindow * window);
gboolean gst_gl_window_x11_activate (GstGLWindow * window, gboolean activate);
GObjectClass *obj_class = G_OBJECT_CLASS (klass);
GstGLWindowClass *window_class = (GstGLWindowClass *) klass;
- g_type_class_add_private (klass, sizeof (GstGLWindowX11Private));
-
obj_class->finalize = gst_gl_window_x11_finalize;
window_class->get_display = GST_DEBUG_FUNCPTR (gst_gl_window_x11_get_display);
static void
gst_gl_window_x11_init (GstGLWindowX11 * window)
{
- window->priv = GST_GL_WINDOW_X11_GET_PRIVATE (window);
+ window->priv = gst_gl_window_x11_get_instance_private (window);
}
/* Must be called in the gl thread */