summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2013-05-08 11:34:31 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-15 12:43:08 +0200
commitb604d96ba8cb4b20f3a27537c591a7777e485d0e (patch)
tree8e636cca1eb1b8436dd03d96b1e4634d324a24b1 /src/plugins
parentf4348fe3ae91ac47f45495681738505ff6005453 (diff)
Make directshow-plugin available.
No longer include <qedit.h> in directshow-plugin, which no longer ships in newer SDKs. Ensure it only provides the camera service if the WMF-plugin is built by using a different .json-file. Adapt qcamerabackend-test to use widgets. Task-number: QTBUG-28047 Change-Id: I22ea441b9edb56ff55bc275dba37c01c77d8dd90 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/directshow/camera/dscamerasession.cpp8
-rw-r--r--src/plugins/directshow/camera/dscamerasession.h1
-rw-r--r--src/plugins/directshow/directshow.pro3
-rw-r--r--src/plugins/directshow/directshow_camera.json3
-rw-r--r--src/plugins/directshow/dsserviceplugin.h6
5 files changed, 17 insertions, 4 deletions
diff --git a/src/plugins/directshow/camera/dscamerasession.cpp b/src/plugins/directshow/camera/dscamerasession.cpp
index f921dac2..353078f4 100644
--- a/src/plugins/directshow/camera/dscamerasession.cpp
+++ b/src/plugins/directshow/camera/dscamerasession.cpp
@@ -656,6 +656,10 @@ HRESULT DSCameraSession::getPin(IBaseFilter *pFilter, PIN_DIRECTION PinDir, IPin
bool DSCameraSession::createFilterGraph()
{
+ // Previously containered in <qedit.h>.
+ static const IID iID_ISampleGrabber = { 0x6B652FFF, 0x11FE, 0x4fce, { 0x92, 0xAD, 0x02, 0x66, 0xB5, 0xD7, 0xC7, 0x8F } };
+ static const CLSID cLSID_SampleGrabber = { 0xC1F400A0, 0x3F08, 0x11d3, { 0x9F, 0x0B, 0x00, 0x60, 0x08, 0x03, 0x9E, 0x37 } };
+
HRESULT hr;
IMoniker* pMoniker = NULL;
ICreateDevEnum* pDevEnum = NULL;
@@ -752,14 +756,14 @@ bool DSCameraSession::createFilterGraph()
}
// Sample grabber filter
- hr = CoCreateInstance(CLSID_SampleGrabber, NULL,CLSCTX_INPROC,
+ hr = CoCreateInstance(cLSID_SampleGrabber, NULL,CLSCTX_INPROC,
IID_IBaseFilter, (void**)&pSG_Filter);
if (FAILED(hr)) {
qWarning() << "failed to create sample grabber";
return false;
}
- hr = pSG_Filter->QueryInterface(IID_ISampleGrabber, (void**)&pSG);
+ hr = pSG_Filter->QueryInterface(iID_ISampleGrabber, (void**)&pSG);
if (FAILED(hr)) {
qWarning() << "failed to get sample grabber";
return false;
diff --git a/src/plugins/directshow/camera/dscamerasession.h b/src/plugins/directshow/camera/dscamerasession.h
index db003881..e78358a5 100644
--- a/src/plugins/directshow/camera/dscamerasession.h
+++ b/src/plugins/directshow/camera/dscamerasession.h
@@ -69,7 +69,6 @@
#define __IDxtAlphaSetter_INTERFACE_DEFINED__
#define __IDxtJpeg_INTERFACE_DEFINED__
#define __IDxtKey_INTERFACE_DEFINED__
-#include <qedit.h>
struct ICaptureGraphBuilder2;
struct ISampleGrabber;
diff --git a/src/plugins/directshow/directshow.pro b/src/plugins/directshow/directshow.pro
index 95f78ed8..97e72a10 100644
--- a/src/plugins/directshow/directshow.pro
+++ b/src/plugins/directshow/directshow.pro
@@ -24,4 +24,5 @@ win32-g++ {
include(camera/camera.pri)
OTHER_FILES += \
- directshow.json
+ directshow.json \
+ directshow_camera.json
diff --git a/src/plugins/directshow/directshow_camera.json b/src/plugins/directshow/directshow_camera.json
new file mode 100644
index 00000000..d3a58c75
--- /dev/null
+++ b/src/plugins/directshow/directshow_camera.json
@@ -0,0 +1,3 @@
+{
+ "Keys": ["org.qt-project.qt.camera"]
+}
diff --git a/src/plugins/directshow/dsserviceplugin.h b/src/plugins/directshow/dsserviceplugin.h
index f3f89d7c..82f1acd6 100644
--- a/src/plugins/directshow/dsserviceplugin.h
+++ b/src/plugins/directshow/dsserviceplugin.h
@@ -54,7 +54,13 @@ class DSServicePlugin
Q_OBJECT
Q_INTERFACES(QMediaServiceSupportedDevicesInterface)
Q_INTERFACES(QMediaServiceFeaturesInterface)
+ // The player service provided by the WMF-plugin should preferably be used.
+ // DirectShow should then only provide the camera (see QTBUG-29172, QTBUG-29175).
+#ifdef QMEDIA_DIRECTSHOW_PLAYER
Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "directshow.json")
+#else
+ Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "directshow_camera.json")
+#endif
public:
QMediaService* create(QString const& key);