diff options
author | Yoann Lopes <yoann.lopes@theqtcompany.com> | 2015-01-29 12:24:45 +0100 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@theqtcompany.com> | 2015-02-18 13:15:20 +0000 |
commit | e48546b44f2178536d6ae3d097f6ccb681b7f0b6 (patch) | |
tree | a98b9a16f2dd8923937e449f298cad2b2b11e896 /src/plugins/gstreamer/camerabin/camerabinsession.cpp | |
parent | d4f88c3ec90962956840abc9a8b7137545d444e3 (diff) | |
download | qtmultimedia-e48546b44f2178536d6ae3d097f6ccb681b7f0b6.tar.gz |
GStreamer: runtime check for controls that require GstPhotography.
Exposure, Flash, Focus and Locks controls were always initialized,
even when the GstPhotography interface was not available (on desktop
for example), causing some warnings and fooling the user in believing
that these features were available.
These controls are now lazily initialized and only when
GstPhotography is available.
The zoom control is not compile-checked anymore since it doesn't
actually require GstPhotography.
Change-Id: I5e8315d796dd920c9c29ccfa4155707f5f0fd7dc
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
Diffstat (limited to 'src/plugins/gstreamer/camerabin/camerabinsession.cpp')
-rw-r--r-- | src/plugins/gstreamer/camerabin/camerabinsession.cpp | 43 |
1 files changed, 35 insertions, 8 deletions
diff --git a/src/plugins/gstreamer/camerabin/camerabinsession.cpp b/src/plugins/gstreamer/camerabin/camerabinsession.cpp index 0ed8dcb67..7cc082e5e 100644 --- a/src/plugins/gstreamer/camerabin/camerabinsession.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinsession.cpp @@ -43,9 +43,9 @@ #include "camerabinflash.h" #include "camerabinfocus.h" #include "camerabinlocks.h" -#include "camerabinzoom.h" #endif +#include "camerabinzoom.h" #include "camerabinimageprocessing.h" #include "camerabinviewfindersettings.h" @@ -121,6 +121,12 @@ CameraBinSession::CameraBinSession(GstElementFactory *sourceFactory, QObject *pa m_videoInputFactory(0), m_viewfinder(0), m_viewfinderInterface(0), +#ifdef HAVE_GST_PHOTOGRAPHY + m_cameraExposureControl(0), + m_cameraFlashControl(0), + m_cameraFocusControl(0), + m_cameraLocksControl(0), +#endif m_cameraSrc(0), m_videoSrc(0), m_viewfinderElement(0), @@ -157,14 +163,7 @@ CameraBinSession::CameraBinSession(GstElementFactory *sourceFactory, QObject *pa m_imageEncodeControl = new CameraBinImageEncoder(this); m_recorderControl = new CameraBinRecorder(this); m_mediaContainerControl = new CameraBinContainer(this); - -#ifdef HAVE_GST_PHOTOGRAPHY - m_cameraExposureControl = new CameraBinExposure(this); - m_cameraFlashControl = new CameraBinFlash(this); - m_cameraFocusControl = new CameraBinFocus(this); - m_cameraLocksControl = new CameraBinLocks(this); m_cameraZoomControl = new CameraBinZoom(this); -#endif m_imageProcessingControl = new CameraBinImageProcessing(this); m_captureDestinationControl = new CameraBinCaptureDestination(this); m_captureBufferFormatControl = new CameraBinCaptureBufferFormat(this); @@ -221,6 +220,34 @@ GstPhotography *CameraBinSession::photography() return 0; } + +CameraBinExposure *CameraBinSession::cameraExposureControl() +{ + if (!m_cameraExposureControl && photography()) + m_cameraExposureControl = new CameraBinExposure(this); + return m_cameraExposureControl; +} + +CameraBinFlash *CameraBinSession::cameraFlashControl() +{ + if (!m_cameraFlashControl && photography()) + m_cameraFlashControl = new CameraBinFlash(this); + return m_cameraFlashControl; +} + +CameraBinFocus *CameraBinSession::cameraFocusControl() +{ + if (!m_cameraFocusControl && photography()) + m_cameraFocusControl = new CameraBinFocus(this); + return m_cameraFocusControl; +} + +CameraBinLocks *CameraBinSession::cameraLocksControl() +{ + if (!m_cameraLocksControl && photography()) + m_cameraLocksControl = new CameraBinLocks(this); + return m_cameraLocksControl; +} #endif CameraBinSession::CameraRole CameraBinSession::cameraRole() const |