summaryrefslogtreecommitdiff
path: root/gst-libs/gst/gl/gstgldisplay.h
diff options
context:
space:
mode:
authorJulien Isorce <julien.isorce@gmail.com>2011-11-24 16:02:32 +0100
committerMatthew Waters <ystreet00@gmail.com>2014-03-15 18:36:42 +0100
commitf639d6096daa45a2d68e077b23de10a2b2451a22 (patch)
tree06a1ac780c3f5080d341b7440be8d76882c24cd7 /gst-libs/gst/gl/gstgldisplay.h
parent9e535a04101fdcec893e2d1f64e1fd0d25561162 (diff)
downloadgstreamer-plugins-bad-f639d6096daa45a2d68e077b23de10a2b2451a22.tar.gz
[481/906] feature checking: error out instead of doing nothing if an OpenGL feature is not present
Fix bug #572767
Diffstat (limited to 'gst-libs/gst/gl/gstgldisplay.h')
-rw-r--r--gst-libs/gst/gl/gstgldisplay.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/gst-libs/gst/gl/gstgldisplay.h b/gst-libs/gst/gl/gstgldisplay.h
index 2ba0ef785..5645b9dab 100644
--- a/gst-libs/gst/gl/gstgldisplay.h
+++ b/gst-libs/gst/gl/gstgldisplay.h
@@ -40,6 +40,7 @@ G_BEGIN_DECLS
(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))
typedef struct _GstGLDisplay GstGLDisplay;
typedef struct _GstGLDisplayClass GstGLDisplayClass;
@@ -77,6 +78,8 @@ typedef void (*GstGLDisplayThreadFunc) (GstGLDisplay * display, gpointer data);
typedef void (*GLCB) (gint, gint, guint, gpointer stuff);
typedef void (*GLCB_V2) (gpointer stuff);
+#define GST_GL_DISPLAY_ERR_MSG(obj) (GST_GL_DISPLAY_CAST(obj)->error_message)
+
struct _GstGLDisplay
{
GObject object;
@@ -224,6 +227,8 @@ struct _GstGLDisplay
GstGLShader *shader_download_RGB;
#endif
+ gchar *error_message;
+
};
@@ -240,7 +245,7 @@ GType gst_gl_display_get_type (void);
//------------------------------------------------------------
GstGLDisplay *gst_gl_display_new (void);
-void gst_gl_display_create_context (GstGLDisplay * display,
+gboolean gst_gl_display_create_context (GstGLDisplay * display,
gulong external_gl_context);
gboolean gst_gl_display_redisplay (GstGLDisplay * display, GLuint texture,
gint gl_width, gint gl_height, gint window_width, gint window_height,
@@ -254,17 +259,17 @@ void gst_gl_display_gen_texture (GstGLDisplay * display, GLuint * pTexture,
void gst_gl_display_del_texture (GstGLDisplay * display, GLuint texture,
GLint width, GLint height);
-void gst_gl_display_init_upload (GstGLDisplay * display,
+gboolean gst_gl_display_init_upload (GstGLDisplay * display,
GstVideoFormat video_format, guint gl_width, guint gl_height,
gint video_width, gint video_height);
gboolean gst_gl_display_do_upload (GstGLDisplay * display, GLuint texture,
gint data_width, gint data_height, gpointer data);
-void gst_gl_display_init_download (GstGLDisplay * display,
+gboolean gst_gl_display_init_download (GstGLDisplay * display,
GstVideoFormat video_format, gint width, gint height);
gboolean gst_gl_display_do_download (GstGLDisplay * display, GLuint texture,
gint width, gint height, gpointer data);
-void gst_gl_display_gen_fbo (GstGLDisplay * display, gint width, gint height,
+gboolean gst_gl_display_gen_fbo (GstGLDisplay * display, gint width, gint height,
GLuint * fbo, GLuint * depthbuffer);
gboolean gst_gl_display_use_fbo (GstGLDisplay * display, gint texture_fbo_width,
gint texture_fbo_height, GLuint fbo, GLuint depth_buffer,
@@ -278,7 +283,7 @@ gboolean gst_gl_display_use_fbo_v2 (GstGLDisplay * display, gint texture_fbo_wid
void gst_gl_display_del_fbo (GstGLDisplay * display, GLuint fbo,
GLuint depth_buffer);
-void gst_gl_display_gen_shader (GstGLDisplay * display,
+gboolean gst_gl_display_gen_shader (GstGLDisplay * display,
const gchar * shader_vertex_source,
const gchar * shader_fragment_source, GstGLShader ** shader);
void gst_gl_display_del_shader (GstGLDisplay * display, GstGLShader * shader);
@@ -292,6 +297,9 @@ void gst_gl_display_set_client_data (GstGLDisplay * display, gpointer data);
gulong gst_gl_display_get_internal_gl_context (GstGLDisplay * display);
void gst_gl_display_activate_gl_context (GstGLDisplay * display, gboolean activate);
+/* Must be called inside a lock/unlock on display, or within the glthread */
+void gst_gl_display_set_error (GstGLDisplay * display, const char * format, ...);
+
G_END_DECLS
#endif /* __GST_GL_H__ */