[607/906] remove get_platform and get_window_handle vfuncs
authorMatthew Waters <ystreet00@gmail.com>
Wed, 14 Nov 2012 09:36:16 +0000 (20:36 +1100)
committerMatthew Waters <ystreet00@gmail.com>
Sat, 15 Mar 2014 17:36:50 +0000 (18:36 +0100)
- rename choose_visual() to choose_format() for later incorporating
  win32 changes and new GstGLPlatform for WGL, EGL, GLX, etc.

gst-libs/gst/gl/gstglwindow.c
gst-libs/gst/gl/gstglwindow.h
gst-libs/gst/gl/gstglwindow_x11.c
gst-libs/gst/gl/gstglwindow_x11.h
gst-libs/gst/gl/gstglwindow_x11_egl.c
gst-libs/gst/gl/gstglwindow_x11_glx.c

index a173acc..20c078f 100644 (file)
@@ -90,19 +90,6 @@ gst_gl_window_new (GstGLRendererAPI render_api, guintptr external_gl_context)
   return window;
 }
 
-GstGLPlatform
-gst_gl_window_get_platform (GstGLWindow * window)
-{
-  GstGLWindowClass *window_class;
-
-  window_class = GST_GL_WINDOW_GET_CLASS (window);
-
-  g_return_val_if_fail (window_class->get_platform != NULL,
-      GST_GL_PLATFORM_UNKNOWN);
-
-  return window_class->get_platform (window);
-}
-
 guintptr
 gst_gl_window_get_gl_context (GstGLWindow * window)
 {
@@ -152,23 +139,6 @@ gst_gl_window_set_window_handle (GstGLWindow * window, guintptr handle)
   GST_GL_WINDOW_UNLOCK (window);
 }
 
-guintptr
-gst_gl_window_get_window_handle (GstGLWindow * window)
-{
-  GstGLWindowClass *window_class;
-  guintptr result;
-
-  g_return_val_if_fail (GST_GL_IS_WINDOW (window), 0);
-  window_class = GST_GL_WINDOW_GET_CLASS (window);
-  g_return_val_if_fail (window_class->get_window_handle != NULL, FALSE);
-
-  GST_GL_WINDOW_LOCK (window);
-  result = window_class->get_window_handle (window);
-  GST_GL_WINDOW_UNLOCK (window);
-
-  return result;
-}
-
 void
 gst_gl_window_draw_unlocked (GstGLWindow * window, guint width, guint height)
 {
index 541bd17..1733999 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * GStreamer
  * Copyright (C) 2008 Julien Isorce <julien.isorce@gmail.com>
+ * Copyright (C) 2012 Matthew Waters <ystreet00@gmail.com>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -23,6 +24,8 @@
 
 #include <gst/gst.h>
 
+#include "gstglrenderer.h"
+
 G_BEGIN_DECLS
 
 #define GST_GL_TYPE_WINDOW         (gst_gl_window_get_type())
@@ -61,7 +64,8 @@ typedef enum
   GST_GL_PLATFORM_GLX,
   GST_GL_PLATFORM_WGL,
   GST_GL_PLATFORM_CGL,
-  
+
+  GST_GL_PLATFORM_ANY = 254,
   GST_GL_PLATFORM_LAST = 255
 } GstGLPlatform;
 
