summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-03-02 00:55:15 +0530
committerTim-Philipp Müller <tim@centricular.com>2016-06-21 11:32:29 +0100
commit36332faf146d63a2047fb6777e5b4eae7d16757c (patch)
treeefef90183d43d873224220651b05d0ede0809fad
parent74dcb59025615960dd114d52ca1b0fa3d08b6237 (diff)
downloadgstreamer-plugins-bad-36332faf146d63a2047fb6777e5b4eae7d16757c.tar.gz
build: Factor out endian-order RGB formats
MSVC seems to ignore preprocessor conditionals inside static pad templates
-rw-r--r--gst/audiovisualizers/gstspacescope.c12
-rw-r--r--gst/audiovisualizers/gstspectrascope.c12
-rw-r--r--gst/audiovisualizers/gstsynaescope.c12
-rw-r--r--gst/audiovisualizers/gstwavescope.c12
4 files changed, 28 insertions, 20 deletions
diff --git a/gst/audiovisualizers/gstspacescope.c b/gst/audiovisualizers/gstspacescope.c
index de1336f97..5071dc8b1 100644
--- a/gst/audiovisualizers/gstspacescope.c
+++ b/gst/audiovisualizers/gstspacescope.c
@@ -39,15 +39,17 @@
#include <stdlib.h>
#include "gstspacescope.h"
+#if G_BYTE_ORDER == G_BIG_ENDIAN
+#define RGB_ORDER "xRGB"
+#else
+#define RGB_ORDER "BGRx"
+#endif
+
static GstStaticPadTemplate gst_space_scope_src_template =
GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
-#if G_BYTE_ORDER == G_BIG_ENDIAN
- GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("xRGB"))
-#else
- GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("BGRx"))
-#endif
+ GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (RGB_ORDER))
);
static GstStaticPadTemplate gst_space_scope_sink_template =
diff --git a/gst/audiovisualizers/gstspectrascope.c b/gst/audiovisualizers/gstspectrascope.c
index ffa41a1c4..10aa7d2f8 100644
--- a/gst/audiovisualizers/gstspectrascope.c
+++ b/gst/audiovisualizers/gstspectrascope.c
@@ -40,15 +40,17 @@
#include "gstspectrascope.h"
+#if G_BYTE_ORDER == G_BIG_ENDIAN
+#define RGB_ORDER "xRGB"
+#else
+#define RGB_ORDER "BGRx"
+#endif
+
static GstStaticPadTemplate gst_spectra_scope_src_template =
GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
-#if G_BYTE_ORDER == G_BIG_ENDIAN
- GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("xRGB"))
-#else
- GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("BGRx"))
-#endif
+ GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (RGB_ORDER))
);
static GstStaticPadTemplate gst_spectra_scope_sink_template =
diff --git a/gst/audiovisualizers/gstsynaescope.c b/gst/audiovisualizers/gstsynaescope.c
index 60814fe9a..f99a753ea 100644
--- a/gst/audiovisualizers/gstsynaescope.c
+++ b/gst/audiovisualizers/gstsynaescope.c
@@ -38,15 +38,17 @@
#include "gstsynaescope.h"
+#if G_BYTE_ORDER == G_BIG_ENDIAN
+#define RGB_ORDER "xRGB"
+#else
+#define RGB_ORDER "BGRx"
+#endif
+
static GstStaticPadTemplate gst_synae_scope_src_template =
GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
-#if G_BYTE_ORDER == G_BIG_ENDIAN
- GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("xRGB"))
-#else
- GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("BGRx"))
-#endif
+ GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (RGB_ORDER))
);
static GstStaticPadTemplate gst_synae_scope_sink_template =
diff --git a/gst/audiovisualizers/gstwavescope.c b/gst/audiovisualizers/gstwavescope.c
index c3b92465a..e4eb8c2fb 100644
--- a/gst/audiovisualizers/gstwavescope.c
+++ b/gst/audiovisualizers/gstwavescope.c
@@ -39,15 +39,17 @@
#include <stdlib.h>
#include "gstwavescope.h"
+#if G_BYTE_ORDER == G_BIG_ENDIAN
+#define RGB_ORDER "xRGB"
+#else
+#define RGB_ORDER "BGRx"
+#endif
+
static GstStaticPadTemplate gst_wave_scope_src_template =
GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
-#if G_BYTE_ORDER == G_BIG_ENDIAN
- GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("xRGB"))
-#else
- GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("BGRx"))
-#endif
+ GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (RGB_ORDER))
);
static GstStaticPadTemplate gst_wave_scope_sink_template =