gl: use #ifdef HAVE_* instead of #if HAVE_FOO

This commit is contained in:
Tim-Philipp Müller 2017-12-10 22:27:31 +00:00
parent 59fe9c9122
commit 26b3955aba
2 changed files with 8 additions and 12 deletions

View file

@ -59,7 +59,7 @@
#include <gst/gl/gstglfuncs.h> #include <gst/gl/gstglfuncs.h>
#include "gstglfiltershader.h" #include "gstglfiltershader.h"
#if HAVE_GRAPHENE #ifdef HAVE_GRAPHENE
#include <graphene-gobject.h> #include <graphene-gobject.h>
#endif #endif
@ -360,7 +360,7 @@ _set_uniform (GQuark field_id, const GValue * value, gpointer user_data)
} else if (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_FLOAT)) { } else if (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_FLOAT)) {
gst_gl_shader_set_uniform_1f (shader, field_name, gst_gl_shader_set_uniform_1f (shader, field_name,
g_value_get_float (value)); g_value_get_float (value));
#if HAVE_GRAPHENE #ifdef HAVE_GRAPHENE
} else if (G_TYPE_CHECK_VALUE_TYPE ((value), GRAPHENE_TYPE_VEC2)) { } else if (G_TYPE_CHECK_VALUE_TYPE ((value), GRAPHENE_TYPE_VEC2)) {
graphene_vec2_t *vec2 = g_value_get_boxed (value); graphene_vec2_t *vec2 = g_value_get_boxed (value);
float x = graphene_vec2_get_x (vec2); float x = graphene_vec2_get_x (vec2);

View file

@ -65,15 +65,13 @@
#include "gstgltestsrc.h" #include "gstgltestsrc.h"
#include "gstgldeinterlace.h" #include "gstgldeinterlace.h"
#if HAVE_GRAPHENE #ifdef HAVE_GRAPHENE
#include "gstgltransformation.h" #include "gstgltransformation.h"
#include "gstglvideoflip.h" #include "gstglvideoflip.h"
#endif #endif
#if HAVE_JPEG #if defined(HAVE_JPEG) && defined(HAVE_PNG)
#if HAVE_PNG
#include "gstgloverlay.h" #include "gstgloverlay.h"
#endif /* HAVE_PNG */ #endif
#endif /* HAVE_JPEG */
#if GST_GL_HAVE_OPENGL #if GST_GL_HAVE_OPENGL
#include "gstglfilterglass.h" #include "gstglfilterglass.h"
@ -171,7 +169,7 @@ plugin_init (GstPlugin * plugin)
GST_RANK_NONE, GST_TYPE_GL_FILTER_CUBE)) { GST_RANK_NONE, GST_TYPE_GL_FILTER_CUBE)) {
return FALSE; return FALSE;
} }
#if HAVE_GRAPHENE #ifdef HAVE_GRAPHENE
if (!gst_element_register (plugin, "gltransformation", if (!gst_element_register (plugin, "gltransformation",
GST_RANK_NONE, GST_TYPE_GL_TRANSFORMATION)) { GST_RANK_NONE, GST_TYPE_GL_TRANSFORMATION)) {
return FALSE; return FALSE;
@ -236,14 +234,12 @@ plugin_init (GstPlugin * plugin)
GST_RANK_NONE, GST_TYPE_GL_DEINTERLACE)) { GST_RANK_NONE, GST_TYPE_GL_DEINTERLACE)) {
return FALSE; return FALSE;
} }
#if HAVE_JPEG #if defined(HAVE_JPEG) && defined(HAVE_PNG)
#if HAVE_PNG
if (!gst_element_register (plugin, "gloverlay", if (!gst_element_register (plugin, "gloverlay",
GST_RANK_NONE, gst_gl_overlay_get_type ())) { GST_RANK_NONE, gst_gl_overlay_get_type ())) {
return FALSE; return FALSE;
} }
#endif /* HAVE_PNG */ #endif
#endif /* HAVE_JPEG */
#if GST_GL_HAVE_OPENGL #if GST_GL_HAVE_OPENGL
if (!gst_element_register (plugin, "glfilterglass", if (!gst_element_register (plugin, "glfilterglass",
GST_RANK_NONE, GST_TYPE_GL_FILTER_GLASS)) { GST_RANK_NONE, GST_TYPE_GL_FILTER_GLASS)) {