ASSERT_OBJECT_REFCOUNT (sink, "sink", 1);
ASSERT_OBJECT_REFCOUNT (pipeline, "pipeline", 1);
- /* change state to PAUSED, spawning three messages */
+ /* change state to PAUSED, spawning four messages */
+ /* STATE_CHANGED (NULL => READY)
+ * STREAM_START
+ * ASYNC_DONE
+ * STATE_CHANGED (READY => PAUSED)
+ */
GST_DEBUG ("setting pipeline to PAUSED");
ret = gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PAUSED);
fail_unless (ret == GST_STATE_CHANGE_ASYNC);
/* wait for async thread to settle down */
GST_DEBUG ("waiting for refcount");
- while (GST_OBJECT_REFCOUNT_VALUE (pipeline) > 3)
+ while (GST_OBJECT_REFCOUNT_VALUE (pipeline) > 4)
THREAD_SWITCH ();
- GST_DEBUG ("refcount <= 3 now");
+ GST_DEBUG ("refcount <= 4 now");
/* each object is referenced by a message;
* base_src is blocked in the push and has an extra refcount.
/* refcount can be 4 if the bin is still processing the async_done message of
* the sink. */
ASSERT_OBJECT_REFCOUNT_BETWEEN (sink, "sink", 2, 3);
- /* 2 or 3 is valid, because the pipeline might still be posting
+ /* 3 or 4 is valid, because the pipeline might still be posting
* its state_change message */
- ASSERT_OBJECT_REFCOUNT_BETWEEN (pipeline, "pipeline", 2, 3);
+ ASSERT_OBJECT_REFCOUNT_BETWEEN (pipeline, "pipeline", 3, 4);
pop_messages (bus, 3);
pop_async_done (bus);
s = "fakesrc can-activate-push=false ! fakesink can-activate-pull=true";
run_pipeline (setup_pipeline (s), s,
GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED |
- GST_MESSAGE_STREAM_STATUS | GST_MESSAGE_ASYNC_DONE, GST_MESSAGE_UNKNOWN);
+ GST_MESSAGE_STREAM_STATUS | GST_MESSAGE_ASYNC_DONE |
+ GST_MESSAGE_STREAM_START, GST_MESSAGE_UNKNOWN);
s = "fakesrc can-activate-push=true ! fakesink can-activate-pull=false";
run_pipeline (setup_pipeline (s), s,
GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED |
- GST_MESSAGE_STREAM_STATUS | GST_MESSAGE_ASYNC_DONE, GST_MESSAGE_UNKNOWN);
+ GST_MESSAGE_STREAM_STATUS | GST_MESSAGE_ASYNC_DONE |
+ GST_MESSAGE_STREAM_START, GST_MESSAGE_UNKNOWN);
s = "fakesrc can-activate-push=false num-buffers=10 ! fakesink can-activate-pull=true";
run_pipeline (setup_pipeline (s), s,
GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED |
- GST_MESSAGE_STREAM_STATUS | GST_MESSAGE_ASYNC_DONE, GST_MESSAGE_EOS);
+ GST_MESSAGE_STREAM_STATUS | GST_MESSAGE_ASYNC_DONE |
+ GST_MESSAGE_STREAM_START, GST_MESSAGE_EOS);
s = "fakesrc can-activate-push=true num-buffers=10 ! fakesink can-activate-pull=false";
run_pipeline (setup_pipeline (s), s,
GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED |
- GST_MESSAGE_STREAM_STATUS | GST_MESSAGE_ASYNC_DONE, GST_MESSAGE_EOS);
+ GST_MESSAGE_STREAM_STATUS | GST_MESSAGE_ASYNC_DONE |
+ GST_MESSAGE_STREAM_START, GST_MESSAGE_EOS);
s = "fakesrc can-activate-push=false ! fakesink can-activate-pull=false";
ASSERT_CRITICAL (run_pipeline (setup_pipeline (s), s,
GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED |
- GST_MESSAGE_STREAM_STATUS | GST_MESSAGE_ASYNC_DONE,
- GST_MESSAGE_UNKNOWN));
+ GST_MESSAGE_STREAM_STATUS | GST_MESSAGE_ASYNC_DONE |
+ GST_MESSAGE_STREAM_START, GST_MESSAGE_UNKNOWN));
}
GST_END_TEST;
s = "fakesrc can-activate-push=true ! tee ! fakesink can-activate-push=true";
run_pipeline (setup_pipeline (s), s,
- GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED, GST_MESSAGE_UNKNOWN);
+ GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED |
+ GST_MESSAGE_STREAM_START, GST_MESSAGE_UNKNOWN);
s = "fakesrc can-activate-push=true num-buffers=10 ! tee ! fakesink can-activate-push=true";
run_pipeline (setup_pipeline (s), s,
- GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED, GST_MESSAGE_EOS);
+ GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED |
+ GST_MESSAGE_STREAM_START, GST_MESSAGE_EOS);
s = "fakesrc can-activate-push=false can-activate-pull=true ! tee ! fakesink can-activate-pull=true";
ASSERT_CRITICAL (run_pipeline (setup_pipeline (s), s,
- GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED,
- GST_MESSAGE_UNKNOWN));
+ GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED |
+ GST_MESSAGE_STREAM_START, GST_MESSAGE_UNKNOWN));
s = "fakesrc can-activate-push=false can-activate-pull=true "
"! tee pull-mode=single ! fakesink can-activate-pull=true";
run_pipeline (setup_pipeline (s), s,
- GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED, GST_MESSAGE_UNKNOWN);
+ GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED |
+ GST_MESSAGE_STREAM_START, GST_MESSAGE_UNKNOWN);
s = "fakesrc can-activate-push=false can-activate-pull=true num-buffers=10 "
"! tee pull-mode=single ! fakesink can-activate-pull=true";
run_pipeline (setup_pipeline (s), s,
- GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED, GST_MESSAGE_EOS);
+ GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED |
+ GST_MESSAGE_STREAM_START, GST_MESSAGE_EOS);
s = "fakesrc can-activate-push=false can-activate-pull=true "
"! tee name=t pull-mode=single ! fakesink can-activate-pull=true "
"t. ! queue ! fakesink can-activate-pull=true can-activate-push=false";
ASSERT_CRITICAL (run_pipeline (setup_pipeline (s), s,
- GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED,
- GST_MESSAGE_UNKNOWN));
+ GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED |
+ GST_MESSAGE_STREAM_START, GST_MESSAGE_UNKNOWN));
s = "fakesrc can-activate-push=false can-activate-pull=true "
"! tee name=t pull-mode=single ! fakesink can-activate-pull=true "
"t. ! queue ! fakesink";
run_pipeline (setup_pipeline (s), s,
- GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED, GST_MESSAGE_UNKNOWN);
+ GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED |
+ GST_MESSAGE_STREAM_START, GST_MESSAGE_UNKNOWN);
s = "fakesrc can-activate-push=false can-activate-pull=true num-buffers=10 "
"! tee name=t pull-mode=single ! fakesink can-activate-pull=true "
"t. ! queue ! fakesink";
run_pipeline (setup_pipeline (s), s,
- GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED, GST_MESSAGE_EOS);
+ GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED |
+ GST_MESSAGE_STREAM_START, GST_MESSAGE_EOS);
}
GST_END_TEST;