summaryrefslogtreecommitdiff
path: root/dispatch
diff options
context:
space:
mode:
authorJosé Fonseca <jose.r.fonseca@gmail.com>2012-07-25 20:47:20 +0100
committerJosé Fonseca <jose.r.fonseca@gmail.com>2012-07-25 20:47:20 +0100
commit12ac428c2f5e004ac6fec9149f83feaf85a29e49 (patch)
treece3386cd963c027ee909d77759b73b29e923a185 /dispatch
parent9a40d9e636d026a3e60af2ebe8be50ebdae608a8 (diff)
Support apps that use DXVA.
Diffstat (limited to 'dispatch')
-rw-r--r--dispatch/dxvaint.h154
1 files changed, 154 insertions, 0 deletions
diff --git a/dispatch/dxvaint.h b/dispatch/dxvaint.h
new file mode 100644
index 00000000..f275d559
--- /dev/null
+++ b/dispatch/dxvaint.h
@@ -0,0 +1,154 @@
+/**************************************************************************
+ *
+ * Copyright 2012 VMware, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
+#include <dxva2api.h>
+
+
+typedef struct _DXVA2_PVP_SETKEY DXVA2_PVP_SETKEY; /* XXX */
+
+typedef struct _DXVA2_DECODEBUFFERDESC {
+ IDirect3DSurface9 *pRenderTarget;
+ DWORD CompressedBufferType;
+ DWORD BufferIndex;
+ DWORD DataOffset;
+ DWORD DataSize;
+ DWORD FirstMBaddress;
+ DWORD NumMBsInBuffer;
+ DWORD Width;
+ DWORD Height;
+ DWORD Stride;
+ DWORD ReservedBits;
+ PVOID pCipherCounter;
+} DXVA2_DECODEBUFFERDESC;
+
+typedef struct _DXVA2_DECODEEXECUTE {
+ UINT NumCompBuffers;
+ DXVA2_DECODEBUFFERDESC *pCompressedBuffers;
+} DXVA2_DECODEEXECUTE;
+
+typedef struct _DXVA2_VIDEOSAMPLE {
+ REFERENCE_TIME Start;
+ REFERENCE_TIME End;
+ DXVA2_ExtendedFormat SampleFormat;
+ DWORD SampleFlags;
+ IDirect3DSurface9* SrcSurface;
+ RECT SrcRect;
+ RECT DstRect;
+ DXVA2_AYUVSample8 Pal[16];
+ DXVA2_Fixed32 PlanarAlpha;
+} DXVA2_VIDEOSAMPLE;
+
+/**
+ * See also:
+ * - D3DDDIARG_VIDEOPROCESSBLT
+ * - DXVA2_VideoProcessBltParams
+ */
+typedef struct _DXVA2_VIDEOPROCESSBLT {
+ REFERENCE_TIME TargetFrame;
+ RECT TargetRect;
+ SIZE ConstrictionSize;
+ DWORD StreamingFlags;
+ DXVA2_AYUVSample16 BackgroundColor;
+ DXVA2_ExtendedFormat DestFormat;
+ DWORD DestFlags;
+ DXVA2_ProcAmpValues ProcAmpValues;
+ DXVA2_Fixed32 Alpha;
+ DXVA2_FilterValues NoiseFilterLuma;
+ DXVA2_FilterValues NoiseFilterChroma;
+ DXVA2_FilterValues DetailFilterLuma;
+ DXVA2_FilterValues DetailFilterChroma;
+ DXVA2_VIDEOSAMPLE *pSrcSurfaces;
+ UINT NumSrcSurfaces;
+} DXVA2_VIDEOPROCESSBLT;
+
+typedef struct _DXVA2_DECODEBUFFERINFO DXVA2_DECODEBUFFERINFO; /* XXX */
+
+typedef struct _DXVA2_EXTENSIONEXECUTE DXVA2_EXTENSIONEXECUTE; /* XXX */
+
+
+static const GUID IID_IDirect3DDecodeDevice9 = {0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}; /* XXX */
+static const GUID IID_IDirect3DVideoProcessDevice9 = {0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}} /* XXX */;
+static const GUID IID_IDirect3DDXVAExtensionDevice9 = {0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}; /* XXX */
+static const GUID IID_IDirect3DDxva2Container9 = {0x126D0349,0x4787,0x4AA6,{0x8E,0x1B,0x40,0xC1,0x77,0xC6,0x0A,0x01}};
+
+
+class IDirect3DDecodeDevice9 : public IUnknown
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE DecodeBeginFrame(DXVA2_PVP_SETKEY *pPVPSetKey) = 0;
+ virtual HRESULT STDMETHODCALLTYPE DecodeEndFrame(HANDLE *pHandleComplete) = 0;
+ virtual HRESULT STDMETHODCALLTYPE DecodeSetRenderTarget(IDirect3DSurface9 *pRenderTarget) = 0;
+ virtual HRESULT STDMETHODCALLTYPE DecodeExecute(DXVA2_DECODEEXECUTE /* const */ *pExecuteParams) = 0;
+};
+
+
+class IDirect3DVideoProcessDevice9 : public IUnknown
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE VideoProcessBeginFrame(void) = 0;
+ virtual HRESULT STDMETHODCALLTYPE VideoProcessEndFrame(HANDLE *pHandleComplete) = 0;
+ virtual HRESULT STDMETHODCALLTYPE VideoProcessSetRenderTarget(IDirect3DSurface9 *pRenderTarget) = 0;
+ virtual HRESULT STDMETHODCALLTYPE VideoProcessBlt(DXVA2_VIDEOPROCESSBLT /* const */ *pData) = 0;
+};
+
+
+class IDirect3DDXVAExtensionDevice9 : public IUnknown
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE ExtensionExecute(DXVA2_EXTENSIONEXECUTE *pData) = 0;
+};
+
+
+class IDirect3DDxva2Container9 : public IUnknown
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE CreateSurface(UINT Width, UINT Height, UINT BackBuffers, D3DFORMAT Format, D3DPOOL Pool, DWORD Usage, DWORD DxvaType, IDirect3DSurface9 **ppSurface, HANDLE *pSharedHandle) = 0;
+ virtual HRESULT STDMETHODCALLTYPE VidToSysBlt(IDirect3DSurface9 *pSourceSurface, RECT *pSourceRect, IDirect3DSurface9 *pDestSurface, RECT *pDestRect) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetDecodeGuidCount(UINT *pCount) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetDecodeGuids(UINT Count, GUID *pGuids) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetDecodeRenderTargetFormatCount(REFGUID Guid, UINT *pCount) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetDecodeRenderTargets(REFGUID Guid, UINT Count, D3DFORMAT *pFormats) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetDecodeCompressedBufferCount(REFGUID Guid, const DXVA2_VideoDesc *pVideoDesc, UINT *pCount) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetDecodeCompressedBuffers(REFGUID Guid, const DXVA2_VideoDesc *pVideoDesc, UINT Count, DXVA2_DECODEBUFFERINFO *pBufferInfo) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetDecodeConfigurationCount(REFGUID Guid, const DXVA2_VideoDesc *pVideoDesc, UINT *pCount) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetDecodeConfigurations(REFGUID Guid, const DXVA2_VideoDesc *pVideoDesc, UINT Count, DXVA2_ConfigPictureDecode *pConfigs) = 0;
+ virtual HRESULT STDMETHODCALLTYPE CreateDecodeDevice(REFGUID Guid, const DXVA2_VideoDesc *pVideoDesc, DXVA2_ConfigPictureDecode const *pConfig, IDirect3DSurface9 * *ppDecoderRenderTargets, UINT NumSurfaces, IDirect3DDecodeDevice9 ** ppDecode) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetVideoProcessorDeviceGuidCount(const DXVA2_VideoDesc *pVideoDesc, UINT *pCount) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetVideoProcessorDeviceGuids(const DXVA2_VideoDesc *pVideoDesc, UINT Count, GUID *pGuids) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetVideoProcessorCaps(REFGUID Guid, const DXVA2_VideoDesc *pVideoDesc, D3DFORMAT Format, DXVA2_VideoProcessorCaps *pCaps) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetProcAmpRange(REFGUID Guid, const DXVA2_VideoDesc *pVideoDesc, D3DFORMAT Format, UINT ProcAmpCap, DXVA2_ValueRange *pRange) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetFilterPropertyRange(REFGUID Guid, const DXVA2_VideoDesc *pVideoDesc, D3DFORMAT Format, UINT FilterSetting, DXVA2_ValueRange *pRange) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetVideoProcessorRenderTargetCount(REFGUID Guid, const DXVA2_VideoDesc *pVideoDesc, UINT *pCount) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetVideoProcessorRenderTargets(REFGUID Guid, const DXVA2_VideoDesc *pVideoDesc, UINT Count, D3DFORMAT *pFormats) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetVideoProcessorSubStreamFormatCount(REFGUID Guid, const DXVA2_VideoDesc *pVideoDesc, D3DFORMAT Format, UINT *pCount) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetVideoProcessorSubStreamFormats(REFGUID Guid, const DXVA2_VideoDesc *pVideoDesc, D3DFORMAT Format, UINT Count, D3DFORMAT *pFormats) = 0;
+ virtual HRESULT STDMETHODCALLTYPE CreateVideoProcessDevice(REFGUID Guid, const DXVA2_VideoDesc *pVideoDesc, D3DFORMAT Format, UINT, IDirect3DVideoProcessDevice9 * * ppVideoProcessDevice) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetExtensionGuidCount(DWORD Extension, UINT *pCount) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetExtensionGuids(DWORD Extension, UINT Count, GUID *pGuids) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetExtensionCaps(REFGUID Guid, UINT, void *, UINT, void *, UINT) = 0;
+ virtual HRESULT STDMETHODCALLTYPE CreateExtensionDevice(REFGUID Guid, void *, UINT, IDirect3DDXVAExtensionDevice9 ** ppExtension) = 0;
+};
+