From 63c87f18994eb446e2d84d38c7be3dc81232de7d Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 4 Oct 2006 17:24:40 +0000 Subject: gst/rtsp/: Factor out extension in separate module. Original commit message from CVS: * gst/rtsp/Makefile.am: * gst/rtsp/gstrtpdec.c: (gst_rtpdec_getcaps), (gst_rtpdec_chain_rtp), (gst_rtpdec_chain_rtcp): * gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_init), (gst_rtspsrc_finalize), (gst_rtspsrc_create_stream), (gst_rtspsrc_parse_rtpmap), (gst_rtspsrc_stream_configure_transport), (gst_rtspsrc_send), (gst_rtspsrc_parse_methods), (gst_rtspsrc_open), (gst_rtspsrc_play), (gst_rtspsrc_handle_message): * gst/rtsp/gstrtspsrc.h: * gst/rtsp/rtspdefs.c: (rtsp_strresult): * gst/rtsp/rtspdefs.h: * gst/rtsp/rtspext.h: * gst/rtsp/rtspextwms.c: (rtsp_ext_wms_parse_sdp), (rtsp_ext_wms_get_context): * gst/rtsp/rtspextwms.h: * gst/rtsp/rtsptransport.c: (rtsp_transport_init), (parse_mode), (rtsp_transport_parse): * gst/rtsp/rtsptransport.h: Factor out extension in separate module. Fix getcaps to filter against the padtemplate. Use Content-Base if the server gives one. Rework the transport parsing a bit for future extensions. Added some Real Header field definitions. --- gst/rtsp/gstrtpdec.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'gst/rtsp/gstrtpdec.c') diff --git a/gst/rtsp/gstrtpdec.c b/gst/rtsp/gstrtpdec.c index 728a1381..a4ea0d46 100644 --- a/gst/rtsp/gstrtpdec.c +++ b/gst/rtsp/gstrtpdec.c @@ -222,6 +222,7 @@ gst_rtpdec_getcaps (GstPad * pad) GstRTPDec *src; GstPad *other; GstCaps *caps; + const GstCaps *templ; src = GST_RTPDEC (GST_PAD_PARENT (pad)); @@ -229,8 +230,20 @@ gst_rtpdec_getcaps (GstPad * pad) caps = gst_pad_peer_get_caps (other); - if (caps == NULL) - caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad)); + templ = gst_pad_get_pad_template_caps (pad); + if (caps == NULL) { + GST_DEBUG_OBJECT (src, "copy template"); + caps = gst_caps_copy (templ); + } else { + GstCaps *intersect; + + GST_DEBUG_OBJECT (src, "intersect with template"); + + intersect = gst_caps_intersect (caps, templ); + gst_caps_unref (caps); + + caps = intersect; + } return caps; } @@ -242,14 +255,18 @@ gst_rtpdec_chain_rtp (GstPad * pad, GstBuffer * buffer) src = GST_RTPDEC (GST_PAD_PARENT (pad)); - GST_DEBUG ("got rtp packet"); + GST_DEBUG_OBJECT (src, "got rtp packet"); return gst_pad_push (src->src_rtp, buffer); } static GstFlowReturn gst_rtpdec_chain_rtcp (GstPad * pad, GstBuffer * buffer) { - GST_DEBUG ("got rtcp packet"); + GstRTPDec *src; + + src = GST_RTPDEC (GST_PAD_PARENT (pad)); + + GST_DEBUG_OBJECT (src, "got rtcp packet"); gst_buffer_unref (buffer); return GST_FLOW_OK; -- cgit