2 * gstvaapidecoder_dpb.h - Decoded Picture Buffer
4 * Copyright (C) 2012 Intel Corporation
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_DECODER_DPB_H
23 #define GST_VAAPI_DECODER_DPB_H
25 #include <gst/vaapi/gstvaapidecoder_objects.h>
29 typedef struct _GstVaapiDpb GstVaapiDpb;
30 typedef struct _GstVaapiDpbClass GstVaapiDpbClass;
31 typedef struct _GstVaapiDpb2 GstVaapiDpb2;
32 typedef struct _GstVaapiDpb2Class GstVaapiDpb2Class;
34 /* ------------------------------------------------------------------------- */
35 /* --- Base Decoded Picture Buffer --- */
36 /* ------------------------------------------------------------------------- */
38 #define GST_VAAPI_TYPE_DPB \
39 (gst_vaapi_dpb_get_type())
41 #define GST_VAAPI_DPB_CAST(obj) \
42 ((GstVaapiDpb *)(obj))
44 #define GST_VAAPI_DPB(obj) \
45 (G_TYPE_CHECK_INSTANCE_CAST((obj), \
49 #define GST_VAAPI_DPB_CLASS(klass) \
50 (G_TYPE_CHECK_CLASS_CAST((klass), \
54 #define GST_VAAPI_IS_DPB(obj) \
55 (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_VAAPI_TYPE_DPB))
57 #define GST_VAAPI_IS_DPB_CLASS(klass) \
58 (G_TYPE_CHECK_CLASS_TYPE((klass), GST_VAAPI_TYPE_DPB))
60 #define GST_VAAPI_DPB_GET_CLASS(obj) \
61 (G_TYPE_INSTANCE_GET_CLASS((obj), \
68 * A decoded picture buffer (DPB) object.
72 GstMiniObject parent_instance;
75 GstVaapiPicture **pictures;
83 * The #GstVaapiDpb base class.
85 struct _GstVaapiDpbClass {
87 GstMiniObjectClass parent_class;
90 void (*flush) (GstVaapiDpb *dpb);
91 gboolean (*add) (GstVaapiDpb *dpb, GstVaapiPicture *picture);
96 gst_vaapi_dpb_get_type(void) G_GNUC_CONST;
100 gst_vaapi_dpb_flush(GstVaapiDpb *dpb);
104 gst_vaapi_dpb_add(GstVaapiDpb *dpb, GstVaapiPicture *picture);
108 gst_vaapi_dpb_size(GstVaapiDpb *dpb);
110 static inline gpointer
111 gst_vaapi_dpb_ref(gpointer ptr)
113 return gst_mini_object_ref(GST_MINI_OBJECT(ptr));
117 gst_vaapi_dpb_unref(gpointer ptr)
119 gst_mini_object_unref(GST_MINI_OBJECT(ptr));
122 /* ------------------------------------------------------------------------- */
123 /* --- Decoded Picture Buffer (optimized for 2 reference pictures) --- */
124 /* ------------------------------------------------------------------------- */
126 #define GST_VAAPI_TYPE_DPB2 \
127 (gst_vaapi_dpb2_get_type())
129 #define GST_VAAPI_DPB2_CAST(obj) \
130 ((GstVaapiDpb2 *)(obj))
132 #define GST_VAAPI_DPB2(obj) \
133 (G_TYPE_CHECK_INSTANCE_CAST((obj), \
134 GST_VAAPI_TYPE_DPB2, \
137 #define GST_VAAPI_DPB2_CLASS(klass) \
138 (G_TYPE_CHECK_CLASS_CAST((klass), \
139 GST_VAAPI_TYPE_DPB2, \
142 #define GST_VAAPI_IS_DPB2(obj) \
143 (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_VAAPI_TYPE_DPB2))
145 #define GST_VAAPI_IS_DPB2_CLASS(klass) \
146 (G_TYPE_CHECK_CLASS_TYPE((klass), GST_VAAPI_TYPE_DPB2))
148 #define GST_VAAPI_DPB2_GET_CLASS(obj) \
149 (G_TYPE_INSTANCE_GET_CLASS((obj), \
150 GST_VAAPI_TYPE_DPB2, \
156 * A decoded picture buffer (DPB2) object.
158 struct _GstVaapiDpb2 {
160 GstVaapiDpb parent_instance;
166 * The #GstVaapiDpb2 base class.
168 struct _GstVaapiDpb2Class {
170 GstVaapiDpbClass parent_class;
175 gst_vaapi_dpb2_get_type(void) G_GNUC_CONST;
179 gst_vaapi_dpb2_new(void);
183 gst_vaapi_dpb2_get_references(
185 GstVaapiPicture *picture,
186 GstVaapiPicture **prev_picture_ptr,
187 GstVaapiPicture **next_picture_ptr
192 #endif /* GST_VAAPI_DECODER_DPB */