From f4036318dafa12100bbe032042d8d6a96484afdf Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Wed, 15 Jan 2014 10:21:56 +1100 Subject: [PATCH] [889/906] display: add display type enum --- gst-libs/gst/gl/gstgldisplay.c | 11 ++++++++--- gst-libs/gst/gl/gstgldisplay.h | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/gst-libs/gst/gl/gstgldisplay.c b/gst-libs/gst/gl/gstgldisplay.c index 16863faa6e..49758e4d87 100644 --- a/gst-libs/gst/gl/gstgldisplay.c +++ b/gst-libs/gst/gl/gstgldisplay.c @@ -77,7 +77,8 @@ gst_gl_display_init (GstGLDisplay * display) { display->priv = GST_GL_DISPLAY_GET_PRIVATE (display); - display->gl_api = GST_GL_API_NONE; + display->gl_api = GST_GL_API_ANY; + display->type = GST_GL_DISPLAY_TYPE_ANY; GST_TRACE ("init %p", display); @@ -99,6 +100,11 @@ gst_gl_display_finalize (GObject * object) G_OBJECT_CLASS (gst_gl_display_parent_class)->finalize (object); } +/** + * gst_gl_display_new: + * + * Returns: (transfer full): a new #GstGLDisplay + */ GstGLDisplay * gst_gl_display_new (void) { @@ -109,9 +115,8 @@ GstGLAPI gst_gl_display_get_gl_api (GstGLDisplay * display) { g_return_val_if_fail (GST_IS_GL_DISPLAY (display), GST_GL_API_NONE); - g_return_val_if_fail (GST_GL_IS_CONTEXT (display->context), GST_GL_API_NONE); - return gst_gl_context_get_gl_api (display->context); + return display->gl_api; } /** diff --git a/gst-libs/gst/gl/gstgldisplay.h b/gst-libs/gst/gl/gstgldisplay.h index a0178e46e1..9863226960 100644 --- a/gst-libs/gst/gl/gstgldisplay.h +++ b/gst-libs/gst/gl/gstgldisplay.h @@ -38,6 +38,20 @@ GType gst_gl_display_get_type (void); #define GST_IS_GL_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GL_DISPLAY)) #define GST_IS_GL_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_GL_DISPLAY)) #define GST_GL_DISPLAY_CAST(obj) ((GstGLDisplay*)(obj)) +#define GST_GL_DISPLAY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GST_TYPE_GL_DISPLAY, GstGLDisplayClass)) + +typedef enum +{ + GST_GL_DISPLAY_TYPE_NONE = 0, + GST_GL_DISPLAY_TYPE_X11 = (1 << 0), + GST_GL_DISPLAY_TYPE_WAYLAND = (1 << 1), + GST_GL_DISPLAY_TYPE_COCOA = (1 << 2), + GST_GL_DISPLAY_TYPE_WIN32 = (1 << 3), + GST_GL_DISPLAY_TYPE_ANDROID = (1 << 4), + GST_GL_DISPLAY_TYPE_DISPMANX = (1 << 5), + + GST_GL_DISPLAY_TYPE_ANY = G_MAXUINT32 +} GstGLDisplayType; /** * GstGLDisplay: @@ -50,6 +64,8 @@ struct _GstGLDisplay /* */ GstObject object; + GstGLDisplayType type; + GstGLContext *context; GstGLAPI gl_api;