diff options
author | Stefan Kost <ensonic@users.sf.net> | 2009-10-15 17:45:00 +0300 |
---|---|---|
committer | Stefan Kost <ensonic@users.sf.net> | 2009-10-24 15:14:26 +0300 |
commit | 0a13cfdaf19f1cb6a43baf6b6388f19ced38089a (patch) | |
tree | a3960b84f60a35df318e932c0c7400bc27110bc1 | |
parent | 65a2e3c6056ef8acb2bfee7a139cd34ae2e283ab (diff) |
camerabin: set camerabin to READY before accessing the elements
-rw-r--r-- | tests/examples/camerabin/gst-camera-perf.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/examples/camerabin/gst-camera-perf.c b/tests/examples/camerabin/gst-camera-perf.c index 0e2121816..9de6fc156 100644 --- a/tests/examples/camerabin/gst-camera-perf.c +++ b/tests/examples/camerabin/gst-camera-perf.c @@ -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); @@ -637,13 +644,6 @@ setup_pipeline (void) } 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"); goto error; |