From: <wt...@fr...> - 2004-09-14 16:54:29
|
CVS Root: /cvs/gstreamer Module: gst-plugins Changes by: wtay Date: Tue Sep 14 2004 09:54:27 PDT Log message: * gst/playback/gstplaybasebin.c: (queue_overrun), (no_more_pads), (setup_source), (gst_play_base_bin_set_property), (gst_play_base_bin_add_element): * gst/playback/gstplaybin.c: (gst_play_bin_send_event): Some more work on making sure seeking pauses the pipeline and that changing the uri actually does something. Modified files: . : ChangeLog gst/playback : gstplaybasebin.c gstplaybin.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ChangeLog.diff?r1=1.1057&r2=1.1058 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/playback/gstplaybasebin.c.diff?r1=1.8&r2=1.9 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/playback/gstplaybin.c.diff?r1=1.10&r2=1.11 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins/ChangeLog,v retrieving revision 1.1057 retrieving revision 1.1058 diff -u -d -r1.1057 -r1.1058 --- ChangeLog 14 Sep 2004 14:03:14 -0000 1.1057 +++ ChangeLog 14 Sep 2004 16:54:14 -0000 1.1058 @@ -1,5 +1,14 @@ 2004-09-17 Wim Taymans <wi...@fl...> + * gst/playback/gstplaybasebin.c: (queue_overrun), (no_more_pads), + (setup_source), (gst_play_base_bin_set_property), + (gst_play_base_bin_add_element): + * gst/playback/gstplaybin.c: (gst_play_bin_send_event): + Some more work on making sure seeking pauses the pipeline and + that changing the uri actually does something. + +2004-09-17 Wim Taymans <wi...@fl...> * gst/tcp/gstfdset.c: (gst_fdset_wait): * gst/tcp/gstmultifdsink.c: (gst_multifdsink_close): * gst/tcp/gsttcpserversink.c: (gst_tcpserversink_init_send), Index: gstplaybasebin.c RCS file: /cvs/gstreamer/gst-plugins/gst/playback/gstplaybasebin.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- gstplaybasebin.c 13 Sep 2004 18:23:49 -0000 1.8 +++ gstplaybasebin.c 14 Sep 2004 16:54:14 -0000 1.9 @@ -196,8 +196,11 @@ static void queue_overrun (GstElement * element, GstPlayBaseBin * play_base_bin) { + GST_DEBUG ("queue %s overrun", gst_element_get_name (element)); g_mutex_lock (play_base_bin->preroll_lock); + GST_DEBUG ("signal preroll done"); g_cond_signal (play_base_bin->preroll_cond); + GST_DEBUG ("signaled preroll done"); g_mutex_unlock (play_base_bin->preroll_lock); } @@ -259,7 +262,9 @@ GST_DEBUG ("no more pads"); @@ -384,7 +389,9 @@ */ g_mutex_lock (play_base_bin->preroll_lock); gst_element_set_state (play_base_bin->thread, GST_STATE_PLAYING); + GST_DEBUG ("waiting for preroll..."); g_cond_wait (play_base_bin->preroll_cond, play_base_bin->preroll_lock); + GST_DEBUG ("preroll done !"); g_mutex_unlock (play_base_bin->preroll_lock); g_signal_handler_disconnect (G_OBJECT (play_base_bin->decoder), sig3); @@ -416,10 +423,14 @@ g_warning ("cannot set NULL uri"); return; } - if (!play_base_bin->uri || strcmp (play_base_bin->uri, uri) != 0) { + /* if we have no previous uri, or the new uri is different from the + * old one, replug */ + if (play_base_bin->uri == NULL || strcmp (play_base_bin->uri, uri) != 0) { g_free (play_base_bin->uri); play_base_bin->uri = g_strdup (uri); + GST_DEBUG ("setting new uri to %s", uri); play_base_bin->need_rebuild = TRUE; break; @@ -562,11 +573,15 @@ } gst_bin_add (GST_BIN (play_base_bin->thread), element); + /* hack */ sched = gst_element_get_scheduler (GST_ELEMENT (play_base_bin->thread)); clock = gst_scheduler_get_clock (sched); gst_scheduler_set_clock (sched, clock); - //gst_element_sync_state_with_parent (element); + /* FIXME set element to READY so that negotiation can happen. This + * currently fails because of weird negotiation problems. */ + /* gst_element_set_state (element, GST_STATE_READY); */ } else { g_warning ("adding elements is not allowed in NULL"); } Index: gstplaybin.c RCS file: /cvs/gstreamer/gst-plugins/gst/playback/gstplaybin.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- gstplaybin.c 13 Sep 2004 09:24:00 -0000 1.10 +++ gstplaybin.c 14 Sep 2004 16:54:14 -0000 1.11 @@ -458,9 +458,17 @@ gboolean res = FALSE; GList *s; GstPlayBin *play_bin; + GstElementState state; + gboolean need_pause = FALSE; play_bin = GST_PLAY_BIN (element); + state = gst_element_get_state (element); + if (state == GST_STATE_PLAYING) { + need_pause = TRUE; + gst_element_set_state (element, GST_STATE_PAUSED); + } s = play_bin->seekables; for (s = play_bin->seekables; s; s = g_list_next (s)) { @@ -472,6 +480,10 @@ res |= ok; gst_event_unref (event); + if (need_pause) + gst_element_set_state (element, GST_STATE_PLAYING); return res; |