summaryrefslogtreecommitdiff
path: root/gst/bayer/gstbayer2rgb.c
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2014-12-22 16:45:05 +0000
committerTim-Philipp Müller <tim@centricular.com>2014-12-22 16:46:06 +0000
commit68d4616ac88eb1af2e238f8b0876725753e8372c (patch)
tree36f838222f052856382da3f6edb8ef87a4bf5cde /gst/bayer/gstbayer2rgb.c
parent5dd1dfdadc3e327adb7bf2b76b5a51e24aa341dc (diff)
downloadgstreamer-plugins-bad-68d4616ac88eb1af2e238f8b0876725753e8372c.tar.gz
bayer2rgb: take into account filter in transform_caps function
Fixes criticals when filter caps are passed. Also fix wrong GST_DEBUG_OBJECT use. https://bugzilla.gnome.org/show_bug.cgi?id=741863
Diffstat (limited to 'gst/bayer/gstbayer2rgb.c')
-rw-r--r--gst/bayer/gstbayer2rgb.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/gst/bayer/gstbayer2rgb.c b/gst/bayer/gstbayer2rgb.c
index f07623159..036ac2a86 100644
--- a/gst/bayer/gstbayer2rgb.c
+++ b/gst/bayer/gstbayer2rgb.c
@@ -286,7 +286,7 @@ gst_bayer2rgb_transform_caps (GstBaseTransform * base,
GstCaps *newcaps;
GstStructure *newstruct;
- GST_DEBUG_OBJECT (caps, "transforming caps (from)");
+ GST_DEBUG_OBJECT (base, "transforming caps from %" GST_PTR_FORMAT, caps);
structure = gst_caps_get_structure (caps, 0);
@@ -305,7 +305,17 @@ gst_bayer2rgb_transform_caps (GstBaseTransform * base,
gst_structure_set_value (newstruct, "framerate",
gst_structure_get_value (structure, "framerate"));
- GST_DEBUG_OBJECT (newcaps, "transforming caps (into)");
+ if (filter != NULL) {
+ GstCaps *icaps;
+
+ GST_DEBUG_OBJECT (base, " filter %" GST_PTR_FORMAT, filter);
+
+ icaps = gst_caps_intersect_full (filter, newcaps, GST_CAPS_INTERSECT_FIRST);
+ gst_caps_unref (newcaps);
+ newcaps = icaps;
+ }
+
+ GST_DEBUG_OBJECT (base, " into %" GST_PTR_FORMAT, newcaps);
return newcaps;
}