From aace8e130fa8dde86e18eceedab130f017c67f8e Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Wed, 15 Jul 2009 17:44:10 +0300 Subject: camerabin: use nonbuffered io to save memcopies We write large blocks anyway, so no extra buffering please. Also use one g_object_set to set multiple properties on same object. --- gst/camerabin/camerabinimage.c | 8 +++----- gst/camerabin/camerabinvideo.c | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'gst/camerabin') diff --git a/gst/camerabin/camerabinimage.c b/gst/camerabin/camerabinimage.c index 8eea8d91..25730ccd 100644 --- a/gst/camerabin/camerabinimage.c +++ b/gst/camerabin/camerabinimage.c @@ -463,15 +463,13 @@ gst_camerabin_image_create_elements (GstCameraBinImage * img) g_object_set (G_OBJECT (img->meta_mux), "exif-byte-order", 1, NULL); } - /* Create file sink element */ + /* Add sink element for storing the image */ if (!(img->sink = gst_camerabin_create_and_add_element (imgbin, DEFAULT_SINK))) { goto done; } - - /* Set properties */ - g_object_set (G_OBJECT (img->sink), "location", img->filename->str, NULL); - g_object_set (G_OBJECT (img->sink), "async", FALSE, NULL); + g_object_set (G_OBJECT (img->sink), "location", img->filename->str, "async", FALSE, "buffer-mode", 2, /* non buffered io */ + NULL); ret = TRUE; diff --git a/gst/camerabin/camerabinvideo.c b/gst/camerabin/camerabinvideo.c index 4bbc5057..40a2bfa7 100644 --- a/gst/camerabin/camerabinvideo.c +++ b/gst/camerabin/camerabinvideo.c @@ -600,8 +600,8 @@ gst_camerabin_video_create_elements (GstCameraBinVideo * vid) gst_camerabin_create_and_add_element (vidbin, DEFAULT_SINK))) { goto error; } - g_object_set (G_OBJECT (vid->sink), "location", vid->filename->str, NULL); - + g_object_set (G_OBJECT (vid->sink), "location", vid->filename->str, "buffer-mode", 2, /* non buffered io */ + NULL); /* Add user set or default audio source element */ if (vid->user_aud_src) { -- cgit v1.2.1