From b8525df9434d34f24c488848e320d1bc77de49cd Mon Sep 17 00:00:00 2001 From: VaL Doroshchuk Date: Thu, 2 Apr 2020 14:34:50 +0200 Subject: GStreamer: Remove file when CaptureToBuffer is used Capturing the image is handled by camerabin and it saves the image to a file. And we wanted to remove the file if capturing to buffer is requested, but the file is kept and not removed. Change-Id: I21404fc160bf275325deebf0f00b588de3493ee1 Fixes: QTBUG-82572 Reviewed-by: Andy Shaw --- src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp b/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp index 52ec75f44..b164bc31a 100644 --- a/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp @@ -366,12 +366,9 @@ bool CameraBinImageCapture::processBusMessage(const QGstreamerMessage &message) #ifdef DEBUG_CAPTURE qDebug() << Q_FUNC_INFO << "Dropped saving file" << fileName; #endif - //camerabin creates an empty file when captured buffer is dropped, - //let's remove it QFileInfo info(QString::fromUtf8(fileName)); - if (info.exists() && info.isFile() && info.size() == 0) { + if (info.exists() && info.isFile()) QFile(info.absoluteFilePath()).remove(); - } } } } -- cgit v1.2.3