libvisual: Factor out endian-order RGB formats
authorNirbheek Chauhan <nirbheek.chauhan@gmail.com>
Thu, 17 Mar 2016 18:17:48 +0000 (23:47 +0530)
committerTim-Philipp Müller <tim@centricular.com>
Tue, 24 May 2016 18:49:38 +0000 (19:49 +0100)
MSVC seems to ignore preprocessor conditionals inside static
pad templates. Also remove unnecessary quotes inside caps strings.

ext/libvisual/visual.c

index 926ac95..2ed94f0 100644 (file)
@@ -30,16 +30,16 @@ GST_DEBUG_CATEGORY_EXTERN (libvisual_debug);
 /* amounf of samples before we can feed libvisual */
 #define VISUAL_SAMPLES  512
 
-static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
-    GST_PAD_SRC,
-    GST_PAD_ALWAYS,
-    GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (" { "
 #if G_BYTE_ORDER == G_BIG_ENDIAN
-            "\"xRGB\", " "\"RGB\", "
+#define RGB_ORDER_CAPS "xRGB, RGB"
 #else
-            "\"BGRx\", " "\"BGR\", "
+#define RGB_ORDER_CAPS "BGRx, BGR"
 #endif
-            "\"RGB16\" } "))
+
+static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
+    GST_PAD_SRC,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (" { " RGB_ORDER_CAPS ", RGB16 } "))
     );
 
 static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",