build: Factor out endian-order RGB formats

MSVC seems to ignore preprocessor conditionals inside static pad templates
This commit is contained in:
Nirbheek Chauhan 2016-03-02 00:55:15 +05:30 committed by Tim-Philipp Müller
parent 74dcb59025
commit 36332faf14
4 changed files with 28 additions and 20 deletions

View file

@ -39,15 +39,17 @@
#include <stdlib.h> #include <stdlib.h>
#include "gstspacescope.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 = static GstStaticPadTemplate gst_space_scope_src_template =
GST_STATIC_PAD_TEMPLATE ("src", GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC, GST_PAD_SRC,
GST_PAD_ALWAYS, GST_PAD_ALWAYS,
#if G_BYTE_ORDER == G_BIG_ENDIAN GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (RGB_ORDER))
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("xRGB"))
#else
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("BGRx"))
#endif
); );
static GstStaticPadTemplate gst_space_scope_sink_template = static GstStaticPadTemplate gst_space_scope_sink_template =

View file

@ -40,15 +40,17 @@
#include "gstspectrascope.h" #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 = static GstStaticPadTemplate gst_spectra_scope_src_template =
GST_STATIC_PAD_TEMPLATE ("src", GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC, GST_PAD_SRC,
GST_PAD_ALWAYS, GST_PAD_ALWAYS,
#if G_BYTE_ORDER == G_BIG_ENDIAN GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (RGB_ORDER))
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("xRGB"))
#else
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("BGRx"))
#endif
); );
static GstStaticPadTemplate gst_spectra_scope_sink_template = static GstStaticPadTemplate gst_spectra_scope_sink_template =

View file

@ -38,15 +38,17 @@
#include "gstsynaescope.h" #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 = static GstStaticPadTemplate gst_synae_scope_src_template =
GST_STATIC_PAD_TEMPLATE ("src", GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC, GST_PAD_SRC,
GST_PAD_ALWAYS, GST_PAD_ALWAYS,
#if G_BYTE_ORDER == G_BIG_ENDIAN GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (RGB_ORDER))
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("xRGB"))
#else
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("BGRx"))
#endif
); );
static GstStaticPadTemplate gst_synae_scope_sink_template = static GstStaticPadTemplate gst_synae_scope_sink_template =

View file

@ -39,15 +39,17 @@
#include <stdlib.h> #include <stdlib.h>
#include "gstwavescope.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 = static GstStaticPadTemplate gst_wave_scope_src_template =
GST_STATIC_PAD_TEMPLATE ("src", GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC, GST_PAD_SRC,
GST_PAD_ALWAYS, GST_PAD_ALWAYS,
#if G_BYTE_ORDER == G_BIG_ENDIAN GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (RGB_ORDER))
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("xRGB"))
#else
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("BGRx"))
#endif
); );
static GstStaticPadTemplate gst_wave_scope_sink_template = static GstStaticPadTemplate gst_wave_scope_sink_template =