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>
33 #include "gstomxallocator.h"
37 #define GST_TYPE_OMX_BUFFER_POOL \
38 (gst_omx_buffer_pool_get_type())
39 #define GST_OMX_BUFFER_POOL(obj) \
40 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_BUFFER_POOL,GstOMXBufferPool))
41 #define GST_IS_OMX_BUFFER_POOL(obj) \
42 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_BUFFER_POOL))
44 typedef struct _GstOMXBufferPool GstOMXBufferPool;
45 typedef struct _GstOMXBufferPoolClass GstOMXBufferPoolClass;
48 GST_OMX_BUFFER_MODE_SYSTEM_MEMORY,
49 GST_OMX_BUFFER_MODE_DMABUF,
52 struct _GstOMXBufferPool
54 GstVideoBufferPool parent;
59 gboolean add_videometa;
61 GstVideoInfo video_info;
63 /* Owned by element, element has to stop this pool before
64 * it destroys component or port */
65 GstOMXComponent *component;
68 /* For handling OpenMAX allocated memory */
69 GstOMXAllocator *allocator;
71 /* Set from outside this pool */
72 /* TRUE if the pool is not used anymore */
75 /* For populating the pool from another one */
76 GstBufferPool *other_pool;
79 /* Used during acquire for output ports to
80 * specify which buffer has to be retrieved
81 * and during alloc, which buffer has to be
84 gint current_buffer_index;
86 /* The type of buffers produced by the decoder */
87 GstOMXBufferMode output_mode;
90 struct _GstOMXBufferPoolClass
92 GstVideoBufferPoolClass parent_class;
95 GType gst_omx_buffer_pool_get_type (void);
97 GstBufferPool *gst_omx_buffer_pool_new (GstElement * element, GstOMXComponent * component, GstOMXPort * port, GstOMXBufferMode output_mode);
101 #endif /* __GST_OMX_BUFFER_POOL_H__ */