2 * Copyright (C) <2019> Seungha Yang <seungha.yang@navercorp.com>
3 * Copyright (C) <2022> 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.
24 #include <gst/video/video.h>
25 #include <gst/d3d11/gstd3d11_fwd.h>
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))
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
46 GST_D3D11_CONVERTER_BACKEND_SHADER = (1 << 0),
47 GST_D3D11_CONVERTER_BACKEND_VIDEO_PROCESSOR = (1 << 1),
48 } GstD3D11ConverterBackend;
51 GType gst_d3d11_converter_backend_get_type (void);
52 #define GST_TYPE_D3D11_CONVERTER_BACKEND (gst_d3d11_converter_backend_get_type())
55 * GST_D3D11_CONVERTER_OPT_BACKEND:
57 * #GstD3D11ConverterBackend, the conversion backend
58 * (e.g., pixel shader and/or video processor) to use
62 #define GST_D3D11_CONVERTER_OPT_BACKEND "GstD3D11Converter.backend"
65 * GST_D3D11_CONVERTER_OPT_GAMMA_MODE:
67 * #GstVideoGammaMode, set the gamma mode.
68 * Default is #GST_VIDEO_GAMMA_MODE_NONE
72 #define GST_D3D11_CONVERTER_OPT_GAMMA_MODE "GstD3D11Converter.gamma-mode"
75 * GST_D3D11_CONVERTER_OPT_PRIMARIES_MODE:
77 * #GstVideoPrimariesMode, set the primaries conversion mode.
78 * Default is #GST_VIDEO_PRIMARIES_MODE_NONE.
82 #define GST_D3D11_CONVERTER_OPT_PRIMARIES_MODE "GstD3D11Converter.primaries-mode"
87 * Opaque GstD3D11Converter struct
91 struct _GstD3D11Converter
95 GstD3D11Device *device;
98 GstD3D11ConverterPrivate *priv;
99 gpointer _gst_reserved[GST_PADDING];
103 * GstD3D11ConverterClass:
105 * Opaque GstD3D11ConverterClass struct
109 struct _GstD3D11ConverterClass
111 GstObjectClass parent_class;
114 gpointer _gst_reserved[GST_PADDING];
118 GType gst_d3d11_converter_get_type (void);
121 GstD3D11Converter * gst_d3d11_converter_new (GstD3D11Device * device,
122 const GstVideoInfo * in_info,
123 const GstVideoInfo * out_info,
124 GstStructure * config);
127 gboolean gst_d3d11_converter_convert_buffer (GstD3D11Converter * converter,
129 GstBuffer * out_buf);
132 gboolean gst_d3d11_converter_convert_buffer_unlocked (GstD3D11Converter * converter,
134 GstBuffer * out_buf);