2 * Copyright 2014 Advanced Micro Devices, Inc.
3 * Author: Christian König <christian.koenig@amd.com>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation
8 * version 2.1 of the License.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef __GST_OMX_BUFFER_POOL_H__
22 #define __GST_OMX_BUFFER_POOL_H__
29 #include <gst/video/gstvideometa.h>
30 #include <gst/video/gstvideopool.h>
36 #define GST_TYPE_OMX_BUFFER_POOL \
37 (gst_omx_buffer_pool_get_type())
38 #define GST_OMX_BUFFER_POOL(obj) \
39 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_BUFFER_POOL,GstOMXBufferPool))
40 #define GST_IS_OMX_BUFFER_POOL(obj) \
41 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_BUFFER_POOL))
43 typedef struct _GstOMXBufferPool GstOMXBufferPool;
44 typedef struct _GstOMXBufferPoolClass GstOMXBufferPoolClass;
46 struct _GstOMXBufferPool
48 GstVideoBufferPool parent;
53 gboolean add_videometa;
55 GstVideoInfo video_info;
57 /* Owned by element, element has to stop this pool before
58 * it destroys component or port */
59 GstOMXComponent *component;
62 /* For handling OpenMAX allocated memory */
63 GstAllocator *allocator;
65 /* Set from outside this pool */
66 /* TRUE if we're currently allocating all our buffers */
68 /* TRUE if the pool is not used anymore */
71 /* For populating the pool from another one */
72 GstBufferPool *other_pool;
75 /* Used during acquire for output ports to
76 * specify which buffer has to be retrieved
77 * and during alloc, which buffer has to be
80 gint current_buffer_index;
81 #ifdef TIZEN_FEATURE_OMX
86 struct _GstOMXBufferPoolClass
88 GstVideoBufferPoolClass parent_class;
91 GType gst_omx_buffer_pool_get_type (void);
93 GstBufferPool *gst_omx_buffer_pool_new (GstElement * element, GstOMXComponent * component, GstOMXPort * port);
97 #endif /* __GST_OMX_BUFFER_POOL_H__ */