transcodebin: fix logs when failing to link filter

- Display caps of the pad we actually tried to link.
- Use the template caps as the filter is likely to not have any caps set
  yet.
- Log pad name as well.
This commit is contained in:
Guillaume Desmottes 2020-03-03 15:21:31 +05:30 committed by Thibault Saunier
parent a0423ee20f
commit 667eadac92

View file

@ -147,13 +147,14 @@ _insert_filter (GstTranscodeBin * self, GstPad * sinkpad, GstPad * pad,
gst_bin_add (GST_BIN (self), gst_object_ref (filter));
if (G_UNLIKELY (gst_pad_link (pad, filter_sink) != GST_PAD_LINK_OK)) {
GstCaps *othercaps = gst_pad_get_current_caps (sinkpad);
GstCaps *othercaps = gst_pad_get_pad_template_caps (filter_sink);
caps = gst_pad_get_current_caps (pad);
GST_ELEMENT_ERROR (self, CORE, PAD,
(NULL),
("Couldn't link pads \n\n%" GST_PTR_FORMAT "\n\n and \n\n %"
GST_PTR_FORMAT "\n\n", caps, othercaps));
("Couldn't link pads \n\n %" GST_PTR_FORMAT ": %" GST_PTR_FORMAT
"\n\n and \n\n %" GST_PTR_FORMAT ": %" GST_PTR_FORMAT
"\n\n", pad, caps, filter_sink, othercaps));
gst_caps_unref (caps);
gst_caps_unref (othercaps);