2023-09-10 14:34:26 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 2023 Seungha Yang <seungha@centricular.com>
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
|
|
|
#include <gst/video/video.h>
|
2024-03-31 12:55:51 +00:00
|
|
|
#include <gst/d3d12/gstd3d12_fwd.h>
|
2023-09-10 14:34:26 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
#define GST_TYPE_D3D12_DEVICE (gst_d3d12_device_get_type())
|
|
|
|
#define GST_D3D12_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_D3D12_DEVICE,GstD3D12Device))
|
|
|
|
#define GST_D3D12_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_D3D12_DEVICE,GstD3D12DeviceClass))
|
|
|
|
#define GST_D3D12_DEVICE_GET_CLASS(obj) (GST_D3D12_DEVICE_CLASS(G_OBJECT_GET_CLASS(obj)))
|
|
|
|
#define GST_IS_D3D12_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_D3D12_DEVICE))
|
|
|
|
#define GST_IS_D3D12_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_D3D12_DEVICE))
|
|
|
|
#define GST_D3D12_DEVICE_CAST(obj) ((GstD3D12Device*)(obj))
|
|
|
|
|
|
|
|
#define GST_D3D12_DEVICE_HANDLE_CONTEXT_TYPE "gst.d3d12.device.handle"
|
|
|
|
|
2024-03-31 12:55:51 +00:00
|
|
|
/**
|
|
|
|
* GstD3D12Device:
|
|
|
|
*
|
|
|
|
* Opaque GstD3D12Device struct
|
|
|
|
*
|
|
|
|
* Since: 1.26
|
|
|
|
*/
|
2023-09-10 14:34:26 +00:00
|
|
|
struct _GstD3D12Device
|
|
|
|
{
|
|
|
|
GstObject parent;
|
|
|
|
|
|
|
|
/*< private >*/
|
|
|
|
GstD3D12DevicePrivate *priv;
|
|
|
|
gpointer _gst_reserved[GST_PADDING];
|
|
|
|
};
|
|
|
|
|
2024-03-31 12:55:51 +00:00
|
|
|
/**
|
|
|
|
* GstD3D12DeviceClass:
|
|
|
|
*
|
|
|
|
* Opaque GstD3D12DeviceClass struct
|
|
|
|
*
|
|
|
|
* Since: 1.26
|
|
|
|
*/
|
2023-09-10 14:34:26 +00:00
|
|
|
struct _GstD3D12DeviceClass
|
|
|
|
{
|
|
|
|
GstObjectClass parent_class;
|
|
|
|
|
|
|
|
/*< private >*/
|
|
|
|
gpointer _gst_reserved[GST_PADDING];
|
|
|
|
};
|
|
|
|
|
2024-03-31 12:55:51 +00:00
|
|
|
GST_D3D12_API
|
2023-09-10 14:34:26 +00:00
|
|
|
GType gst_d3d12_device_get_type (void);
|
|
|
|
|
2024-03-31 12:55:51 +00:00
|
|
|
GST_D3D12_API
|
2023-09-10 14:34:26 +00:00
|
|
|
GstD3D12Device * gst_d3d12_device_new (guint adapter_index);
|
|
|
|
|
2024-03-31 12:55:51 +00:00
|
|
|
GST_D3D12_API
|
2023-09-10 14:34:26 +00:00
|
|
|
GstD3D12Device * gst_d3d12_device_new_for_adapter_luid (gint64 adapter_luid);
|
|
|
|
|
2024-03-31 12:55:51 +00:00
|
|
|
GST_D3D12_API
|
2023-09-10 14:34:26 +00:00
|
|
|
ID3D12Device * gst_d3d12_device_get_device_handle (GstD3D12Device * device);
|
|
|
|
|
2024-03-31 12:55:51 +00:00
|
|
|
GST_D3D12_API
|
2023-09-10 14:34:26 +00:00
|
|
|
IDXGIAdapter1 * gst_d3d12_device_get_adapter_handle (GstD3D12Device * device);
|
|
|
|
|
2024-03-31 12:55:51 +00:00
|
|
|
GST_D3D12_API
|
2023-09-10 14:34:26 +00:00
|
|
|
IDXGIFactory2 * gst_d3d12_device_get_factory_handle (GstD3D12Device * device);
|
|
|
|
|
2024-06-18 15:57:11 +00:00
|
|
|
GST_D3D12_API
|
|
|
|
ID3D12Fence * gst_d3d12_device_get_fence_handle (GstD3D12Device * device,
|
|
|
|
D3D12_COMMAND_LIST_TYPE queue_type);
|
|
|
|
|
2024-03-31 12:55:51 +00:00
|
|
|
GST_D3D12_API
|
2023-09-17 15:44:10 +00:00
|
|
|
gboolean gst_d3d12_device_get_format (GstD3D12Device * device,
|
2023-09-10 14:34:26 +00:00
|
|
|
GstVideoFormat format,
|
|
|
|
GstD3D12Format * device_format);
|
|
|
|
|
2024-03-31 12:55:51 +00:00
|
|
|
GST_D3D12_API
|
2023-12-25 07:14:39 +00:00
|
|
|
GstD3D12CommandQueue * gst_d3d12_device_get_command_queue (GstD3D12Device * device,
|
|
|
|
D3D12_COMMAND_LIST_TYPE queue_type);
|
|
|
|
|
2024-03-31 12:55:51 +00:00
|
|
|
GST_D3D12_API
|
2024-06-18 12:48:11 +00:00
|
|
|
HRESULT gst_d3d12_device_execute_command_lists (GstD3D12Device * device,
|
2023-12-25 07:14:39 +00:00
|
|
|
D3D12_COMMAND_LIST_TYPE queue_type,
|
|
|
|
guint num_command_lists,
|
|
|
|
ID3D12CommandList ** command_lists,
|
|
|
|
guint64 * fence_value);
|
|
|
|
|
2024-03-31 12:55:51 +00:00
|
|
|
GST_D3D12_API
|
2023-12-25 07:14:39 +00:00
|
|
|
guint64 gst_d3d12_device_get_completed_value (GstD3D12Device * device,
|
|
|
|
D3D12_COMMAND_LIST_TYPE queue_type);
|
|
|
|
|
2024-03-31 12:55:51 +00:00
|
|
|
GST_D3D12_API
|
2023-12-25 07:14:39 +00:00
|
|
|
gboolean gst_d3d12_device_set_fence_notify (GstD3D12Device * device,
|
|
|
|
D3D12_COMMAND_LIST_TYPE queue_type,
|
|
|
|
guint64 fence_value,
|
2024-06-18 13:59:17 +00:00
|
|
|
gpointer fence_data,
|
|
|
|
GDestroyNotify notify);
|
2023-12-25 07:14:39 +00:00
|
|
|
|
2024-03-31 12:55:51 +00:00
|
|
|
GST_D3D12_API
|
2024-06-18 12:48:11 +00:00
|
|
|
HRESULT gst_d3d12_device_fence_wait (GstD3D12Device * device,
|
2023-12-25 07:14:39 +00:00
|
|
|
D3D12_COMMAND_LIST_TYPE queue_type,
|
|
|
|
guint64 fence_value,
|
|
|
|
HANDLE event_handle);
|
|
|
|
|
2024-03-31 12:55:51 +00:00
|
|
|
GST_D3D12_API
|
2024-03-31 09:42:41 +00:00
|
|
|
gboolean gst_d3d12_device_is_equal (GstD3D12Device * device1,
|
|
|
|
GstD3D12Device * device2);
|
|
|
|
|
2023-09-10 14:34:26 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|