mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
gst Factor out endian-order RGB formats
MSVC seems to ignore preprocessor conditionals inside static pad template macros.
This commit is contained in:
parent
93d09f0474
commit
5d93844676
4 changed files with 28 additions and 24 deletions
|
@ -47,15 +47,17 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
|
||||||
GST_STATIC_CAPS ("video/x-fli")
|
GST_STATIC_CAPS ("video/x-fli")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#if G_BYTE_ORDER == G_BIG_ENDIAN
|
||||||
|
#define RGB_ORDER "xRGB"
|
||||||
|
#else
|
||||||
|
#define RGB_ORDER "BGRx"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* output */
|
/* output */
|
||||||
static GstStaticPadTemplate src_video_factory = GST_STATIC_PAD_TEMPLATE ("src",
|
static GstStaticPadTemplate src_video_factory = 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 void gst_flxdec_dispose (GstFlxDec * flxdec);
|
static void gst_flxdec_dispose (GstFlxDec * flxdec);
|
||||||
|
|
|
@ -66,14 +66,16 @@ enum
|
||||||
/* FILL ME */
|
/* FILL ME */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#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",
|
static GstStaticPadTemplate src_template = 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 sink_template = GST_STATIC_PAD_TEMPLATE ("sink", /* the name of the pads */
|
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", /* the name of the pads */
|
||||||
|
|
|
@ -51,14 +51,16 @@ GST_DEBUG_CATEGORY_STATIC (goom2k1_debug);
|
||||||
#define DEFAULT_FPS_N 25
|
#define DEFAULT_FPS_N 25
|
||||||
#define DEFAULT_FPS_D 1
|
#define DEFAULT_FPS_D 1
|
||||||
|
|
||||||
|
#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",
|
static GstStaticPadTemplate src_template = 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 sink_template = GST_STATIC_PAD_TEMPLATE ("sink", /* the name of the pads */
|
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", /* the name of the pads */
|
||||||
|
|
|
@ -47,22 +47,20 @@
|
||||||
GST_DEBUG_CATEGORY_STATIC (monoscope_debug);
|
GST_DEBUG_CATEGORY_STATIC (monoscope_debug);
|
||||||
#define GST_CAT_DEFAULT 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",
|
static GstStaticPadTemplate src_template = 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 ("video/x-raw, "
|
GST_STATIC_CAPS ("video/x-raw, "
|
||||||
"format = (string) xRGB, "
|
"format = (string) " RGB_ORDER ", "
|
||||||
"width = " G_STRINGIFY (scope_width) ", "
|
"width = " G_STRINGIFY (scope_width) ", "
|
||||||
"height = " G_STRINGIFY (scope_height) ", "
|
"height = " G_STRINGIFY (scope_height) ", "
|
||||||
"framerate = " GST_VIDEO_FPS_RANGE)
|
"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",
|
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
|
||||||
|
|
Loading…
Reference in a new issue