summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2007-03-01 18:47:28 +0000
committerWim Taymans <wim.taymans@gmail.com>2007-03-01 18:47:28 +0000
commit84c6cb989a6d124debe22a9b587e0b98a153ba85 (patch)
treeb278fd79a5a2e1138b310bb33984f167b7747ea1 /gst
parent520caf5f34c2103aef2bfe56ef1e561aa421a4bd (diff)
gst/rtsp/gstrtspsrc.c: Errors from the udp sources are not fatal unless all of them are in error.
Original commit message from CVS: * gst/rtsp/gstrtspsrc.c: (find_stream_by_channel), (find_stream_by_udpsrc), (gst_rtspsrc_handle_message): Errors from the udp sources are not fatal unless all of them are in error.
Diffstat (limited to 'gst')
-rw-r--r--gst/rtsp/gstrtspsrc.c65
1 files changed, 52 insertions, 13 deletions
diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c
index 065c3d19..9e9aa1a5 100644
--- a/gst/rtsp/gstrtspsrc.c
+++ b/gst/rtsp/gstrtspsrc.c
@@ -376,6 +376,17 @@ gst_rtspsrc_get_property (GObject * object, guint prop_id, GValue * value,
}
static gint
+find_stream_by_channel (GstRTSPStream * stream, gconstpointer a)
+{
+ gint channel = GPOINTER_TO_INT (a);
+
+ if (stream->channel[0] == channel || stream->channel[1] == channel)
+ return 0;
+
+ return -1;
+}
+
+static gint
find_stream_by_pt (GstRTSPStream * stream, gconstpointer a)
{
gint pt = GPOINTER_TO_INT (a);
@@ -386,6 +397,17 @@ find_stream_by_pt (GstRTSPStream * stream, gconstpointer a)
return -1;
}
+static gint
+find_stream_by_udpsrc (GstRTSPStream * stream, gconstpointer a)
+{
+ GstElement *src = (GstElement *) a;
+
+ if (stream->udpsrc[0] == src)
+ return 0;
+
+ return -1;
+}
+
static GstRTSPStream *
gst_rtspsrc_create_stream (GstRTSPSrc * src, SDPMessage * sdp, gint idx)
{
@@ -1171,16 +1193,6 @@ gst_rtspsrc_activate_streams (GstRTSPSrc * src)
return TRUE;
}
-static gint
-find_stream_by_channel (GstRTSPStream * stream, gconstpointer a)
-{
- gint channel = GPOINTER_TO_INT (a);
-
- if (stream->channel[0] == channel || stream->channel[1] == channel)
- return 0;
-
- return -1;
-}
static GstFlowReturn
gst_rtspsrc_combine_flows (GstRTSPSrc * src, GstRTSPStream * stream,
@@ -2593,14 +2605,15 @@ send_error:
static void
gst_rtspsrc_handle_message (GstBin * bin, GstMessage * message)
{
+ GstRTSPSrc *rtspsrc;
+
+ rtspsrc = GST_RTSPSRC (bin);
+
switch (GST_MESSAGE_TYPE (message)) {
case GST_MESSAGE_ELEMENT:
{
- GstRTSPSrc *rtspsrc;
const GstStructure *s = gst_message_get_structure (message);
- rtspsrc = GST_RTSPSRC (bin);
-
if (gst_structure_has_name (s, "GstUDPSrcTimeout")) {
GST_DEBUG_OBJECT (bin, "timeout on UDP port");
gst_rtspsrc_loop_send_cmd (rtspsrc, CMD_RECONNECT);
@@ -2611,6 +2624,32 @@ gst_rtspsrc_handle_message (GstBin * bin, GstMessage * message)
}
case GST_MESSAGE_ERROR:
{
+ GstObject *udpsrc;
+ GList *lstream;
+ GstRTSPStream *stream;
+ GstFlowReturn ret;
+
+ udpsrc = GST_MESSAGE_SRC (message);
+
+ lstream = g_list_find_custom (rtspsrc->streams, udpsrc,
+ (GCompareFunc) find_stream_by_udpsrc);
+ if (!lstream)
+ goto forward;
+
+ stream = (GstRTSPStream *) lstream->data;
+
+ /* if we get error messages from the udp sources, that's not a problem as
+ * long as not all of them error out. We also don't really know what the
+ * problem is, the message does not give enough detail... */
+ ret = gst_rtspsrc_combine_flows (rtspsrc, stream, GST_FLOW_NOT_LINKED);
+ if (ret != GST_FLOW_OK)
+ goto forward;
+
+ gst_message_unref (message);
+ break;
+
+ /* fatal our not our message, forward */
+ forward:
GST_BIN_CLASS (parent_class)->handle_message (bin, message);
break;
}