Required for gstreamer in Windows https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/1.24.4/subprojects...
From: Biswapriyo Nath nathbappai@gmail.com
--- include/windows.graphics.capture.idl | 11 +++++++++++ 1 file changed, 11 insertions(+)
diff --git a/include/windows.graphics.capture.idl b/include/windows.graphics.capture.idl index f89f91afc42..f0ebd0cab9b 100644 --- a/include/windows.graphics.capture.idl +++ b/include/windows.graphics.capture.idl @@ -51,6 +51,17 @@ namespace Windows.Graphics.Capture { HRESULT StartCapture(); }
+ [ + contract(Windows.Foundation.UniversalApiContract, 10.0), + exclusiveto(Windows.Graphics.Capture.GraphicsCaptureSession), + uuid(2c39ae40-7d2e-5044-804e-8b6799d4cf9e) + ] + interface IGraphicsCaptureSession2 : IInspectable + { + [propget] HRESULT IsCursorCaptureEnabled([out, retval] boolean *value); + [propput] HRESULT IsCursorCaptureEnabled([in] boolean value); + } + [ contract(Windows.Foundation.UniversalApiContract, 6.0), exclusiveto(Windows.Graphics.Capture.GraphicsCaptureSession),
From: Biswapriyo Nath nathbappai@gmail.com
--- include/windows.graphics.capture.idl | 11 +++++++++++ 1 file changed, 11 insertions(+)
diff --git a/include/windows.graphics.capture.idl b/include/windows.graphics.capture.idl index f0ebd0cab9b..ad8ff3c9134 100644 --- a/include/windows.graphics.capture.idl +++ b/include/windows.graphics.capture.idl @@ -62,6 +62,17 @@ namespace Windows.Graphics.Capture { [propput] HRESULT IsCursorCaptureEnabled([in] boolean value); }
+ [ + contract(Windows.Foundation.UniversalApiContract, 12.0), + exclusiveto(Windows.Graphics.Capture.GraphicsCaptureSession), + uuid(f2cdd966-22ae-5ea1-9596-3a289344c3be) + ] + interface IGraphicsCaptureSession3 : IInspectable + { + [propget] HRESULT IsBorderRequired([out, retval] boolean *value); + [propput] HRESULT IsBorderRequired([in] boolean value); + } + [ contract(Windows.Foundation.UniversalApiContract, 6.0), exclusiveto(Windows.Graphics.Capture.GraphicsCaptureSession),
From: Biswapriyo Nath nathbappai@gmail.com
--- include/Makefile.in | 1 + include/windows.graphics.idl | 97 ++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 include/windows.graphics.idl
diff --git a/include/Makefile.in b/include/Makefile.in index 81ff6cfa634..6b66918d564 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -849,6 +849,7 @@ SOURCES = \ windows.graphics.directx.idl \ windows.graphics.effects.idl \ windows.graphics.holographic.idl \ + windows.graphics.idl \ windows.graphics.imaging.idl \ windows.h \ windows.management.deployment.idl \ diff --git a/include/windows.graphics.idl b/include/windows.graphics.idl new file mode 100644 index 00000000000..48c68014a76 --- /dev/null +++ b/include/windows.graphics.idl @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2024 Biswapriyo Nath + * + * 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 + */ + +#ifdef __WIDL__ +#pragma winrt ns_prefix +#endif + +import "inspectable.idl"; +import "eventtoken.idl"; +import "windowscontracts.idl"; +import "windows.foundation.idl"; + +namespace Windows.Graphics { + typedef struct DisplayAdapterId DisplayAdapterId; + typedef struct DisplayId DisplayId; + typedef struct PointInt32 PointInt32; + typedef struct RectInt32 RectInt32; + typedef struct SizeInt32 SizeInt32; + + interface IGeometrySource2D; + + declare { + interface Windows.Foundation.Collections.IIterable<Windows.Graphics.RectInt32>; + interface Windows.Foundation.Collections.IIterator<Windows.Graphics.RectInt32>; + interface Windows.Foundation.Collections.IVectorView<Windows.Graphics.RectInt32>; + interface Windows.Foundation.IReference<Windows.Graphics.SizeInt32>; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 6.0) + ] + struct DisplayAdapterId + { + UINT32 LowPart; + INT32 HighPart; + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 12.0) + ] + struct DisplayId + { + UINT64 Value; + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 4.0) + ] + struct PointInt32 + { + INT32 X; + INT32 Y; + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 4.0) + ] + struct RectInt32 + { + INT32 X; + INT32 Y; + INT32 Width; + INT32 Height; + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 4.0) + ] + struct SizeInt32 + { + INT32 Width; + INT32 Height; + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 6.0), + uuid(caff7902-670c-4181-a624-da977203b845) + ] + interface IGeometrySource2D : IInspectable + { + } +}
From: Biswapriyo Nath nathbappai@gmail.com
--- include/windows.graphics.capture.idl | 68 +++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 2 deletions(-)
diff --git a/include/windows.graphics.capture.idl b/include/windows.graphics.capture.idl index ad8ff3c9134..a5ccd952ca5 100644 --- a/include/windows.graphics.capture.idl +++ b/include/windows.graphics.capture.idl @@ -25,22 +25,74 @@ import "asyncinfo.idl"; import "eventtoken.idl"; import "windowscontracts.idl"; import "windows.foundation.idl"; -/* import "windows.graphics.idl"; */ +import "windows.graphics.idl"; import "windows.graphics.directx.idl"; import "windows.graphics.directx.direct3d11.idl"; /* import "windows.security.authorization.appcapabilityaccess.idl"; */ import "windows.system.idl"; import "windows.ui.idl"; -/* import "windows.ui.composition.idl"; */ +import "windows.ui.composition.idl";
namespace Windows.Graphics.Capture { + interface IGraphicsCaptureItem; + interface IGraphicsCaptureItemStatics; + interface IGraphicsCaptureItemStatics2; interface IGraphicsCaptureSession; interface IGraphicsCaptureSession2; interface IGraphicsCaptureSession3; interface IGraphicsCaptureSessionStatics;
+ runtimeclass GraphicsCaptureItem; runtimeclass GraphicsCaptureSession;
+ declare { + interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Graphics.Capture.GraphicsCaptureItem *>; + interface Windows.Foundation.IAsyncOperation<Windows.Graphics.Capture.GraphicsCaptureItem *>; + interface Windows.Foundation.TypedEventHandler<Windows.Graphics.Capture.GraphicsCaptureItem *, IInspectable *>; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 6.0), + exclusiveto(Windows.Graphics.Capture.GraphicsCaptureItem), + uuid(79c3f95b-31f7-4ec2-a464-632ef5d30760) + ] + interface IGraphicsCaptureItem : IInspectable + { + [propget] HRESULT DisplayName([out, retval] HSTRING *value); + [propget] HRESULT Size([out, retval] Windows.Graphics.SizeInt32 *value); + [eventadd] HRESULT Closed( + [in] Windows.Foundation.TypedEventHandler<Windows.Graphics.Capture.GraphicsCaptureItem *, IInspectable *> *handler, + [out, retval] EventRegistrationToken *token); + [eventremove] HRESULT Closed([in] EventRegistrationToken token); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 7.0), + exclusiveto(Windows.Graphics.Capture.GraphicsCaptureItem), + uuid(a87ebea5-457c-5788-ab47-0cf1d3637e74) + ] + interface IGraphicsCaptureItemStatics : IInspectable + { + HRESULT CreateFromVisual( + [in] Windows.UI.Composition.Visual *visual, + [out, retval] Windows.Graphics.Capture.GraphicsCaptureItem **result); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 12.0), + exclusiveto(Windows.Graphics.Capture.GraphicsCaptureItem), + uuid(3b92acc9-e584-5862-bf5c-9c316c6d2dbb) + ] + interface IGraphicsCaptureItemStatics2 : IInspectable + { + HRESULT TryCreateFromWindowId( + [in] Windows.UI.WindowId window_id, + [out, retval] Windows.Graphics.Capture.GraphicsCaptureItem **result); + HRESULT TryCreateFromDisplayId( + [in] Windows.Graphics.DisplayId display_id, + [out, retval] Windows.Graphics.Capture.GraphicsCaptureItem **result); + } + [ contract(Windows.Foundation.UniversalApiContract, 6.0), exclusiveto(Windows.Graphics.Capture.GraphicsCaptureSession), @@ -83,6 +135,18 @@ namespace Windows.Graphics.Capture { HRESULT IsSupported([out, retval] boolean *result); }
+ [ + contract(Windows.Foundation.UniversalApiContract, 6.0), + marshaling_behavior(agile), + static(Windows.Graphics.Capture.IGraphicsCaptureItemStatics, Windows.Foundation.UniversalApiContract, 7.0), + static(Windows.Graphics.Capture.IGraphicsCaptureItemStatics2, Windows.Foundation.UniversalApiContract, 12.0), + threading(both) + ] + runtimeclass GraphicsCaptureItem + { + [default] interface Windows.Graphics.Capture.IGraphicsCaptureItem; + } + [ contract(Windows.Foundation.UniversalApiContract, 6.0), marshaling_behavior(agile),
From: Biswapriyo Nath nathbappai@gmail.com
--- include/windows.graphics.capture.idl | 48 ++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+)
diff --git a/include/windows.graphics.capture.idl b/include/windows.graphics.capture.idl index a5ccd952ca5..d102dff8fb0 100644 --- a/include/windows.graphics.capture.idl +++ b/include/windows.graphics.capture.idl @@ -34,6 +34,10 @@ import "windows.ui.idl"; import "windows.ui.composition.idl";
namespace Windows.Graphics.Capture { + typedef enum GraphicsCaptureDirtyRegionMode GraphicsCaptureDirtyRegionMode; + + interface IDirect3D11CaptureFrame; + interface IDirect3D11CaptureFrame2; interface IGraphicsCaptureItem; interface IGraphicsCaptureItemStatics; interface IGraphicsCaptureItemStatics2; @@ -42,6 +46,7 @@ namespace Windows.Graphics.Capture { interface IGraphicsCaptureSession3; interface IGraphicsCaptureSessionStatics;
+ runtimeclass Direct3D11CaptureFrame; runtimeclass GraphicsCaptureItem; runtimeclass GraphicsCaptureSession;
@@ -51,6 +56,38 @@ namespace Windows.Graphics.Capture { interface Windows.Foundation.TypedEventHandler<Windows.Graphics.Capture.GraphicsCaptureItem *, IInspectable *>; }
+ [ + contract(Windows.Foundation.UniversalApiContract, 19.0) + ] + enum GraphicsCaptureDirtyRegionMode + { + ReportOnly = 0, + ReportAndRender = 1, + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 6.0), + exclusiveto(Windows.Graphics.Capture.Direct3D11CaptureFrame), + uuid(fa50c623-38da-4b32-acf3-fa9734ad800e) + ] + interface IDirect3D11CaptureFrame : IInspectable + { + [propget] HRESULT Surface([out, retval] Windows.Graphics.DirectX.Direct3D11.IDirect3DSurface **value); + [propget] HRESULT SystemRelativeTime([out, retval] Windows.Foundation.TimeSpan *value); + [propget] HRESULT ContentSize([out, retval] Windows.Graphics.SizeInt32 *value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 19.0), + exclusiveto(Windows.Graphics.Capture.Direct3D11CaptureFrame), + uuid(37869cfa-2b48-5ebf-9afb-dffd805defdb) + ] + interface IDirect3D11CaptureFrame2 : IInspectable + { + [propget] HRESULT DirtyRegions([out, retval] Windows.Foundation.Collections.IVectorView<Windows.Graphics.RectInt32> **value); + [propget] HRESULT DirtyRegionMode([out, retval] Windows.Graphics.Capture.GraphicsCaptureDirtyRegionMode *value); + } + [ contract(Windows.Foundation.UniversalApiContract, 6.0), exclusiveto(Windows.Graphics.Capture.GraphicsCaptureItem), @@ -135,6 +172,17 @@ namespace Windows.Graphics.Capture { HRESULT IsSupported([out, retval] boolean *result); }
+ [ + contract(Windows.Foundation.UniversalApiContract, 6.0), + marshaling_behavior(agile) + ] + runtimeclass Direct3D11CaptureFrame + { + [default] interface Windows.Graphics.Capture.IDirect3D11CaptureFrame; + [contract(Windows.Foundation.UniversalApiContract, 19.0)] interface Windows.Graphics.Capture.IDirect3D11CaptureFrame2; + interface Windows.Foundation.IClosable; + } + [ contract(Windows.Foundation.UniversalApiContract, 6.0), marshaling_behavior(agile),
From: Biswapriyo Nath nathbappai@gmail.com
--- include/windows.graphics.capture.idl | 71 ++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+)
diff --git a/include/windows.graphics.capture.idl b/include/windows.graphics.capture.idl index d102dff8fb0..fc1c852908b 100644 --- a/include/windows.graphics.capture.idl +++ b/include/windows.graphics.capture.idl @@ -38,6 +38,9 @@ namespace Windows.Graphics.Capture {
interface IDirect3D11CaptureFrame; interface IDirect3D11CaptureFrame2; + interface IDirect3D11CaptureFramePool; + interface IDirect3D11CaptureFramePoolStatics; + interface IDirect3D11CaptureFramePoolStatics2; interface IGraphicsCaptureItem; interface IGraphicsCaptureItemStatics; interface IGraphicsCaptureItemStatics2; @@ -47,12 +50,14 @@ namespace Windows.Graphics.Capture { interface IGraphicsCaptureSessionStatics;
runtimeclass Direct3D11CaptureFrame; + runtimeclass Direct3D11CaptureFramePool; runtimeclass GraphicsCaptureItem; runtimeclass GraphicsCaptureSession;
declare { interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Graphics.Capture.GraphicsCaptureItem *>; interface Windows.Foundation.IAsyncOperation<Windows.Graphics.Capture.GraphicsCaptureItem *>; + interface Windows.Foundation.TypedEventHandler<Windows.Graphics.Capture.Direct3D11CaptureFramePool *, IInspectable *>; interface Windows.Foundation.TypedEventHandler<Windows.Graphics.Capture.GraphicsCaptureItem *, IInspectable *>; }
@@ -88,6 +93,59 @@ namespace Windows.Graphics.Capture { [propget] HRESULT DirtyRegionMode([out, retval] Windows.Graphics.Capture.GraphicsCaptureDirtyRegionMode *value); }
+ [ + contract(Windows.Foundation.UniversalApiContract, 6.0), + exclusiveto(Windows.Graphics.Capture.Direct3D11CaptureFramePool), + uuid(24eb6d22-1975-422e-82e7-780dbd8ddf24) + ] + interface IDirect3D11CaptureFramePool : IInspectable + { + HRESULT Recreate( + [in] Windows.Graphics.DirectX.Direct3D11.IDirect3DDevice *device, + [in] Windows.Graphics.DirectX.DirectXPixelFormat pixel_format, + [in] INT32 number_of_buffers, [in] Windows.Graphics.SizeInt32 size); + HRESULT TryGetNextFrame( + [out, retval] Windows.Graphics.Capture.Direct3D11CaptureFrame **result); + [eventadd] HRESULT FrameArrived( + [in] Windows.Foundation.TypedEventHandler<Windows.Graphics.Capture.Direct3D11CaptureFramePool *, IInspectable *> *handler, + [out, retval] EventRegistrationToken* token); + [eventremove] HRESULT FrameArrived([in] EventRegistrationToken token); + HRESULT CreateCaptureSession( + [in] Windows.Graphics.Capture.GraphicsCaptureItem *item, + [out, retval] Windows.Graphics.Capture.GraphicsCaptureSession **result); + [propget] HRESULT DispatcherQueue([out, retval] Windows.System.DispatcherQueue **value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 6.0), + exclusiveto(Windows.Graphics.Capture.Direct3D11CaptureFramePool), + uuid(7784056a-67aa-4d53-ae54-1088d5a8ca21) + ] + interface IDirect3D11CaptureFramePoolStatics : IInspectable + { + HRESULT Create( + [in] Windows.Graphics.DirectX.Direct3D11.IDirect3DDevice *device, + [in] Windows.Graphics.DirectX.DirectXPixelFormat pixel_format, + [in] INT32 number_of_buffers, + [in] Windows.Graphics.SizeInt32 size, + [out, retval] Windows.Graphics.Capture.Direct3D11CaptureFramePool **result); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 7.0), + exclusiveto(Windows.Graphics.Capture.Direct3D11CaptureFramePool), + uuid(589b103f-6bbc-5df5-a991-02e28b3b66d5) + ] + interface IDirect3D11CaptureFramePoolStatics2 : IInspectable + { + HRESULT CreateFreeThreaded( + [in] Windows.Graphics.DirectX.Direct3D11.IDirect3DDevice *device, + [in] Windows.Graphics.DirectX.DirectXPixelFormat pixel_format, + [in] INT32 number_of_buffers, + [in] Windows.Graphics.SizeInt32 size, + [out, retval] Windows.Graphics.Capture.Direct3D11CaptureFramePool **result); + } + [ contract(Windows.Foundation.UniversalApiContract, 6.0), exclusiveto(Windows.Graphics.Capture.GraphicsCaptureItem), @@ -183,6 +241,19 @@ namespace Windows.Graphics.Capture { interface Windows.Foundation.IClosable; }
+ [ + contract(Windows.Foundation.UniversalApiContract, 6.0), + marshaling_behavior(agile), + static(Windows.Graphics.Capture.IDirect3D11CaptureFramePoolStatics, Windows.Foundation.UniversalApiContract, 6.0), + static(Windows.Graphics.Capture.IDirect3D11CaptureFramePoolStatics2, Windows.Foundation.UniversalApiContract, 7.0), + threading(both) + ] + runtimeclass Direct3D11CaptureFramePool + { + [default] interface Windows.Graphics.Capture.IDirect3D11CaptureFramePool; + interface Windows.Foundation.IClosable; + } + [ contract(Windows.Foundation.UniversalApiContract, 6.0), marshaling_behavior(agile),
This merge request was approved by Rémi Bernon.