rtspclientsink: fix retrieval of custom payloader caps

If a bin is passed as the custom payloader, the caps of
its factory will be empty, the correct way to obtain the caps
is to query its sinkpad.
This commit is contained in:
Mathieu Duponchelle 2018-02-26 22:59:17 +01:00
parent 7f6367cc63
commit ba9395c158

View file

@ -1296,10 +1296,17 @@ gst_rtsp_client_sink_sinkpad_query (GstPad * pad, GstObject * parent,
GstCaps *caps;
if (cspad->custom_payloader) {
GstElementFactory *factory =
gst_element_get_factory (cspad->custom_payloader);
GstPad *sinkpad =
gst_element_get_static_pad (cspad->custom_payloader, "sink");
caps = gst_rtsp_client_sink_get_payloader_caps (factory);
if (sinkpad) {
caps = gst_pad_query_caps (sinkpad, NULL);
gst_object_unref (sinkpad);
} else {
GST_ELEMENT_ERROR (parent, CORE, NEGOTIATION, (NULL),
("Custom payloaders are expected to expose a sink pad named 'sink'"));
return FALSE;
}
} else {
/* No target yet - return the union of all payloader caps */
caps = gst_rtsp_client_sink_get_all_payloaders_caps ();