diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-02-25 05:16:09 +0530 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2016-03-10 10:00:58 +0000 |
commit | 5d93844676cb8c5f270a5b107f217754bbb10a37 (patch) | |
tree | a1ec0e02fd3df18e1f79173523b97ab77257b036 | |
parent | 93d09f0474567c06efef3c77fb0e034a5d4a2f63 (diff) | |
download | gstreamer-plugins-good-5d93844676cb8c5f270a5b107f217754bbb10a37.tar.gz |
gst Factor out endian-order RGB formats
MSVC seems to ignore preprocessor conditionals inside static pad
template macros.
-rw-r--r-- | gst/flx/gstflxdec.c | 12 | ||||
-rw-r--r-- | gst/goom/gstgoom.c | 12 | ||||
-rw-r--r-- | gst/goom2k1/gstgoom.c | 12 | ||||
-rw-r--r-- | gst/monoscope/gstmonoscope.c | 16 |
4 files changed, 28 insertions, 24 deletions
diff --git a/gst/flx/gstflxdec.c b/gst/flx/gstflxdec.c index 71fd880fa..604be2f58 100644 --- a/gst/flx/gstflxdec.c +++ b/gst/flx/gstflxdec.c @@ -47,15 +47,17 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", GST_STATIC_CAPS ("video/x-fli") ); +#if G_BYTE_ORDER == G_BIG_ENDIAN +#define RGB_ORDER "xRGB" +#else +#define RGB_ORDER "BGRx" +#endif + /* output */ static GstStaticPadTemplate src_video_factory = 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 void gst_flxdec_dispose (GstFlxDec * flxdec); diff --git a/gst/goom/gstgoom.c b/gst/goom/gstgoom.c index 1e86ac51f..7cb1bd84c 100644 --- a/gst/goom/gstgoom.c +++ b/gst/goom/gstgoom.c @@ -66,14 +66,16 @@ enum /* FILL ME */ }; -static GstStaticPadTemplate 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")) +#define RGB_ORDER "xRGB" #else - GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("BGRx")) +#define RGB_ORDER "BGRx" #endif + +static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (RGB_ORDER)) ); static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", /* the name of the pads */ diff --git a/gst/goom2k1/gstgoom.c b/gst/goom2k1/gstgoom.c index 2f10db18d..0c97e9422 100644 --- a/gst/goom2k1/gstgoom.c +++ b/gst/goom2k1/gstgoom.c @@ -51,14 +51,16 @@ GST_DEBUG_CATEGORY_STATIC (goom2k1_debug); #define DEFAULT_FPS_N 25 #define DEFAULT_FPS_D 1 -static GstStaticPadTemplate 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")) +#define RGB_ORDER "xRGB" #else - GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("BGRx")) +#define RGB_ORDER "BGRx" #endif + +static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (RGB_ORDER)) ); static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", /* the name of the pads */ diff --git a/gst/monoscope/gstmonoscope.c b/gst/monoscope/gstmonoscope.c index 442c98524..9ff4fd576 100644 --- a/gst/monoscope/gstmonoscope.c +++ b/gst/monoscope/gstmonoscope.c @@ -47,22 +47,20 @@ GST_DEBUG_CATEGORY_STATIC (monoscope_debug); #define GST_CAT_DEFAULT monoscope_debug +#if G_BYTE_ORDER == G_BIG_ENDIAN +#define RGB_ORDER "xRGB" +#else +#define RGB_ORDER "BGRx" +#endif + static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, -#if G_BYTE_ORDER == G_BIG_ENDIAN GST_STATIC_CAPS ("video/x-raw, " - "format = (string) xRGB, " + "format = (string) " RGB_ORDER ", " "width = " G_STRINGIFY (scope_width) ", " "height = " G_STRINGIFY (scope_height) ", " "framerate = " GST_VIDEO_FPS_RANGE) -#else - GST_STATIC_CAPS ("video/x-raw, " - "format = (string) BGRx, " - "width = " G_STRINGIFY (scope_width) ", " - "height = " G_STRINGIFY (scope_height) ", " - "framerate = " GST_VIDEO_FPS_RANGE) -#endif ); static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", |