mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-25 16:48:11 +00:00
basecamerabinsrc: Optimize preview pipeline startup
Use gst_element_link_pads_full to optimize preview pipeline startup, leading to a faster camerabin2 startup as well.
This commit is contained in:
parent
ac7fc0d357
commit
e17d99c4c4
1 changed files with 28 additions and 6 deletions
|
@ -128,6 +128,7 @@ gst_camerabin_create_preview_pipeline (GstElement * element,
|
||||||
GstElement *csp2;
|
GstElement *csp2;
|
||||||
GstElement *vscale;
|
GstElement *vscale;
|
||||||
gboolean added = FALSE;
|
gboolean added = FALSE;
|
||||||
|
gboolean linkfail = FALSE;
|
||||||
GstBus *bus;
|
GstBus *bus;
|
||||||
GstAppSinkCallbacks callbacks = { 0, };
|
GstAppSinkCallbacks callbacks = { 0, };
|
||||||
|
|
||||||
|
@ -154,13 +155,34 @@ gst_camerabin_create_preview_pipeline (GstElement * element,
|
||||||
added = TRUE;
|
added = TRUE;
|
||||||
|
|
||||||
if (filter) {
|
if (filter) {
|
||||||
if (!gst_element_link_many (data->appsrc, filter, csp, vscale, csp2,
|
linkfail |=
|
||||||
data->capsfilter, data->appsink, NULL))
|
GST_PAD_LINK_FAILED (gst_element_link_pads_full (data->appsrc, "src",
|
||||||
goto error;
|
filter, NULL, GST_PAD_LINK_CHECK_NOTHING));
|
||||||
|
linkfail |=
|
||||||
|
GST_PAD_LINK_FAILED (gst_element_link_pads_full (filter, NULL,
|
||||||
|
csp, "sink", GST_PAD_LINK_CHECK_CAPS));
|
||||||
} else {
|
} else {
|
||||||
if (!gst_element_link_many (data->appsrc, csp, vscale, csp2,
|
linkfail |=
|
||||||
data->capsfilter, data->appsink, NULL))
|
GST_PAD_LINK_FAILED (gst_element_link_pads_full (data->appsrc, "src",
|
||||||
goto error;
|
csp, "sink", GST_PAD_LINK_CHECK_NOTHING));
|
||||||
|
}
|
||||||
|
|
||||||
|
linkfail |=
|
||||||
|
GST_PAD_LINK_FAILED (gst_element_link_pads_full (csp, "src", vscale,
|
||||||
|
"sink", GST_PAD_LINK_CHECK_NOTHING));
|
||||||
|
linkfail |=
|
||||||
|
GST_PAD_LINK_FAILED (gst_element_link_pads_full (vscale, "src", csp2,
|
||||||
|
"sink", GST_PAD_LINK_CHECK_NOTHING));
|
||||||
|
linkfail |=
|
||||||
|
GST_PAD_LINK_FAILED (gst_element_link_pads_full (csp2, "src",
|
||||||
|
data->capsfilter, "sink", GST_PAD_LINK_CHECK_NOTHING));
|
||||||
|
linkfail |=
|
||||||
|
GST_PAD_LINK_FAILED (gst_element_link_pads_full (data->capsfilter, "src",
|
||||||
|
data->appsink, "sink", GST_PAD_LINK_CHECK_NOTHING));
|
||||||
|
|
||||||
|
if (linkfail) {
|
||||||
|
GST_WARNING ("Failed to link preview pipeline elements");
|
||||||
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
callbacks.new_buffer = gst_camerabin_preview_pipeline_new_buffer;
|
callbacks.new_buffer = gst_camerabin_preview_pipeline_new_buffer;
|
||||||
|
|
Loading…
Reference in a new issue