camerabin: set camerabin to READY before accessing the elements

This commit is contained in:
Stefan Kost 2009-10-15 17:45:00 +03:00
parent 65a2e3c605
commit 0a13cfdaf1

View file

@ -560,6 +560,13 @@ setup_pipeline (void)
GST_INFO_OBJECT (camera_bin, "elements created");
if (GST_STATE_CHANGE_FAILURE ==
gst_element_set_state (camera_bin, GST_STATE_READY)) {
g_warning ("can't set camerabin to ready\n");
goto error;
}
GST_INFO_OBJECT (camera_bin, "camera ready");
/* set properties */
g_object_set (camera_bin, "filename", filename->str, NULL);
@ -636,13 +643,6 @@ setup_pipeline (void)
video_height, view_framerate_num, view_framerate_den, NULL);
}
if (GST_STATE_CHANGE_FAILURE ==
gst_element_set_state (camera_bin, GST_STATE_READY)) {
g_warning ("can't set camerabin to ready\n");
goto error;
}
GST_INFO_OBJECT (camera_bin, "camera ready");
if (GST_STATE_CHANGE_FAILURE ==
gst_element_set_state (camera_bin, GST_STATE_PLAYING)) {
g_warning ("can't set camerabin to playing\n");