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>
This commit is contained in:
committed by
Qt by Nokia
parent
bc7d964a05
commit
c97f5f8c2e
@@ -13,19 +13,21 @@ HEADERS += \
|
||||
$$PWD/dsvideodevicecontrol.h \
|
||||
$$PWD/dsimagecapturecontrol.h \
|
||||
$$PWD/dscamerasession.h \
|
||||
$$PWD/dsvideowidgetcontrol.h \
|
||||
$$PWD/dscameraservice.h \
|
||||
$$PWD/directshowglobal.h
|
||||
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/dscameraservice.cpp \
|
||||
$$PWD/dscameracontrol.cpp \
|
||||
$$PWD/dsvideorenderer.cpp \
|
||||
$$PWD/dsvideodevicecontrol.cpp \
|
||||
$$PWD/dsimagecapturecontrol.cpp \
|
||||
$$PWD/dscamerasession.cpp \
|
||||
$$PWD/dsvideowidgetcontrol.cpp
|
||||
$$PWD/dscamerasession.cpp
|
||||
|
||||
contains(config_test_widgets, yes) {
|
||||
HEADERS += $$PWD/dsvideowidgetcontrol.h
|
||||
SOURCES += $$PWD/dsvideowidgetcontrol.cpp
|
||||
}
|
||||
|
||||
INCLUDEPATH += $(DXSDK_DIR)/include
|
||||
LIBS += -lstrmiids -ldmoguids -luuid -lmsdmo -lole32 -loleaut32
|
||||
|
||||
@@ -41,9 +41,11 @@
|
||||
|
||||
#include <QtCore/qvariant.h>
|
||||
#include <QtCore/qdebug.h>
|
||||
|
||||
#if defined(HAVE_WIDGETS)
|
||||
#include <QtWidgets/qwidget.h>
|
||||
#include <QVideoWidgetControl.h>
|
||||
|
||||
#endif
|
||||
|
||||
#include "dscameraservice.h"
|
||||
#include "dscameracontrol.h"
|
||||
@@ -51,7 +53,10 @@
|
||||
#include "dsvideorenderer.h"
|
||||
#include "dsvideodevicecontrol.h"
|
||||
#include "dsimagecapturecontrol.h"
|
||||
|
||||
#if defined(HAVE_WIDGETS)
|
||||
#include "dsvideowidgetcontrol.h"
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@@ -68,7 +73,9 @@ DSCameraService::DSCameraService(QObject *parent):
|
||||
|
||||
m_imageCapture = new DSImageCaptureControl(m_session);
|
||||
|
||||
#if defined(HAVE_WIDGETS)
|
||||
m_viewFinderWidget = new DSVideoWidgetControl(m_session);
|
||||
#endif
|
||||
|
||||
m_device = QByteArray("default");
|
||||
}
|
||||
@@ -79,7 +86,9 @@ DSCameraService::~DSCameraService()
|
||||
delete m_videoDevice;
|
||||
delete m_videoRenderer;
|
||||
delete m_imageCapture;
|
||||
#if defined(HAVE_WIDGETS)
|
||||
delete m_viewFinderWidget;
|
||||
#endif
|
||||
delete m_session;
|
||||
}
|
||||
|
||||
@@ -91,11 +100,13 @@ QMediaControl* DSCameraService::requestControl(const char *name)
|
||||
if (qstrcmp(name, QCameraImageCaptureControl_iid) == 0)
|
||||
return m_imageCapture;
|
||||
|
||||
#if defined(HAVE_WIDGETS)
|
||||
if (qstrcmp(name, QVideoWidgetControl_iid) == 0) {
|
||||
if (m_viewFinderWidget) {
|
||||
return m_viewFinderWidget;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if(qstrcmp(name,QVideoRendererControl_iid) == 0)
|
||||
return m_videoRenderer;
|
||||
|
||||
@@ -74,7 +74,9 @@ private:
|
||||
DSCameraControl *m_control;
|
||||
DSCameraSession *m_session;
|
||||
DSVideoOutputControl *m_videoOutput;
|
||||
#if defined(HAVE_WIDGETS)
|
||||
DSVideoWidgetControl *m_viewFinderWidget;
|
||||
#endif
|
||||
DSVideoDeviceControl *m_videoDevice;
|
||||
DSVideoRendererControl *m_videoRenderer;
|
||||
DSImageCaptureControl *m_imageCapture;
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
|
||||
#include <QDebug>
|
||||
#include <QFile>
|
||||
#include <QtWidgets/QIcon>
|
||||
|
||||
#include "dsvideodevicecontrol.h"
|
||||
#include "dscamerasession.h"
|
||||
@@ -135,13 +134,6 @@ QString DSVideoDeviceControl::deviceDescription(int index) const
|
||||
return QString();
|
||||
}
|
||||
|
||||
QIcon DSVideoDeviceControl::deviceIcon(int index) const
|
||||
{
|
||||
Q_UNUSED(index)
|
||||
|
||||
return QIcon();
|
||||
}
|
||||
|
||||
int DSVideoDeviceControl::defaultDevice() const
|
||||
{
|
||||
return 0;
|
||||
|
||||
@@ -60,7 +60,6 @@ public:
|
||||
int deviceCount() const;
|
||||
QString deviceName(int index) const;
|
||||
QString deviceDescription(int index) const;
|
||||
QIcon deviceIcon(int index) const;
|
||||
int defaultDevice() const;
|
||||
int selectedDevice() const;
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@ TARGET = $$qtLibraryTarget(dsengine)
|
||||
|
||||
PLUGIN_TYPE=mediaservice
|
||||
|
||||
include (../../../common.pri)
|
||||
|
||||
QT += multimedia
|
||||
|
||||
DEPENDPATH += .
|
||||
@@ -16,8 +14,13 @@ SOURCES += dsserviceplugin.cpp
|
||||
|
||||
!contains(config_test_wmsdk, yes): DEFINES += QT_NO_WMSDK
|
||||
|
||||
contains(config_test_wmf, no): include (player/player.pri)
|
||||
include (camera/camera.pri)
|
||||
contains(config_test_widgets, yes) {
|
||||
QT += multimediawidgets
|
||||
DEFINES += HAVE_WIDGETS
|
||||
}
|
||||
|
||||
contains(config_test_wmf, no): include(player/player.pri)
|
||||
include(camera/camera.pri)
|
||||
|
||||
target.path += $$[QT_INSTALL_PLUGINS]/$${PLUGIN_TYPE}
|
||||
INSTALLS += target
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#include "directshowmetadatacontrol.h"
|
||||
#include "directshowplayercontrol.h"
|
||||
#include "directshowvideorenderercontrol.h"
|
||||
#ifndef Q_WS_SIMULATOR
|
||||
#if defined(HAVE_WIDGETS) && !defined(Q_WS_SIMULATOR)
|
||||
#include "vmr9videowindowcontrol.h"
|
||||
#endif
|
||||
|
||||
@@ -83,7 +83,7 @@ DirectShowPlayerService::DirectShowPlayerService(QObject *parent)
|
||||
, m_playerControl(0)
|
||||
, m_metaDataControl(0)
|
||||
, m_videoRendererControl(0)
|
||||
#ifndef Q_WS_SIMULATOR
|
||||
#if defined(HAVE_WIDGETS) && !defined(Q_WS_SIMULATOR)
|
||||
, m_videoWindowControl(0)
|
||||
#endif
|
||||
, m_audioEndpointControl(0)
|
||||
@@ -144,7 +144,7 @@ DirectShowPlayerService::~DirectShowPlayerService()
|
||||
delete m_audioEndpointControl;
|
||||
delete m_metaDataControl;
|
||||
delete m_videoRendererControl;
|
||||
#ifndef Q_WS_SIMULATOR
|
||||
#if defined(HAVE_WIDGETS) && !defined(Q_WS_SIMULATOR)
|
||||
delete m_videoWindowControl;
|
||||
#endif
|
||||
|
||||
@@ -161,7 +161,7 @@ QMediaControl *DirectShowPlayerService::requestControl(const char *name)
|
||||
} else if (qstrcmp(name, QMetaDataReaderControl_iid) == 0) {
|
||||
return m_metaDataControl;
|
||||
} else if (qstrcmp(name, QVideoRendererControl_iid) == 0) {
|
||||
#ifndef Q_WS_SIMULATOR
|
||||
#if defined(HAVE_WIDGETS) && !defined(Q_WS_SIMULATOR)
|
||||
if (!m_videoRendererControl && !m_videoWindowControl) {
|
||||
#else
|
||||
if (!m_videoRendererControl) {
|
||||
@@ -173,7 +173,7 @@ QMediaControl *DirectShowPlayerService::requestControl(const char *name)
|
||||
|
||||
return m_videoRendererControl;
|
||||
}
|
||||
#ifndef Q_WS_SIMULATOR
|
||||
#if defined(HAVE_WIDGETS) && !defined(Q_WS_SIMULATOR)
|
||||
} else if (qstrcmp(name, QVideoWindowControl_iid) == 0) {
|
||||
if (!m_videoRendererControl && !m_videoWindowControl) {
|
||||
m_videoWindowControl = new Vmr9VideoWindowControl;
|
||||
@@ -198,7 +198,7 @@ void DirectShowPlayerService::releaseControl(QMediaControl *control)
|
||||
delete m_videoRendererControl;
|
||||
|
||||
m_videoRendererControl = 0;
|
||||
#ifndef Q_WS_SIMULATOR
|
||||
#if defined(HAVE_WIDGETS) && !defined(Q_WS_SIMULATOR)
|
||||
} else if (control == m_videoWindowControl) {
|
||||
setVideoOutput(0);
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ class DirectShowAudioEndpointControl;
|
||||
class DirectShowMetaDataControl;
|
||||
class DirectShowPlayerControl;
|
||||
class DirectShowVideoRendererControl;
|
||||
#ifndef Q_WS_SIMULATOR
|
||||
#if defined(HAVE_WIDGETS) && !defined(Q_WS_SIMULATOR)
|
||||
class Vmr9VideoWindowControl;
|
||||
#endif
|
||||
|
||||
@@ -180,7 +180,7 @@ private:
|
||||
DirectShowPlayerControl *m_playerControl;
|
||||
DirectShowMetaDataControl *m_metaDataControl;
|
||||
DirectShowVideoRendererControl *m_videoRendererControl;
|
||||
#ifndef Q_WS_SIMULATOR
|
||||
#if defined(HAVE_WIDGETS) && !defined(Q_WS_SIMULATOR)
|
||||
Vmr9VideoWindowControl *m_videoWindowControl;
|
||||
#endif
|
||||
DirectShowAudioEndpointControl *m_audioEndpointControl;
|
||||
|
||||
@@ -35,11 +35,11 @@ SOURCES += \
|
||||
$$PWD/mediasamplevideobuffer.cpp \
|
||||
$$PWD/videosurfacefilter.cpp
|
||||
|
||||
!simulator {
|
||||
HEADERS += \
|
||||
contains(config_test_widgets, yes):!simulator {
|
||||
HEADERS += \
|
||||
$$PWD/vmr9videowindowcontrol.h
|
||||
|
||||
SOURCES += \
|
||||
SOURCES += \
|
||||
$$PWD/vmr9videowindowcontrol.cpp
|
||||
}
|
||||
|
||||
|
||||
@@ -61,16 +61,18 @@
|
||||
#include "qgstreameraudioinputendpointselector.h"
|
||||
#include "qgstreamervideoinputdevicecontrol.h"
|
||||
|
||||
#if defined(HAVE_WIDGETS)
|
||||
#include "qgstreamervideooverlay.h"
|
||||
#include "qgstreamervideowindow.h"
|
||||
#include "qgstreamervideowidget.h"
|
||||
#endif
|
||||
|
||||
#include "qgstreamervideorenderer.h"
|
||||
|
||||
#if defined(Q_WS_MAEMO_6) && defined(__arm__)
|
||||
#include "qgstreamergltexturerenderer.h"
|
||||
#endif
|
||||
|
||||
#include "qgstreamervideowidget.h"
|
||||
|
||||
#include <qmediaserviceprovider.h>
|
||||
|
||||
#include <QtCore/qdebug.h>
|
||||
@@ -92,9 +94,11 @@ CameraBinService::CameraBinService(const QString &service, QObject *parent):
|
||||
|
||||
m_videoOutput = 0;
|
||||
m_videoRenderer = 0;
|
||||
#if defined(HAVE_XVIDEO) && defined(HAVE_WIDGETS)
|
||||
m_videoWindow = 0;
|
||||
m_videoWidgetControl = 0;
|
||||
m_imageCaptureControl = 0;
|
||||
#endif
|
||||
m_imageCaptureControl = 0;
|
||||
|
||||
if (service == Q_MEDIASERVICE_CAMERA) {
|
||||
m_captureSession = new CameraBinSession(this);
|
||||
@@ -106,29 +110,24 @@ CameraBinService::CameraBinService(const QString &service, QObject *parent):
|
||||
m_captureSession, SLOT(setDevice(QString)));
|
||||
|
||||
if (m_videoInputDevice->deviceCount())
|
||||
m_captureSession->setDevice(m_videoInputDevice->deviceName(m_videoInputDevice->selectedDevice()));
|
||||
m_captureSession->setDevice(m_videoInputDevice->deviceName(m_videoInputDevice->selectedDevice()));
|
||||
|
||||
#if defined(Q_WS_MAEMO_6) && defined(__arm__)
|
||||
#if defined(Q_WS_MAEMO_6) && defined(__arm__) && defined(HAVE_WIDGETS)
|
||||
m_videoRenderer = new QGstreamerGLTextureRenderer(this);
|
||||
#else
|
||||
m_videoRenderer = new QGstreamerVideoRenderer(this);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_XVIDEO
|
||||
|
||||
#if defined(HAVE_XVIDEO) && defined(HAVE_WIDGETS)
|
||||
#ifdef Q_WS_MAEMO_6
|
||||
m_videoWindow = new QGstreamerVideoWindow(this, "omapxvsink");
|
||||
//m_videoWindow = new QGstreamerVideoWindow(this);
|
||||
#else
|
||||
m_videoWindow = new QGstreamerVideoOverlay(this);
|
||||
#endif
|
||||
|
||||
m_videoWidgetControl = new QGstreamerVideoWidgetControl(this);
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
if (!m_captureSession) {
|
||||
qWarning() << Q_FUNC_INFO << "Service type is not supported:" << service;
|
||||
return;
|
||||
@@ -163,11 +162,14 @@ QMediaControl *CameraBinService::requestControl(const char *name)
|
||||
if (!m_videoOutput) {
|
||||
if (qstrcmp(name, QVideoRendererControl_iid) == 0) {
|
||||
m_videoOutput = m_videoRenderer;
|
||||
} else if (qstrcmp(name, QVideoWindowControl_iid) == 0) {
|
||||
}
|
||||
#if defined(HAVE_XVIDEO) && defined(HAVE_WIDGETS)
|
||||
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->setViewfinder(m_videoOutput);
|
||||
|
||||
@@ -79,7 +79,7 @@ private:
|
||||
void setAudioPreview(GstElement*);
|
||||
|
||||
CameraBinSession *m_captureSession;
|
||||
CameraBinControl *m_cameraControl;
|
||||
CameraBinControl *m_cameraControl;
|
||||
CameraBinMetaData *m_metaDataControl;
|
||||
|
||||
QAudioEndpointSelector *m_audioInputEndpointSelector;
|
||||
@@ -88,8 +88,10 @@ private:
|
||||
QMediaControl *m_videoOutput;
|
||||
|
||||
QMediaControl *m_videoRenderer;
|
||||
#if defined(HAVE_XVIDEO) && defined(HAVE_WIDGETS)
|
||||
QMediaControl *m_videoWindow;
|
||||
QGstreamerVideoWidgetControl *m_videoWidgetControl;
|
||||
#endif
|
||||
CameraBinImageCapture *m_imageCaptureControl;
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,14 @@
|
||||
load(qt_module)
|
||||
|
||||
TARGET = qgstengine
|
||||
QT += multimedia-private network multimediawidgets-private
|
||||
QT += multimedia-private network
|
||||
CONFIG += no_private_qt_headers_warning
|
||||
|
||||
contains(config_test_widgets, yes) {
|
||||
QT += widgets multimediawidgets-private
|
||||
DEFINES += HAVE_WIDGETS
|
||||
}
|
||||
|
||||
PLUGIN_TYPE=mediaservice
|
||||
|
||||
load(qt_plugin)
|
||||
@@ -11,9 +18,8 @@ DESTDIR = $$QT.multimedia.plugins/$${PLUGIN_TYPE}
|
||||
LIBS += -lqgsttools_p
|
||||
|
||||
unix:!maemo*:contains(QT_CONFIG, alsa) {
|
||||
DEFINES += HAVE_ALSA
|
||||
LIBS += \
|
||||
-lasound
|
||||
DEFINES += HAVE_ALSA
|
||||
LIBS += -lasound
|
||||
}
|
||||
|
||||
CONFIG += link_pkgconfig
|
||||
@@ -40,7 +46,7 @@ maemo6 {
|
||||
|
||||
PKGCONFIG += qmsystem2
|
||||
|
||||
isEqual(QT_ARCH,armv6) {
|
||||
isEqual(QT_ARCH,armv6):contains(config_test_widgets, yes) {
|
||||
HEADERS += qgstreamergltexturerenderer.h
|
||||
SOURCES += qgstreamergltexturerenderer.cpp
|
||||
QT += opengl
|
||||
@@ -68,7 +74,7 @@ SOURCES += \
|
||||
gstvideoconnector.c \
|
||||
|
||||
|
||||
contains(config_test_xvideo, yes) {
|
||||
contains(config_test_xvideo, yes):contains(config_test_widgets, yes): {
|
||||
DEFINES += HAVE_XVIDEO
|
||||
|
||||
LIBS += -lXv -lX11 -lXext
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -87,8 +87,10 @@ private:
|
||||
QMediaControl *m_videoOutput;
|
||||
|
||||
QGstreamerVideoRenderer *m_videoRenderer;
|
||||
#if defined(HAVE_XVIDEO) && defined(HAVE_WIDGETS)
|
||||
QMediaControl *m_videoWindow;
|
||||
QMediaControl *m_videoWidgetControl;
|
||||
#endif
|
||||
QGstreamerImageCaptureControl *m_imageCaptureControl;
|
||||
};
|
||||
|
||||
|
||||
@@ -41,22 +41,28 @@
|
||||
|
||||
#include <QtCore/qvariant.h>
|
||||
#include <QtCore/qdebug.h>
|
||||
|
||||
#if defined(HAVE_WIDGETS)
|
||||
#include <QtWidgets/qwidget.h>
|
||||
#endif
|
||||
|
||||
#include "qgstreamerplayerservice.h"
|
||||
#include "qgstreamerplayercontrol.h"
|
||||
#include "qgstreamerplayersession.h"
|
||||
#include "qgstreamermetadataprovider.h"
|
||||
|
||||
#if defined(HAVE_WIDGETS)
|
||||
#include "qgstreamervideooverlay.h"
|
||||
#include "qgstreamervideowindow.h"
|
||||
#include "qgstreamervideowidget.h"
|
||||
#endif
|
||||
|
||||
#include "qgstreamervideorenderer.h"
|
||||
|
||||
#if defined(Q_WS_MAEMO_6) && defined(__arm__)
|
||||
#include "qgstreamergltexturerenderer.h"
|
||||
#endif
|
||||
|
||||
#include "qgstreamervideowidget.h"
|
||||
#include "qgstreamerstreamscontrol.h"
|
||||
|
||||
#include <qmediaplaylistnavigator.h>
|
||||
@@ -65,11 +71,13 @@
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QGstreamerPlayerService::QGstreamerPlayerService(QObject *parent):
|
||||
QMediaService(parent),
|
||||
m_videoOutput(0),
|
||||
m_videoRenderer(0),
|
||||
m_videoWindow(0),
|
||||
m_videoWidget(0)
|
||||
QMediaService(parent)
|
||||
, m_videoOutput(0)
|
||||
, m_videoRenderer(0)
|
||||
#if defined(HAVE_XVIDEO) && defined(HAVE_WIDGETS)
|
||||
, m_videoWindow(0)
|
||||
, m_videoWidget(0)
|
||||
#endif
|
||||
{
|
||||
m_session = new QGstreamerPlayerSession(this);
|
||||
m_control = new QGstreamerPlayerControl(m_session, this);
|
||||
@@ -82,14 +90,12 @@ QGstreamerPlayerService::QGstreamerPlayerService(QObject *parent):
|
||||
m_videoRenderer = new QGstreamerVideoRenderer(this);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_XVIDEO
|
||||
|
||||
#if defined(HAVE_XVIDEO) && defined(HAVE_WIDGETS)
|
||||
#ifdef Q_WS_MAEMO_6
|
||||
m_videoWindow = new QGstreamerVideoWindow(this, "omapxvsink");
|
||||
#else
|
||||
m_videoWindow = new QGstreamerVideoOverlay(this);
|
||||
#endif
|
||||
|
||||
m_videoWidget = new QGstreamerVideoWidgetControl(this);
|
||||
#endif
|
||||
}
|
||||
@@ -110,12 +116,14 @@ QMediaControl *QGstreamerPlayerService::requestControl(const char *name)
|
||||
return m_streamsControl;
|
||||
|
||||
if (!m_videoOutput) {
|
||||
if (qstrcmp(name, QVideoWidgetControl_iid) == 0)
|
||||
m_videoOutput = m_videoWidget;
|
||||
else if (qstrcmp(name, QVideoRendererControl_iid) == 0)
|
||||
if (qstrcmp(name, QVideoRendererControl_iid) == 0)
|
||||
m_videoOutput = m_videoRenderer;
|
||||
#if defined(HAVE_XVIDEO) && defined(HAVE_WIDGETS)
|
||||
else if (qstrcmp(name, QVideoWidgetControl_iid) == 0)
|
||||
m_videoOutput = m_videoWidget;
|
||||
else if (qstrcmp(name, QVideoWindowControl_iid) == 0)
|
||||
m_videoOutput = m_videoWindow;
|
||||
#endif
|
||||
|
||||
if (m_videoOutput) {
|
||||
m_control->setVideoOutput(m_videoOutput);
|
||||
|
||||
@@ -80,8 +80,10 @@ private:
|
||||
|
||||
QMediaControl *m_videoOutput;
|
||||
QMediaControl *m_videoRenderer;
|
||||
#if defined(HAVE_XVIDEO) && defined(HAVE_WIDGETS)
|
||||
QMediaControl *m_videoWindow;
|
||||
QMediaControl *m_videoWidget;
|
||||
#endif
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
|
||||
#include "qgstreameraudioinputendpointselector.h"
|
||||
|
||||
#include <QtWidgets/QIcon>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
|
||||
#include <QtCore/qstring.h>
|
||||
#include <QtCore/qdebug.h>
|
||||
#include <QtWidgets/QIcon>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
|
||||
#include "qgstreamervideoinputdevicecontrol.h"
|
||||
|
||||
#include <QtWidgets/QIcon>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
@@ -82,12 +81,6 @@ QString QGstreamerVideoInputDeviceControl::deviceDescription(int index) const
|
||||
return m_descriptions[index];
|
||||
}
|
||||
|
||||
QIcon QGstreamerVideoInputDeviceControl::deviceIcon(int index) const
|
||||
{
|
||||
Q_UNUSED(index);
|
||||
return QIcon();
|
||||
}
|
||||
|
||||
int QGstreamerVideoInputDeviceControl::defaultDevice() const
|
||||
{
|
||||
return 0;
|
||||
|
||||
@@ -58,7 +58,6 @@ public:
|
||||
|
||||
QString deviceName(int index) const;
|
||||
QString deviceDescription(int index) const;
|
||||
QIcon deviceIcon(int index) const;
|
||||
|
||||
int defaultDevice() const;
|
||||
int selectedDevice() const;
|
||||
|
||||
@@ -43,8 +43,6 @@
|
||||
#include <private/qvideosurfacegstsink_p.h>
|
||||
#include <qabstractvideosurface.h>
|
||||
|
||||
#include <QEvent>
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <QDebug>
|
||||
|
||||
#include <gst/gst.h>
|
||||
|
||||
@@ -36,6 +36,9 @@ unix:!mac {
|
||||
|
||||
mac:!simulator {
|
||||
SUBDIRS += audiocapture
|
||||
SUBDIRS += qt7
|
||||
|
||||
# Currently we need qmacdefines_mac.h from QtWidgets, so this depends on that :/
|
||||
# despite the code not really using them.
|
||||
contains(config_test_widgets, yes):SUBDIRS += qt7
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
load(qt_module)
|
||||
|
||||
TARGET = qqt7engine
|
||||
QT += multimedia-private multimediawidgets-private network widgets
|
||||
QT += multimedia-private network
|
||||
contains(config_test_widgets, yes) {
|
||||
QT += multimediawidgets-private widgets
|
||||
}
|
||||
|
||||
PLUGIN_TYPE = mediaservice
|
||||
|
||||
load(qt_plugin)
|
||||
@@ -39,7 +43,6 @@ OBJECTIVE_SOURCES += \
|
||||
!simulator {
|
||||
HEADERS += \
|
||||
qt7movieviewoutput.h \
|
||||
qt7movievideowidget.h \
|
||||
qt7movieviewrenderer.h \
|
||||
qt7movierenderer.h \
|
||||
qt7ciimagevideobuffer.h \
|
||||
@@ -47,12 +50,19 @@ OBJECTIVE_SOURCES += \
|
||||
|
||||
OBJECTIVE_SOURCES += \
|
||||
qt7movieviewoutput.mm \
|
||||
qt7movievideowidget.mm \
|
||||
qt7movieviewrenderer.mm \
|
||||
qt7movierenderer.mm \
|
||||
qt7videooutput.mm \
|
||||
qt7ciimagevideobuffer.mm \
|
||||
qcvdisplaylink.mm
|
||||
|
||||
contains(config_test_widgets, yes) {
|
||||
HEADERS += \
|
||||
qt7movieviewwidget.h
|
||||
|
||||
OBJECTIVE_SOURCES += \
|
||||
qt7movievideowidget.mm
|
||||
}
|
||||
}
|
||||
|
||||
include(mediaplayer/mediaplayer.pri)
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
|
||||
#include "simulatorvideoinputdevicecontrol.h"
|
||||
|
||||
#include <QtWidgets/QIcon>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QStringList>
|
||||
@@ -77,12 +76,6 @@ QString QSimulatorVideoInputDeviceControl::deviceDescription(int index) const
|
||||
return mDescriptions[index];
|
||||
}
|
||||
|
||||
QIcon QSimulatorVideoInputDeviceControl::deviceIcon(int index) const
|
||||
{
|
||||
Q_UNUSED(index);
|
||||
return QIcon();
|
||||
}
|
||||
|
||||
int QSimulatorVideoInputDeviceControl::defaultDevice() const
|
||||
{
|
||||
if (mDevices.isEmpty())
|
||||
|
||||
@@ -61,7 +61,6 @@ public:
|
||||
|
||||
QString deviceName(int index) const;
|
||||
QString deviceDescription(int index) const;
|
||||
QIcon deviceIcon(int index) const;
|
||||
|
||||
int defaultDevice() const;
|
||||
int selectedDevice() const;
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
|
||||
#include <QtCore/qstring.h>
|
||||
#include <QtCore/qdebug.h>
|
||||
#include <QtWidgets/QIcon>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ QMediaControl* MFPlayerService::requestControl(const char *name)
|
||||
} else if (qstrcmp(name, QMetaDataReaderControl_iid) == 0) {
|
||||
return m_metaDataControl;
|
||||
} else if (qstrcmp(name, QVideoRendererControl_iid) == 0) {
|
||||
#ifndef Q_WS_SIMULATOR
|
||||
#if defined(HAVE_WIDGETS) && !defined(Q_WS_SIMULATOR)
|
||||
if (!m_videoRendererControl && !m_videoWindowControl) {
|
||||
#else
|
||||
if (!m_videoRendererControl) {
|
||||
@@ -103,7 +103,7 @@ QMediaControl* MFPlayerService::requestControl(const char *name)
|
||||
m_videoRendererControl = new MFVideoRendererControl;
|
||||
return m_videoRendererControl;
|
||||
}
|
||||
#ifndef Q_WS_SIMULATOR
|
||||
#if defined(HAVE_WIDGETS) && !defined(Q_WS_SIMULATOR)
|
||||
} else if (qstrcmp(name, QVideoWindowControl_iid) == 0) {
|
||||
if (!m_videoRendererControl && !m_videoWindowControl) {
|
||||
m_videoWindowControl = new Evr9VideoWindowControl;
|
||||
@@ -124,7 +124,7 @@ void MFPlayerService::releaseControl(QMediaControl *control)
|
||||
m_videoRendererControl->setSurface(0);
|
||||
delete m_videoRendererControl;
|
||||
m_videoRendererControl = 0;
|
||||
#ifndef Q_WS_SIMULATOR
|
||||
#if defined(HAVE_WIDGETS) && !defined(Q_WS_SIMULATOR)
|
||||
} else if (control == m_videoWindowControl) {
|
||||
delete m_videoWindowControl;
|
||||
m_videoWindowControl = 0;
|
||||
@@ -142,7 +142,7 @@ MFVideoRendererControl* MFPlayerService::videoRendererControl() const
|
||||
return m_videoRendererControl;
|
||||
}
|
||||
|
||||
#ifndef Q_WS_SIMULATOR
|
||||
#if defined(HAVE_WIDGETS) && !defined(Q_WS_SIMULATOR)
|
||||
Evr9VideoWindowControl* MFPlayerService::videoWindowControl() const
|
||||
{
|
||||
return m_videoWindowControl;
|
||||
|
||||
@@ -56,7 +56,7 @@ QT_END_NAMESPACE
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
|
||||
#ifndef Q_WS_SIMULATOR
|
||||
#if defined(HAVE_WIDGETS) && !defined(Q_WS_SIMULATOR)
|
||||
class Evr9VideoWindowControl;
|
||||
#endif
|
||||
class MFAudioEndpointControl;
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
|
||||
MFAudioEndpointControl* audioEndpointControl() const;
|
||||
MFVideoRendererControl* videoRendererControl() const;
|
||||
#ifndef Q_WS_SIMULATOR
|
||||
#if defined(HAVE_WIDGETS) && !defined(Q_WS_SIMULATOR)
|
||||
Evr9VideoWindowControl* videoWindowControl() const;
|
||||
#endif
|
||||
MFMetaDataControl* metaDataControl() const;
|
||||
@@ -86,7 +86,7 @@ private:
|
||||
MFPlayerSession *m_session;
|
||||
MFVideoRendererControl *m_videoRendererControl;
|
||||
MFAudioEndpointControl *m_audioEndpointControl;
|
||||
#ifndef Q_WS_SIMULATOR
|
||||
#if defined(HAVE_WIDGETS) && !defined(Q_WS_SIMULATOR)
|
||||
Evr9VideoWindowControl *m_videoWindowControl;
|
||||
#endif
|
||||
MFPlayerControl *m_player;
|
||||
|
||||
@@ -24,7 +24,7 @@ SOURCES += \
|
||||
$$PWD/mfaudioendpointcontrol.cpp \
|
||||
$$PWD/mfmetadatacontrol.cpp
|
||||
|
||||
!simulator {
|
||||
contains(config_test_widgets, yes):!simulator {
|
||||
HEADERS += $$PWD/evr9videowindowcontrol.h
|
||||
SOURCES += $$PWD/evr9videowindowcontrol.cpp
|
||||
}
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
load(qt_module)
|
||||
|
||||
TARGET = wmfengine
|
||||
QT += multimedia-private network multimediawidgets-private
|
||||
QT += multimedia-private network
|
||||
contains(config_test_widgets, yes) {
|
||||
QT += multimediawidgets-private
|
||||
DEFINES += HAVE_WIDGETS
|
||||
}
|
||||
PLUGIN_TYPE=mediaservice
|
||||
|
||||
load(qt_plugin)
|
||||
|
||||
Reference in New Issue
Block a user