From: Wim Taymans Date: Thu, 3 Nov 2011 11:55:24 +0000 (+0100) Subject: media: add a seekable boolean X-Git-Tag: 1.19.3~495^2~1387^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a701e8595e1fbf005be31cb5a01660e6acdb6818;p=platform%2Fupstream%2Fgstreamer.git media: add a seekable boolean Maintain the seekable state with a new variable instead of reusing the is_live variable. --- diff --git a/gst/rtsp-server/rtsp-media.c b/gst/rtsp-server/rtsp-media.c index 44d3376..96d039e 100644 --- a/gst/rtsp-server/rtsp-media.c +++ b/gst/rtsp-server/rtsp-media.c @@ -720,8 +720,8 @@ gst_rtsp_media_seek (GstRTSPMedia * media, GstRTSPTimeRange * range) g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), FALSE); g_return_val_if_fail (range != NULL, FALSE); - if (media->is_live) { - GST_INFO ("no seek in live media"); + if (media->seekable) { + GST_INFO ("pipeline is not seekable"); return TRUE; } @@ -1711,6 +1711,7 @@ gst_rtsp_media_prepare (GstRTSPMedia * media) /* reset some variables */ media->is_live = FALSE; + media->seekable = FALSE; media->buffering = FALSE; /* we're preparing now */ media->status = GST_RTSP_MEDIA_STATUS_PREPARING; @@ -1764,13 +1765,18 @@ gst_rtsp_media_prepare (GstRTSPMedia * media) switch (ret) { case GST_STATE_CHANGE_SUCCESS: GST_INFO ("SUCCESS state change for media %p", media); + media->seekable = TRUE; break; case GST_STATE_CHANGE_ASYNC: GST_INFO ("ASYNC state change for media %p", media); + media->seekable = TRUE; break; case GST_STATE_CHANGE_NO_PREROLL: /* we need to go to PLAYING */ GST_INFO ("NO_PREROLL state change: live media %p", media); + /* FIXME we disable seeking for live streams for now. We should perform a + * seeking query in preroll instead and do a seeking query. */ + media->seekable = FALSE; media->is_live = TRUE; ret = gst_element_set_state (media->pipeline, GST_STATE_PLAYING); if (ret == GST_STATE_CHANGE_FAILURE) diff --git a/gst/rtsp-server/rtsp-media.h b/gst/rtsp-server/rtsp-media.h index 09fe524..a7334ed 100644 --- a/gst/rtsp-server/rtsp-media.h +++ b/gst/rtsp-server/rtsp-media.h @@ -179,6 +179,7 @@ typedef enum { * @source: the bus watch for pipeline messages. * @id: the id of the watch * @is_live: if the pipeline is live + * @seekable: if the pipeline can perform a seek * @buffering: if the pipeline is buffering * @target_state: the desired target state of the pipeline * @rtpbin: the rtpbin @@ -220,6 +221,7 @@ struct _GstRTSPMedia { guint id; gboolean is_live; + gboolean seekable; gboolean buffering; GstState target_state;