summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTommi Myöhänen <ext-tommi.1.myohanen@nokia.com>2009-07-30 14:17:59 +0300
committerStefan Kost <ensonic@users.sf.net>2009-07-31 14:07:24 +0300
commit89788ddc1f4caa951880ac0402499fb62690f980 (patch)
tree17e394cf30fb6ad32e0888b869c9b79d102667f5
parent43b56d41c5b1a1a3eff8e89b50a04d1a25a6f0ea (diff)
camerabin: Set camerasrc to READY state instead of PAUSED when acquiring allowed caps
-rw-r--r--gst/camerabin/gstcamerabin.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/gst/camerabin/gstcamerabin.c b/gst/camerabin/gstcamerabin.c
index c64db5420..c3010ab8d 100644
--- a/gst/camerabin/gstcamerabin.c
+++ b/gst/camerabin/gstcamerabin.c
@@ -1095,7 +1095,6 @@ gst_camerabin_get_allowed_input_caps (GstCameraBin * camera)
GstCaps *caps = NULL;
GstPad *pad = NULL, *peer_pad = NULL;
GstState state;
- gboolean temp_videosrc_pause = FALSE;
GstElement *videosrc;
g_return_val_if_fail (camera != NULL, NULL);
@@ -1121,27 +1120,25 @@ gst_camerabin_get_allowed_input_caps (GstCameraBin * camera)
state = GST_STATE (videosrc);
- /* Make this function work also in READY and NULL state */
- if (state == GST_STATE_READY || state == GST_STATE_NULL) {
- GST_DEBUG_OBJECT (camera, "setting videosrc to paused temporarily");
- temp_videosrc_pause = TRUE;
+ /* Make this function work also in NULL state */
+ if (state == GST_STATE_NULL) {
+ GST_DEBUG_OBJECT (camera, "setting videosrc to ready temporarily");
peer_pad = gst_pad_get_peer (pad);
if (peer_pad) {
gst_pad_unlink (pad, peer_pad);
}
- /* Set videosrc to PAUSED to open video device */
+ /* Set videosrc to READY to open video device */
gst_element_set_locked_state (videosrc, TRUE);
- gst_element_set_state (videosrc, GST_STATE_PAUSED);
+ gst_element_set_state (videosrc, GST_STATE_READY);
}
camera->allowed_caps = gst_pad_get_caps (pad);
/* Restore state and re-link if necessary */
- if (temp_videosrc_pause) {
+ if (state == GST_STATE_NULL) {
GST_DEBUG_OBJECT (camera, "restoring videosrc state %d", state);
/* Reset videosrc to NULL state, some drivers seem to need this */
gst_element_set_state (videosrc, GST_STATE_NULL);
- gst_element_set_state (videosrc, state);
if (peer_pad) {
gst_pad_link (pad, peer_pad);
gst_object_unref (peer_pad);