+2005-11-03 Wim Taymans <wim@fluendo.com>
+
+ * check/states/sinks.c: (GST_START_TEST):
+ Uncomment fixed check.
+
+ * docs/design/part-TODO.txt:
+ Updated TODO.
+
+ * gst/base/gstbasesink.c: (gst_base_sink_commit_state),
+ (gst_base_sink_handle_object), (gst_base_sink_do_sync),
+ (gst_base_sink_get_position):
+ If we are going to PLAYING, post the right pending state
+ when we post the intermediate paused message.
+
+ * gst/gstelement.c: (gst_element_continue_state),
+ (gst_element_set_state_func), (gst_element_change_state):
+ Don't post state changes that were between the same state
+ and were not ASYNC.
+
2005-11-03 Stefan Kost <ensonic@users.sf.net>
* docs/gst/gstreamer-sections.txt:
fail_unless (current == GST_STATE_PLAYING, "not playing");
fail_unless (pending == GST_STATE_VOID_PENDING, "not playing");
-#ifdef WIM_EARNS_HIS_KEEP
/* now we have four messages on the bus: src from paused to playing, sink from
ready to paused and paused to playing, and pipeline from paused to playing.
the pipeline message should be last, and the sink messages should go in
pop_state_change_message (bus, pipeline, GST_STATE_PAUSED, GST_STATE_PLAYING,
GST_STATE_VOID_PENDING);
-#endif
gst_object_unref (bus);
gst_element_set_state (pipeline, GST_STATE_NULL);
- GstQuery quark, get_name.
- GstEvent, GstMessage register like GstFormat or GstQuery.
+
+- unblocking while seeking. gst_element_flush_pads (GstElement, gboolean);
{
/* commit state and proceed to next pending state */
{
- GstState current, next, pending;
+ GstState current, next, pending, post_pending;
GstMessage *message;
gboolean post_paused = FALSE;
gboolean post_playing = FALSE;
current = GST_STATE (basesink);
next = GST_STATE_NEXT (basesink);
pending = GST_STATE_PENDING (basesink);
+ post_pending = pending;
switch (pending) {
case GST_STATE_PLAYING:
basesink->need_preroll = FALSE;
post_playing = TRUE;
/* post PAUSED too when we were READY */
- if (current == GST_STATE_READY)
+ if (current == GST_STATE_READY) {
post_paused = TRUE;
+ }
break;
case GST_STATE_PAUSED:
basesink->need_preroll = TRUE;
post_paused = TRUE;
+ post_pending = GST_STATE_VOID_PENDING;
break;
case GST_STATE_READY:
goto stopping;
if (post_paused) {
message = gst_message_new_state_changed (GST_OBJECT_CAST (basesink),
- current, next, GST_STATE_VOID_PENDING);
+ current, next, post_pending);
gst_element_post_message (GST_ELEMENT_CAST (basesink), message);
}
if (post_playing) {
gst_element_continue_state (GstElement * element, GstStateChangeReturn ret)
{
GstState pending;
- GstState old_state, old_next;
+ GstState old_ret, old_state, old_next;
GstState current, next;
GstMessage *message;
GstStateChange transition;
GST_LOCK (element);
+ old_ret = GST_STATE_RETURN (element);
GST_STATE_RETURN (element) = ret;
pending = GST_STATE_PENDING (element);
GST_CAT_INFO_OBJECT (GST_CAT_STATES, element, "completed state change");
GST_UNLOCK (element);
- message = gst_message_new_state_changed (GST_OBJECT (element),
- old_state, old_next, GST_STATE_VOID_PENDING);
- gst_element_post_message (element, message);
+ /* don't post silly messages with the same state. This can happen
+ * when an element state is changed to what it already was. For bins
+ * this can be the result of a lost state, which we check with the
+ * previous return value.
+ * We do signal the cond though as a _get_state() might be blocking
+ * on it. */
+ if (old_state != old_next || old_ret == GST_STATE_CHANGE_ASYNC) {
+ message = gst_message_new_state_changed (GST_OBJECT (element),
+ old_state, old_next, GST_STATE_VOID_PENDING);
+ gst_element_post_message (element, message);
+ }
GST_STATE_BROADCAST (element);
{
/* commit state and proceed to next pending state */
{
- GstState current, next, pending;
+ GstState current, next, pending, post_pending;
GstMessage *message;
gboolean post_paused = FALSE;
gboolean post_playing = FALSE;
current = GST_STATE (basesink);
next = GST_STATE_NEXT (basesink);
pending = GST_STATE_PENDING (basesink);
+ post_pending = pending;
switch (pending) {
case GST_STATE_PLAYING:
basesink->need_preroll = FALSE;
post_playing = TRUE;
/* post PAUSED too when we were READY */
- if (current == GST_STATE_READY)
+ if (current == GST_STATE_READY) {
post_paused = TRUE;
+ }
break;
case GST_STATE_PAUSED:
basesink->need_preroll = TRUE;
post_paused = TRUE;
+ post_pending = GST_STATE_VOID_PENDING;
break;
case GST_STATE_READY:
goto stopping;
if (post_paused) {
message = gst_message_new_state_changed (GST_OBJECT_CAST (basesink),
- current, next, GST_STATE_VOID_PENDING);
+ current, next, post_pending);
gst_element_post_message (GST_ELEMENT_CAST (basesink), message);
}
if (post_playing) {
fail_unless (current == GST_STATE_PLAYING, "not playing");
fail_unless (pending == GST_STATE_VOID_PENDING, "not playing");
-#ifdef WIM_EARNS_HIS_KEEP
/* now we have four messages on the bus: src from paused to playing, sink from
ready to paused and paused to playing, and pipeline from paused to playing.
the pipeline message should be last, and the sink messages should go in
pop_state_change_message (bus, pipeline, GST_STATE_PAUSED, GST_STATE_PLAYING,
GST_STATE_VOID_PENDING);
-#endif
gst_object_unref (bus);
gst_element_set_state (pipeline, GST_STATE_NULL);