camerabin2: Make viewfinder's queue a thread limit only
authorThiago Santos <thiago.sousa.santos@collabora.co.uk>
Fri, 26 Aug 2011 12:43:14 +0000 (09:43 -0300)
committerThiago Santos <thiago.sousa.santos@collabora.co.uk>
Fri, 26 Aug 2011 12:43:14 +0000 (09:43 -0300)
Reduce the viewfinder queue limits to only allow it to store
one buffer, preventing the queue from holding old buffers for
too long. This also avoids showing slightly outdated frames on
the viewfinder when the source has already produced new ones
and improves the buffer recycling rate, important for sources
that use bufferpools.

gst/camerabin2/gstcamerabin2.c

index f40ef051be4f180c8e93c0fd5859db912a557570..8343d88505678b5087a79bacc18ee8efc521a7f5 100644 (file)
@@ -1368,7 +1368,8 @@ gst_camera_bin_create_elements (GstCameraBin2 * camera)
     }
 
     g_object_set (camera->viewfinderbin_queue, "leaky", 2, "silent", TRUE,
-        NULL);
+        "max-size-time", (guint64) 0, "max-size-bytes", (guint) 0,
+        "max-size-buffers", (guint) 1, NULL);
 
     gst_bin_add_many (GST_BIN_CAST (camera),
         gst_object_ref (camera->video_encodebin),