2 * Copyright (C) 2021 Intel Corporation
3 * Author: He Junyan <junyan.he@intel.com>
4 * Author: Víctor Jáquez <vjaquez@igalia.com>
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.
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.
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.
24 #include <gst/va/gstva.h>
25 #include <gst/video/video.h>
30 #define GST_TYPE_VA_ENCODER (gst_va_encoder_get_type())
31 G_DECLARE_FINAL_TYPE (GstVaEncoder, gst_va_encoder, GST, VA_ENCODER, GstObject);
33 typedef struct _GstVaEncodePicture GstVaEncodePicture;
34 struct _GstVaEncodePicture
36 GstVaDisplay *display;
38 /* picture parameters */
41 GstBuffer *raw_buffer;
42 GstBuffer *reconstruct_buffer;
44 VABufferID coded_buffer;
47 gboolean gst_va_encoder_is_open (GstVaEncoder * self);
48 gboolean gst_va_encoder_open (GstVaEncoder * self,
50 GstVideoFormat video_format,
55 guint max_reconstruct_surfaces,
57 guint32 packed_headers);
58 gboolean gst_va_encoder_close (GstVaEncoder * self);
59 gboolean gst_va_encoder_get_reconstruct_pool_config (GstVaEncoder * self,
61 guint * max_surfaces);
62 gboolean gst_va_encoder_has_profile (GstVaEncoder * self,
64 gint gst_va_encoder_get_max_slice_num (GstVaEncoder * self,
66 VAEntrypoint entrypoint);
67 gint32 gst_va_encoder_get_slice_structure (GstVaEncoder * self,
69 VAEntrypoint entrypoint);
70 gboolean gst_va_encoder_get_max_num_reference (GstVaEncoder * self,
72 VAEntrypoint entrypoint,
75 guint gst_va_encoder_get_prediction_direction (GstVaEncoder * self,
77 VAEntrypoint entrypoint);
78 guint32 gst_va_encoder_get_rate_control_mode (GstVaEncoder * self,
80 VAEntrypoint entrypoint);
81 guint32 gst_va_encoder_get_quality_level (GstVaEncoder * self,
83 VAEntrypoint entrypoint);
84 gboolean gst_va_encoder_has_trellis (GstVaEncoder * self,
86 VAEntrypoint entrypoint);
87 gboolean gst_va_encoder_has_tile (GstVaEncoder * self,
89 VAEntrypoint entrypoint);
90 guint32 gst_va_encoder_get_rtformat (GstVaEncoder * self,
92 VAEntrypoint entrypoint);
93 gboolean gst_va_encoder_get_packed_headers (GstVaEncoder * self,
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,
104 gboolean gst_va_encoder_add_packed_header (GstVaEncoder * self,
105 GstVaEncodePicture * pic,
109 gboolean has_emulation_bytes);
110 GstVaEncoder * gst_va_encoder_new (GstVaDisplay * display,
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);
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);