mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-29 19:50:40 +00:00
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.
This commit is contained in:
parent
e358ec6ddd
commit
410d0c0194
1 changed files with 15 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue