From c97f5f8c2e91c1b76d42583efaf232487d490060 Mon Sep 17 00:00:00 2001 From: Michael Goddard Date: Thu, 5 Jan 2012 17:22:19 +1000 Subject: 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 --- .../mediacapture/qgstreamercaptureservice.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'src/plugins/gstreamer/mediacapture/qgstreamercaptureservice.cpp') 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 @@ -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); -- cgit v1.2.3