GST_END_TEST;
+static gboolean
+set_playing (GstElement * element)
+{
+ GstStateChangeReturn state_res;
+
+ state_res = gst_element_set_state (element, GST_STATE_PLAYING);
+ ck_assert_int_ne (state_res, GST_STATE_CHANGE_FAILURE);
+
+ return FALSE;
+}
+
static void
message_received (GstBus * bus, GstMessage * message, GstPipeline * bin)
{
fail_unless (res == TRUE, NULL);
/* run pipeline */
- state_res = gst_element_set_state (bin, GST_STATE_PLAYING);
- ck_assert_int_ne (state_res, GST_STATE_CHANGE_FAILURE);
+ g_idle_add ((GSourceFunc) set_playing, bin);
GST_INFO ("running main loop");
g_main_loop_run (main_loop);
GST_INFO ("seeked");
/* run pipeline */
- state_res = gst_element_set_state (bin, GST_STATE_PLAYING);
- ck_assert_int_ne (state_res, GST_STATE_CHANGE_FAILURE);
+ g_idle_add ((GSourceFunc) set_playing, bin);
g_main_loop_run (main_loop);
GST_INFO ("seeked");
/* run pipeline */
- state_res = gst_element_set_state (bin, GST_STATE_PLAYING);
- ck_assert_int_ne (state_res, GST_STATE_CHANGE_FAILURE);
+ g_idle_add ((GSourceFunc) set_playing, bin);
g_main_loop_run (main_loop);
GST_INFO ("seeked");
/* run pipeline */
- state_res = gst_element_set_state (bin, GST_STATE_PLAYING);
- ck_assert_int_ne (state_res, GST_STATE_CHANGE_FAILURE);
+ g_idle_add ((GSourceFunc) set_playing, bin);
GST_INFO ("playing");
ck_assert_int_ne (state_res, GST_STATE_CHANGE_FAILURE);
/* now play all */
- state_res = gst_element_set_state (bin, GST_STATE_PLAYING);
- ck_assert_int_ne (state_res, GST_STATE_CHANGE_FAILURE);
+ g_idle_add ((GSourceFunc) set_playing, bin);
g_main_loop_run (main_loop);
ck_assert_int_ne (state_res, GST_STATE_CHANGE_FAILURE);
/* now play all */
- state_res = gst_element_set_state (bin, GST_STATE_PLAYING);
- ck_assert_int_ne (state_res, GST_STATE_CHANGE_FAILURE);
+ g_idle_add ((GSourceFunc) set_playing, bin);
g_main_loop_run (main_loop);
fail_unless (res == TRUE, NULL);
/* run pipeline */
- state_res = gst_element_set_state (bin, GST_STATE_PLAYING);
- ck_assert_int_ne (state_res, GST_STATE_CHANGE_FAILURE);
+ g_idle_add ((GSourceFunc) set_playing, bin);
GST_INFO ("running main loop");
g_main_loop_run (main_loop);
res = gst_element_link (audiomixer, sink);
fail_unless (res == TRUE, NULL);
- /* set to playing */
- state_res = gst_element_set_state (bin, GST_STATE_PLAYING);
+ /* set to paused */
+ state_res = gst_element_set_state (bin, GST_STATE_PAUSED);
ck_assert_int_ne (state_res, GST_STATE_CHANGE_FAILURE);
/* create an unconnected sinkpad in audiomixer, should also automatically activate
gst_pad_send_event (queue2_sinkpad, gst_event_new_eos ());
+ /* Set PLAYING */
+ g_idle_add ((GSourceFunc) set_playing, bin);
+
/* Collect buffers and messages */
g_main_loop_run (main_loop);