Signed-off-by: Jeff Smith whydoubt@gmail.com --- dlls/dxva2/Makefile.in | 3 +- dlls/dxva2/dxva2.spec | 1 + dlls/dxva2/dxvahd.c | 65 ++++++++++++++++++++++++++++++++++++++++++ include/Makefile.in | 1 + include/dxvahd.idl | 65 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 dlls/dxva2/dxvahd.c create mode 100644 include/dxvahd.idl
diff --git a/dlls/dxva2/Makefile.in b/dlls/dxva2/Makefile.in index e3fc2fd6c3..0248c7f20b 100644 --- a/dlls/dxva2/Makefile.in +++ b/dlls/dxva2/Makefile.in @@ -5,4 +5,5 @@ IMPORTLIB = dxva2 EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ - main.c + main.c \ + dxvahd.c diff --git a/dlls/dxva2/dxva2.spec b/dlls/dxva2/dxva2.spec index 024a972697..ea7a98718b 100644 --- a/dlls/dxva2/dxva2.spec +++ b/dlls/dxva2/dxva2.spec @@ -1,6 +1,7 @@ @ stdcall CapabilitiesRequestAndCapabilitiesReply(ptr ptr long) @ stdcall DXVA2CreateDirect3DDeviceManager9(ptr ptr) @ stdcall DXVA2CreateVideoService(ptr ptr ptr) +@ stdcall DXVAHD_CreateDevice(ptr ptr long ptr ptr) @ stdcall DegaussMonitor(ptr) @ stdcall DestroyPhysicalMonitor(ptr) @ stdcall DestroyPhysicalMonitors(long ptr) diff --git a/dlls/dxva2/dxvahd.c b/dlls/dxva2/dxvahd.c new file mode 100644 index 0000000000..ac67f9e5a7 --- /dev/null +++ b/dlls/dxva2/dxvahd.c @@ -0,0 +1,65 @@ +/* + * Copyright 2020 Jeff Smith + * + * 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 + */ + +#include "d3d9.h" +#include "dxvahd.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(dxva2); + + +/******************************************** + * Utility functions + */ + +static const char *debug_dxvahd_device_usage(DXVAHD_DEVICE_USAGE usage) +{ + switch (usage) + { +#define USAGE_TO_STR(e) case e: return #e + USAGE_TO_STR(DXVAHD_DEVICE_USAGE_PLAYBACK_NORMAL); + USAGE_TO_STR(DXVAHD_DEVICE_USAGE_OPTIMAL_SPEED); + USAGE_TO_STR(DXVAHD_DEVICE_USAGE_OPTIMAL_QUALITY); +#undef USAGE_TO_STR + default: + FIXME("Unrecognized device usage %#x.\n", usage); + return "unrecognized"; + } +} + + +/******************************************** + * DXVA-HD device creation function + */ + +HRESULT WINAPI DXVAHD_CreateDevice(IDirect3DDevice9Ex *d3d_device, const DXVAHD_CONTENT_DESC *desc, + DXVAHD_DEVICE_USAGE usage, PDXVAHDSW_Plugin plugin, IDXVAHD_Device **device) +{ + FIXME("%p, %p, %s, %p, %p. stub.\n", d3d_device, desc, debug_dxvahd_device_usage(usage), plugin, device); + + TRACE("Frame Format %d Input %ux%u @%.2f Output %ux%u @%.2f\n", + desc->InputFrameFormat, desc->InputWidth, desc->InputHeight, + (double)desc->InputFrameRate.Numerator / desc->InputFrameRate.Denominator, + desc->OutputWidth, desc->OutputHeight, + (double)desc->OutputFrameRate.Numerator / desc->OutputFrameRate.Denominator); + + *device = NULL; + + return E_NOINTERFACE; +} diff --git a/include/Makefile.in b/include/Makefile.in index 216adf0d7a..f986ef42dd 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -268,6 +268,7 @@ SOURCES = \ dxgitype.idl \ dxva.h \ dxva2api.idl \ + dxvahd.idl \ dyngraph.idl \ endpointvolume.idl \ errorrep.h \ diff --git a/include/dxvahd.idl b/include/dxvahd.idl new file mode 100644 index 0000000000..cd6de6eab3 --- /dev/null +++ b/include/dxvahd.idl @@ -0,0 +1,65 @@ +/* + * Copyright 2020 Jeff Smith + * + * 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 + */ + +import "unknwn.idl"; + +cpp_quote("#if 0") +interface IDirect3DDevice9Ex; +cpp_quote("#endif") + + +typedef enum _DXVAHD_FRAME_FORMAT +{ + DXVAHD_FRAME_FORMAT_PROGRESSIVE = 0, + DXVAHD_FRAME_FORMAT_INTERLACED_TOP_FIELD_FIRST = 1, + DXVAHD_FRAME_FORMAT_INTERLACED_BOTTOM_FIELD_FIRST = 2 +} DXVAHD_FRAME_FORMAT; + +typedef enum _DXVAHD_DEVICE_USAGE +{ + DXVAHD_DEVICE_USAGE_PLAYBACK_NORMAL = 0, + DXVAHD_DEVICE_USAGE_OPTIMAL_SPEED = 1, + DXVAHD_DEVICE_USAGE_OPTIMAL_QUALITY = 2 +} DXVAHD_DEVICE_USAGE; + + +typedef struct _DXVAHD_RATIONAL +{ + UINT Numerator; + UINT Denominator; +} DXVAHD_RATIONAL; + +typedef struct _DXVAHD_CONTENT_DESC +{ + DXVAHD_FRAME_FORMAT InputFrameFormat; + DXVAHD_RATIONAL InputFrameRate; + UINT InputWidth; + UINT InputHeight; + DXVAHD_RATIONAL OutputFrameRate; + UINT OutputWidth; + UINT OutputHeight; +} DXVAHD_CONTENT_DESC; + + +/* FIXME */ +typedef void* PDXVAHDSW_Plugin; + + +interface IDXVAHD_Device; + +cpp_quote("HRESULT WINAPI DXVAHD_CreateDevice(IDirect3DDevice9Ex *d3d_device, const DXVAHD_CONTENT_DESC *desc, DXVAHD_DEVICE_USAGE usage, PDXVAHDSW_Plugin plugin, IDXVAHD_Device **device);")