gl: Fix backwards compat GST_GL_TYPE_* functions/macros

These have to be macros instead of inline function as they must behave
more or less like an integer literal, i.e. include the function call.
This commit is contained in:
Sebastian Dröge 2017-03-04 11:15:58 +02:00 committed by Tim-Philipp Müller
parent dde95e8270
commit de16dc2555
6 changed files with 18 additions and 12 deletions

View file

@ -31,8 +31,9 @@ G_BEGIN_DECLS
GType gst_gl_context_cocoa_get_type (void); GType gst_gl_context_cocoa_get_type (void);
/* FIXME: remove this when moving to -base */ /* FIXME: remove this when moving to -base */
G_DEPRECATED_FOR(GST_TYPE_GL_CONTEXT_COCOA) \ #ifndef GST_DISABLE_DEPRECATED
static inline GType GST_GL_TYPE_CONTEXT_COCOA (void) { return GST_TYPE_GL_CONTEXT_COCOA; } #define GST_GL_TYPE_CONTEXT_COCOA GST_TYPE_GL_CONTEXT_COCOA
#endif
#define GST_GL_CONTEXT_COCOA(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GST_TYPE_GL_CONTEXT_COCOA, GstGLContextCocoa)) #define GST_GL_CONTEXT_COCOA(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GST_TYPE_GL_CONTEXT_COCOA, GstGLContextCocoa))
#define GST_GL_CONTEXT_COCOA_CLASS(k) (G_TYPE_CHECK_CLASS((k), GST_TYPE_GL_CONTEXT_COCOA, GstGLContextCocoaClass)) #define GST_GL_CONTEXT_COCOA_CLASS(k) (G_TYPE_CHECK_CLASS((k), GST_TYPE_GL_CONTEXT_COCOA, GstGLContextCocoaClass))
#define GST_IS_GL_CONTEXT_COCOA(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_GL_CONTEXT_COCOA)) #define GST_IS_GL_CONTEXT_COCOA(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_GL_CONTEXT_COCOA))

View file

@ -36,8 +36,9 @@ GType gst_gl_context_egl_get_type (void);
#define GST_TYPE_GL_CONTEXT_EGL (gst_gl_context_egl_get_type()) #define GST_TYPE_GL_CONTEXT_EGL (gst_gl_context_egl_get_type())
/* FIXME: remove this when moving to -base */ /* FIXME: remove this when moving to -base */
G_DEPRECATED_FOR(GST_TYPE_GL_CONTEXT_EGL) \ #ifndef GST_DISABLE_DEPRECATED
static inline GType GST_GL_TYPE_CONTEXT_EGL (void) { return GST_TYPE_GL_CONTEXT_EGL; } #define GST_GL_TYPE_CONTEXT_EGL GST_TYPE_GL_CONTEXT_EGL
#endif
#define GST_GL_CONTEXT_EGL(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GST_TYPE_GL_CONTEXT_EGL, GstGLContextEGL)) #define GST_GL_CONTEXT_EGL(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GST_TYPE_GL_CONTEXT_EGL, GstGLContextEGL))
#define GST_GL_CONTEXT_EGL_CLASS(k) (G_TYPE_CHECK_CLASS((k), GST_TYPE_GL_CONTEXT_EGL, GstGLContextEGLClass)) #define GST_GL_CONTEXT_EGL_CLASS(k) (G_TYPE_CHECK_CLASS((k), GST_TYPE_GL_CONTEXT_EGL, GstGLContextEGLClass))
#define GST_IS_GL_CONTEXT_EGL(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_GL_CONTEXT_EGL)) #define GST_IS_GL_CONTEXT_EGL(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_GL_CONTEXT_EGL))

View file

@ -32,8 +32,9 @@ GType gst_gl_context_get_type (void);
#define GST_TYPE_GL_CONTEXT (gst_gl_context_get_type()) #define GST_TYPE_GL_CONTEXT (gst_gl_context_get_type())
/* FIXME: remove this when moving to -base */ /* FIXME: remove this when moving to -base */
G_DEPRECATED_FOR(GST_TYPE_GL_CONTEXT) \ #ifndef GST_DISABLE_DEPRECATED
static inline GType GST_GL_TYPE_CONTEXT (void) { return GST_TYPE_GL_CONTEXT; } #define GST_TYPE_GL_CONTEXT GST_TYPE_GL_CONTEXT
#endif
#define GST_GL_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GST_TYPE_GL_CONTEXT, GstGLContext)) #define GST_GL_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GST_TYPE_GL_CONTEXT, GstGLContext))
#define GST_GL_CONTEXT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GST_TYPE_GL_CONTEXT, GstGLContextClass)) #define GST_GL_CONTEXT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GST_TYPE_GL_CONTEXT, GstGLContextClass))
#define GST_IS_GL_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_GL_CONTEXT)) #define GST_IS_GL_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_GL_CONTEXT))

