GstGLWindowCB callback, gpointer data);
static void gst_gl_window_default_send_message_async (GstGLWindow * window,
GstGLWindowCB callback, gpointer data, GDestroyNotify destroy);
+static gboolean gst_gl_window_default_has_output_surface (GstGLWindow * window);
struct _GstGLWindowPrivate
{
klass->send_message = GST_DEBUG_FUNCPTR (gst_gl_window_default_send_message);
klass->send_message_async =
GST_DEBUG_FUNCPTR (gst_gl_window_default_send_message_async);
+ klass->has_output_surface =
+ GST_DEBUG_FUNCPTR (gst_gl_window_default_has_output_surface);
G_OBJECT_CLASS (klass)->finalize = gst_gl_window_finalize;
message);
}
+static gboolean
+gst_gl_window_default_has_output_surface (GstGLWindow * window)
+{
+ return TRUE;
+}
+
+/**
+ * gst_gl_window_has_output_surface:
+ * @window: a #GstGLWindow
+ *
+ * Query whether @window has output surface or not
+ *
+ * Returns: %TRUE if @window has useable output surface
+ *
+ * Since: 1.18
+ */
+gboolean
+gst_gl_window_has_output_surface (GstGLWindow * window)
+{
+ GstGLWindowClass *window_class;
+
+ g_return_val_if_fail (GST_IS_GL_WINDOW (window), FALSE);
+
+ window_class = GST_GL_WINDOW_GET_CLASS (window);
+
+ g_assert (window_class->has_output_surface);
+
+ return window_class->has_output_surface (window);
+}
+
/**
* gst_gl_window_send_message_async:
* @window: a #GstGLWindow
static GType gst_gl_dummy_window_get_type (void);
+static gboolean
+gst_gl_dummy_window_has_output_surface (GstGLWindow * window)
+{
+ return FALSE;
+}
+
G_DEFINE_TYPE (GstGLDummyWindow, gst_gl_dummy_window, GST_TYPE_GL_WINDOW);
static void
GST_DEBUG_FUNCPTR (gst_gl_dummy_window_get_window_handle);
window_class->set_window_handle =
GST_DEBUG_FUNCPTR (gst_gl_dummy_window_set_window_handle);
+ window_class->has_output_surface =
+ GST_DEBUG_FUNCPTR (gst_gl_dummy_window_has_output_surface);
}
static void
* @queue_resize: request a resize to occur when possible
* @controls_viewport: Whether the window takes care of glViewport setup.
* and the user does not need to deal with viewports
+ * @has_output_surface: Whether the window has output surface or not. (Since: 1.18)
*/
struct _GstGLWindowClass {
GstObjectClass parent_class;
gboolean (*set_render_rectangle)(GstGLWindow *window, gint x, gint y, gint width, gint height);
void (*queue_resize) (GstGLWindow *window);
gboolean (*controls_viewport) (GstGLWindow *window);
+ gboolean (*has_output_surface) (GstGLWindow *window);
/*< private >*/
- gpointer _reserved[GST_PADDING-1];
+ gpointer _reserved[GST_PADDING-2];
};
GST_GL_API
GST_GL_API
guintptr gst_gl_window_get_display (GstGLWindow *window);
+GST_GL_API
+gboolean gst_gl_window_has_output_surface (GstGLWindow *window);
+
G_END_DECLS
#endif /* __GST_GL_WINDOW_H__ */