Search
SailfishOS Open Build Service
>
Projects
>
home:sledge
:
branches:nemo:devel:hw:ti:omap4:common
>
gst-plugins-base
> 0027-stridetransform-maintain-caps-order.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File 0027-stridetransform-maintain-caps-order.patch of Package gst-plugins-base
From 4bb4d524f494fb9e2f05d5e202ab86795eb6fcf0 Mon Sep 17 00:00:00 2001 From: Alessandro Decina <alessandro.decina@collabora.co.uk> Date: Thu, 18 Aug 2011 11:28:19 +0200 Subject: [PATCH] stridetransform: maintain caps order transform yuv to yuv;yuv-strided and yuv-strided to yuv-strided;yuv. Fixes some dynamic pipelines negotiating non-strided yuv for no good reason. --- gst/stride/gststridetransform.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/gst/stride/gststridetransform.c b/gst/stride/gststridetransform.c index 7874ed4..b272500 100644 --- a/gst/stride/gststridetransform.c +++ b/gst/stride/gststridetransform.c @@ -479,6 +479,32 @@ gst_stride_transform_transform_caps (GstBaseTransform * base, gst_caps_do_simplify (ret); + /* do_simplify sorts caps in a way that yuv always comes before yuv-strided. + * If we're converting from yuv-strided we want to favor yuv-strided though, + * so we reverse the result. + */ + if (!gst_caps_is_empty (caps)) { + GstCaps *tmp; + GstStructure *s; + const char *name; + + s = gst_caps_get_structure (caps, 0); + name = gst_structure_get_name (s); + + if (!strcmp (name, "video/x-raw-yuv-strided") || + !strcmp (name, "video/x-raw-rgb-strided")) { + tmp = gst_caps_new_empty (); + + for (int i = gst_caps_get_size (ret) - 1; i >= 0; i--) { + gst_caps_append_structure (tmp, + gst_structure_copy (gst_caps_get_structure (ret, i))); + } + + gst_caps_unref (ret); + ret = tmp; + } + } + LOG_CAPS (self, ret); return ret; -- 1.7.9.5