From b604d96ba8cb4b20f3a27537c591a7777e485d0e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 8 May 2013 11:34:31 +0200 Subject: Make directshow-plugin available. No longer include 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 --- src/plugins/directshow/camera/dscamerasession.cpp | 8 ++++++-- src/plugins/directshow/camera/dscamerasession.h | 1 - src/plugins/directshow/directshow.pro | 3 ++- src/plugins/directshow/directshow_camera.json | 3 +++ src/plugins/directshow/dsserviceplugin.h | 6 ++++++ 5 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 src/plugins/directshow/directshow_camera.json (limited to 'src/plugins') diff --git a/src/plugins/directshow/camera/dscamerasession.cpp b/src/plugins/directshow/camera/dscamerasession.cpp index f921dac20..353078f43 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 . + 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 db0038813..e78358a5f 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 struct ICaptureGraphBuilder2; struct ISampleGrabber; diff --git a/src/plugins/directshow/directshow.pro b/src/plugins/directshow/directshow.pro index 95f78ed81..97e72a107 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 000000000..d3a58c758 --- /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 f3f89d7cd..82f1acd6d 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); -- cgit v1.2.1