mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
camerabin2: Remove redundant image-queue
Encodebin is used for image encoding and it already contains a queue, so we can remove camerabin2 image queue.
This commit is contained in:
parent
cc9e490313
commit
a68b1f049c
2 changed files with 12 additions and 15 deletions
|
@ -440,8 +440,6 @@ gst_camera_bin_dispose (GObject * object)
|
|||
gst_object_unref (camerabin->imagesink);
|
||||
if (camerabin->image_encodebin)
|
||||
gst_object_unref (camerabin->image_encodebin);
|
||||
if (camerabin->imagebin_queue)
|
||||
gst_object_unref (camerabin->imagebin_queue);
|
||||
if (camerabin->imagebin_capsfilter)
|
||||
gst_object_unref (camerabin->imagebin_capsfilter);
|
||||
|
||||
|
@ -1183,6 +1181,9 @@ gst_camera_bin_create_elements (GstCameraBin2 * camera)
|
|||
missing_element_name = "encodebin";
|
||||
goto missing_element;
|
||||
}
|
||||
/* durations have no meaning for image captures */
|
||||
g_object_set (camera->image_encodebin, "queue-time-max", (guint64) 0, NULL);
|
||||
|
||||
camera->image_encodebin_signal_id =
|
||||
g_signal_connect (camera->image_encodebin, "element-added",
|
||||
(GCallback) encodebin_element_added, camera);
|
||||
|
@ -1215,29 +1216,21 @@ gst_camera_bin_create_elements (GstCameraBin2 * camera)
|
|||
camera->image_profile_switch = TRUE;
|
||||
}
|
||||
|
||||
camera->imagebin_queue =
|
||||
gst_element_factory_make ("queue", "imagebin-queue");
|
||||
camera->viewfinderbin_queue =
|
||||
gst_element_factory_make ("queue", "viewfinderbin-queue");
|
||||
|
||||
g_object_set (camera->viewfinderbin_queue, "leaky", 2, "silent", TRUE,
|
||||
NULL);
|
||||
g_object_set (camera->imagebin_queue, "max-size-time", (guint64) 0,
|
||||
"silent", TRUE, NULL);
|
||||
|
||||
gst_bin_add_many (GST_BIN_CAST (camera),
|
||||
gst_object_ref (camera->video_encodebin),
|
||||
gst_object_ref (camera->videosink),
|
||||
gst_object_ref (camera->image_encodebin),
|
||||
gst_object_ref (camera->imagesink),
|
||||
gst_object_ref (camera->imagebin_queue),
|
||||
gst_object_ref (camera->viewfinderbin_queue), NULL);
|
||||
|
||||
/* Linking can be optimized TODO */
|
||||
gst_element_link (camera->video_encodebin, camera->videosink);
|
||||
|
||||
gst_element_link_many (camera->imagebin_queue, camera->imagebin_capsfilter,
|
||||
NULL);
|
||||
gst_element_link (camera->image_encodebin, camera->imagesink);
|
||||
gst_element_link_many (camera->viewfinderbin_queue,
|
||||
camera->viewfinderbin_capsfilter, camera->viewfinderbin, NULL);
|
||||
|
@ -1344,8 +1337,13 @@ gst_camera_bin_create_elements (GstCameraBin2 * camera)
|
|||
G_CALLBACK (gst_camera_bin_src_notify_readyforcapture), camera);
|
||||
gst_element_link_pads (camera->src, "vfsrc", camera->viewfinderbin_queue,
|
||||
"sink");
|
||||
gst_element_link_pads (camera->src, "imgsrc", camera->imagebin_queue,
|
||||
"sink");
|
||||
|
||||
if (!gst_element_link_pads (camera->src, "imgsrc",
|
||||
camera->imagebin_capsfilter, "sink")) {
|
||||
GST_ERROR_OBJECT (camera,
|
||||
"Failed to link camera source's imgsrc pad to image bin capsfilter");
|
||||
goto fail;
|
||||
}
|
||||
if (!gst_element_link_pads (camera->src, "vidsrc",
|
||||
camera->videobin_capsfilter, "sink")) {
|
||||
GST_ERROR_OBJECT (camera,
|
||||
|
@ -1359,8 +1357,8 @@ gst_camera_bin_create_elements (GstCameraBin2 * camera)
|
|||
}
|
||||
|
||||
gst_camera_bin_check_and_replace_filter (camera, &camera->image_filter,
|
||||
camera->user_image_filter, camera->imagebin_queue,
|
||||
camera->imagebin_capsfilter, NULL);
|
||||
camera->user_image_filter, camera->src, camera->imagebin_capsfilter,
|
||||
"imgsrc");
|
||||
gst_camera_bin_check_and_replace_filter (camera, &camera->video_filter,
|
||||
camera->user_video_filter, camera->src, camera->videobin_capsfilter,
|
||||
"vidsrc");
|
||||
|
|
|
@ -63,7 +63,6 @@ struct _GstCameraBin2
|
|||
GstElement *image_encodebin;
|
||||
gulong image_encodebin_signal_id;
|
||||
GstElement *imagesink;
|
||||
GstElement *imagebin_queue;
|
||||
GstElement *imagebin_capsfilter;
|
||||
|
||||
GstElement *video_filter;
|
||||
|
|
Loading…
Reference in a new issue