2 * gstvaapidecoder_priv.h - VA decoder abstraction (private definitions)
4 * Copyright (C) 2010-2011 Splitted-Desktop Systems
5 * Copyright (C) 2011-2012 Intel Corporation
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * as published by the Free Software Foundation; either version 2.1
10 * of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301 USA
23 #ifndef GST_VAAPI_DECODER_PRIV_H
24 #define GST_VAAPI_DECODER_PRIV_H
27 #include <gst/vaapi/gstvaapidecoder.h>
28 #include <gst/vaapi/gstvaapicontext.h>
32 #define GST_VAAPI_DECODER_CAST(decoder) ((GstVaapiDecoder *)(decoder))
35 * GST_VAAPI_DECODER_DISPLAY:
36 * @decoder: a #GstVaapiDecoder
38 * Macro that evaluates to the #GstVaapiDisplay of @decoder.
39 * This is an internal macro that does not do any run-time type check.
41 #undef GST_VAAPI_DECODER_DISPLAY
42 #define GST_VAAPI_DECODER_DISPLAY(decoder) \
43 GST_VAAPI_DECODER_CAST(decoder)->priv->display
46 * GST_VAAPI_DECODER_CONTEXT:
47 * @decoder: a #GstVaapiDecoder
49 * Macro that evaluates to the #GstVaapiContext of @decoder.
50 * This is an internal macro that does not do any run-time type check.
52 #undef GST_VAAPI_DECODER_CONTEXT
53 #define GST_VAAPI_DECODER_CONTEXT(decoder) \
54 GST_VAAPI_DECODER_CAST(decoder)->priv->context
57 * GST_VAAPI_DECODER_CODEC:
58 * @decoder: a #GstVaapiDecoder
60 * Macro that evaluates to the #GstVaapiCodec of @decoder.
61 * This is an internal macro that does not do any run-time type check.
63 #undef GST_VAAPI_DECODER_CODEC
64 #define GST_VAAPI_DECODER_CODEC(decoder) \
65 GST_VAAPI_DECODER_CAST(decoder)->priv->codec
68 * GST_VAAPI_DECODER_CODEC_DATA:
69 * @decoder: a #GstVaapiDecoder
71 * Macro that evaluates to the #GstBuffer holding optional codec data
73 * This is an internal macro that does not do any run-time type check.
75 #undef GST_VAAPI_DECODER_CODEC_DATA
76 #define GST_VAAPI_DECODER_CODEC_DATA(decoder) \
77 GST_VAAPI_DECODER_CAST(decoder)->priv->codec_data
80 * GST_VAAPI_DECODER_WIDTH:
81 * @decoder: a #GstVaapiDecoder
83 * Macro that evaluates to the coded width of the picture
84 * This is an internal macro that does not do any run-time type check.
86 #undef GST_VAAPI_DECODER_WIDTH
87 #define GST_VAAPI_DECODER_WIDTH(decoder) \
88 GST_VAAPI_DECODER_CAST(decoder)->priv->width
91 * GST_VAAPI_DECODER_HEIGHT:
92 * @decoder: a #GstVaapiDecoder
94 * Macro that evaluates to the coded height of the picture
95 * This is an internal macro that does not do any run-time type check.
97 #undef GST_VAAPI_DECODER_HEIGHT
98 #define GST_VAAPI_DECODER_HEIGHT(decoder) \
99 GST_VAAPI_DECODER_CAST(decoder)->priv->height
101 /* End-of-Stream buffer */
102 #define GST_BUFFER_FLAG_EOS (GST_BUFFER_FLAG_LAST + 0)
104 #define GST_BUFFER_IS_EOS(buffer) \
105 GST_BUFFER_FLAG_IS_SET(buffer, GST_BUFFER_FLAG_EOS)
107 #define GST_VAAPI_DECODER_GET_PRIVATE(obj) \
108 (G_TYPE_INSTANCE_GET_PRIVATE((obj), \
109 GST_VAAPI_TYPE_DECODER, \
110 GstVaapiDecoderPrivate))
112 /* Number of scratch surfaces beyond those used as reference */
113 /* 5 = 2 + 4; 2 for reference, 4 for scratch*/
114 #define GST_DECODER_DEFAULT_SURFACES_COUNT 6
116 struct _GstVaapiDecoderPrivate {
117 GstVaapiDisplay *display;
118 VADisplay va_display;
119 GstVaapiContext *context;
120 VAContextID va_context;
123 GstBuffer *codec_data;
132 guint is_interlaced : 1;
137 gst_vaapi_decoder_set_picture_size(
138 GstVaapiDecoder *decoder,
145 gst_vaapi_decoder_set_framerate(
146 GstVaapiDecoder *decoder,
153 gst_vaapi_decoder_set_pixel_aspect_ratio(
154 GstVaapiDecoder *decoder,
161 gst_vaapi_decoder_set_interlaced(GstVaapiDecoder *decoder, gboolean interlaced);
165 gst_vaapi_decoder_ensure_context(
166 GstVaapiDecoder *decoder,
167 GstVaapiProfile profile,
168 GstVaapiEntrypoint entrypoint,
176 gst_vaapi_decoder_push_buffer_sub(
177 GstVaapiDecoder *decoder,
185 gst_vaapi_decoder_push_surface_proxy(
186 GstVaapiDecoder *decoder,
187 GstVaapiSurfaceProxy *proxy
191 GstVaapiDecoderStatus
192 gst_vaapi_decoder_check_status(GstVaapiDecoder *decoder);
196 #endif /* GST_VAAPI_DECODER_PRIV_H */