Update DXVA2 patches, remove last work-in-progress part.

This commit is contained in:
Sebastian Lackner 2014-03-29 06:53:54 +01:00
parent 2f449562d1
commit 09bfdcb009
8 changed files with 67 additions and 562 deletions

View File

@ -1,12 +1,12 @@
From fea79238dba89c6233b58cbb86b3702f91f5be24 Mon Sep 17 00:00:00 2001
From fceaf9739a92377afc2834e0ce9d9a187f06a2e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Wed, 26 Mar 2014 21:09:24 +0100
Subject: include: Add dxva2api.idl
---
include/Makefile.in | 1 +
include/dxva2api.idl | 461 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 462 insertions(+)
include/dxva2api.idl | 503 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 504 insertions(+)
create mode 100644 include/dxva2api.idl
diff --git a/include/Makefile.in b/include/Makefile.in
@ -23,10 +23,10 @@ index ebdc96b..d6997db 100644
fusion.idl \
diff --git a/include/dxva2api.idl b/include/dxva2api.idl
new file mode 100644
index 0000000..274cccf
index 0000000..c11f90d
--- /dev/null
+++ b/include/dxva2api.idl
@@ -0,0 +1,461 @@
@@ -0,0 +1,503 @@
+/*
+ * Copyright Michael Müller for Pipelight
+ *
@ -56,6 +56,47 @@ index 0000000..274cccf
+typedef DWORD D3DPOOL;
+cpp_quote("#endif")
+
+cpp_quote("DEFINE_GUID(DXVA2_ModeMPEG2_MoComp, 0xe6a9f44b, 0x61b0,0x4563, 0x9e,0xa4,0x63,0xd2,0xa3,0xc6,0xfe,0x66);")
+cpp_quote("DEFINE_GUID(DXVA2_ModeMPEG2_IDCT, 0xbf22ad00, 0x03ea,0x4690, 0x80,0x77,0x47,0x33,0x46,0x20,0x9b,0x7e);")
+cpp_quote("DEFINE_GUID(DXVA2_ModeMPEG2_VLD, 0xee27417f, 0x5e28,0x4e65, 0xbe,0xea,0x1d,0x26,0xb5,0x08,0xad,0xc9);")
+cpp_quote("DEFINE_GUID(DXVA2_ModeH264_A, 0x1b81be64, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
+cpp_quote("DEFINE_GUID(DXVA2_ModeH264_B, 0x1b81be65, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
+cpp_quote("DEFINE_GUID(DXVA2_ModeH264_C, 0x1b81be66, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
+cpp_quote("DEFINE_GUID(DXVA2_ModeH264_D, 0x1b81be67, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
+cpp_quote("DEFINE_GUID(DXVA2_ModeH264_E, 0x1b81be68, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
+cpp_quote("DEFINE_GUID(DXVA2_ModeH264_F, 0x1b81be69, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
+cpp_quote("DEFINE_GUID(DXVA2_ModeWMV8_A, 0x1b81be80, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
+cpp_quote("DEFINE_GUID(DXVA2_ModeWMV8_B, 0x1b81be81, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
+cpp_quote("DEFINE_GUID(DXVA2_ModeWMV9_A, 0x1b81be90, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
+cpp_quote("DEFINE_GUID(DXVA2_ModeWMV9_B, 0x1b81be91, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
+cpp_quote("DEFINE_GUID(DXVA2_ModeWMV9_C, 0x1b81be94, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
+cpp_quote("DEFINE_GUID(DXVA2_ModeVC1_A, 0x1b81beA0, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
+cpp_quote("DEFINE_GUID(DXVA2_ModeVC1_B, 0x1b81beA1, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
+cpp_quote("DEFINE_GUID(DXVA2_ModeVC1_C, 0x1b81beA2, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
+cpp_quote("DEFINE_GUID(DXVA2_ModeVC1_D, 0x1b81beA3, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
+
+/* alternate names */
+cpp_quote("#define DXVA2_ModeMPEG2_MOCOMP DXVA2_ModeMPEG2_MoComp")
+
+cpp_quote("#define DXVA2_ModeWMV8_PostProc DXVA2_ModeWMV8_A")
+cpp_quote("#define DXVA2_ModeWMV8_MoComp DXVA2_ModeWMV8_B")
+
+cpp_quote("#define DXVA2_ModeWMV9_PostProc DXVA2_ModeWMV9_A")
+cpp_quote("#define DXVA2_ModeWMV9_MoComp DXVA2_ModeWMV9_B")
+cpp_quote("#define DXVA2_ModeWMV9_IDCT DXVA2_ModeWMV9_C")
+
+cpp_quote("#define DXVA2_ModeVC1_PostProc DXVA2_ModeVC1_A")
+cpp_quote("#define DXVA2_ModeVC1_MoComp DXVA2_ModeVC1_B")
+cpp_quote("#define DXVA2_ModeVC1_IDCT DXVA2_ModeVC1_C")
+cpp_quote("#define DXVA2_ModeVC1_VLD DXVA2_ModeVC1_D")
+
+cpp_quote("#define DXVA2_ModeH264_MoComp_NoFGT DXVA2_ModeH264_A")
+cpp_quote("#define DXVA2_ModeH264_MoComp_FGT DXVA2_ModeH264_B")
+cpp_quote("#define DXVA2_ModeH264_IDCT_NoFGT DXVA2_ModeH264_C")
+cpp_quote("#define DXVA2_ModeH264_IDCT_FGT DXVA2_ModeH264_D")
+cpp_quote("#define DXVA2_ModeH264_VLD_NoFGT DXVA2_ModeH264_E")
+cpp_quote("#define DXVA2_ModeH264_VLD_FGT DXVA2_ModeH264_F")
+
+typedef LONGLONG REFERENCE_TIME;
+
+enum
@ -325,20 +366,6 @@ index 0000000..274cccf
+]
+interface IDirectXVideoDecoderService : IDirectXVideoAccelerationService
+{
+ HRESULT CreateVideoDecoder(
+ [in] REFGUID guid,
+ [in] const DXVA2_VideoDesc *pVideoDesc,
+ [in] DXVA2_ConfigPictureDecode *pConfig,
+ [in] IDirect3DSurface9 **ppDecoderRenderTargets,
+ [in] UINT NumSurfaces,
+ [out] IDirectXVideoDecoder **ppDecode);
+
+ HRESULT GetDecoderConfigurations(
+ [in] REFGUID guid,
+ [in] const DXVA2_VideoDesc *pVideoDesc,
+ [in] IUnknown *pReserved,
+ [out] UINT *pCount,
+ [out] DXVA2_ConfigPictureDecode **ppConfigs);
+
+ HRESULT GetDecoderDeviceGuids(
+ [out] UINT *count,
@ -348,6 +375,21 @@ index 0000000..274cccf
+ [in] REFGUID guid,
+ [out] UINT *pCount,
+ [out] D3DFORMAT **pFormats);
+
+ HRESULT GetDecoderConfigurations(
+ [in] REFGUID guid,
+ [in] const DXVA2_VideoDesc *pVideoDesc,
+ [in] IUnknown *pReserved,
+ [out] UINT *pCount,
+ [out] DXVA2_ConfigPictureDecode **ppConfigs);
+
+ HRESULT CreateVideoDecoder(
+ [in] REFGUID guid,
+ [in] const DXVA2_VideoDesc *pVideoDesc,
+ [in] DXVA2_ConfigPictureDecode *pConfig,
+ [in] IDirect3DSurface9 **ppDecoderRenderTargets,
+ [in] UINT NumSurfaces,
+ [out] IDirectXVideoDecoder **ppDecode);
+};
+
+/*****************************************************************************

View File

@ -1,4 +1,4 @@
From e9681f3d80f1900071d56a5a008424453f39a304 Mon Sep 17 00:00:00 2001
From 807e66d582215c2335b39ea2a35bc0abe2cf64dd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Wed, 26 Mar 2014 05:20:09 +0100
Subject: include: Add PhysicalMonitorEnumerationAPI.h

View File

@ -1,4 +1,4 @@
From 1e3a30b0fac3c5a9d8283f404334ade4e4f44104 Mon Sep 17 00:00:00 2001
From 49c89bb58a132a3b34bb40c6eae04d82e5d75978 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Wed, 26 Mar 2014 05:24:03 +0100
Subject: include: Add LowLevelMonitorConfigurationAPI.h

View File

@ -1,4 +1,4 @@
From 505fa26a6bf60858f35c45982fefcba41cd27d5a Mon Sep 17 00:00:00 2001
From 55f15ed3d397d9220a6b5435ce98c007e0d5514f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Wed, 26 Mar 2014 05:26:25 +0100
Subject: include: Add HighLevelMonitorConfigurationAPI.h

View File

@ -1,4 +1,4 @@
From 1c3379da1c8615f03acce7c441b3d511245212eb Mon Sep 17 00:00:00 2001
From 79288605ddeb6dda4e1b039cd611ba23e60cf178 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Wed, 26 Mar 2014 05:32:36 +0100
Subject: dxva2: Add implementation for stub functions

View File

@ -1,537 +0,0 @@
From a2ecf8ef503fea27bc72a6d0e690d43a5c44be54 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Wed, 26 Mar 2014 22:23:52 +0100
Subject: dxva2: Implement stubs for IDirectXVideo{Acceleration, Decoder,
Processor}Service interfaces
---
dlls/dxva2/Makefile.in | 4 +-
dlls/dxva2/dxva2_private.h | 3 +
dlls/dxva2/main.c | 5 +-
dlls/dxva2/videoservices.c | 467 ++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 476 insertions(+), 3 deletions(-)
create mode 100644 dlls/dxva2/dxva2_private.h
create mode 100644 dlls/dxva2/videoservices.c
diff --git a/dlls/dxva2/Makefile.in b/dlls/dxva2/Makefile.in
index 7b9ef6f..4b4d24f 100644
--- a/dlls/dxva2/Makefile.in
+++ b/dlls/dxva2/Makefile.in
@@ -1,4 +1,6 @@
MODULE = dxva2.dll
+IMPORTS = ole32
C_SRCS = \
- main.c
+ main.c \
+ videoservices.c
diff --git a/dlls/dxva2/dxva2_private.h b/dlls/dxva2/dxva2_private.h
new file mode 100644
index 0000000..55e84c2
--- /dev/null
+++ b/dlls/dxva2/dxva2_private.h
@@ -0,0 +1,3 @@
+#include "dxva2api.h"
+
+HRESULT videoservices_create( IDirect3DDevice9 *device, REFIID riid, void **ppv );
\ No newline at end of file
diff --git a/dlls/dxva2/main.c b/dlls/dxva2/main.c
index f22e5d1..7d23d1f 100644
--- a/dlls/dxva2/main.c
+++ b/dlls/dxva2/main.c
@@ -22,6 +22,7 @@
#include "wine/debug.h"
#include "dxva2api.h"
+#include "dxva2_private.h"
#include "PhysicalMonitorEnumerationAPI.h"
#include "LowLevelMonitorConfigurationAPI.h"
#include "HighLevelMonitorConfigurationAPI.h"
@@ -45,9 +46,9 @@ HRESULT WINAPI DXVA2CreateDirect3DDeviceManager9( UINT *resetToken, IDirect3DDev
HRESULT WINAPI DXVA2CreateVideoService( IDirect3DDevice9 *device, REFIID riid, void **ppv )
{
- FIXME("(%p, %s, %p): stub\n", device, debugstr_guid(riid), ppv);
+ TRACE("(%p, %s, %p)\n", device, debugstr_guid(riid), ppv);
- return E_NOTIMPL;
+ return videoservices_create( device, riid, ppv );
}
BOOL WINAPI DegaussMonitor( HMONITOR monitor )
diff --git a/dlls/dxva2/videoservices.c b/dlls/dxva2/videoservices.c
new file mode 100644
index 0000000..0374260
--- /dev/null
+++ b/dlls/dxva2/videoservices.c
@@ -0,0 +1,467 @@
+/*
+ * Copyright 2014 Michael Müller for Pipelight
+ *
+ * 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 St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#define COBJMACROS
+#define INITGUID
+
+#include <stdarg.h>
+#include "windef.h"
+#include "winbase.h"
+
+#include "wine/debug.h"
+#include "dxva2api.h"
+#include "dxva2_private.h"
+#include "PhysicalMonitorEnumerationAPI.h"
+#include "LowLevelMonitorConfigurationAPI.h"
+#include "HighLevelMonitorConfigurationAPI.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(dxva2);
+
+/*****************************************************************************
+ * IDirectXVideoAccelerationService interface
+ */
+
+typedef struct
+{
+ const IDirectXVideoAccelerationServiceVtbl* lpVtbl;
+ LONG refCount;
+} DirectXVideoAccelerationServiceImpl;
+
+static inline DirectXVideoAccelerationServiceImpl *impl_from_IDirectXVideoAccelerationService( IDirectXVideoAccelerationService *iface )
+{
+ return (DirectXVideoAccelerationServiceImpl *)iface;
+}
+
+static HRESULT WINAPI DirectXVideoAccelerationService_QueryInterface( IDirectXVideoAccelerationService *iface, REFIID riid, LPVOID *ppv )
+{
+ DirectXVideoAccelerationServiceImpl *This = impl_from_IDirectXVideoAccelerationService(iface);
+ TRACE("(%p/%p)->(%s, %p)\n", iface, This, debugstr_guid(riid), ppv);
+
+ *ppv = NULL;
+
+ if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IDirectXVideoAccelerationService))
+ *ppv = (LPVOID)iface;
+
+ if (*ppv)
+ {
+ IUnknown_AddRef((IUnknown *)(*ppv));
+ return S_OK;
+ }
+
+ FIXME("No interface for %s\n", debugstr_guid(riid));
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI DirectXVideoAccelerationService_AddRef( IDirectXVideoAccelerationService *iface )
+{
+ DirectXVideoAccelerationServiceImpl *This = impl_from_IDirectXVideoAccelerationService(iface);
+ ULONG refCount = InterlockedIncrement(&This->refCount);
+
+ TRACE("(%p)->() AddRef from %d\n", This, refCount - 1);
+
+ return refCount;
+}
+
+static ULONG WINAPI DirectXVideoAccelerationService_Release( IDirectXVideoAccelerationService *iface )
+{
+ DirectXVideoAccelerationServiceImpl *This = impl_from_IDirectXVideoAccelerationService(iface);
+ ULONG refCount = InterlockedDecrement(&This->refCount);
+
+ TRACE("(%p)->() Release from %d\n", This, refCount + 1);
+
+ if (!refCount)
+ {
+ TRACE("Destroying\n");
+ CoTaskMemFree(This);
+ }
+
+ return refCount;
+}
+
+static HRESULT WINAPI DirectXVideoAccelerationService_CreateSurface( IDirectXVideoAccelerationService *iface, UINT width, UINT height,
+ UINT backBuffers, D3DFORMAT format, D3DPOOL pool, DWORD usage,
+ DWORD dxvaType, IDirect3DSurface9 **ppSurface, HANDLE *pSharedHandle )
+{
+ DirectXVideoAccelerationServiceImpl *This = impl_from_IDirectXVideoAccelerationService(iface);
+
+ FIXME("(%p)->(%u, %u, %u, %#x, 0x%x, 0x%x, 0x%x, %p, %p): stub\n",
+ This, width, height, backBuffers, format, pool, usage, dxvaType, ppSurface, pSharedHandle);
+
+ return E_NOTIMPL;
+}
+
+static const IDirectXVideoAccelerationServiceVtbl DirectXVideoAccelerationService_VTable =
+{
+ DirectXVideoAccelerationService_QueryInterface,
+ DirectXVideoAccelerationService_AddRef,
+ DirectXVideoAccelerationService_Release,
+ DirectXVideoAccelerationService_CreateSurface
+};
+
+
+/*****************************************************************************
+ * IDirectXVideoDecoderService interface
+ */
+
+typedef struct
+{
+ const IDirectXVideoDecoderServiceVtbl* lpVtbl;
+ LONG refCount;
+} DirectXVideoDecoderServiceImpl;
+
+static inline DirectXVideoDecoderServiceImpl *impl_from_IDirectXVideoDecoderService( IDirectXVideoDecoderService *iface )
+{
+ return (DirectXVideoDecoderServiceImpl *)iface;
+}
+
+static HRESULT WINAPI DirectXVideoDecoderService_QueryInterface( IDirectXVideoDecoderService *iface, REFIID riid, LPVOID * ppv )
+{
+ DirectXVideoDecoderServiceImpl *This = impl_from_IDirectXVideoDecoderService(iface);
+ TRACE("(%p/%p)->(%s, %p)\n", iface, This, debugstr_guid(riid), ppv);
+
+ *ppv = NULL;
+
+ if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IDirectXVideoDecoderService))
+ *ppv = (LPVOID)iface;
+
+ if (*ppv)
+ {
+ IUnknown_AddRef((IUnknown *)(*ppv));
+ return S_OK;
+ }
+
+ FIXME("No interface for %s\n", debugstr_guid(riid));
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI DirectXVideoDecoderService_AddRef( IDirectXVideoDecoderService *iface )
+{
+ DirectXVideoDecoderServiceImpl *This = impl_from_IDirectXVideoDecoderService(iface);
+ ULONG refCount = InterlockedIncrement(&This->refCount);
+
+ TRACE("(%p)->() AddRef from %d\n", This, refCount - 1);
+
+ return refCount;
+}
+
+static ULONG WINAPI DirectXVideoDecoderService_Release( IDirectXVideoDecoderService *iface )
+{
+ DirectXVideoDecoderServiceImpl *This = impl_from_IDirectXVideoDecoderService(iface);
+ ULONG refCount = InterlockedDecrement(&This->refCount);
+
+ TRACE("(%p)->() Release from %d\n", This, refCount + 1);
+
+ if (!refCount)
+ {
+ TRACE("Destroying\n");
+ CoTaskMemFree(This);
+ }
+
+ return refCount;
+}
+
+static HRESULT WINAPI DirectXVideoDecoderService_CreateSurface( IDirectXVideoDecoderService *iface, UINT width, UINT height,
+ UINT backBuffers, D3DFORMAT format, D3DPOOL pool, DWORD usage,
+ DWORD dxvaType, IDirect3DSurface9 **ppSurface, HANDLE *pSharedHandle )
+{
+ DirectXVideoDecoderServiceImpl *This = impl_from_IDirectXVideoDecoderService(iface);
+
+ FIXME("(%p)->(%u, %u, %u, %#x, 0x%x, 0x%x, 0x%x, %p, %p): stub\n",
+ This, width, height, backBuffers, format, pool, usage, dxvaType, ppSurface, pSharedHandle );
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DirectXVideoDecoderService_CreateVideoDecoder( IDirectXVideoDecoderService *iface, REFGUID guid, const DXVA2_VideoDesc *pVideoDesc,
+ DXVA2_ConfigPictureDecode *pConfig, IDirect3DSurface9 **ppDecoderRenderTargets,
+ UINT NumSurfaces, IDirectXVideoDecoder **ppDecode )
+{
+ DirectXVideoDecoderServiceImpl *This = impl_from_IDirectXVideoDecoderService(iface);
+
+ FIXME("(%p)->(%s, %p, %p, %p, %u, %p): stub\n", This, debugstr_guid(guid), pVideoDesc, pConfig, ppDecoderRenderTargets, NumSurfaces, ppDecode);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DirectXVideoDecoderService_GetDecoderConfigurations( IDirectXVideoDecoderService *iface, REFGUID guid, const DXVA2_VideoDesc *pVideoDesc,
+ IUnknown *pReserved, UINT *pCount, DXVA2_ConfigPictureDecode **ppConfigs )
+{
+ DirectXVideoDecoderServiceImpl *This = impl_from_IDirectXVideoDecoderService(iface);
+
+ FIXME("(%p)->(%s, %p, %p, %p, %p): stub\n", This, debugstr_guid(guid), pVideoDesc, pReserved, pCount, ppConfigs);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DirectXVideoDecoderService_GetDecoderDeviceGuids( IDirectXVideoDecoderService *iface, UINT *count, GUID **pGuids )
+{
+ DirectXVideoDecoderServiceImpl *This = impl_from_IDirectXVideoDecoderService(iface);
+
+ FIXME("(%p)->(%p, %p): stub\n", This, count, pGuids);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DirectXVideoDecoderService_GetDecoderRenderTargets( IDirectXVideoDecoderService *iface, REFGUID guid, UINT *pCount, D3DFORMAT **pFormats)
+{
+ DirectXVideoDecoderServiceImpl *This = impl_from_IDirectXVideoDecoderService(iface);
+
+ FIXME("(%p)->(%s, %p, %p): stub\n", This, debugstr_guid(guid), pCount, pFormats);
+
+ return E_NOTIMPL;
+}
+
+static const IDirectXVideoDecoderServiceVtbl DirectXVideoDecoderService_VTable =
+{
+ DirectXVideoDecoderService_QueryInterface,
+ DirectXVideoDecoderService_AddRef,
+ DirectXVideoDecoderService_Release,
+ DirectXVideoDecoderService_CreateSurface,
+ DirectXVideoDecoderService_CreateVideoDecoder,
+ DirectXVideoDecoderService_GetDecoderConfigurations,
+ DirectXVideoDecoderService_GetDecoderDeviceGuids,
+ DirectXVideoDecoderService_GetDecoderRenderTargets
+};
+
+/*****************************************************************************
+ * IDirectXVideoProcessorService interface
+ */
+
+typedef struct
+{
+ const IDirectXVideoProcessorServiceVtbl* lpVtbl;
+ LONG refCount;
+} DirectXVideoProcessorServiceImpl;
+
+static inline DirectXVideoProcessorServiceImpl *impl_from_IDirectXVideoProcessorService( IDirectXVideoProcessorService *iface )
+{
+ return (DirectXVideoProcessorServiceImpl *)iface;
+}
+
+static HRESULT WINAPI DirectXVideoProcessorService_QueryInterface( IDirectXVideoProcessorService *iface, REFIID riid, LPVOID * ppv )
+{
+ DirectXVideoProcessorServiceImpl *This = impl_from_IDirectXVideoProcessorService(iface);
+ TRACE("(%p/%p)->(%s, %p)\n", iface, This, debugstr_guid(riid), ppv);
+
+ *ppv = NULL;
+
+ if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IDirectXVideoProcessorService))
+ *ppv = (LPVOID)iface;
+
+ if (*ppv)
+ {
+ IUnknown_AddRef((IUnknown *)(*ppv));
+ return S_OK;
+ }
+
+ FIXME("No interface for %s\n", debugstr_guid(riid));
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI DirectXVideoProcessorService_AddRef( IDirectXVideoProcessorService *iface )
+{
+ DirectXVideoProcessorServiceImpl *This = impl_from_IDirectXVideoProcessorService(iface);
+ ULONG refCount = InterlockedIncrement(&This->refCount);
+
+ TRACE("(%p)->() AddRef from %d\n", This, refCount - 1);
+
+ return refCount;
+}
+
+static ULONG WINAPI DirectXVideoProcessorService_Release( IDirectXVideoProcessorService *iface )
+{
+ DirectXVideoProcessorServiceImpl *This = impl_from_IDirectXVideoProcessorService(iface);
+ ULONG refCount = InterlockedDecrement(&This->refCount);
+
+ TRACE("(%p)->() Release from %d\n", This, refCount + 1);
+
+ if (!refCount)
+ {
+ TRACE("Destroying\n");
+ CoTaskMemFree(This);
+ }
+
+ return refCount;
+}
+
+static HRESULT WINAPI DirectXVideoProcessorService_CreateSurface( IDirectXVideoProcessorService *iface, UINT width, UINT height,
+ UINT backBuffers, D3DFORMAT format, D3DPOOL pool, DWORD usage,
+ DWORD dxvaType, IDirect3DSurface9 **ppSurface, HANDLE *pSharedHandle )
+{
+ DirectXVideoProcessorServiceImpl *This = impl_from_IDirectXVideoProcessorService(iface);
+
+ FIXME("(%p)->(%u, %u, %u, %#x, 0x%x, 0x%x, 0x%x, %p, %p): stub\n",
+ This, width, height, backBuffers, format, pool, usage, dxvaType, ppSurface, pSharedHandle );
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DirectXVideoProcessorService_RegisterVideoProcessorSoftwareDevice( IDirectXVideoProcessorService *iface, void* pCallbacks)
+{
+ DirectXVideoProcessorServiceImpl *This = impl_from_IDirectXVideoProcessorService(iface);
+
+ FIXME("(%p)->(%p): stub\n", This, pCallbacks );
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DirectXVideoProcessorService_GetVideoProcessorDeviceGuids( IDirectXVideoProcessorService *iface, const DXVA2_VideoDesc* pVideoDesc,
+ UINT* pCount, GUID** pGuids )
+{
+ DirectXVideoProcessorServiceImpl *This = impl_from_IDirectXVideoProcessorService(iface);
+
+ FIXME("(%p)->(%p, %p, %p): stub\n", This, pVideoDesc, pCount, pGuids );
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DirectXVideoProcessorService_GetVideoProcessorRenderTargets( IDirectXVideoProcessorService *iface, REFGUID VideoProcDeviceGuid,
+ const DXVA2_VideoDesc* pVideoDesc, UINT* pCount, D3DFORMAT** pFormats )
+{
+ DirectXVideoProcessorServiceImpl *This = impl_from_IDirectXVideoProcessorService(iface);
+
+ FIXME("(%p)->(%s, %p, %p, %p): stub\n",
+ This, debugstr_guid(VideoProcDeviceGuid), pVideoDesc, pCount, pFormats );
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DirectXVideoProcessorService_GetVideoProcessorSubStreamFormats( IDirectXVideoProcessorService *iface, REFGUID VideoProcDeviceGuid,
+ const DXVA2_VideoDesc* pVideoDesc, D3DFORMAT RenderTargetFormat, UINT* pCount,
+ D3DFORMAT** pFormats )
+{
+ DirectXVideoProcessorServiceImpl *This = impl_from_IDirectXVideoProcessorService(iface);
+
+ FIXME("(%p)->(%s, %p, %#x, %p, %p): stub\n", This, debugstr_guid(VideoProcDeviceGuid), pVideoDesc, RenderTargetFormat, pCount, pFormats );
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DirectXVideoProcessorService_GetVideoProcessorCaps( IDirectXVideoProcessorService *iface, REFGUID VideoProcDeviceGuid,
+ const DXVA2_VideoDesc* pVideoDesc, D3DFORMAT RenderTargetFormat,
+ DXVA2_VideoProcessorCaps* pCaps)
+{
+ DirectXVideoProcessorServiceImpl *This = impl_from_IDirectXVideoProcessorService(iface);
+
+ FIXME("(%p)->(%s, %p, %#x, %p): stub\n", This, debugstr_guid(VideoProcDeviceGuid), pVideoDesc, RenderTargetFormat, pCaps);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DirectXVideoProcessorService_GetProcAmpRange( IDirectXVideoProcessorService *iface, REFGUID VideoProcDeviceGuid,
+ const DXVA2_VideoDesc* pVideoDesc, D3DFORMAT RenderTargetFormat, UINT ProcAmpCap,
+ DXVA2_ValueRange* pRange )
+{
+ DirectXVideoProcessorServiceImpl *This = impl_from_IDirectXVideoProcessorService(iface);
+
+ FIXME("(%p)->(%s, %p, %#x, %u, %p): stub\n", This, debugstr_guid(VideoProcDeviceGuid), pVideoDesc, RenderTargetFormat, ProcAmpCap, pRange);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DirectXVideoProcessorService_GetFilterPropertyRange( IDirectXVideoProcessorService *iface, REFGUID VideoProcDeviceGuid,
+ const DXVA2_VideoDesc* pVideoDesc, D3DFORMAT RenderTargetFormat, UINT FilterSetting,
+ DXVA2_ValueRange* pRange )
+{
+ DirectXVideoProcessorServiceImpl *This = impl_from_IDirectXVideoProcessorService(iface);
+
+ FIXME("(%p)->(%s, %p, %#x, %u, %p): stub\n", This, debugstr_guid(VideoProcDeviceGuid), pVideoDesc, RenderTargetFormat, FilterSetting, pRange);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DirectXVideoProcessorService_CreateVideoProcessor( IDirectXVideoProcessorService *iface, REFGUID VideoProcDeviceGuid,
+ const DXVA2_VideoDesc* pVideoDesc, D3DFORMAT RenderTargetFormat, UINT MaxNumSubStreams,
+ IDirectXVideoProcessor** ppVidProcess )
+{
+ DirectXVideoProcessorServiceImpl *This = impl_from_IDirectXVideoProcessorService(iface);
+
+ FIXME("(%p)->(%s, %#x, %u, %p): stub\n", This, debugstr_guid(VideoProcDeviceGuid), RenderTargetFormat, MaxNumSubStreams, ppVidProcess);
+
+ return E_NOTIMPL;
+}
+
+static const IDirectXVideoProcessorServiceVtbl DirectXVideoProcessorService_VTable =
+{
+ DirectXVideoProcessorService_QueryInterface,
+ DirectXVideoProcessorService_AddRef,
+ DirectXVideoProcessorService_Release,
+ DirectXVideoProcessorService_CreateSurface,
+ DirectXVideoProcessorService_RegisterVideoProcessorSoftwareDevice,
+ DirectXVideoProcessorService_GetVideoProcessorDeviceGuids,
+ DirectXVideoProcessorService_GetVideoProcessorRenderTargets,
+ DirectXVideoProcessorService_GetVideoProcessorSubStreamFormats,
+ DirectXVideoProcessorService_GetVideoProcessorCaps,
+ DirectXVideoProcessorService_GetProcAmpRange,
+ DirectXVideoProcessorService_GetFilterPropertyRange,
+ DirectXVideoProcessorService_CreateVideoProcessor
+};
+
+
+HRESULT videoservices_create( IDirect3DDevice9 *device, REFIID riid, void **ppv )
+{
+ HRESULT hr = S_OK;
+
+ if (!riid || !ppv)
+ return E_INVALIDARG;
+
+ *ppv = NULL;
+
+ /* IDirectXVideoAccelerationService */
+ if (IsEqualIID(riid, &IID_IDirectXVideoAccelerationService))
+ {
+ DirectXVideoAccelerationServiceImpl* accelerator = CoTaskMemAlloc(sizeof(DirectXVideoAccelerationServiceImpl));
+ if (!accelerator)
+ return E_OUTOFMEMORY;
+
+ accelerator->lpVtbl = &DirectXVideoAccelerationService_VTable;
+ accelerator->refCount = 1;
+
+ *ppv = accelerator;
+ }
+
+ /* IDirectXVideoDecoderService */
+ else if (IsEqualIID(riid, &IID_IDirectXVideoDecoderService))
+ {
+ DirectXVideoDecoderServiceImpl* decoder = CoTaskMemAlloc(sizeof(DirectXVideoDecoderServiceImpl));
+ if (!decoder)
+ return E_OUTOFMEMORY;
+
+ decoder->lpVtbl = &DirectXVideoDecoderService_VTable;
+ decoder->refCount = 1;
+ *ppv = decoder;
+ }
+
+ /* IDirectXVideoProcessorService */
+ else if (IsEqualIID(riid, &IID_IDirectXVideoProcessorService))
+ {
+ DirectXVideoProcessorServiceImpl* processor = CoTaskMemAlloc(sizeof(DirectXVideoProcessorServiceImpl));
+ if (!processor)
+ return E_OUTOFMEMORY;
+
+ processor->lpVtbl = &DirectXVideoProcessorService_VTable;
+ processor->refCount = 1;
+
+ *ppv = processor;
+ }
+
+ else
+ hr = E_NOINTERFACE;
+
+ return hr;
+}
--
1.7.9.5

View File

@ -1,3 +1,3 @@
Revision: 2
Revision: 3
Author: Michael Müller
Title: Added DXVA2 stub implementation.

View File

@ -57,7 +57,7 @@ index a273502..5fa0cd5 100644
+ { "4cd13e94-7f2d-11e3-b5eb-0090f5c75ad5:1", "Erich E. Hoover", "Support for junction points/reparse points." },
+ { "5fb1f5c8-7f17-11e3-9b62-0090f5c75ad5:1", "Erich E. Hoover", "Implement TransmitFile." },
+ { "3d7c4774-9e7f-11e3-9cfc-0090f5c75ad5:1", "Erich E. Hoover", "Implement missing fonts expected by Silverlight." },
+ { "39ca2373-65c1-4d01-8ba0-1c2007cbbc59:2", "Michael Müller", "Added DXVA2 stub implementation." },
+ { "39ca2373-65c1-4d01-8ba0-1c2007cbbc59:3", "Michael Müller", "Added DXVA2 stub implementation." },
+ { "0b21d7ac-0387-4493-aa38-fbafe3e749f5:1", "Michael Müller", "Decrease minimum SetTimer interval from 15 to 5 ms." },
+ { "19835498-8d90-4673-867e-2376af4d7c76:1", "Sebastian Lackner", "Allow to set wined3d strictDrawOrdering via environment variable." },
+ { "59bd38b7-bbdc-4cfd-9ccd-1c72c4ed84c0:1", "Sebastian Lackner", "Implement X11DRV_FLUSH_GDI_DISPLAY ExtEscape command." },