Skip to content

Commit

Permalink
let mingw build d3d11 decoder
Browse files Browse the repository at this point in the history
d3d11.h in mingw64<v5 is not complete, no video decoder there. So the
latest d3d11.h from vs is used. other dependencies like d3d11layers.h,
d3d10.h are already in mingw64. Toolchain provided by qt does not
contains wrl and d3d11layers.h, use mingw-builds instead.
xaudio2 still use 2.8.
tested on mingw64 gcc 4.9, 5.3
remove d2d1headers because d2d1 is supported by most toolchains (gcc4.7,
vs2010 for example)
  • Loading branch information
wang-bin committed Apr 10, 2016
1 parent 46c5dd1 commit 796781b
Show file tree
Hide file tree
Showing 25 changed files with 14,826 additions and 2,278 deletions.
1 change: 1 addition & 0 deletions QtAV.pro
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 57,7 @@ contains(QT_CONFIG, opengl):!no-gl:!no-widgets {
!no-uchardet: OptionalDepends *= uchardet
win32:macx:!android:!winrt:!no-portaudio: OptionalDepends *= portaudio
win32 {
OptionalDepends *= dx
!no-xaudio2: OptionalDepends *= xaudio2
!no-direct2d:!no-widgets: OptionalDepends *= direct2d
!no-dxva: OptionalDepends *= dxva
Expand Down
7 changes: 4 additions & 3 deletions config.tests/d3d11va/main.cpp
Original file line number Diff line number Diff line change
@@ -1,8 1,8 @@
/******************************************************************************
QtAV: Media play library based on Qt and FFmpeg
Copyright (C) 2013 Wang Bin <[email protected]>
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <[email protected]>
* This file is part of QtAV
* This file is part of QtAV (from 2016)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand All @@ -18,6 18,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
******************************************************************************/
#include "../dxcompat.h"
#include <d3d11.h>
extern "C" {
#include <libavcodec/d3d11va.h>
Expand Down
1 change: 0 additions & 1 deletion config.tests/direct2d/direct2d.pro
Original file line number Diff line number Diff line change
@@ -1,6 1,5 @@
CONFIG -= qt
CONFIG = console
!*msvc*:INCLUDEPATH = ../../contrib/d2d1headers
SOURCES = main.cpp

#dynamic load
Expand Down
7 changes: 4 additions & 3 deletions config.tests/direct2d/main.cpp
Original file line number Diff line number Diff line change
@@ -1,8 1,8 @@
/******************************************************************************
QtAV: Media play library based on Qt and FFmpeg
Copyright (C) 2013 Wang Bin <[email protected]>
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <[email protected]>
* This file is part of QtAV
* This file is part of QtAV (from 2013)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand All @@ -18,6 18,7 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
******************************************************************************/
#include "../dxcompat.h"
#include <d2d1.h>

int main()
Expand Down
7 changes: 7 additions & 0 deletions config.tests/dx/dx.pro
Original file line number Diff line number Diff line change
@@ -0,0 1,7 @@
CONFIG -= qt app_bundle
CONFIG = console
CONFIG *= c 11
CONFIG = config_dx
SOURCES = main.cpp

include(../paths.pri)
30 changes: 30 additions & 0 deletions config.tests/dx/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 1,30 @@
/******************************************************************************
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <[email protected]>
* This file is part of QtAV (from 2016)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
******************************************************************************/
#include "../dxcompat.h"
#include <XAudio2.h> // standalone check?
#include <d3d11.h>
#include <wrl/client.h> //ComPtr is used in QtAV

int main()
{
D3D11_VIDEO_PROCESSOR_STREAM s; //used by vp
return 0;
}
3 changes: 3 additions & 0 deletions config.tests/dxcompat.h
Original file line number Diff line number Diff line change
@@ -0,0 1,3 @@
#include "../src/directx/dxcompat.h"
//#include <windows.h> //to include _mingw.h
// check __MINGW64_VERSION_MAJOR? 5.x has complete headers we need
19 changes: 4 additions & 15 deletions config.tests/dxva/main.cpp
Original file line number Diff line number Diff line change
@@ -1,8 1,8 @@
/******************************************************************************
QtAV: Media play library based on Qt and FFmpeg
Copyright (C) 2013 Wang Bin <[email protected]>
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <[email protected]>
* This file is part of QtAV
* This file is part of QtAV (from 2013)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand All @@ -18,24 18,13 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
******************************************************************************/

#include "../dxcompat.h"
extern "C" {
#include <libavcodec/dxva2.h> //will include d3d9.h, dxva2api.h
}
#define VA_DXVA2_MAX_SURFACE_COUNT (64)

#include <d3d9.h>
#include <dxva2api.h>

#define MS_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
static const GUID name = { l, w1, w2, {b1, b2, b3, b4, b5, b6, b7, b8}}
#ifdef __MINGW32__
# include <_mingw.h>
# if defined(__MINGW64_VERSION_MAJOR)
# include <dxva.h>
# endif
#endif /* __MINGW32__ */

int main()
{
return 0;
Expand Down
2 changes: 2 additions & 0 deletions config.tests/paths.pri
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 4,5 @@ INCLUDEPATH = $$[QT_INSTALL_HEADERS]
LIBS = -L$$[QT_INSTALL_LIBS]
CONFIG -= qt app_bundle lib_bundle
CONFIG = console
*msvc*: INCLUDEPATH *= $$PWD/../src/compat/msvc
!config_dx: INCLUDEPATH *= $$PWD/../contrib/dxsdk
22 changes: 14 additions & 8 deletions config.tests/xaudio2/main.cpp
Original file line number Diff line number Diff line change
@@ -1,8 1,8 @@
/******************************************************************************
QtAV: Media play library based on Qt and FFmpeg
Copyright (C) 2015 Wang Bin <[email protected]>
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <[email protected]>
* This file is part of QtAV
* This file is part of QtAV (from 2015)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand All @@ -18,11 18,17 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
******************************************************************************/
#include <xaudio2.h>

#if(_WIN32_WINNT < _WIN32_WINNT_WIN8)
#error "XAudio2 is not from Windows SDK. Use header from June 2010 DXSDK"
#endif // (_WIN32_WINNT < _WIN32_WINNT_WIN8)
#include "../dxcompat.h"
#ifdef __GNUC__
// macros used by XAudio 2.7 (June 2010 SDK)
#ifndef __in
#define __in
#endif
#ifndef __out
#define __out
#endif
#endif
#include <XAudio2.h>

int main()
{
Expand Down
1 change: 0 additions & 1 deletion contrib/d2d1headers/README.INSTALL

This file was deleted.

Loading

0 comments on commit 796781b

Please sign in to comment.