glcolorconvert: Keep colorimetry and chroma-site fields if passthrough

https://bugzilla.gnome.org/show_bug.cgi?id=748141
This commit is contained in:
Matthieu Bouron 2015-04-19 19:16:55 +02:00 committed by Tim-Philipp Müller
parent 5fbc9bd5e0
commit 4e05044734

View file

@ -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;
}