diff options
author | Youness Alaoui <youness.alaoui@collabora.co.uk> | 2013-01-16 14:41:08 -0500 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2013-01-16 14:51:01 -0500 |
commit | 410d0c0194d2628f271da0a1c810ad77446cf733 (patch) | |
tree | d299b15fa02c3c95ac5ec6865730eb728a481a90 /sys/uvch264 | |
parent | e358ec6dddde2dc26a6acb921cbe607a0b56f48c (diff) | |
download | gstreamer-plugins-bad-410d0c0194d2628f271da0a1c810ad77446cf733.tar.gz |
uvch264: Add a fakesink to the transform_caps
Some version of basetransform will return the template caps if the src
pad is not linked, so the capsfilter will return ANY. Linking it to
fakesink allows us to return the right caps in the capsfilter and have
them transformed by the colorspace converter.
Diffstat (limited to 'sys/uvch264')
-rw-r--r-- | sys/uvch264/gstuvch264_src.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/uvch264/gstuvch264_src.c b/sys/uvch264/gstuvch264_src.c index 69351e712..206ead8bb 100644 --- a/sys/uvch264/gstuvch264_src.c +++ b/sys/uvch264/gstuvch264_src.c @@ -2185,20 +2185,33 @@ _transform_caps (GstUvcH264Src * self, GstCaps * caps, const gchar * name) { GstElement *el = gst_element_factory_make (name, NULL); GstElement *cf = gst_element_factory_make ("capsfilter", NULL); + GstElement *fs = gst_element_factory_make ("fakesink", NULL); GstPad *sink; - if (!el || !cf || !gst_bin_add (GST_BIN (self), el)) { + if (!el || !cf || !fs || !gst_bin_add (GST_BIN (self), el)) { if (el) gst_object_unref (el); if (cf) gst_object_unref (cf); + if (fs) + gst_object_unref (fs); goto done; } if (!gst_bin_add (GST_BIN (self), cf)) { gst_object_unref (cf); + gst_object_unref (fs); gst_bin_remove (GST_BIN (self), el); goto done; } + if (!gst_bin_add (GST_BIN (self), fs)) { + gst_object_unref (fs); + gst_bin_remove (GST_BIN (self), el); + gst_bin_remove (GST_BIN (self), cf); + goto done; + } + + if (!gst_element_link (cf, fs)) + goto error_remove; if (!gst_element_link (el, cf)) goto error_remove; @@ -2213,6 +2226,7 @@ _transform_caps (GstUvcH264Src * self, GstCaps * caps, const gchar * name) error_remove: gst_bin_remove (GST_BIN (self), cf); gst_bin_remove (GST_BIN (self), el); + gst_bin_remove (GST_BIN (self), fs); done: return caps; |