d3d11: Update library doc
[platform/upstream/gstreamer.git] / subprojects / gst-plugins-bad / gst-libs / gst / d3d11 / gstd3d11converter.h
1 /* GStreamer
2  * Copyright (C) <2019> Seungha Yang <seungha.yang@navercorp.com>
3  * Copyright (C) <2022> 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_fwd.h>
26
27 G_BEGIN_DECLS
28
29 #define GST_TYPE_D3D11_CONVERTER             (gst_d3d11_converter_get_type())
30 #define GST_D3D11_CONVERTER(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_D3D11_CONVERTER,GstD3D11Converter))
31 #define GST_D3D11_CONVERTER_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_D3D11_CONVERTER,GstD3D11ConverterClass))
32 #define GST_D3D11_CONVERTER_GET_CLASS(obj)   (GST_D3D11_CONVERTER_CLASS(G_OBJECT_GET_CLASS(obj)))
33 #define GST_IS_D3D11_CONVERTER(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_D3D11_CONVERTER))
34 #define GST_IS_D3D11_CONVERTER_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_D3D11_CONVERTER))
35 #define GST_D3D11_CONVERTER_CAST(obj)        ((GstD3D11Converter*)(obj))
36
37 /**
38  * GstD3D11ConverterBackend:
39  * @GST_D3D11_CONVERTER_BACKEND_SHADER: Performs conversion using pixel shader
40  * @GST_D3D11_CONVERTER_BACKEND_VIDEO_PROCESSOR: Performs conversion using video processor
41  *
42  * Since: 1.22
43  */
44 typedef enum
45 {
46   GST_D3D11_CONVERTER_BACKEND_SHADER = (1 << 0),
47   GST_D3D11_CONVERTER_BACKEND_VIDEO_PROCESSOR = (1 << 1),
48 } GstD3D11ConverterBackend;
49
50 GST_D3D11_API
51 GType gst_d3d11_converter_backend_get_type (void);
52 #define GST_TYPE_D3D11_CONVERTER_BACKEND (gst_d3d11_converter_backend_get_type())
53
54 /**
55  * GST_D3D11_CONVERTER_OPT_BACKEND:
56  *
57  * #GstD3D11ConverterBackend, the conversion backend
58  * (e.g., pixel shader and/or video processor) to use
59  *
60  * Since: 1.22
61  */
62 #define GST_D3D11_CONVERTER_OPT_BACKEND "GstD3D11Converter.backend"
63
64 /**
65  * GST_D3D11_CONVERTER_OPT_GAMMA_MODE:
66  *
67  * #GstVideoGammaMode, set the gamma mode.
68  * Default is #GST_VIDEO_GAMMA_MODE_NONE
69  *
70  * Since: 1.22
71  */
72 #define GST_D3D11_CONVERTER_OPT_GAMMA_MODE "GstD3D11Converter.gamma-mode"
73
74 /**
75  * GST_D3D11_CONVERTER_OPT_PRIMARIES_MODE:
76  *
77  * #GstVideoPrimariesMode, set the primaries conversion mode.
78  * Default is #GST_VIDEO_PRIMARIES_MODE_NONE.
79  *
80  * Since: 1.22
81  */
82 #define GST_D3D11_CONVERTER_OPT_PRIMARIES_MODE "GstD3D11Converter.primaries-mode"
83
84 /**
85  * GstD3D11Converter:
86  *
87  * Opaque GstD3D11Converter struct
88  *
89  * Since: 1.22
90  */
91 struct _GstD3D11Converter
92 {
93   GstObject parent;
94
95   GstD3D11Device *device;
96
97   /*< private >*/
98   GstD3D11ConverterPrivate *priv;
99   gpointer _gst_reserved[GST_PADDING];
100 };
101
102 /**
103  * GstD3D11ConverterClass:
104  *
105  * Opaque GstD3D11ConverterClass struct
106  *
107  * Since: 1.22
108  */
109 struct _GstD3D11ConverterClass
110 {
111   GstObjectClass parent_class;
112
113   /*< private >*/
114   gpointer _gst_reserved[GST_PADDING];
115 };
116
117 GST_D3D11_API
118 GType               gst_d3d11_converter_get_type (void);
119
120 GST_D3D11_API
121 GstD3D11Converter * gst_d3d11_converter_new  (GstD3D11Device * device,
122                                               const GstVideoInfo * in_info,
123                                               const GstVideoInfo * out_info,
124                                               GstStructure * config);
125
126 GST_D3D11_API
127 gboolean            gst_d3d11_converter_convert_buffer (GstD3D11Converter * converter,
128                                                         GstBuffer * in_buf,
129                                                         GstBuffer * out_buf);
130
131 GST_D3D11_API
132 gboolean            gst_d3d11_converter_convert_buffer_unlocked (GstD3D11Converter * converter,
133                                                                  GstBuffer * in_buf,
134                                                                  GstBuffer * out_buf);
135
136 G_END_DECLS