2 * gstvaapivideopool.h - Video object pool abstraction
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_VIDEO_POOL_H
23 #define GST_VAAPI_VIDEO_POOL_H
26 #include <gst/gstcaps.h>
27 #include <gst/vaapi/gstvaapidisplay.h>
31 #define GST_VAAPI_TYPE_VIDEO_POOL \
32 (gst_vaapi_video_pool_get_type())
34 #define GST_VAAPI_VIDEO_POOL(obj) \
35 (G_TYPE_CHECK_INSTANCE_CAST((obj), \
36 GST_VAAPI_TYPE_VIDEO_POOL, \
39 #define GST_VAAPI_VIDEO_POOL_CLASS(klass) \
40 (G_TYPE_CHECK_CLASS_CAST((klass), \
41 GST_VAAPI_TYPE_VIDEO_POOL, \
42 GstVaapiVideoPoolClass))
44 #define GST_VAAPI_IS_VIDEO_POOL(obj) \
45 (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_VAAPI_TYPE_VIDEO_POOL))
47 #define GST_VAAPI_IS_VIDEO_POOL_CLASS(klass) \
48 (G_TYPE_CHECK_CLASS_TYPE((klass), GST_VAAPI_TYPE_VIDEO_POOL))
50 #define GST_VAAPI_VIDEO_POOL_GET_CLASS(obj) \
51 (G_TYPE_INSTANCE_GET_CLASS((obj), \
52 GST_VAAPI_TYPE_VIDEO_POOL, \
53 GstVaapiVideoPoolClass))
55 typedef struct _GstVaapiVideoPool GstVaapiVideoPool;
56 typedef struct _GstVaapiVideoPoolPrivate GstVaapiVideoPoolPrivate;
57 typedef struct _GstVaapiVideoPoolClass GstVaapiVideoPoolClass;
62 * A pool of lazily allocated video objects. e.g. surfaces, images.
64 struct _GstVaapiVideoPool {
66 GObject parent_instance;
68 GstVaapiVideoPoolPrivate *priv;
72 * GstVaapiVideoPoolClass:
73 * @set_caps: virtual function for notifying the subclass of the
75 * @alloc_object: virtual function for allocating a video pool object
77 * A pool base class used to hold video objects. e.g. surfaces, images.
79 struct _GstVaapiVideoPoolClass {
81 GObjectClass parent_class;
84 void (*set_caps) (GstVaapiVideoPool *pool, GstCaps *caps);
85 gpointer (*alloc_object)(GstVaapiVideoPool *pool, GstVaapiDisplay *display);
89 gst_vaapi_video_pool_get_type(void) G_GNUC_CONST;
92 gst_vaapi_video_pool_get_display(GstVaapiVideoPool *pool);
95 gst_vaapi_video_pool_get_caps(GstVaapiVideoPool *pool);
98 gst_vaapi_video_pool_get_object(GstVaapiVideoPool *pool);
101 gst_vaapi_video_pool_put_object(GstVaapiVideoPool *pool, gpointer object);
104 gst_vaapi_video_pool_add_object(GstVaapiVideoPool *pool, gpointer object);
107 gst_vaapi_video_pool_add_objects(GstVaapiVideoPool *pool, GPtrArray *objects);
110 gst_vaapi_video_pool_get_size(GstVaapiVideoPool *pool);
113 gst_vaapi_video_pool_reserve(GstVaapiVideoPool *pool, guint n);
116 gst_vaapi_video_pool_get_capacity(GstVaapiVideoPool *pool);
119 gst_vaapi_video_pool_set_capacity(GstVaapiVideoPool *pool, guint capacity);
123 #endif /* GST_VAAPI_VIDEO_POOL_H */