View file

@ -31,8 +31,9 @@ GType gst_gl_shader_get_type (void);
#define GST_TYPE_GL_SHADER (gst_gl_shader_get_type()) #define GST_TYPE_GL_SHADER (gst_gl_shader_get_type())
/* FIXME: remove this when moving to -base */ /* FIXME: remove this when moving to -base */
G_DEPRECATED_FOR(GST_TYPE_GL_SHADER) \ #ifndef GST_DISABLE_DEPRECATED
static inline GType GST_GL_TYPE_SHADER (void) { return GST_TYPE_GL_SHADER; } #define GST_TYPE_GL_SHADER GST_TYPE_GL_SHADER
#endif
#define GST_GL_SHADER(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GST_TYPE_GL_SHADER, GstGLShader)) #define GST_GL_SHADER(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GST_TYPE_GL_SHADER, GstGLShader))
#define GST_GL_SHADER_CLASS(k) (G_TYPE_CHECK_CLASS((k), GST_TYPE_GL_SHADER, GstGLShaderClass)) #define GST_GL_SHADER_CLASS(k) (G_TYPE_CHECK_CLASS((k), GST_TYPE_GL_SHADER, GstGLShaderClass))
#define GST_IS_GL_SHADER(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_GL_SHADER)) #define GST_IS_GL_SHADER(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_GL_SHADER))

View file

@ -35,8 +35,9 @@ GType gst_gl_window_get_type (void);
#define GST_TYPE_GL_WINDOW (gst_gl_window_get_type()) #define GST_TYPE_GL_WINDOW (gst_gl_window_get_type())
/* FIXME: remove this when moving to -base */ /* FIXME: remove this when moving to -base */
G_DEPRECATED_FOR(GST_TYPE_GL_WINDOW) \ #ifndef GST_DISABLE_DEPRECATED
static inline GType GST_GL_TYPE_WINDOW (void) { return GST_TYPE_GL_WINDOW; } #define GST_TYPE_GL_WINDOW GST_TYPE_GL_WINDOW
#endif
#define GST_GL_WINDOW(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GST_TYPE_GL_WINDOW, GstGLWindow)) #define GST_GL_WINDOW(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GST_TYPE_GL_WINDOW, GstGLWindow))
#define GST_GL_WINDOW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GST_TYPE_GL_WINDOW, GstGLWindowClass)) #define GST_GL_WINDOW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GST_TYPE_GL_WINDOW, GstGLWindowClass))
#define GST_IS_GL_WINDOW(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_GL_WINDOW)) #define GST_IS_GL_WINDOW(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_GL_WINDOW))

View file

@ -31,8 +31,9 @@ G_BEGIN_DECLS
GType gst_gl_context_glx_get_type (void); GType gst_gl_context_glx_get_type (void);
/* FIXME: remove this when moving to -base */ /* FIXME: remove this when moving to -base */
G_DEPRECATED_FOR(GST_TYPE_GL_CONTEXT_GLX) \ #ifndef GST_DISABLE_DEPRECATED
static inline GType GST_GL_TYPE_CONTEXT_GLX (void) { return GST_TYPE_GL_CONTEXT_GLX; } #define GST_TYPE_GL_CONTEXT_GLX GST_TYPE_GL_CONTEXT_GLX
#endif
#define GST_GL_CONTEXT_GLX(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GST_TYPE_GL_CONTEXT_GLX, GstGLContextGLX)) #define GST_GL_CONTEXT_GLX(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GST_TYPE_GL_CONTEXT_GLX, GstGLContextGLX))
#define GST_GL_CONTEXT_GLX_CLASS(k) (G_TYPE_CHECK_CLASS((k), GST_TYPE_GL_CONTEXT_GLX, GstGLContextGLXClass)) #define GST_GL_CONTEXT_GLX_CLASS(k) (G_TYPE_CHECK_CLASS((k), GST_TYPE_GL_CONTEXT_GLX, GstGLContextGLXClass))
#define GST_IS_GL_CONTEXT_GLX(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_GL_CONTEXT_GLX)) #define GST_IS_GL_CONTEXT_GLX(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_GL_CONTEXT_GLX))