Fix compilation with stock MinGW.
authorFriedemann Kleint <Friedemann.Kleint@digia.com>
Tue, 16 Oct 2012 14:49:52 +0000 (16:49 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 17 Oct 2012 11:40:13 +0000 (13:40 +0200)
Use qt_windows.h, provide interfaces and UIDs missing
in stock MinGW.

Task-number: QTBUG-23829
Change-Id: I79ed902bb7636c751df7607f6059a7de237acb31
Reviewed-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp
src/multimedia/audio/qaudioinput_win32_p.h
src/multimedia/audio/qaudiooutput_win32_p.h

index e72d6fd..bfbd042 100644 (file)
 //
 
 
-#include <windows.h>
+#include <QtCore/qt_windows.h>
 #include <mmsystem.h>
 #include "qaudiodeviceinfo_win32_p.h"
-#include <dshow.h>
 
 #if defined(Q_CC_MINGW) && !defined(__MINGW64_VERSION_MAJOR)
+struct IBaseFilter; // Needed for strmif.h from stock MinGW.
+struct _DDPIXELFORMAT;
+typedef struct _DDPIXELFORMAT* LPDDPIXELFORMAT;
+#endif
+
+#include <strmif.h>
+#if !defined(Q_CC_MINGW) || defined(__MINGW64_VERSION_MAJOR)
+#  include <uuids.h>
+#else
 
 extern GUID CLSID_AudioInputDeviceCategory;
+extern GUID CLSID_AudioRendererCategory;
+extern GUID IID_ICreateDevEnum;
+extern GUID CLSID_SystemDeviceEnum;
+
+#ifndef __ICreateDevEnum_INTERFACE_DEFINED__
+#define __ICreateDevEnum_INTERFACE_DEFINED__
+
+DECLARE_INTERFACE_(ICreateDevEnum, IUnknown)
+{
+    STDMETHOD(CreateClassEnumerator)(REFCLSID clsidDeviceClass,
+                                     IEnumMoniker **ppEnumMoniker,
+                                     DWORD dwFlags) PURE;
+};
+
+#endif //  __ICreateDevEnum_INTERFACE_DEFINED__
 
 #ifndef __IErrorLog_INTERFACE_DEFINED__
 #define __IErrorLog_INTERFACE_DEFINED__
index 0f027a4..a7f1568 100644 (file)
@@ -53,9 +53,7 @@
 #ifndef QAUDIOINPUTWIN_H
 #define QAUDIOINPUTWIN_H
 
-#define NOMINMAX
-
-#include <windows.h>
+#include <QtCore/qt_windows.h>
 #include <mmsystem.h>
 
 #include <QtCore/qfile.h>
index 13c44c6..b28157e 100644 (file)
@@ -53,9 +53,7 @@
 #ifndef QAUDIOOUTPUTWIN_H
 #define QAUDIOOUTPUTWIN_H
 
-#define NOMINMAX
-
-#include <windows.h>
+#include <QtCore/qt_windows.h>
 #include <mmsystem.h>
 
 #include <QtCore/qdebug.h>