Files
MINGW-packages/mingw-w64-headers-git/0006-Add-d3d11-video-context.patch
2015-11-02 10:43:44 +03:00

386 lines
15 KiB
Diff

From b952e857814e5cfe766626573e2f056ed91ceb09 Mon Sep 17 00:00:00 2001
From: Martell Malone <martellmalone@gmail.com>
Date: Sun, 14 Jun 2015 21:07:03 +0100
Subject: [PATCH 6/6] Add d3d11 video context
---
mingw-w64-headers/direct-x/include/d3d11.h | 259 +++++++++++++++++++++++++++
mingw-w64-headers/direct-x/include/d3d11.idl | 66 ++++++
2 files changed, 325 insertions(+)
diff --git a/mingw-w64-headers/direct-x/include/d3d11.h b/mingw-w64-headers/direct-x/include/d3d11.h
index e49fd99..834a536 100644
--- a/mingw-w64-headers/direct-x/include/d3d11.h
+++ b/mingw-w64-headers/direct-x/include/d3d11.h
@@ -21,6 +21,11 @@
#define __ID3D11DeviceChild_FWD_DEFINED__
typedef interface ID3D11DeviceChild ID3D11DeviceChild;
#endif
+
+#ifndef __ID3D11VideoContext_FWD_DEFINED__
+#define __ID3D11VideoContext_FWD_DEFINED__
+typedef interface ID3D11VideoContext ID3D11VideoContext;
+#endif
#ifndef __ID3D11Asynchronous_FWD_DEFINED__
#define __ID3D11Asynchronous_FWD_DEFINED__
@@ -1366,6 +1366,38 @@
USHORT ConfigMinRenderTargetBuffCount;
USHORT ConfigDecoderSpecific;
} D3D11_VIDEO_DECODER_CONFIG;
+typedef enum D3D11_VIDEO_DECODER_BUFFER_TYPE {
+ D3D11_VIDEO_DECODER_BUFFER_PICTURE_PARAMETERS = 0,
+ D3D11_VIDEO_DECODER_BUFFER_MACROBLOCK_CONTROL = 1,
+ D3D11_VIDEO_DECODER_BUFFER_RESIDUAL_DIFFERENCE = 2,
+ D3D11_VIDEO_DECODER_BUFFER_DEBLOCKING_CONTROL = 3,
+ D3D11_VIDEO_DECODER_BUFFER_INVERSE_QUANTIZATION_MATRIX = 4,
+ D3D11_VIDEO_DECODER_BUFFER_SLICE_CONTROL = 5,
+ D3D11_VIDEO_DECODER_BUFFER_BITSTREAM = 6,
+ D3D11_VIDEO_DECODER_BUFFER_MOTION_VECTOR = 7,
+ D3D11_VIDEO_DECODER_BUFFER_FILM_GRAIN = 8
+} D3D11_VIDEO_DECODER_BUFFER_TYPE;
+typedef struct D3D11_ENCRYPTED_BLOCK_INFO {
+ UINT NumEncryptedBytesAtBeginning;
+ UINT NumBytesInSkipPattern;
+ UINT NumBytesInEncryptPattern;
+} D3D11_ENCRYPTED_BLOCK_INFO;
+typedef struct D3D11_VIDEO_DECODER_BUFFER_DESC {
+ D3D11_VIDEO_DECODER_BUFFER_TYPE BufferType;
+ UINT BufferIndex;
+ UINT DataOffset;
+ UINT DataSize;
+ UINT FirstMBaddress;
+ UINT NumMBsInBuffer;
+ UINT Width;
+ UINT Height;
+ UINT Stride;
+ UINT ReservedBits;
+ void *pIV;
+ UINT IVSize;
+ WINBOOL PartialEncryption;
+ D3D11_ENCRYPTED_BLOCK_INFO EncryptedBlockInfo;
+} D3D11_VIDEO_DECODER_BUFFER_DESC;
typedef enum D3D11_VIDEO_FRAME_FORMAT {
D3D11_VIDEO_FRAME_FORMAT_PROGRESSIVE = 0,
D3D11_VIDEO_FRAME_FORMAT_INTERLACED_TOP_FIELD_FIRST = 1,
@@ -8514,6 +8514,233 @@
DWORD* pdwStubPhase);
#endif /* __ID3D11VideoDecoder_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ID3D11VideoContext interface
+ */
+#ifndef __ID3D11VideoContext_INTERFACE_DEFINED__
+#define __ID3D11VideoContext_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ID3D11VideoContext, 0x61f21c45, 0x3c0e, 0x4a74, 0x9c,0xea, 0x67,0x10,0x0d,0x9a,0xd5,0xe4);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+MIDL_INTERFACE("61f21c45-3c0e-4a74-9cea-67100d9ad5e4")
+ID3D11VideoContext : public ID3D11DeviceChild
+{
+ virtual HRESULT STDMETHODCALLTYPE GetDecoderBuffer(
+ ID3D11VideoDecoder *pDecoder,
+ D3D11_VIDEO_DECODER_BUFFER_TYPE BufferType,
+ UINT *pBufferSize,
+ void **ppBuffer) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ReleaseDecoderBuffer(
+ ID3D11VideoDecoder *pDecoder,
+ D3D11_VIDEO_DECODER_BUFFER_TYPE BufferType) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE DecoderBeginFrame(
+ ID3D11VideoDecoder *pDecoder,
+ ID3D11VideoDecoderOutputView *pVideoDecoderOutputView,
+ UINT ContentKeySize,
+ const void *pContentKey) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE DecoderEndFrame(
+ ID3D11VideoDecoder *pDecoder) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SubmitDecoderBuffers(
+ ID3D11VideoDecoder *pDecoder,
+ UINT NumBuffers,
+ const D3D11_VIDEO_DECODER_BUFFER_DESC *pBufferDesc) = 0;
+
+};
+#ifdef __CRT_UUID_DECL
+__CRT_UUID_DECL(ID3D11VideoContext, 0x61f21c45, 0x3c0e, 0x4a74, 0x9c,0xea, 0x67,0x10,0x0d,0x9a,0xd5,0xe4)
+#endif
+#else
+typedef struct ID3D11VideoContextVtbl {
+ BEGIN_INTERFACE
+
+ /*** IUnknown methods ***/
+ HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+ ID3D11VideoContext* This,
+ REFIID riid,
+ void **ppvObject);
+
+ ULONG (STDMETHODCALLTYPE *AddRef)(
+ ID3D11VideoContext* This);
+
+ ULONG (STDMETHODCALLTYPE *Release)(
+ ID3D11VideoContext* This);
+
+ /*** ID3D11DeviceChild methods ***/
+ void (STDMETHODCALLTYPE *GetDevice)(
+ ID3D11VideoContext* This,
+ ID3D11Device **ppDevice);
+
+ HRESULT (STDMETHODCALLTYPE *GetPrivateData)(
+ ID3D11VideoContext* This,
+ REFGUID guid,
+ UINT *pDataSize,
+ void *pData);
+
+ HRESULT (STDMETHODCALLTYPE *SetPrivateData)(
+ ID3D11VideoContext* This,
+ REFGUID guid,
+ UINT DataSize,
+ const void *pData);
+
+ HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)(
+ ID3D11VideoContext* This,
+ REFGUID guid,
+ const IUnknown *pData);
+
+ /*** ID3D11VideoContext methods ***/
+ HRESULT (STDMETHODCALLTYPE *GetDecoderBuffer)(
+ ID3D11VideoContext* This,
+ ID3D11VideoDecoder *pDecoder,
+ D3D11_VIDEO_DECODER_BUFFER_TYPE BufferType,
+ UINT *pBufferSize,
+ void **ppBuffer);
+
+ HRESULT (STDMETHODCALLTYPE *ReleaseDecoderBuffer)(
+ ID3D11VideoContext* This,
+ ID3D11VideoDecoder *pDecoder,
+ D3D11_VIDEO_DECODER_BUFFER_TYPE BufferType);
+
+ HRESULT (STDMETHODCALLTYPE *DecoderBeginFrame)(
+ ID3D11VideoContext* This,
+ ID3D11VideoDecoder *pDecoder,
+ ID3D11VideoDecoderOutputView *pVideoDecoderOutputView,
+ UINT ContentKeySize,
+ const void *pContentKey);
+
+ HRESULT (STDMETHODCALLTYPE *DecoderEndFrame)(
+ ID3D11VideoContext* This,
+ ID3D11VideoDecoder *pDecoder);
+
+ HRESULT (STDMETHODCALLTYPE *SubmitDecoderBuffers)(
+ ID3D11VideoContext* This,
+ ID3D11VideoDecoder *pDecoder,
+ UINT NumBuffers,
+ const D3D11_VIDEO_DECODER_BUFFER_DESC *pBufferDesc);
+
+ END_INTERFACE
+} ID3D11VideoContextVtbl;
+interface ID3D11VideoContext {
+ CONST_VTBL ID3D11VideoContextVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+#ifndef WIDL_C_INLINE_WRAPPERS
+/*** IUnknown methods ***/
+#define ID3D11VideoContext_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ID3D11VideoContext_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ID3D11VideoContext_Release(This) (This)->lpVtbl->Release(This)
+/*** ID3D11DeviceChild methods ***/
+#define ID3D11VideoContext_GetDevice(This,ppDevice) (This)->lpVtbl->GetDevice(This,ppDevice)
+#define ID3D11VideoContext_GetPrivateData(This,guid,pDataSize,pData) (This)->lpVtbl->GetPrivateData(This,guid,pDataSize,pData)
+#define ID3D11VideoContext_SetPrivateData(This,guid,DataSize,pData) (This)->lpVtbl->SetPrivateData(This,guid,DataSize,pData)
+#define ID3D11VideoContext_SetPrivateDataInterface(This,guid,pData) (This)->lpVtbl->SetPrivateDataInterface(This,guid,pData)
+/*** ID3D11VideoContext methods ***/
+#define ID3D11VideoContext_GetDecoderBuffer(This,pDecoder,BufferType,pBufferSize,ppBuffer) (This)->lpVtbl->GetDecoderBuffer(This,pDecoder,BufferType,pBufferSize,ppBuffer)
+#define ID3D11VideoContext_ReleaseDecoderBuffer(This,pDecoder,BufferType) (This)->lpVtbl->ReleaseDecoderBuffer(This,pDecoder,BufferType)
+#define ID3D11VideoContext_DecoderBeginFrame(This,pDecoder,pVideoDecoderOutputView,ContentKeySize,pContentKey) (This)->lpVtbl->DecoderBeginFrame(This,pDecoder,pVideoDecoderOutputView,ContentKeySize,pContentKey)
+#define ID3D11VideoContext_DecoderEndFrame(This,pDecoder) (This)->lpVtbl->DecoderEndFrame(This,pDecoder)
+#define ID3D11VideoContext_SubmitDecoderBuffers(This,pDecoder,NumBuffers,pBufferDesc) (This)->lpVtbl->SubmitDecoderBuffers(This,pDecoder,NumBuffers,pBufferDesc)
+#else
+/*** IUnknown methods ***/
+static FORCEINLINE HRESULT ID3D11VideoContext_QueryInterface(ID3D11VideoContext* This,REFIID riid,void **ppvObject) {
+ return This->lpVtbl->QueryInterface(This,riid,ppvObject);
+}
+static FORCEINLINE ULONG ID3D11VideoContext_AddRef(ID3D11VideoContext* This) {
+ return This->lpVtbl->AddRef(This);
+}
+static FORCEINLINE ULONG ID3D11VideoContext_Release(ID3D11VideoContext* This) {
+ return This->lpVtbl->Release(This);
+}
+/*** ID3D11DeviceChild methods ***/
+static FORCEINLINE void ID3D11VideoContext_GetDevice(ID3D11VideoContext* This,ID3D11Device **ppDevice) {
+ This->lpVtbl->GetDevice(This,ppDevice);
+}
+static FORCEINLINE HRESULT ID3D11VideoContext_GetPrivateData(ID3D11VideoContext* This,REFGUID guid,UINT *pDataSize,void *pData) {
+ return This->lpVtbl->GetPrivateData(This,guid,pDataSize,pData);
+}
+static FORCEINLINE HRESULT ID3D11VideoContext_SetPrivateData(ID3D11VideoContext* This,REFGUID guid,UINT DataSize,const void *pData) {
+ return This->lpVtbl->SetPrivateData(This,guid,DataSize,pData);
+}
+static FORCEINLINE HRESULT ID3D11VideoContext_SetPrivateDataInterface(ID3D11VideoContext* This,REFGUID guid,const IUnknown *pData) {
+ return This->lpVtbl->SetPrivateDataInterface(This,guid,pData);
+}
+/*** ID3D11VideoContext methods ***/
+static FORCEINLINE HRESULT ID3D11VideoContext_GetDecoderBuffer(ID3D11VideoContext* This,ID3D11VideoDecoder *pDecoder,D3D11_VIDEO_DECODER_BUFFER_TYPE BufferType,UINT *pBufferSize,void **ppBuffer) {
+ return This->lpVtbl->GetDecoderBuffer(This,pDecoder,BufferType,pBufferSize,ppBuffer);
+}
+static FORCEINLINE HRESULT ID3D11VideoContext_ReleaseDecoderBuffer(ID3D11VideoContext* This,ID3D11VideoDecoder *pDecoder,D3D11_VIDEO_DECODER_BUFFER_TYPE BufferType) {
+ return This->lpVtbl->ReleaseDecoderBuffer(This,pDecoder,BufferType);
+}
+static FORCEINLINE HRESULT ID3D11VideoContext_DecoderBeginFrame(ID3D11VideoContext* This,ID3D11VideoDecoder *pDecoder,ID3D11VideoDecoderOutputView *pVideoDecoderOutputView,UINT ContentKeySize,const void *pContentKey) {
+ return This->lpVtbl->DecoderBeginFrame(This,pDecoder,pVideoDecoderOutputView,ContentKeySize,pContentKey);
+}
+static FORCEINLINE HRESULT ID3D11VideoContext_DecoderEndFrame(ID3D11VideoContext* This,ID3D11VideoDecoder *pDecoder) {
+ return This->lpVtbl->DecoderEndFrame(This,pDecoder);
+}
+static FORCEINLINE HRESULT ID3D11VideoContext_SubmitDecoderBuffers(ID3D11VideoContext* This,ID3D11VideoDecoder *pDecoder,UINT NumBuffers,const D3D11_VIDEO_DECODER_BUFFER_DESC *pBufferDesc) {
+ return This->lpVtbl->SubmitDecoderBuffers(This,pDecoder,NumBuffers,pBufferDesc);
+}
+#endif
+#endif
+
+#endif
+
+HRESULT STDMETHODCALLTYPE ID3D11VideoContext_GetDecoderBuffer_Proxy(
+ ID3D11VideoContext* This,
+ ID3D11VideoDecoder *pDecoder,
+ D3D11_VIDEO_DECODER_BUFFER_TYPE BufferType,
+ UINT *pBufferSize,
+ void **ppBuffer);
+void __RPC_STUB ID3D11VideoContext_GetDecoderBuffer_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D11VideoContext_ReleaseDecoderBuffer_Proxy(
+ ID3D11VideoContext* This,
+ ID3D11VideoDecoder *pDecoder,
+ D3D11_VIDEO_DECODER_BUFFER_TYPE BufferType);
+void __RPC_STUB ID3D11VideoContext_ReleaseDecoderBuffer_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D11VideoContext_DecoderBeginFrame_Proxy(
+ ID3D11VideoContext* This,
+ ID3D11VideoDecoder *pDecoder,
+ ID3D11VideoDecoderOutputView *pVideoDecoderOutputView,
+ UINT ContentKeySize,
+ const void *pContentKey);
+void __RPC_STUB ID3D11VideoContext_DecoderBeginFrame_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D11VideoContext_DecoderEndFrame_Proxy(
+ ID3D11VideoContext* This,
+ ID3D11VideoDecoder *pDecoder);
+void __RPC_STUB ID3D11VideoContext_DecoderEndFrame_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D11VideoContext_SubmitDecoderBuffers_Proxy(
+ ID3D11VideoContext* This,
+ ID3D11VideoDecoder *pDecoder,
+ UINT NumBuffers,
+ const D3D11_VIDEO_DECODER_BUFFER_DESC *pBufferDesc);
+void __RPC_STUB ID3D11VideoContext_SubmitDecoderBuffers_Stub(
+ IRpcStubBuffer* This,
+ IRpcChannelBuffer* pRpcChannelBuffer,
+ PRPC_MESSAGE pRpcMessage,
+ DWORD* pdwStubPhase);
+
+#endif /* __ID3D11VideoContext_INTERFACE_DEFINED__ */
/*****************************************************************************
* ID3D11VideoProcessorEnumerator interface
diff --git a/mingw-w64-headers/direct-x/include/d3d11.idl b/mingw-w64-headers/direct-x/include/d3d11.idl
index 59beafb..cfae7c8 100644
--- a/mingw-w64-headers/direct-x/include/d3d11.idl
+++ b/mingw-w64-headers/direct-x/include/d3d11.idl
@@ -1246,6 +1246,44 @@
USHORT ConfigMinRenderTargetBuffCount;
USHORT ConfigDecoderSpecific;
} D3D11_VIDEO_DECODER_CONFIG;
+
+typedef enum D3D11_VIDEO_DECODER_BUFFER_TYPE
+{
+ D3D11_VIDEO_DECODER_BUFFER_PICTURE_PARAMETERS = 0,
+ D3D11_VIDEO_DECODER_BUFFER_MACROBLOCK_CONTROL,
+ D3D11_VIDEO_DECODER_BUFFER_RESIDUAL_DIFFERENCE,
+ D3D11_VIDEO_DECODER_BUFFER_DEBLOCKING_CONTROL,
+ D3D11_VIDEO_DECODER_BUFFER_INVERSE_QUANTIZATION_MATRIX,
+ D3D11_VIDEO_DECODER_BUFFER_SLICE_CONTROL,
+ D3D11_VIDEO_DECODER_BUFFER_BITSTREAM,
+ D3D11_VIDEO_DECODER_BUFFER_MOTION_VECTOR,
+ D3D11_VIDEO_DECODER_BUFFER_FILM_GRAIN
+} D3D11_VIDEO_DECODER_BUFFER_TYPE;
+
+typedef struct D3D11_ENCRYPTED_BLOCK_INFO
+{
+ UINT NumEncryptedBytesAtBeginning;
+ UINT NumBytesInSkipPattern;
+ UINT NumBytesInEncryptPattern;
+} D3D11_ENCRYPTED_BLOCK_INFO;
+
+typedef struct D3D11_VIDEO_DECODER_BUFFER_DESC
+{
+ D3D11_VIDEO_DECODER_BUFFER_TYPE BufferType;
+ UINT BufferIndex;
+ UINT DataOffset;
+ UINT DataSize;
+ UINT FirstMBaddress;
+ UINT NumMBsInBuffer;
+ UINT Width;
+ UINT Height;
+ UINT Stride;
+ UINT ReservedBits;
+ void *pIV;
+ UINT IVSize;
+ BOOL PartialEncryption;
+ D3D11_ENCRYPTED_BLOCK_INFO EncryptedBlockInfo;
+} D3D11_VIDEO_DECODER_BUFFER_DESC;
typedef enum D3D11_VIDEO_FRAME_FORMAT
{
@@ -2286,6 +2286,34 @@
D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC *pDesc);
}
+[
+ object,
+ local,
+ uuid(61f21c45-3c0e-4a74-9cea-67100d9ad5e4)
+]
+interface ID3D11VideoContext : ID3D11DeviceChild
+{
+ HRESULT GetDecoderBuffer(
+ [in] ID3D11VideoDecoder *pDecoder,
+ [in] D3D11_VIDEO_DECODER_BUFFER_TYPE BufferType,
+ [out] UINT *pBufferSize,
+ [out] void **ppBuffer);
+ HRESULT ReleaseDecoderBuffer(
+ [in] ID3D11VideoDecoder *pDecoder,
+ [in] D3D11_VIDEO_DECODER_BUFFER_TYPE BufferType);
+ HRESULT DecoderBeginFrame(
+ [in] ID3D11VideoDecoder *pDecoder,
+ [in] ID3D11VideoDecoderOutputView *pVideoDecoderOutputView,
+ [in] UINT ContentKeySize,
+ [in] const void *pContentKey);
+ HRESULT DecoderEndFrame(
+ [in] ID3D11VideoDecoder *pDecoder);
+ HRESULT SubmitDecoderBuffers(
+ [in] ID3D11VideoDecoder *pDecoder,
+ [in] UINT NumBuffers,
+ [in] const D3D11_VIDEO_DECODER_BUFFER_DESC *pBufferDesc);
+}
+
[
object,
uuid(10ec4d5b-975a-4689-b9e4-d0aac30fe333),
--
2.4.5