diff options
author | Mathieu Duponchelle <mathieu@centricular.com> | 2018-02-26 22:59:17 +0100 |
---|---|---|
committer | Mathieu Duponchelle <mathieu@centricular.com> | 2018-02-26 22:59:17 +0100 |
commit | ba9395c158093ee736a2faedd7e2689fc36bf44a (patch) | |
tree | ce816ad3d9442a18e55a88d79fe055d06bd13dd3 | |
parent | 7f6367cc63937f80b45c6060f8b1f64e40d97fd3 (diff) |
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.
-rw-r--r-- | gst/rtsp-sink/gstrtspclientsink.c | 13 |
1 files changed, 10 insertions, 3 deletions
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 (); |