@@ -93,17 +97,16 @@ struct _GstGLWindow {
 struct _GstGLWindowClass {
   /*< private >*/
   GObjectClass parent_class;
-  
+
   guintptr      (*get_gl_context)     (GstGLWindow *window);
   gboolean      (*activate)           (GstGLWindow *window, gboolean activate);
   void          (*set_window_handle)  (GstGLWindow *window, guintptr id);
-  guintptr      (*get_window_handle)  (GstGLWindow *window);
+  gboolean      (*share_context)      (GstGLWindow *window, guintptr external_gl_context);
   void          (*draw_unlocked)      (GstGLWindow *window, guint width, guint height);
   void          (*draw)               (GstGLWindow *window, guint width, guint height);
   void          (*run)                (GstGLWindow *window);
   void          (*quit)               (GstGLWindow *window, GstGLWindowCB callback, gpointer data);
   void          (*send_message)       (GstGLWindow *window, GstGLWindowCB callback, gpointer data);
-  GstGLPlatform (*get_platform)       (GstGLWindow *window);
 
   /*< private >*/
   gpointer _reserved[GST_PADDING];
index 0e9a3d9..644bbe2 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * GStreamer
  * Copyright (C) 2008 Julien Isorce <julien.isorce@gmail.com>
+ * Copyright (C) 2012 Matthew Waters <ystreet00@gmail.com>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -64,7 +65,6 @@ guintptr gst_gl_window_x11_get_gl_context (GstGLWindow * window);
 gboolean gst_gl_window_x11_activate (GstGLWindow * window, gboolean activate);
 void gst_gl_window_x11_set_window_handle (GstGLWindow * window,
     guintptr handle);
-guintptr gst_gl_window_x11_get_window_handle (GstGLWindow * window);
 void gst_gl_window_x11_draw_unlocked (GstGLWindow * window, guint width,
     guint height);
 void gst_gl_window_x11_draw (GstGLWindow * window, guint width, guint height);
@@ -196,8 +196,6 @@ gst_gl_window_x11_class_init (GstGLWindowX11Class * klass)
   window_class->activate = GST_DEBUG_FUNCPTR (gst_gl_window_x11_activate);
   window_class->set_window_handle =
       GST_DEBUG_FUNCPTR (gst_gl_window_x11_set_window_handle);
-  window_class->get_window_handle =
-      GST_DEBUG_FUNCPTR (gst_gl_window_x11_get_window_handle);
   window_class->draw_unlocked =
       GST_DEBUG_FUNCPTR (gst_gl_window_x11_draw_unlocked);
   window_class->draw = GST_DEBUG_FUNCPTR (gst_gl_window_x11_draw);
@@ -323,7 +321,7 @@ gst_gl_window_x11_open_device (GstGLWindowX11 * window_x11,
 
   window_x11->connection = ConnectionNumber (window_x11->device);
 
-  if (!window_class->choose_visual (window_x11)) {
+  if (!window_class->choose_format (window_x11)) {
     GST_WARNING ("Failed to choose XVisual");
     goto failure;
   }
@@ -452,12 +450,6 @@ gst_gl_window_x11_get_gl_context (GstGLWindow * window)
   return window_class->get_gl_context (GST_GL_WINDOW_X11 (window));
 }
 
-guintptr
-gst_gl_window_x11_get_window_handle (GstGLWindow * window)
-{
-  return (guintptr) GST_GL_WINDOW_X11 (window)->internal_win_id;
-}
-
 static void
 callback_activate (GstGLWindow * window)
 {
index 755629e..33a0363 100644 (file)
@@ -80,7 +80,7 @@ struct _GstGLWindowX11Class {
   /*< private >*/
   GstGLWindowClass parent_class;
 
-  gboolean (*choose_visual)    (GstGLWindowX11 *window);
+  gboolean (*choose_format)    (GstGLWindowX11 *window);
   gboolean (*create_context)   (GstGLWindowX11 *window, GstGLRendererAPI render_api,
                                 guintptr external_gl_context);
   void     (*swap_buffers)     (GstGLWindowX11 *window);
index 7513acc..28a93fd 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * GStreamer
  * Copyright (C) 2008 Julien Isorce <julien.isorce@gmail.com>
+ * Copyright (C) 2012 Matthew Waters <ystreet00@gmail.com>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -45,7 +46,7 @@ static gboolean gst_gl_window_x11_egl_activate (GstGLWindowX11 * window_x11,
 static gboolean gst_gl_window_x11_egl_create_context (GstGLWindowX11 *
     window_x11, GstGLRendererAPI render_api, guintptr external_gl_context);
 static void gst_gl_window_x11_egl_destroy_context (GstGLWindowX11 * window_x11);
-static gboolean gst_gl_window_x11_egl_choose_visual (GstGLWindowX11 *
+static gboolean gst_gl_window_x11_egl_choose_format (GstGLWindowX11 *
     window_x11);
 static GstGLPlatform gst_gl_window_x11_egl_get_platform (GstGLWindow * window);
 
@@ -66,8 +67,8 @@ gst_gl_window_x11_egl_class_init (GstGLWindowX11EGLClass * klass)
       GST_DEBUG_FUNCPTR (gst_gl_window_x11_egl_create_context);
   window_x11_class->destroy_context =
       GST_DEBUG_FUNCPTR (gst_gl_window_x11_egl_destroy_context);
-  window_x11_class->choose_visual =
-      GST_DEBUG_FUNCPTR (gst_gl_window_x11_egl_choose_visual);
+  window_x11_class->choose_format =
+      GST_DEBUG_FUNCPTR (gst_gl_window_x11_egl_choose_format);
   window_x11_class->swap_buffers =
       GST_DEBUG_FUNCPTR (gst_gl_window_x11_egl_swap_buffers);
 }
@@ -97,7 +98,7 @@ gst_gl_window_x11_egl_get_platform (GstGLWindow * window)
 }
 
 static gboolean
-gst_gl_window_x11_egl_choose_visual (GstGLWindowX11 * window_x11)
+gst_gl_window_x11_egl_choose_format (GstGLWindowX11 * window_x11)
 {
   gint ret;
 
index 25292d7..ce0022e 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * GStreamer
  * Copyright (C) 2008 Julien Isorce <julien.isorce@gmail.com>
+ * Copyright (C) 2012 Matthew Waters <ystreet00@gmail.com>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -45,7 +46,7 @@ static gboolean gst_gl_window_x11_glx_activate (GstGLWindowX11 * window_x11,
 static gboolean gst_gl_window_x11_glx_create_context (GstGLWindowX11 *
     window_x11, GstGLRendererAPI render_api, guintptr external_gl_context);
 static void gst_gl_window_x11_glx_destroy_context (GstGLWindowX11 * window_x11);
-static gboolean gst_gl_window_x11_glx_choose_visual (GstGLWindowX11 *
+static gboolean gst_gl_window_x11_glx_choose_format (GstGLWindowX11 *
     window_x11);
 
 static void
@@ -61,8 +62,8 @@ gst_gl_window_x11_glx_class_init (GstGLWindowX11GLXClass * klass)
       GST_DEBUG_FUNCPTR (gst_gl_window_x11_glx_create_context);
   window_x11_class->destroy_context =
       GST_DEBUG_FUNCPTR (gst_gl_window_x11_glx_destroy_context);
-  window_x11_class->choose_visual =
-      GST_DEBUG_FUNCPTR (gst_gl_window_x11_glx_choose_visual);
+  window_x11_class->choose_format =
+      GST_DEBUG_FUNCPTR (gst_gl_window_x11_glx_choose_format);
   window_x11_class->swap_buffers =
       GST_DEBUG_FUNCPTR (gst_gl_window_x11_glx_swap_buffers);
 }
@@ -123,7 +124,7 @@ gst_gl_window_x11_glx_destroy_context (GstGLWindowX11 * window_x11)
 }
 
 static gboolean
-gst_gl_window_x11_glx_choose_visual (GstGLWindowX11 * window_x11)
+gst_gl_window_x11_glx_choose_format (GstGLWindowX11 * window_x11)
 {
   gint error_base;
   gint event_base;