From: <wt...@ke...> - 2006-11-28 11:52:40
|
CVS Root: /cvs/gstreamer Module: gst-plugins-good Changes by: wtay Date: Tue Nov 28 2006 11:52:39 UTC Log message: * gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_open): * gst/rtsp/gstrtspsrc.h: * gst/rtsp/rtspext.h: * gst/rtsp/rtspextwms.c: (rtsp_ext_wms_configure_stream), (rtsp_ext_wms_get_context): Add method so that extensions can choose to disable the setup of a stream. Make the WMS extension skip setup of x-wms-rtx streams. Fixes #377792. Modified files: . : ChangeLog gst/rtsp : gstrtspsrc.c gstrtspsrc.h rtspext.h rtspextwms.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/ChangeLog.diff?r1=1.2638&r2=1.2639 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/rtsp/gstrtspsrc.c.diff?r1=1.50&r2=1.51 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/rtsp/gstrtspsrc.h.diff?r1=1.20&r2=1.21 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/rtsp/rtspext.h.diff?r1=1.2&r2=1.3 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/rtsp/rtspextwms.c.diff?r1=1.2&r2=1.3 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-good/ChangeLog,v retrieving revision 1.2638 retrieving revision 1.2639 diff -u -d -r1.2638 -r1.2639 --- ChangeLog 27 Nov 2006 16:30:49 -0000 1.2638 +++ ChangeLog 28 Nov 2006 11:52:26 -0000 1.2639 @@ -1,3 +1,14 @@ +2006-11-28 Wim Taymans <wi...@fl...> + + * gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_open): + * gst/rtsp/gstrtspsrc.h: + * gst/rtsp/rtspext.h: + * gst/rtsp/rtspextwms.c: (rtsp_ext_wms_configure_stream), + (rtsp_ext_wms_get_context): + Add method so that extensions can choose to disable the setup of + a stream. + Make the WMS extension skip setup of x-wms-rtx streams. Fixes #377792. 2006-11-27 Wim Taymans <wi...@fl...> Patch by: Jonas Holmberg <jonas dot holmberg at axis dot com> Index: gstrtspsrc.c RCS file: /cvs/gstreamer/gst-plugins-good/gst/rtsp/gstrtspsrc.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- gstrtspsrc.c 18 Oct 2006 16:18:55 -0000 1.50 +++ gstrtspsrc.c 28 Nov 2006 11:52:27 -0000 1.51 @@ -1770,6 +1770,14 @@ /* create stream from the media, can never return NULL */ stream = gst_rtspsrc_create_stream (src, &sdp, i); + /* see if we need to configure this stream */ + if (src->extension && src->extension->configure_stream) { + if (!src->extension->configure_stream (src->extension, stream)) { + GST_DEBUG_OBJECT (src, "skipping stream %d, disabled by extension", i); + continue; + } + } /* merge/overwrite global caps */ if (stream->caps) { guint j, num; @@ -1791,8 +1799,10 @@ } /* skip setup if we have no URL for it */ - if (stream->setup_url == NULL) + if (stream->setup_url == NULL) { + GST_DEBUG_OBJECT (src, "skipping stream %d, no setup", i); continue; GST_DEBUG_OBJECT (src, "doing setup of stream %d with %s", i, stream->setup_url); Index: gstrtspsrc.h RCS file: /cvs/gstreamer/gst-plugins-good/gst/rtsp/gstrtspsrc.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- gstrtspsrc.h 11 Oct 2006 16:21:53 -0000 1.20 +++ gstrtspsrc.h 28 Nov 2006 11:52:27 -0000 1.21 @@ -50,7 +50,6 @@ #include "gstrtsp.h" #include "rtsp.h" -#include "rtspext.h" #define GST_TYPE_RTSPSRC \ (gst_rtspsrc_get_type()) @@ -74,6 +73,8 @@ typedef struct _GstRTSPStream GstRTSPStream; +#include "rtspext.h" struct _GstRTSPStream { gint id; Index: rtspext.h RCS file: /cvs/gstreamer/gst-plugins-good/gst/rtsp/rtspext.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- rtspext.h 6 Oct 2006 12:55:53 -0000 1.2 +++ rtspext.h 28 Nov 2006 11:52:27 -0000 1.3 @@ -45,6 +45,7 @@ #include <glib.h> +#include "gstrtspsrc.h" #include "rtsptransport.h" #include "sdp.h" @@ -58,17 +59,19 @@ gchar *name; gpointer *src; - gboolean (*detect_server) (RTSPExtensionCtx *ctx, RTSPMessage *resp); + gboolean (*detect_server) (RTSPExtensionCtx *ctx, RTSPMessage *resp); - RTSPResult (*before_send) (RTSPExtensionCtx *ctx, RTSPMessage *req); - RTSPResult (*after_send) (RTSPExtensionCtx *ctx, RTSPMessage *req, RTSPMessage *resp); + RTSPResult (*before_send) (RTSPExtensionCtx *ctx, RTSPMessage *req); + RTSPResult (*after_send) (RTSPExtensionCtx *ctx, RTSPMessage *req, RTSPMessage *resp); - RTSPResult (*parse_sdp) (RTSPExtensionCtx *ctx, SDPMessage *sdp); - RTSPResult (*setup_media) (RTSPExtensionCtx *ctx, SDPMedia *media); + RTSPResult (*parse_sdp) (RTSPExtensionCtx *ctx, SDPMessage *sdp); + RTSPResult (*setup_media) (RTSPExtensionCtx *ctx, SDPMedia *media); - RTSPResult (*get_transports) (RTSPExtensionCtx *ctx, RTSPLowerTrans protocols, gchar **transport); + gboolean (*configure_stream) (RTSPExtensionCtx *ctx, GstRTSPStream *stream); - RTSPResult (*stream_select) (RTSPExtensionCtx *ctx); + RTSPResult (*get_transports) (RTSPExtensionCtx *ctx, RTSPLowerTrans protocols, gchar **transport); + RTSPResult (*stream_select) (RTSPExtensionCtx *ctx); }; RTSPExtensionCtx* rtsp_extension_detect (RTSPMessage *resp); Index: rtspextwms.c RCS file: /cvs/gstreamer/gst-plugins-good/gst/rtsp/rtspextwms.c,v --- rtspextwms.c 6 Oct 2006 12:55:53 -0000 1.2 +++ rtspextwms.c 28 Nov 2006 11:52:27 -0000 1.3 @@ -142,6 +142,25 @@ } } +static gboolean +rtsp_ext_wms_configure_stream (RTSPExtensionCtx * ctx, GstRTSPStream * stream) +{ + GstRTSPSrc *src = (GstRTSPSrc *) ctx->src; + GstStructure *s; + const gchar *encoding; + s = gst_caps_get_structure (stream->caps, 0); + encoding = gst_structure_get_string (s, "encoding-name"); + GST_DEBUG_OBJECT (src, "%" GST_PTR_FORMAT " encoding-name: %s", stream->caps, + encoding); + if (!strcmp (encoding, "x-wms-rtx")) + return FALSE; + return TRUE; +} RTSPExtensionCtx * rtsp_ext_wms_get_context (void) { @@ -151,6 +170,7 @@ res->ctx.parse_sdp = rtsp_ext_wms_parse_sdp; res->ctx.before_send = rtsp_ext_wms_before_send; res->ctx.after_send = rtsp_ext_wms_after_send; + res->ctx.configure_stream = rtsp_ext_wms_configure_stream; return (RTSPExtensionCtx *) res; |