diff options
author | Andrew den Exter <andrew.den.exter@jollamobile.com> | 2013-12-11 14:29:57 +1000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-13 06:06:33 +0100 |
commit | 15025088eac53d97705191d06b13868d62977155 (patch) | |
tree | 8c3f403b235a97bd610eb83a6c78a14f43f061e7 /src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp | |
parent | b27913b76d5a1820470b411d2193e4388b047c9d (diff) | |
download | qtmultimedia-15025088eac53d97705191d06b13868d62977155.tar.gz |
Only acquire resources as required in gstreamer backend.
Make resources required for capture optional and disable just the
capture features if they are not available, so the camera viewfinder
can be displayed and images captured without blocking the music
playback and the other way around.
Change-Id: Ic9692195156d994ccd4a911ae41d2242a00d575b
Reviewed-by: John Brooks <john.brooks@dereferenced.net>
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
Diffstat (limited to 'src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp')
-rw-r--r-- | src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp b/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp index 79cfca3bf..122a10eed 100644 --- a/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp @@ -40,9 +40,11 @@ ****************************************************************************/ #include "camerabinimagecapture.h" +#include "camerabincontrol.h" #include "camerabincapturedestination.h" #include "camerabincapturebufferformat.h" #include "camerabinsession.h" +#include "camerabinresourcepolicy.h" #include <private/qgstvideobuffer_p.h> #include <private/qvideosurfacegstsink_p.h> #include <private/qgstutils_p.h> @@ -68,6 +70,7 @@ CameraBinImageCapture::CameraBinImageCapture(CameraBinSession *session) connect(m_session, SIGNAL(stateChanged(QCamera::State)), SLOT(updateState())); connect(m_session, SIGNAL(imageExposed(int)), this, SIGNAL(imageExposed(int))); connect(m_session, SIGNAL(imageCaptured(int,QImage)), this, SIGNAL(imageCaptured(int,QImage))); + connect(m_session->cameraControl()->resourcePolicy(), SIGNAL(canCaptureChanged()), this, SLOT(updateState())); m_session->bus()->installMessageFilter(this); } @@ -103,7 +106,8 @@ void CameraBinImageCapture::cancelCapture() void CameraBinImageCapture::updateState() { - bool ready = m_session->state() == QCamera::ActiveState; + bool ready = m_session->state() == QCamera::ActiveState + && m_session->cameraControl()->resourcePolicy()->canCapture(); if (m_ready != ready) { #ifdef DEBUG_CAPTURE qDebug() << "readyForCaptureChanged" << ready; |