mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
frei0r: Use static caps instead of converting strings to caps all the time
This commit is contained in:
parent
498620d16c
commit
4e43e8bc67
1 changed files with 14 additions and 10 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue