2 * gstvaapidecoder_priv.h - VA decoder abstraction (private definitions)
4 * gstreamer-vaapi (C) 2010 Splitted-Desktop Systems
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program 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
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef GST_VAAPI_DECODER_PRIV_H
22 #define GST_VAAPI_DECODER_PRIV_H
25 #include <gst/gsttask.h>
26 #include <gst/vaapi/gstvaapidecoder.h>
27 #include <gst/vaapi/gstvaapicontext.h>
31 #define GST_VAAPI_DECODER_CAST(decoder) ((GstVaapiDecoder *)(decoder))
34 * GST_VAAPI_DECODER_DISPLAY:
35 * @decoder: a #GstVaapiDecoder
37 * Macro that evaluates to the #GstVaapiDisplay of @decoder.
38 * This is an internal macro that does not do any run-time type check.
40 #undef GST_VAAPI_DECODER_DISPLAY
41 #define GST_VAAPI_DECODER_DISPLAY(decoder) \
42 GST_VAAPI_DECODER_CAST(decoder)->priv->display
45 * GST_VAAPI_DECODER_CONTEXT:
46 * @decoder: a #GstVaapiDecoder
48 * Macro that evaluates to the #GstVaapiContext of @decoder.
49 * This is an internal macro that does not do any run-time type check.
51 #undef GST_VAAPI_DECODER_CONTEXT
52 #define GST_VAAPI_DECODER_CONTEXT(decoder) \
53 GST_VAAPI_DECODER_CAST(decoder)->priv->context
56 * GST_VAAPI_DECODER_CODEC:
57 * @decoder: a #GstVaapiDecoder
59 * Macro that evaluates to the #GstVaapiCodec of @decoder.
60 * This is an internal macro that does not do any run-time type check.
62 #undef GST_VAAPI_DECODER_CODEC
63 #define GST_VAAPI_DECODER_CODEC(decoder) \
64 GST_VAAPI_DECODER_CAST(decoder)->priv->codec
67 * GST_VAAPI_DECODER_CODEC_DATA:
68 * @decoder: a #GstVaapiDecoder
70 * Macro that evaluates to the #GstBuffer holding optional codec data
72 * This is an internal macro that does not do any run-time type check.
74 #undef GST_VAAPI_DECODER_CODEC_DATA
75 #define GST_VAAPI_DECODER_CODEC_DATA(decoder) \
76 GST_VAAPI_DECODER_CAST(decoder)->priv->codec_data
78 /* End-of-Stream buffer */
79 #define GST_BUFFER_FLAG_EOS (GST_BUFFER_FLAG_LAST + 0)
81 #define GST_BUFFER_IS_EOS(buffer) \
82 GST_BUFFER_FLAG_IS_SET(buffer, GST_BUFFER_FLAG_EOS)
84 #define GST_VAAPI_DECODER_GET_PRIVATE(obj) \
85 (G_TYPE_INSTANCE_GET_PRIVATE((obj), \
86 GST_VAAPI_TYPE_DECODER, \
87 GstVaapiDecoderPrivate))
89 struct _GstVaapiDecoderPrivate {
90 GstVaapiDisplay *display;
91 GstVaapiContext *context;
93 GstBuffer *codec_data;
98 GstClockTime surface_timestamp;
99 GstClockTime surface_duration;
103 gst_vaapi_decoder_ensure_context(
104 GstVaapiDecoder *decoder,
105 GstVaapiProfile profile,
106 GstVaapiEntrypoint entrypoint,
112 gst_vaapi_decoder_push_surface(
113 GstVaapiDecoder *decoder,
114 GstVaapiSurface *surface
119 #endif /* GST_VAAPI_DECODER_PRIV_H */