2019-01-30 11:07:29 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 2019 Seungha Yang <seungha.yang@navercorp.com>
|
2020-12-20 17:47:45 +00:00
|
|
|
* Copyright (C) 2020 Seungha Yang <seungha@centricular.com>
|
2019-01-30 11:07:29 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 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
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library 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.
|
|
|
|
*/
|
|
|
|
|
2020-12-20 17:47:45 +00:00
|
|
|
#ifndef __GST_D3D11_PLUGIN_UTILS_H__
|
|
|
|
#define __GST_D3D11_PLUGIN_UTILS_H__
|
2019-01-30 11:07:29 +00:00
|
|
|
|
|
|
|
#include <gst/gst.h>
|
|
|
|
#include <gst/video/video.h>
|
2020-12-20 17:47:45 +00:00
|
|
|
#include <gst/d3d11/gstd3d11.h>
|
2022-08-25 15:16:56 +00:00
|
|
|
#include <gst/d3d11/gstd3d11-private.h>
|
2023-09-30 13:21:40 +00:00
|
|
|
#include <gst/d3d11/gstd3d11device-private.h>
|
2019-01-30 11:07:29 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2020-07-11 16:22:55 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
GST_D3D11_DEVICE_VENDOR_UNKNOWN = 0,
|
|
|
|
GST_D3D11_DEVICE_VENDOR_AMD,
|
|
|
|
GST_D3D11_DEVICE_VENDOR_INTEL,
|
|
|
|
GST_D3D11_DEVICE_VENDOR_NVIDIA,
|
|
|
|
GST_D3D11_DEVICE_VENDOR_QUALCOMM,
|
|
|
|
GST_D3D11_DEVICE_VENDOR_XBOX,
|
|
|
|
} GstD3D11DeviceVendor;
|
|
|
|
|
2023-08-29 14:06:42 +00:00
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
GST_D3D11_ALPHA_MODE_UNSPECIFIED = 0,
|
|
|
|
GST_D3D11_ALPHA_MODE_PREMULTIPLIED,
|
|
|
|
GST_D3D11_ALPHA_MODE_STRAIGHT,
|
|
|
|
} GstD3D11AlphaMode;
|
|
|
|
|
|
|
|
#define GST_TYPE_D3D11_ALPHA_MODE (gst_d3d11_alpha_mode_get_type())
|
|
|
|
GType gst_d3d11_alpha_mode_get_type (void);
|
|
|
|
|
2021-01-19 17:29:43 +00:00
|
|
|
void gst_d3d11_plugin_utils_init (D3D_FEATURE_LEVEL feature_level);
|
|
|
|
|
|
|
|
GstCaps * gst_d3d11_get_updated_template_caps (GstStaticCaps * template_caps);
|
|
|
|
|
2019-11-06 10:37:33 +00:00
|
|
|
gboolean gst_d3d11_is_windows_8_or_greater (void);
|
|
|
|
|
2020-07-11 16:22:55 +00:00
|
|
|
GstD3D11DeviceVendor gst_d3d11_get_device_vendor (GstD3D11Device * device);
|
2020-06-12 10:07:07 +00:00
|
|
|
|
2023-09-19 12:40:22 +00:00
|
|
|
GstD3D11DeviceVendor gst_d3d11_get_device_vendor_from_id (guint vendor_id);
|
|
|
|
|
2020-12-20 17:47:45 +00:00
|
|
|
gboolean gst_d3d11_hdr_meta_data_to_dxgi (GstVideoMasteringDisplayInfo * minfo,
|
|
|
|
GstVideoContentLightLevel * cll,
|
|
|
|
DXGI_HDR_METADATA_HDR10 * dxgi_hdr10);
|
|
|
|
|
2022-06-21 13:44:55 +00:00
|
|
|
gboolean gst_d3d11_find_swap_chain_color_space (const GstVideoInfo * info,
|
|
|
|
IDXGISwapChain3 * swapchain,
|
2022-07-16 19:48:24 +00:00
|
|
|
DXGI_COLOR_SPACE_TYPE * color_space);
|
2020-12-20 17:47:45 +00:00
|
|
|
|
2020-09-30 18:47:13 +00:00
|
|
|
GstBuffer * gst_d3d11_allocate_staging_buffer_for (GstBuffer * buffer,
|
|
|
|
const GstVideoInfo * info,
|
|
|
|
gboolean add_videometa);
|
|
|
|
|
|
|
|
gboolean gst_d3d11_buffer_copy_into (GstBuffer * dst,
|
2020-12-19 17:39:40 +00:00
|
|
|
GstBuffer * src,
|
|
|
|
const GstVideoInfo * info);
|
|
|
|
|
|
|
|
gboolean gst_is_d3d11_buffer (GstBuffer * buffer);
|
|
|
|
|
|
|
|
gboolean gst_d3d11_buffer_can_access_device (GstBuffer * buffer,
|
|
|
|
ID3D11Device * device);
|
|
|
|
|
|
|
|
gboolean gst_d3d11_buffer_map (GstBuffer * buffer,
|
|
|
|
ID3D11Device * device,
|
|
|
|
GstMapInfo info[GST_VIDEO_MAX_PLANES],
|
|
|
|
GstMapFlags flags);
|
|
|
|
|
|
|
|
gboolean gst_d3d11_buffer_unmap (GstBuffer * buffer,
|
|
|
|
GstMapInfo info[GST_VIDEO_MAX_PLANES]);
|
|
|
|
|
|
|
|
guint gst_d3d11_buffer_get_shader_resource_view (GstBuffer * buffer,
|
|
|
|
ID3D11ShaderResourceView * view[GST_VIDEO_MAX_PLANES]);
|
|
|
|
|
|
|
|
guint gst_d3d11_buffer_get_render_target_view (GstBuffer * buffer,
|
|
|
|
ID3D11RenderTargetView * view[GST_VIDEO_MAX_PLANES]);
|
2020-09-30 18:47:13 +00:00
|
|
|
|
2020-12-19 16:06:24 +00:00
|
|
|
GstBufferPool * gst_d3d11_buffer_pool_new_with_options (GstD3D11Device * device,
|
|
|
|
GstCaps * caps,
|
|
|
|
GstD3D11AllocationParams * alloc_params,
|
|
|
|
guint min_buffers,
|
|
|
|
guint max_buffers);
|
|
|
|
|
2023-09-30 13:21:40 +00:00
|
|
|
HRESULT gst_d3d11_get_pixel_shader_checker_luma (GstD3D11Device * device,
|
|
|
|
ID3D11PixelShader ** ps);
|
|
|
|
|
|
|
|
HRESULT gst_d3d11_get_pixel_shader_checker_rgb (GstD3D11Device * device,
|
|
|
|
ID3D11PixelShader ** ps);
|
|
|
|
|
|
|
|
HRESULT gst_d3d11_get_pixel_shader_checker_vuya (GstD3D11Device * device,
|
|
|
|
ID3D11PixelShader ** ps);
|
|
|
|
|
|
|
|
HRESULT gst_d3d11_get_pixel_shader_checker (GstD3D11Device * device,
|
|
|
|
ID3D11PixelShader ** ps);
|
|
|
|
|
|
|
|
HRESULT gst_d3d11_get_pixel_shader_color (GstD3D11Device * device,
|
|
|
|
ID3D11PixelShader ** ps);
|
|
|
|
|
|
|
|
HRESULT gst_d3d11_get_pixel_shader_sample_premul (GstD3D11Device * device,
|
|
|
|
ID3D11PixelShader ** ps);
|
|
|
|
|
|
|
|
HRESULT gst_d3d11_get_pixel_shader_sample (GstD3D11Device * device,
|
|
|
|
ID3D11PixelShader ** ps);
|
|
|
|
|
|
|
|
HRESULT gst_d3d11_get_pixel_shader_snow (GstD3D11Device * device,
|
|
|
|
ID3D11PixelShader ** ps);
|
|
|
|
|
|
|
|
HRESULT gst_d3d11_get_vertex_shader_color (GstD3D11Device * device,
|
|
|
|
ID3D11VertexShader ** vs,
|
|
|
|
ID3D11InputLayout ** layout);
|
|
|
|
|
|
|
|
HRESULT gst_d3d11_get_vertex_shader_coord (GstD3D11Device * device,
|
|
|
|
ID3D11VertexShader ** vs,
|
|
|
|
ID3D11InputLayout ** layout);
|
|
|
|
|
|
|
|
HRESULT gst_d3d11_get_vertex_shader_pos (GstD3D11Device * device,
|
|
|
|
ID3D11VertexShader ** vs,
|
|
|
|
ID3D11InputLayout ** layout);
|
|
|
|
|
2019-01-30 11:07:29 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
2020-12-20 17:47:45 +00:00
|
|
|
#endif /* __GST_D3D11_PLUGIN_UTILS_H__ */
|