mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-17 22:06:41 +00:00
wrappercamerabinsrc: handle when source creation fail
Remember to set the source to NULL state as adding it to the pipeline will set it to the READY state.
This commit is contained in:
parent
fc4f95bb7c
commit
f9f6bbf4f5
1 changed files with 8 additions and 3 deletions
|
@ -487,18 +487,18 @@ check_and_replace_src (GstWrapperCameraBinSrc * self)
|
||||||
self->app_vid_src, "autovideosrc", DEFAULT_VIDEOSRC,
|
self->app_vid_src, "autovideosrc", DEFAULT_VIDEOSRC,
|
||||||
"camerasrc-real-src"))) {
|
"camerasrc-real-src"))) {
|
||||||
self->src_vid_src = NULL;
|
self->src_vid_src = NULL;
|
||||||
return FALSE;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gst_bin_add (cbin, self->src_vid_src)) {
|
if (!gst_bin_add (cbin, self->src_vid_src)) {
|
||||||
return FALSE;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check if we already have the next element to link to */
|
/* check if we already have the next element to link to */
|
||||||
if (self->src_crop) {
|
if (self->src_crop) {
|
||||||
if (!gst_element_link_pads (self->src_vid_src, "src", self->src_crop,
|
if (!gst_element_link_pads (self->src_vid_src, "src", self->src_crop,
|
||||||
"sink")) {
|
"sink")) {
|
||||||
return FALSE;
|
goto fail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -511,6 +511,11 @@ check_and_replace_src (GstWrapperCameraBinSrc * self)
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
fail:
|
||||||
|
if (self->src_vid_src)
|
||||||
|
gst_element_set_state (self->src_vid_src, GST_STATE_NULL);
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue