summaryrefslogtreecommitdiff
path: root/gst/rtsp-server/rtsp-media.c
diff options
context:
space:
mode:
Diffstat (limited to 'gst/rtsp-server/rtsp-media.c')
-rw-r--r--gst/rtsp-server/rtsp-media.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/gst/rtsp-server/rtsp-media.c b/gst/rtsp-server/rtsp-media.c
index 4b1e76a..93db2b7 100644
--- a/gst/rtsp-server/rtsp-media.c
+++ b/gst/rtsp-server/rtsp-media.c
@@ -672,6 +672,25 @@ default_create_rtpbin (GstRTSPMedia * media)
return rtpbin;
}
+static gboolean
+is_receive_only (GstRTSPMedia * media)
+{
+ GstRTSPMediaPrivate *priv = media->priv;
+ gboolean recive_only = TRUE;
+ guint i;
+
+ for (i = 0; i < priv->streams->len; i++) {
+ GstRTSPStream *stream = g_ptr_array_index (priv->streams, i);
+ if (gst_rtsp_stream_is_sender (stream) ||
+ !gst_rtsp_stream_is_receiver (stream)) {
+ recive_only = FALSE;
+ break;
+ }
+ }
+
+ return recive_only;
+}
+
/* must be called with state lock */
static void
check_seekable (GstRTSPMedia * media)
@@ -680,8 +699,8 @@ check_seekable (GstRTSPMedia * media)
GstRTSPMediaPrivate *priv = media->priv;
/* Update the seekable state of the pipeline in case it changed */
- if ((priv->transport_mode & GST_RTSP_TRANSPORT_MODE_RECORD)) {
- /* TODO: Seeking for RECORD? */
+ if (is_receive_only (media)) {
+ /* TODO: Seeking for "receive-only"? */
priv->seekable = -1;
} else {
guint i, n = priv->streams->len;
@@ -2640,8 +2659,8 @@ default_handle_message (GstRTSPMedia * media, GstMessage * message)
GST_DEBUG ("%p: went from %s to %s (pending %s)", media,
gst_element_state_get_name (old), gst_element_state_get_name (new),
gst_element_state_get_name (pending));
- if ((priv->transport_mode & GST_RTSP_TRANSPORT_MODE_RECORD)
- && old == GST_STATE_READY && new == GST_STATE_PAUSED) {
+ if (priv->no_more_pads_pending == 0 && is_receive_only (media) &&
+ old == GST_STATE_READY && new == GST_STATE_PAUSED) {
GST_INFO ("%p: went to PAUSED, prepared now", media);
collect_media_stats (media);
@@ -3851,7 +3870,7 @@ default_unsuspend (GstRTSPMedia * media)
switch (priv->suspend_mode) {
case GST_RTSP_SUSPEND_MODE_NONE:
- if ((priv->transport_mode & GST_RTSP_TRANSPORT_MODE_RECORD))
+ if (is_receive_only (media))
break;
if (media_streams_blocking (media)) {
gst_rtsp_media_set_status (media, GST_RTSP_MEDIA_STATUS_PREPARING);