diff --git a/gst/camerabin2/gstcamerabin2.c b/gst/camerabin2/gstcamerabin2.c index ba6a926c62..4a55cae4b7 100644 --- a/gst/camerabin2/gstcamerabin2.c +++ b/gst/camerabin2/gstcamerabin2.c @@ -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"); diff --git a/gst/camerabin2/gstcamerabin2.h b/gst/camerabin2/gstcamerabin2.h index d5a37f034e..3276429ca7 100644 --- a/gst/camerabin2/gstcamerabin2.h +++ b/gst/camerabin2/gstcamerabin2.h @@ -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;