Commit f249d639 authored by Wim Taymans's avatar Wim Taymans
Browse files

gst/rtsp/: Add method so that extensions can choose to disable the setup of a stream.

Original commit message from CVS:
* 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.
parent 4b859766
2006-11-28 Wim Taymans <wim@fluendo.com>
* 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 <wim@fluendo.com>
Patch by: Jonas Holmberg <jonas dot holmberg at axis dot com>
......
......@@ -1770,6 +1770,14 @@ gst_rtspsrc_open (GstRTSPSrc * src)
/* 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 @@ gst_rtspsrc_open (GstRTSPSrc * src)
}
/* 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);
......
......@@ -50,7 +50,6 @@ G_BEGIN_DECLS
#include "gstrtsp.h"
#include "rtsp.h"
#include "rtspext.h"
#define GST_TYPE_RTSPSRC \
(gst_rtspsrc_get_type())
......@@ -74,6 +73,8 @@ typedef struct _GstRTSPSrcClass GstRTSPSrcClass;
typedef struct _GstRTSPStream GstRTSPStream;
#include "rtspext.h"
struct _GstRTSPStream {
gint id;
......
......@@ -45,6 +45,7 @@
#include <glib.h>
#include "gstrtspsrc.h"
#include "rtsptransport.h"
#include "sdp.h"
......@@ -58,17 +59,19 @@ struct _RTSPExtensionCtx
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);
......
......@@ -142,6 +142,25 @@ no_config:
}
}
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 @@ rtsp_ext_wms_get_context (void)
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;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment