summaryrefslogtreecommitdiff
path: root/gst/frei0r
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2010-09-28 16:20:50 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2010-09-28 16:20:50 +0200
commit4e43e8bc677f52c5a6e88c4861f4d5e448fe60f8 (patch)
tree3f4763c08f162f4ce5da26a8ea066ababaddd358 /gst/frei0r
parent498620d16c8661d216c45694622c540cfb838b90 (diff)
downloadgstreamer-plugins-bad-4e43e8bc677f52c5a6e88c4861f4d5e448fe60f8.tar.gz
frei0r: Use static caps instead of converting strings to caps all the time
Diffstat (limited to 'gst/frei0r')
-rw-r--r--gst/frei0r/gstfrei0r.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/gst/frei0r/gstfrei0r.c b/gst/frei0r/gstfrei0r.c
index 6b8c0080a..c7a9c71d5 100644
--- a/gst/frei0r/gstfrei0r.c
+++ b/gst/frei0r/gstfrei0r.c
@@ -32,23 +32,27 @@
GST_DEBUG_CATEGORY (frei0r_debug);
#define GST_CAT_DEFAULT frei0r_debug
+static GstStaticCaps bgra8888_caps = GST_STATIC_CAPS (GST_VIDEO_CAPS_BGRA);
+static GstStaticCaps rgba8888_caps = GST_STATIC_CAPS (GST_VIDEO_CAPS_RGBA);
+static GstStaticCaps packed32_caps = GST_STATIC_CAPS (GST_VIDEO_CAPS_BGRA " ; "
+ GST_VIDEO_CAPS_RGBA " ; "
+ GST_VIDEO_CAPS_ABGR " ; "
+ GST_VIDEO_CAPS_ARGB " ; "
+ GST_VIDEO_CAPS_BGRx " ; "
+ GST_VIDEO_CAPS_RGBx " ; "
+ GST_VIDEO_CAPS_xBGR " ; "
+ GST_VIDEO_CAPS_xRGB " ; " GST_VIDEO_CAPS_YUV ("AYUV"));
+
GstCaps *
gst_frei0r_caps_from_color_model (gint color_model)
{
switch (color_model) {
case F0R_COLOR_MODEL_BGRA8888:
- return gst_caps_from_string (GST_VIDEO_CAPS_BGRA);
+ return gst_static_caps_get (&bgra8888_caps);
case F0R_COLOR_MODEL_RGBA8888:
- return gst_caps_from_string (GST_VIDEO_CAPS_RGBA);
+ return gst_static_caps_get (&rgba8888_caps);
case F0R_COLOR_MODEL_PACKED32:
- return gst_caps_from_string (GST_VIDEO_CAPS_BGRA " ; "
- GST_VIDEO_CAPS_RGBA " ; "
- GST_VIDEO_CAPS_ABGR " ; "
- GST_VIDEO_CAPS_ARGB " ; "
- GST_VIDEO_CAPS_BGRx " ; "
- GST_VIDEO_CAPS_RGBx " ; "
- GST_VIDEO_CAPS_xBGR " ; "
- GST_VIDEO_CAPS_xRGB " ; " GST_VIDEO_CAPS_YUV ("AYUV"));
+ return gst_static_caps_get (&packed32_caps);
default:
break;
}