2 * gstvaapitypes.h - Basic types
4 * Copyright (C) 2010-2011 Splitted-Desktop Systems
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public License
8 * as published by the Free Software Foundation; either version 2.1
9 * 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 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free
18 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301 USA
22 #ifndef GST_VAAPI_TYPES_H
23 #define GST_VAAPI_TYPES_H
32 * An integer large enough to hold a generic VA id or a pointer
35 #if defined(GLIB_SIZEOF_VOID_P)
36 # define GST_VAAPI_TYPE_ID_SIZE GLIB_SIZEOF_VOID_P
37 #elif G_MAXULONG == 0xffffffff
38 # define GST_VAAPI_TYPE_ID_SIZE 4
39 #elif G_MAXULONG == 0xffffffffffffffffull
40 # define GST_VAAPI_TYPE_ID_SIZE 8
42 # error "could not determine size of GstVaapiID"
44 #if GST_VAAPI_TYPE_ID_SIZE == 4
45 typedef guint32 GstVaapiID;
46 #elif GST_VAAPI_TYPE_ID_SIZE == 8
47 typedef guint64 GstVaapiID;
49 # error "unsupported value for GST_VAAPI_TYPE_ID_SIZE"
54 * @id: an arbitrary integer value
56 * Macro that creates a #GstVaapiID from @id.
58 #define GST_VAAPI_ID(id) ((GstVaapiID)(id))
63 * Macro that evaluates to the default #GstVaapiID value.
65 #define GST_VAAPI_ID_NONE GST_VAAPI_ID(0)
68 * GST_VAAPI_ID_FORMAT:
70 * Can be used together with #GST_VAAPI_ID_ARGS to properly output an
71 * integer value in a printf()-style text message.
74 * printf("id: %" GST_VAAPI_ID_FORMAT "\n", GST_VAAPI_ID_ARGS(id));
78 #define GST_VAAPI_ID_FORMAT "p"
84 * Can be used together with #GST_VAAPI_ID_FORMAT to properly output
85 * an integer value in a printf()-style text message.
87 #define GST_VAAPI_ID_ARGS(id) GUINT_TO_POINTER(id)
94 * A location within a surface.
96 typedef struct _GstVaapiPoint GstVaapiPoint;
97 struct _GstVaapiPoint {
106 * @width: region width
107 * @height: region height
109 * A rectangle region within a surface.
111 typedef struct _GstVaapiRectangle GstVaapiRectangle;
112 struct _GstVaapiRectangle {
120 * GstVaapiRenderMode:
121 * @GST_VAAPI_RENDER_MODE_OVERLAY: in this mode, the VA display
122 * backend renders surfaces with an overlay engine. This means that
123 * the surface that is currently displayed shall not be re-used
124 * right away for decoding. i.e. it needs to be retained further,
125 * until the next surface is to be displayed.
126 * @GST_VAAPI_RENDER_MODE_TEXTURE: in this modem the VA display
127 * backend renders surfaces with a textured blit (GPU/3D engine).
128 * This means that the surface is copied to some intermediate
129 * backing store, or back buffer of a frame buffer, and is free to
130 * be re-used right away for decoding.
132 typedef enum _GstVaapiRenderMode GstVaapiRenderMode;
133 enum _GstVaapiRenderMode {
134 GST_VAAPI_RENDER_MODE_OVERLAY = 1,
135 GST_VAAPI_RENDER_MODE_TEXTURE
140 * @GST_VAAPI_ROTATION_0: the VA display is not rotated.
141 * @GST_VAAPI_ROTATION_90: the VA display is rotated by 90°, clockwise.
142 * @GST_VAAPI_ROTATION_180: the VA display is rotated by 180°, clockwise.
143 * @GST_VAAPI_ROTATION_270: the VA display is rotated by 270°, clockwise.
145 typedef enum _GstVaapiRotation GstVaapiRotation;
146 enum _GstVaapiRotation {
147 GST_VAAPI_ROTATION_0 = 0,
148 GST_VAAPI_ROTATION_90 = 90,
149 GST_VAAPI_ROTATION_180 = 180,
150 GST_VAAPI_ROTATION_270 = 270,
154 * GstVaapiRateControl:
155 * @GST_VAAPI_RATECONTROL_NONE: None rate control
156 * @GST_VAAPI_RATECONTROL_CBR: Constant rate control
157 * @GST_VAAPI_RATECONTROL_VBR: Variable bitrate control
158 * @GST_VAAPI_RATECONTROL_VCM: Video conference mode
159 * @GST_VAAPI_RATECONTROL_CQP: Variable bitrate control
160 * @GST_VAAPI_RATECONTROL_VBR_CONSTRAINED: Variable bitrate control with peak rate higher than average bitrate
162 * The set of all rate-controls for #GstVaapiRateControl, only worked on encoders
165 GST_VAAPI_RATECONTROL_NONE = 0,
166 GST_VAAPI_RATECONTROL_CBR,
167 GST_VAAPI_RATECONTROL_VBR,
168 GST_VAAPI_RATECONTROL_VCM,
169 GST_VAAPI_RATECONTROL_CQP,
170 GST_VAAPI_RATECONTROL_VBR_CONSTRAINED,
171 } GstVaapiRateControl;
175 #endif /* GST_VAAPI_TYPES_H */