mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
camerabin: fix NULL -> READY state change failure handling.
In some error situations the NULL -> READY state change failed and camerabin elements were not destroyed.
This commit is contained in:
parent
58bf3be730
commit
341d91520a
2 changed files with 7 additions and 0 deletions
|
@ -205,6 +205,7 @@ gst_camerabin_remove_elements_from_bin (GstBin * bin)
|
||||||
case GST_ITERATOR_OK:
|
case GST_ITERATOR_OK:
|
||||||
elem = GST_ELEMENT (data);
|
elem = GST_ELEMENT (data);
|
||||||
gst_bin_remove (bin, elem);
|
gst_bin_remove (bin, elem);
|
||||||
|
gst_element_set_state (GST_ELEMENT (elem), GST_STATE_NULL);
|
||||||
/* Iterator increased the element refcount, so unref */
|
/* Iterator increased the element refcount, so unref */
|
||||||
gst_object_unref (elem);
|
gst_object_unref (elem);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -3171,6 +3171,12 @@ gst_camerabin_change_state (GstElement * element, GstStateChange transition)
|
||||||
case GST_STATE_CHANGE_READY_TO_NULL:
|
case GST_STATE_CHANGE_READY_TO_NULL:
|
||||||
camerabin_destroy_elements (camera);
|
camerabin_destroy_elements (camera);
|
||||||
break;
|
break;
|
||||||
|
/* In some error situation camerabin may end up being still in NULL
|
||||||
|
state so we must take care of destroying elements. */
|
||||||
|
case GST_STATE_CHANGE_NULL_TO_READY:
|
||||||
|
if (ret == GST_STATE_CHANGE_FAILURE)
|
||||||
|
camerabin_destroy_elements (camera);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue