diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2009-10-06 14:10:27 +0200 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2009-10-15 18:51:19 +0200 |
commit | 4fe33c8fa199991eefed6694b93ec80b63b26f32 (patch) | |
tree | b01bcffe41cff463a26d5d885f7c48e66fcf0936 | |
parent | 225d6d77b172eb982eebdd092e378c21896208ea (diff) |
playbasebin: use different queuing for rtspste-base-rtp-0.10.25
Since RTSP does its own buffering we don't need to have the large queues.
-rw-r--r-- | gst/playback/gstplaybasebin.c | 34 | ||||
-rw-r--r-- | gst/playback/gstplaybasebin.h | 1 |
2 files changed, 25 insertions, 10 deletions
diff --git a/gst/playback/gstplaybasebin.c b/gst/playback/gstplaybasebin.c index 77ba97c38..109d21dcf 100644 --- a/gst/playback/gstplaybasebin.c +++ b/gst/playback/gstplaybasebin.c @@ -837,10 +837,16 @@ gen_preroll_element (GstPlayBaseBin * play_base_bin, 2 * 1024 * 1024, "max-size-time", play_base_bin->queue_size, NULL); } } else { - g_object_set (G_OBJECT (preroll), - "max-size-buffers", 0, "max-size-bytes", - ((type == GST_STREAM_TYPE_VIDEO) ? 25 : 2) * 1024 * 1024, - "max-size-time", play_base_bin->queue_size, NULL); + if (play_base_bin->is_rtsp) { + g_object_set (G_OBJECT (preroll), + "max-size-buffers", 2, "max-size-bytes", 0, + "max-size-time", (guint64) 0, NULL); + } else { + g_object_set (G_OBJECT (preroll), + "max-size-buffers", 0, "max-size-bytes", + ((type == GST_STREAM_TYPE_VIDEO) ? 25 : 2) * 1024 * 1024, + "max-size-time", play_base_bin->queue_size, NULL); + } } /* the overrun signal is always attached and serves two purposes: @@ -856,13 +862,15 @@ gen_preroll_element (GstPlayBaseBin * play_base_bin, * will never get a running signal but we can use the overrun signal to * detect this deadlock and correct it. */ - overrun_sig = g_signal_connect (G_OBJECT (preroll), "overrun", - G_CALLBACK (queue_overrun), play_base_bin); + if (!play_base_bin->is_rtsp) { + overrun_sig = g_signal_connect (G_OBJECT (preroll), "overrun", + G_CALLBACK (queue_overrun), play_base_bin); - /* keep a ref to the signal id so that we can disconnect the signal callback - * when we are done with the preroll */ - g_object_set_data (G_OBJECT (preroll), "overrun_signal_id", - GINT_TO_POINTER (overrun_sig)); + /* keep a ref to the signal id so that we can disconnect the signal callback + * when we are done with the preroll */ + g_object_set_data (G_OBJECT (preroll), "overrun_signal_id", + GINT_TO_POINTER (overrun_sig)); + } if (play_base_bin->is_stream && ((type == GST_STREAM_TYPE_VIDEO && @@ -1581,6 +1589,10 @@ static const gchar *stream_uris[] = { "http://", "mms://", "mmsh://", "mmsu://", "mmst://", "myth://", NULL }; +static const gchar *rtsp_uris[] = { "rtsp://", "rtspt://", "rtspu://", + "rtsph://", NULL +}; + /* blacklisted URIs, we know they will always fail. */ static const gchar *blacklisted_uris[] = { NULL }; @@ -1597,6 +1609,7 @@ static const gchar *raw_mimes[] = { #define IS_STREAM_URI(uri) (array_has_value (stream_uris, uri)) #define IS_BLACKLISTED_URI(uri) (array_has_value (blacklisted_uris, uri)) +#define IS_RTSP_URI(uri) (array_has_value (rtsp_uris, uri)) #define IS_NO_MEDIA_MIME(mime) (array_has_value (no_media_mimes, mime)) #define IS_RAW_MIME(mime) (array_has_value (raw_mimes, mime)) @@ -1633,6 +1646,7 @@ gen_source_element (GstPlayBaseBin * play_base_bin, GstElement ** subbin) goto no_source; play_base_bin->is_stream = IS_STREAM_URI (play_base_bin->uri); + play_base_bin->is_rtsp = IS_RTSP_URI (play_base_bin->uri); /* make HTTP sources send extra headers so we get icecast * metadata in case the stream is an icecast stream */ diff --git a/gst/playback/gstplaybasebin.h b/gst/playback/gstplaybasebin.h index c8c86499e..4dcef8267 100644 --- a/gst/playback/gstplaybasebin.h +++ b/gst/playback/gstplaybasebin.h @@ -82,6 +82,7 @@ struct _GstPlayBaseBin { gint current[NUM_TYPES]; gchar *uri, *suburi; gboolean is_stream; + gboolean is_rtsp; /* Use smaller queue without overrun */ GstElement *source; GSList *decoders; GstElement *subtitle; /* additional filesrc ! subparse bin */ |