|
|
|
@ -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
|
|
|
|
|
|