summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorMatthieu Bouron <matthieu.bouron@collabora.com>2015-04-19 19:16:55 +0200
committerSebastian Dröge <sebastian@centricular.com>2015-04-26 20:31:53 +0200
commit76b2cefd2d916aba1fb70a3ca221adec844aa7f6 (patch)
treeb5b2555edaabbc0394563ddd929a34aa3269881e /ext
parent699452ef31cb41bf8a809e45350058b0ae462834 (diff)
downloadgstreamer-plugins-bad-76b2cefd2d916aba1fb70a3ca221adec844aa7f6.tar.gz
glcolorconvert: Keep colorimetry and chroma-site fields if passthrough
https://bugzilla.gnome.org/show_bug.cgi?id=748141
Diffstat (limited to 'ext')
-rw-r--r--ext/gl/gstglcolorconvertelement.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/ext/gl/gstglcolorconvertelement.c b/ext/gl/gstglcolorconvertelement.c
index 3fd1b5326..52cf13bf3 100644
--- a/ext/gl/gstglcolorconvertelement.c
+++ b/ext/gl/gstglcolorconvertelement.c
@@ -48,6 +48,8 @@ gst_gl_color_convert_element_prepare_output_buffer (GstBaseTransform * bt,
GstBuffer * inbuf, GstBuffer ** outbuf);
static GstFlowReturn gst_gl_color_convert_element_transform (GstBaseTransform *
bt, GstBuffer * inbuf, GstBuffer * outbuf);
+static GstCaps *gst_gl_color_convert_element_fixate_caps (GstBaseTransform *
+ bt, GstPadDirection direction, GstCaps * caps, GstCaps * othercaps);
static GstStaticPadTemplate gst_gl_color_convert_element_src_pad_template =
GST_STATIC_PAD_TEMPLATE ("src",
@@ -93,6 +95,7 @@ gst_gl_color_convert_element_class_init (GstGLColorConvertElementClass * klass)
gst_gl_color_convert_element_prepare_output_buffer;
bt_class->transform = gst_gl_color_convert_element_transform;
bt_class->stop = gst_gl_color_convert_element_stop;
+ bt_class->fixate_caps = gst_gl_color_convert_element_fixate_caps;
bt_class->passthrough_on_same_caps = TRUE;
@@ -211,3 +214,25 @@ gst_gl_color_convert_element_transform (GstBaseTransform * bt,
{
return GST_FLOW_OK;
}
+
+static GstCaps *
+gst_gl_color_convert_element_fixate_caps (GstBaseTransform *
+ bt, GstPadDirection direction, GstCaps * caps, GstCaps * othercaps)
+{
+ GstCaps *ret;
+
+ ret =
+ GST_BASE_TRANSFORM_CLASS
+ (gst_gl_color_convert_element_parent_class)->fixate_caps (bt, direction,
+ caps, othercaps);
+
+ if (direction == GST_PAD_SINK) {
+ GstStructure *in_structure = gst_caps_get_structure (caps, 0);
+
+ if (gst_caps_is_subset (caps, ret)) {
+ gst_caps_replace (&ret, caps);
+ }
+ }
+
+ return ret;
+}