mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
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.
This commit is contained in:
parent
c73bf8e4b6
commit
aace8e130f
2 changed files with 5 additions and 7 deletions
|
@ -463,15 +463,13 @@ gst_camerabin_image_create_elements (GstCameraBinImage * img)
|
||||||
g_object_set (G_OBJECT (img->meta_mux), "exif-byte-order", 1, NULL);
|
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 =
|
if (!(img->sink =
|
||||||
gst_camerabin_create_and_add_element (imgbin, DEFAULT_SINK))) {
|
gst_camerabin_create_and_add_element (imgbin, DEFAULT_SINK))) {
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
g_object_set (G_OBJECT (img->sink), "location", img->filename->str, "async", FALSE, "buffer-mode", 2, /* non buffered io */
|
||||||
/* Set properties */
|
NULL);
|
||||||
g_object_set (G_OBJECT (img->sink), "location", img->filename->str, NULL);
|
|
||||||
g_object_set (G_OBJECT (img->sink), "async", FALSE, NULL);
|
|
||||||
|
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
|
|
||||||
|
|
|
@ -600,8 +600,8 @@ gst_camerabin_video_create_elements (GstCameraBinVideo * vid)
|
||||||
gst_camerabin_create_and_add_element (vidbin, DEFAULT_SINK))) {
|
gst_camerabin_create_and_add_element (vidbin, DEFAULT_SINK))) {
|
||||||
goto error;
|
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 */
|
/* Add user set or default audio source element */
|
||||||
if (vid->user_aud_src) {
|
if (vid->user_aud_src) {
|
||||||
|
|
Loading…
Reference in a new issue