From: Lasse Laukkanen Date: Thu, 14 Apr 2011 01:33:37 +0000 (-0300) Subject: camerabin: Preserve unused imagebin or videobin on NULL X-Git-Tag: 1.19.3~507^2~16050^2~345 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=26553bfb1dba0083599e7dc7b5743a8834d60859;p=platform%2Fupstream%2Fgstreamer.git camerabin: Preserve unused imagebin or videobin on NULL If video or image mode is never selected then respective bin is in NULL state. Preserve this state when resetting camerabin from PAUSED to READY. --- diff --git a/gst/camerabin/gstcamerabin.c b/gst/camerabin/gstcamerabin.c index 7070903..99b1b54 100644 --- a/gst/camerabin/gstcamerabin.c +++ b/gst/camerabin/gstcamerabin.c @@ -3851,8 +3851,12 @@ gst_camerabin_change_state (GstElement * element, GstStateChange transition) case GST_STATE_CHANGE_PAUSED_TO_READY: /* all processing should stop and those elements could have their state * locked, so set them explicitly here */ - gst_element_set_state (camera->imgbin, GST_STATE_READY); - gst_element_set_state (camera->vidbin, GST_STATE_READY); + if (GST_STATE (camera->imgbin) != GST_STATE_NULL) { + gst_element_set_state (camera->imgbin, GST_STATE_READY); + } + if (GST_STATE (camera->vidbin) != GST_STATE_NULL) { + gst_element_set_state (camera->vidbin, GST_STATE_READY); + } break; case GST_STATE_CHANGE_READY_TO_NULL: gst_element_set_locked_state (camera->imgbin, FALSE);