diff options
author | Michael Goddard <michael.goddard@nokia.com> | 2012-01-05 17:22:19 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-06 05:26:01 +0100 |
commit | c97f5f8c2e91c1b76d42583efaf232487d490060 (patch) | |
tree | 533f1142282ebce38bbf7bd4356b4341530f30be /src/plugins/gstreamer/mediacapture/qgstreamercaptureservice.cpp | |
parent | bc7d964a053a3a37a0b286ee17ee15c9ef747c3e (diff) |
Properly handle the case where QtWidgets is not available.
It does use a config test for now, just to make it clearer. The Mac
backend currently requires widgets, but most of the others should work
without it (just not supporting QVideoWidget/WindowControl).
The QVideoDeviceControl interface was modified to remove the QIcon
usage - it was never implemented.
Unfortunately even the QML examples need widgets for the wrapper
application, and will need to be ported to QtGui based wrapper.
Change-Id: I8a55ad5cf09ab51749510bf16f49de0bd3f0bcdb
Reviewed-by: Ling Hu <ling.hu@nokia.com>
Diffstat (limited to 'src/plugins/gstreamer/mediacapture/qgstreamercaptureservice.cpp')
-rw-r--r-- | src/plugins/gstreamer/mediacapture/qgstreamercaptureservice.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/plugins/gstreamer/mediacapture/qgstreamercaptureservice.cpp b/src/plugins/gstreamer/mediacapture/qgstreamercaptureservice.cpp index f1516885a..55357d21a 100644 --- a/src/plugins/gstreamer/mediacapture/qgstreamercaptureservice.cpp +++ b/src/plugins/gstreamer/mediacapture/qgstreamercaptureservice.cpp @@ -55,10 +55,12 @@ #include "qgstreamervideoinputdevicecontrol.h" #include "qgstreamerimagecapturecontrol.h" -#include "qgstreamervideooverlay.h" #include "qgstreamervideorenderer.h" +#if defined(HAVE_WIDGETS) +#include "qgstreamervideooverlay.h" #include "qgstreamervideowidget.h" +#endif #include <qmediaserviceprovider.h> @@ -77,8 +79,10 @@ QGstreamerCaptureService::QGstreamerCaptureService(const QString &service, QObje m_videoOutput = 0; m_videoRenderer = 0; +#if defined(HAVE_XVIDEO) && defined(HAVE_WIDGETS) m_videoWindow = 0; m_videoWidgetControl = 0; +#endif m_imageCaptureControl = 0; if (service == Q_MEDIASERVICE_AUDIOSOURCE) { @@ -100,10 +104,10 @@ QGstreamerCaptureService::QGstreamerCaptureService(const QString &service, QObje m_videoRenderer = new QGstreamerVideoRenderer(this); -#ifdef HAVE_XVIDEO +#if defined(HAVE_XVIDEO) && defined(HAVE_WIDGETS) m_videoWindow = new QGstreamerVideoOverlay(this); m_videoWidgetControl = new QGstreamerVideoWidgetControl(this); -#endif +#endif m_imageCaptureControl = new QGstreamerImageCaptureControl(m_captureSession); } @@ -125,8 +129,8 @@ QGstreamerCaptureService::~QGstreamerCaptureService() QMediaControl *QGstreamerCaptureService::requestControl(const char *name) { if (!m_captureSession) - return 0; - + return 0; + if (qstrcmp(name,QAudioEndpointSelector_iid) == 0) return m_audioInputEndpointSelector; @@ -157,15 +161,18 @@ QMediaControl *QGstreamerCaptureService::requestControl(const char *name) if (qstrcmp(name, QCameraImageCaptureControl_iid) == 0) return m_imageCaptureControl; - + if (!m_videoOutput) { if (qstrcmp(name, QVideoRendererControl_iid) == 0) { m_videoOutput = m_videoRenderer; - } else if (qstrcmp(name, QVideoWindowControl_iid) == 0) { + } +#if defined(HAVE_WIDGETS) && defined(HAVE_XVIDEO) + else if (qstrcmp(name, QVideoWindowControl_iid) == 0) { m_videoOutput = m_videoWindow; } else if (qstrcmp(name, QVideoWidgetControl_iid) == 0) { m_videoOutput = m_videoWidgetControl; } +#endif if (m_videoOutput) { m_captureSession->setVideoPreview(m_videoOutput); |