2 * Copyright (C) 2019 Seungha Yang <seungha.yang@navercorp.com>
3 * Copyright (C) 2020 Seungha Yang <seungha@centricular.com>
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.
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.
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.
21 #ifndef __GST_D3D11_PLUGIN_UTILS_H__
22 #define __GST_D3D11_PLUGIN_UTILS_H__
25 #include <gst/video/video.h>
26 #include <gst/d3d11/gstd3d11.h>
27 #include <gst/d3d11/gstd3d11-private.h>
33 GST_D3D11_DEVICE_VENDOR_UNKNOWN = 0,
34 GST_D3D11_DEVICE_VENDOR_AMD,
35 GST_D3D11_DEVICE_VENDOR_INTEL,
36 GST_D3D11_DEVICE_VENDOR_NVIDIA,
37 GST_D3D11_DEVICE_VENDOR_QUALCOMM,
38 GST_D3D11_DEVICE_VENDOR_XBOX,
39 } GstD3D11DeviceVendor;
41 void gst_d3d11_plugin_utils_init (D3D_FEATURE_LEVEL feature_level);
43 GstCaps * gst_d3d11_get_updated_template_caps (GstStaticCaps * template_caps);
45 gboolean gst_d3d11_is_windows_8_or_greater (void);
47 GstD3D11DeviceVendor gst_d3d11_get_device_vendor (GstD3D11Device * device);
49 gboolean gst_d3d11_hdr_meta_data_to_dxgi (GstVideoMasteringDisplayInfo * minfo,
50 GstVideoContentLightLevel * cll,
51 DXGI_HDR_METADATA_HDR10 * dxgi_hdr10);
53 gboolean gst_d3d11_find_swap_chain_color_space (const GstVideoInfo * info,
54 IDXGISwapChain3 * swapchain,
55 DXGI_COLOR_SPACE_TYPE * color_space);
57 GstBuffer * gst_d3d11_allocate_staging_buffer_for (GstBuffer * buffer,
58 const GstVideoInfo * info,
59 gboolean add_videometa);
61 gboolean gst_d3d11_buffer_copy_into (GstBuffer * dst,
63 const GstVideoInfo * info);
65 gboolean gst_is_d3d11_buffer (GstBuffer * buffer);
67 gboolean gst_d3d11_buffer_can_access_device (GstBuffer * buffer,
68 ID3D11Device * device);
70 gboolean gst_d3d11_buffer_map (GstBuffer * buffer,
71 ID3D11Device * device,
72 GstMapInfo info[GST_VIDEO_MAX_PLANES],
75 gboolean gst_d3d11_buffer_unmap (GstBuffer * buffer,
76 GstMapInfo info[GST_VIDEO_MAX_PLANES]);
78 guint gst_d3d11_buffer_get_shader_resource_view (GstBuffer * buffer,
79 ID3D11ShaderResourceView * view[GST_VIDEO_MAX_PLANES]);
81 guint gst_d3d11_buffer_get_render_target_view (GstBuffer * buffer,
82 ID3D11RenderTargetView * view[GST_VIDEO_MAX_PLANES]);
84 GstBufferPool * gst_d3d11_buffer_pool_new_with_options (GstD3D11Device * device,
86 GstD3D11AllocationParams * alloc_params,
92 #endif /* __GST_D3D11_PLUGIN_UTILS_H__ */