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.
This commit is contained in:
Lasse Laukkanen 2011-04-13 22:33:37 -03:00 committed by Thiago Santos
parent cb0d2e9da0
commit 26553bfb1d

View file

@ -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);