1 /* 2 * GStreamer 3 * Copyright (C) 2020 Seungha Yang <seungha@centricular.com> 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Library General Public 7 * License as published by the Free Software Foundation; either 8 * version 2 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Library General Public License for more details. 14 * 15 * You should have received a copy of the GNU Library General Public 16 * License along with this library; if not, write to the 17 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 18 * Boston, MA 02110-1301, USA. 19 */ 20 21 #pragma once 22 23 #include <gst/gst.h> 24 #include <gst/video/video.h> 25 #include <gst/d3d11/gstd3d11.h> 26 27 G_BEGIN_DECLS 28 29 #define GST_D3D11_SCREEN_CAPTURE_FLOW_EXPECTED_ERROR GST_FLOW_CUSTOM_SUCCESS 30 #define GST_D3D11_SCREEN_CAPTURE_FLOW_SIZE_CHANGED GST_FLOW_CUSTOM_SUCCESS_1 31 #define GST_D3D11_SCREEN_CAPTURE_FLOW_UNSUPPORTED GST_FLOW_CUSTOM_ERROR 32 33 #define GST_TYPE_D3D11_SCREEN_CAPTURE (gst_d3d11_screen_capture_get_type()) 34 G_DECLARE_FINAL_TYPE (GstD3D11ScreenCapture, gst_d3d11_screen_capture, 35 GST, D3D11_SCREEN_CAPTURE, GstObject); 36 37 GstD3D11ScreenCapture * gst_d3d11_screen_capture_new (GstD3D11Device * device, 38 HMONITOR monitor_handle); 39 40 GstFlowReturn gst_d3d11_screen_capture_prepare (GstD3D11ScreenCapture * capture); 41 42 gboolean gst_d3d11_screen_capture_get_size (GstD3D11ScreenCapture * capture, 43 guint * width, 44 guint * height); 45 46 GstFlowReturn gst_d3d11_screen_capture_do_capture (GstD3D11ScreenCapture * capture, 47 GstD3D11Device * device, 48 ID3D11Texture2D * texture, 49 ID3D11RenderTargetView * rtv, 50 ID3D11VertexShader * vs, 51 ID3D11PixelShader * ps, 52 ID3D11InputLayout * layout, 53 ID3D11SamplerState * sampler, 54 ID3D11BlendState * blend, 55 gboolean draw_mouse); 56 57 HRESULT gst_d3d11_screen_capture_find_output_for_monitor (HMONITOR monitor, 58 IDXGIAdapter1 ** adapter, 59 IDXGIOutput ** output); 60 61 HRESULT gst_d3d11_screen_capture_find_primary_monitor (HMONITOR * monitor, 62 IDXGIAdapter1 ** adapter, 63 IDXGIOutput ** output); 64 65 HRESULT gst_d3d11_screen_capture_find_nth_monitor (guint index, 66 HMONITOR * monitor, 67 IDXGIAdapter1 ** adapter, 68 IDXGIOutput ** output); 69 70 G_END_DECLS 71 72