• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* GStreamer
2  * Copyright (C) 2019 Seungha Yang <seungha.yang@navercorp.com>
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 #ifndef __GST_D3D11_DEVICE_H__
22 #define __GST_D3D11_DEVICE_H__
23 
24 #include <gst/gst.h>
25 #include <gst/video/video.h>
26 #include <gst/d3d11/gstd3d11_fwd.h>
27 
28 G_BEGIN_DECLS
29 
30 #define GST_TYPE_D3D11_DEVICE             (gst_d3d11_device_get_type())
31 #define GST_D3D11_DEVICE(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_D3D11_DEVICE,GstD3D11Device))
32 #define GST_D3D11_DEVICE_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_D3D11_DEVICE,GstD3D11DeviceClass))
33 #define GST_D3D11_DEVICE_GET_CLASS(obj)   (GST_D3D11_DEVICE_CLASS(G_OBJECT_GET_CLASS(obj)))
34 #define GST_IS_D3D11_DEVICE(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_D3D11_DEVICE))
35 #define GST_IS_D3D11_DEVICE_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_D3D11_DEVICE))
36 #define GST_D3D11_DEVICE_CAST(obj)        ((GstD3D11Device*)(obj))
37 
38 #define GST_D3D11_DEVICE_HANDLE_CONTEXT_TYPE "gst.d3d11.device.handle"
39 
40 struct _GstD3D11Device
41 {
42   GstObject parent;
43 
44   GstD3D11DevicePrivate *priv;
45 
46   /*< private >*/
47   gpointer _gst_reserved[GST_PADDING];
48 };
49 
50 struct _GstD3D11DeviceClass
51 {
52   GstObjectClass parent_class;
53 
54   /*< private >*/
55   gpointer _gst_reserved[GST_PADDING];
56 };
57 
58 GST_D3D11_API
59 GType                 gst_d3d11_device_get_type           (void);
60 
61 GST_D3D11_API
62 GstD3D11Device *      gst_d3d11_device_new                (guint adapter_index,
63                                                            guint flags);
64 
65 GST_D3D11_API
66 GstD3D11Device *      gst_d3d11_device_new_for_adapter_luid (gint64 adapter_luid,
67                                                              guint flags);
68 
69 GST_D3D11_API
70 GstD3D11Device *      gst_d3d11_device_new_wrapped        (ID3D11Device * device);
71 
72 GST_D3D11_API
73 ID3D11Device *        gst_d3d11_device_get_device_handle  (GstD3D11Device * device);
74 
75 GST_D3D11_API
76 ID3D11DeviceContext * gst_d3d11_device_get_device_context_handle (GstD3D11Device * device);
77 
78 GST_D3D11_API
79 IDXGIFactory1 *       gst_d3d11_device_get_dxgi_factory_handle (GstD3D11Device * device);
80 
81 GST_D3D11_API
82 ID3D11VideoDevice *   gst_d3d11_device_get_video_device_handle (GstD3D11Device * device);
83 
84 GST_D3D11_API
85 ID3D11VideoContext *  gst_d3d11_device_get_video_context_handle (GstD3D11Device * device);
86 
87 GST_D3D11_API
88 void                  gst_d3d11_device_lock               (GstD3D11Device * device);
89 
90 GST_D3D11_API
91 void                  gst_d3d11_device_unlock             (GstD3D11Device * device);
92 
93 GST_D3D11_API
94 const GstD3D11Format * gst_d3d11_device_format_from_gst (GstD3D11Device * device,
95                                                          GstVideoFormat format);
96 
97 G_END_DECLS
98 
99 #endif /* __GST_D3D11_DEVICE_H__ */
100