mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
basecamerasrc: Fail state change if preview pipeline fails creation
If the preview pipeline fails creation, for any reason, we should fail basecamerasrc state change. Also adds a missing g_return_if_fail check to preview pipeline functions
This commit is contained in:
parent
7d5bd1992e
commit
43ec4f46b8
2 changed files with 7 additions and 1 deletions
|
@ -445,7 +445,11 @@ gst_base_camera_src_change_state (GstElement * element,
|
|||
gst_camerabin_create_preview_pipeline (GST_ELEMENT_CAST (self),
|
||||
self->preview_filter);
|
||||
|
||||
g_assert (self->preview_pipeline != NULL);
|
||||
if (self->preview_pipeline == NULL) {
|
||||
/* failed to create preview pipeline, fail state change */
|
||||
return GST_STATE_CHANGE_FAILURE;
|
||||
}
|
||||
|
||||
self->preview_filter_changed = FALSE;
|
||||
if (self->preview_caps) {
|
||||
GST_DEBUG_OBJECT (self,
|
||||
|
|
|
@ -231,6 +231,8 @@ void
|
|||
gst_camerabin_destroy_preview_pipeline (GstCameraBinPreviewPipelineData *
|
||||
preview)
|
||||
{
|
||||
g_return_if_fail (preview != NULL);
|
||||
|
||||
if (preview->processing_lock) {
|
||||
g_mutex_free (preview->processing_lock);
|
||||
preview->processing_lock = NULL;
|
||||
|
|
Loading…
Reference in a new issue