]> git.cworth.org Git - apitrace/blob - dispatch/dxvaint.h
specs/dxva: Try to define DXVA2_PVP_SETKEY.
[apitrace] / dispatch / dxvaint.h
1 /**************************************************************************
2  *
3  * Copyright 2012 VMware, Inc.
4  * All Rights Reserved.
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22  * THE SOFTWARE.
23  *
24  **************************************************************************/
25
26
27 #include <dxva2api.h>
28
29
30 #ifndef DXVA2_E_NOT_INITIALIZED
31 #define DXVA2_E_NOT_INITIALIZED ((HRESULT)0x80041000L)
32 #endif
33
34 #ifndef DXVA2_E_NEW_VIDEO_DEVICE
35 #define DXVA2_E_NEW_VIDEO_DEVICE ((HRESULT)0x80041001L)
36 #endif
37
38 #ifndef DXVA2_E_VIDEO_DEVICE_LOCKED
39 #define DXVA2_E_VIDEO_DEVICE_LOCKED ((HRESULT)0x80041002L)
40 #endif
41
42 #ifndef DXVA2_E_NOT_AVAILABLE
43 #define DXVA2_E_NOT_AVAILABLE ((HRESULT)0x80041003L)
44 #endif
45
46
47 typedef struct _DXVA2_DECODEBUFFERDESC {
48     IDirect3DSurface9 *pRenderTarget;
49     DWORD CompressedBufferType;
50     DWORD BufferIndex;
51     DWORD DataOffset;
52     DWORD DataSize;
53     DWORD FirstMBaddress;
54     DWORD NumMBsInBuffer;
55     DWORD Width;
56     DWORD Height;
57     DWORD Stride;
58     DWORD ReservedBits;
59     PVOID pCipherCounter;
60 } DXVA2_DECODEBUFFERDESC;
61
62 typedef struct _DXVA2_DECODEEXECUTE {
63     UINT NumCompBuffers;
64     DXVA2_DECODEBUFFERDESC *pCompressedBuffers;
65 } DXVA2_DECODEEXECUTE;
66
67 typedef struct _DXVA2_VIDEOSAMPLE {
68   REFERENCE_TIME           Start;
69   REFERENCE_TIME           End;
70   DXVA2_ExtendedFormat   SampleFormat;
71   DWORD SampleFlags;
72   IDirect3DSurface9*   SrcSurface;
73   RECT                     SrcRect;
74   RECT                     DstRect;
75   DXVA2_AYUVSample8      Pal[16];
76   DXVA2_Fixed32          PlanarAlpha;
77 } DXVA2_VIDEOSAMPLE;
78
79 /**
80  * See also:
81  * - D3DDDIARG_VIDEOPROCESSBLT
82  * - DXVA2_VideoProcessBltParams
83  */
84 typedef struct _DXVA2_VIDEOPROCESSBLT {
85     REFERENCE_TIME               TargetFrame;
86     RECT                         TargetRect;
87     SIZE                         ConstrictionSize;
88     DWORD                        StreamingFlags;
89     DXVA2_AYUVSample16         BackgroundColor;
90     DXVA2_ExtendedFormat       DestFormat;
91     DWORD DestFlags;
92     DXVA2_ProcAmpValues        ProcAmpValues;
93     DXVA2_Fixed32              Alpha;
94     DXVA2_FilterValues         NoiseFilterLuma;
95     DXVA2_FilterValues         NoiseFilterChroma;
96     DXVA2_FilterValues         DetailFilterLuma;
97     DXVA2_FilterValues         DetailFilterChroma;
98     DXVA2_VIDEOSAMPLE          *pSrcSurfaces;
99     UINT                         NumSrcSurfaces;
100 }  DXVA2_VIDEOPROCESSBLT;
101
102 typedef struct _DXVA2_DECODEBUFFERINFO DXVA2_DECODEBUFFERINFO; /* XXX */
103
104 typedef struct _DXVA2_EXTENSIONEXECUTE DXVA2_EXTENSIONEXECUTE; /* XXX */
105
106
107 static const GUID IID_IDirect3DDecodeDevice9 = {0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}; /* XXX */
108 static const GUID IID_IDirect3DVideoProcessDevice9 = {0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}} /* XXX */;
109 static const GUID IID_IDirect3DDXVAExtensionDevice9 = {0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}; /* XXX */
110 static const GUID IID_IDirect3DDxva2Container9 = {0x126D0349,0x4787,0x4AA6,{0x8E,0x1B,0x40,0xC1,0x77,0xC6,0x0A,0x01}};
111
112
113 typedef struct DECLSPEC_ALIGN(16) _DXVA2_PVP_KEY128
114 {
115     BYTE Data[16];
116 } DXVA2_PVP_KEY128;
117
118 typedef struct _DXVA2_PVP_SETKEY
119 {
120     DXVA2_PVP_KEY128  ContentKey;
121 } DXVA2_PVP_SETKEY;
122
123 class IDirect3DDecodeDevice9 : public IUnknown
124 {
125 public:
126     virtual HRESULT STDMETHODCALLTYPE DecodeBeginFrame(DXVA2_PVP_SETKEY *pPVPSetKey) = 0;
127     virtual HRESULT STDMETHODCALLTYPE DecodeEndFrame(HANDLE *pHandleComplete) = 0;
128     virtual HRESULT STDMETHODCALLTYPE DecodeSetRenderTarget(IDirect3DSurface9 *pRenderTarget) = 0;
129     virtual HRESULT STDMETHODCALLTYPE DecodeExecute(DXVA2_DECODEEXECUTE /* const */ *pExecuteParams) = 0;
130 };
131
132
133 class IDirect3DVideoProcessDevice9 : public IUnknown
134 {
135 public:
136     virtual HRESULT STDMETHODCALLTYPE VideoProcessBeginFrame(void) = 0;
137     virtual HRESULT STDMETHODCALLTYPE VideoProcessEndFrame(HANDLE *pHandleComplete) = 0;
138     virtual HRESULT STDMETHODCALLTYPE VideoProcessSetRenderTarget(IDirect3DSurface9 *pRenderTarget) = 0;
139     virtual HRESULT STDMETHODCALLTYPE VideoProcessBlt(DXVA2_VIDEOPROCESSBLT /* const */ *pData) = 0;
140 };
141
142
143 class IDirect3DDXVAExtensionDevice9 : public IUnknown
144 {
145 public:
146     virtual HRESULT STDMETHODCALLTYPE ExtensionExecute(DXVA2_EXTENSIONEXECUTE *pData) = 0;
147 };
148
149
150 class IDirect3DDxva2Container9 : public IUnknown
151 {
152 public:
153     virtual HRESULT STDMETHODCALLTYPE CreateSurface(UINT Width, UINT Height, UINT BackBuffers, D3DFORMAT Format, D3DPOOL Pool, DWORD Usage, DWORD DxvaType, IDirect3DSurface9 **ppSurface, HANDLE *pSharedHandle) = 0;
154     virtual HRESULT STDMETHODCALLTYPE VidToSysBlt(IDirect3DSurface9 *pSourceSurface, RECT *pSourceRect, IDirect3DSurface9 *pDestSurface, RECT *pDestRect) = 0;
155     virtual HRESULT STDMETHODCALLTYPE GetDecodeGuidCount(UINT *pCount) = 0;
156     virtual HRESULT STDMETHODCALLTYPE GetDecodeGuids(UINT Count, GUID *pGuids) = 0;
157     virtual HRESULT STDMETHODCALLTYPE GetDecodeRenderTargetFormatCount(REFGUID Guid, UINT *pCount) = 0;
158     virtual HRESULT STDMETHODCALLTYPE GetDecodeRenderTargets(REFGUID Guid, UINT Count, D3DFORMAT *pFormats) = 0;
159     virtual HRESULT STDMETHODCALLTYPE GetDecodeCompressedBufferCount(REFGUID Guid, const DXVA2_VideoDesc *pVideoDesc, UINT *pCount) = 0;
160     virtual HRESULT STDMETHODCALLTYPE GetDecodeCompressedBuffers(REFGUID Guid, const DXVA2_VideoDesc *pVideoDesc, UINT Count, DXVA2_DECODEBUFFERINFO *pBufferInfo) = 0;
161     virtual HRESULT STDMETHODCALLTYPE GetDecodeConfigurationCount(REFGUID Guid, const DXVA2_VideoDesc *pVideoDesc, UINT *pCount) = 0;
162     virtual HRESULT STDMETHODCALLTYPE GetDecodeConfigurations(REFGUID Guid, const DXVA2_VideoDesc *pVideoDesc, UINT Count, DXVA2_ConfigPictureDecode *pConfigs) = 0;
163     virtual HRESULT STDMETHODCALLTYPE CreateDecodeDevice(REFGUID Guid, const DXVA2_VideoDesc *pVideoDesc, DXVA2_ConfigPictureDecode const *pConfig, IDirect3DSurface9 * *ppDecoderRenderTargets, UINT NumSurfaces, IDirect3DDecodeDevice9 ** ppDecode) = 0;
164     virtual HRESULT STDMETHODCALLTYPE GetVideoProcessorDeviceGuidCount(const DXVA2_VideoDesc *pVideoDesc, UINT *pCount) = 0;
165     virtual HRESULT STDMETHODCALLTYPE GetVideoProcessorDeviceGuids(const DXVA2_VideoDesc *pVideoDesc, UINT Count, GUID *pGuids) = 0;
166     virtual HRESULT STDMETHODCALLTYPE GetVideoProcessorCaps(REFGUID Guid, const DXVA2_VideoDesc *pVideoDesc, D3DFORMAT Format, DXVA2_VideoProcessorCaps *pCaps) = 0;
167     virtual HRESULT STDMETHODCALLTYPE GetProcAmpRange(REFGUID Guid, const DXVA2_VideoDesc *pVideoDesc, D3DFORMAT Format, UINT ProcAmpCap, DXVA2_ValueRange *pRange) = 0;
168     virtual HRESULT STDMETHODCALLTYPE GetFilterPropertyRange(REFGUID Guid, const DXVA2_VideoDesc *pVideoDesc, D3DFORMAT Format, UINT FilterSetting, DXVA2_ValueRange *pRange) = 0;
169     virtual HRESULT STDMETHODCALLTYPE GetVideoProcessorRenderTargetCount(REFGUID Guid, const DXVA2_VideoDesc *pVideoDesc, UINT *pCount) = 0;
170     virtual HRESULT STDMETHODCALLTYPE GetVideoProcessorRenderTargets(REFGUID Guid, const DXVA2_VideoDesc *pVideoDesc, UINT Count, D3DFORMAT *pFormats) = 0;
171     virtual HRESULT STDMETHODCALLTYPE GetVideoProcessorSubStreamFormatCount(REFGUID Guid, const DXVA2_VideoDesc *pVideoDesc, D3DFORMAT Format, UINT *pCount) = 0;
172     virtual HRESULT STDMETHODCALLTYPE GetVideoProcessorSubStreamFormats(REFGUID Guid, const DXVA2_VideoDesc *pVideoDesc, D3DFORMAT Format, UINT Count, D3DFORMAT *pFormats) = 0;
173     virtual HRESULT STDMETHODCALLTYPE CreateVideoProcessDevice(REFGUID Guid, const DXVA2_VideoDesc *pVideoDesc, D3DFORMAT Format, UINT, IDirect3DVideoProcessDevice9 * * ppVideoProcessDevice) = 0;
174     virtual HRESULT STDMETHODCALLTYPE GetExtensionGuidCount(DWORD Extension, UINT *pCount) = 0;
175     virtual HRESULT STDMETHODCALLTYPE GetExtensionGuids(DWORD Extension, UINT Count, GUID *pGuids) = 0;
176     virtual HRESULT STDMETHODCALLTYPE GetExtensionCaps(REFGUID Guid, UINT, void *, UINT, void *, UINT) = 0;
177     virtual HRESULT STDMETHODCALLTYPE CreateExtensionDevice(REFGUID Guid, void *, UINT, IDirect3DDXVAExtensionDevice9 ** ppExtension) = 0;
178 };
179