From: Mathieu Duponchelle Date: Mon, 26 Feb 2018 21:59:17 +0000 (+0100) Subject: rtspclientsink: fix retrieval of custom payloader caps X-Git-Tag: 1.16.2~146 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba9395c158093ee736a2faedd7e2689fc36bf44a;p=platform%2Fupstream%2Fgst-rtsp-server.git 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. --- diff --git a/gst/rtsp-sink/gstrtspclientsink.c b/gst/rtsp-sink/gstrtspclientsink.c index 090b056..454c58d 100644 --- a/gst/rtsp-sink/gstrtspclientsink.c +++ b/gst/rtsp-sink/gstrtspclientsink.c @@ -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 ();