va: Fix struct empty initialization syntax
[platform/upstream/gstreamer.git] / subprojects / gst-plugins-bad / sys / va / gstvaencoder.h
1 /* GStreamer
2  *  Copyright (C) 2021 Intel Corporation
3  *     Author: He Junyan <junyan.he@intel.com>
4  *     Author: Víctor Jáquez <vjaquez@igalia.com>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21
22 #pragma once
23
24 #include <gst/va/gstva.h>
25 #include <gst/video/video.h>
26 #include <va/va.h>
27
28 G_BEGIN_DECLS
29
30 #define GST_TYPE_VA_ENCODER (gst_va_encoder_get_type())
31 G_DECLARE_FINAL_TYPE (GstVaEncoder, gst_va_encoder, GST, VA_ENCODER, GstObject);
32
33 typedef struct _GstVaEncodePicture GstVaEncodePicture;
34 struct _GstVaEncodePicture
35 {
36   GstVaDisplay *display;
37
38   /* picture parameters */
39   GArray *params;
40
41   GstBuffer *raw_buffer;
42   GstBuffer *reconstruct_buffer;
43
44   VABufferID coded_buffer;
45 };
46
47 gboolean              gst_va_encoder_is_open              (GstVaEncoder * self);
48 gboolean              gst_va_encoder_open                 (GstVaEncoder * self,
49                                                            VAProfile profile,
50                                                            GstVideoFormat video_format,
51                                                            guint rt_format,
52                                                            gint coded_width,
53                                                            gint coded_height,
54                                                            gint codedbuf_size,
55                                                            guint max_reconstruct_surfaces,
56                                                            guint rc_ctrl,
57                                                            guint32 packed_headers);
58 gboolean              gst_va_encoder_close                (GstVaEncoder * self);
59 gboolean              gst_va_encoder_get_reconstruct_pool_config (GstVaEncoder * self,
60                                                                   GstCaps ** caps,
61                                                                   guint * max_surfaces);
62 gboolean              gst_va_encoder_has_profile          (GstVaEncoder * self,
63                                                            VAProfile profile);
64 gint                  gst_va_encoder_get_max_slice_num    (GstVaEncoder * self,
65                                                            VAProfile profile,
66                                                            VAEntrypoint entrypoint);
67 gint32                gst_va_encoder_get_slice_structure  (GstVaEncoder * self,
68                                                            VAProfile profile,
69                                                            VAEntrypoint entrypoint);
70 gboolean              gst_va_encoder_get_max_num_reference (GstVaEncoder * self,
71                                                             VAProfile profile,
72                                                             VAEntrypoint entrypoint,
73                                                             guint32 * list0,
74                                                             guint32 * list1);
75 guint                 gst_va_encoder_get_prediction_direction (GstVaEncoder * self,
76                                                                VAProfile profile,
77                                                                VAEntrypoint entrypoint);
78 guint32               gst_va_encoder_get_rate_control_mode (GstVaEncoder * self,
79                                                             VAProfile profile,
80                                                             VAEntrypoint entrypoint);
81 guint32               gst_va_encoder_get_quality_level    (GstVaEncoder * self,
82                                                            VAProfile profile,
83                                                            VAEntrypoint entrypoint);
84 gboolean              gst_va_encoder_has_trellis          (GstVaEncoder * self,
85                                                            VAProfile profile,
86                                                            VAEntrypoint entrypoint);
87 gboolean              gst_va_encoder_has_tile             (GstVaEncoder * self,
88                                                            VAProfile profile,
89                                                            VAEntrypoint entrypoint);
90 guint32               gst_va_encoder_get_rtformat         (GstVaEncoder * self,
91                                                            VAProfile profile,
92                                                            VAEntrypoint entrypoint);
93 gboolean               gst_va_encoder_get_packed_headers  (GstVaEncoder * self,
94                                                            VAProfile profile,
95                                                            VAEntrypoint entrypoint,
96                                                            guint32 * packed_headers);
97 gboolean              gst_va_encoder_get_rate_control_enum (GstVaEncoder * self,
98                                                             GEnumValue ratectl[16]);
99 gboolean              gst_va_encoder_add_param            (GstVaEncoder * self,
100                                                            GstVaEncodePicture * pic,
101                                                            VABufferType type,
102                                                            gpointer data,
103                                                            gsize size);
104 gboolean              gst_va_encoder_add_packed_header    (GstVaEncoder * self,
105                                                            GstVaEncodePicture * pic,
106                                                            gint type,
107                                                            gpointer data,
108                                                            gsize size_in_bits,
109                                                            gboolean has_emulation_bytes);
110 GstVaEncoder *        gst_va_encoder_new                  (GstVaDisplay * display,
111                                                            guint32 codec,
112                                                            VAEntrypoint entrypoint);
113 GArray *              gst_va_encoder_get_surface_formats  (GstVaEncoder * self);
114 GstCaps *             gst_va_encoder_get_sinkpad_caps     (GstVaEncoder * self);
115 GstCaps *             gst_va_encoder_get_srcpad_caps      (GstVaEncoder * self);
116 gboolean              gst_va_encoder_encode               (GstVaEncoder * self,
117                                                            GstVaEncodePicture * pic);
118
119 GstVaEncodePicture *  gst_va_encode_picture_new           (GstVaEncoder * self,
120                                                            GstBuffer * raw_buffer);
121 void                  gst_va_encode_picture_free          (GstVaEncodePicture * pic);
122 VASurfaceID           gst_va_encode_picture_get_raw_surface (GstVaEncodePicture * pic);
123 VASurfaceID           gst_va_encode_picture_get_reconstruct_surface (GstVaEncodePicture * pic);
124
125 G_END_DECLS