3 * Copyright (c) 2010, 2011 Texas Instruments Incorporated
4 * Copyright (c) 2011, Collabora Ltda
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation
9 * version 2.1 of the License.
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 Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef __GSTPVRBUFFERPOOL_H__
22 #define __GSTPVRBUFFERPOOL_H__
29 GType gst_ducati_buffer_get_type (void);
30 #define GST_TYPE_DUCATIBUFFER (gst_ducati_buffer_get_type())
31 #define GST_IS_DUCATIBUFFER(obj) \
32 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_DUCATIBUFFER))
33 #define GST_DUCATIBUFFER(obj) \
34 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_DUCATIBUFFER, GstDucatiBuffer))
36 GType gst_pvr_bufferpool_get_type (void);
37 #define GST_TYPE_PVRBUFFERPOOL (gst_pvr_bufferpool_get_type())
38 #define GST_IS_PVRBUFFERPOOL(obj) \
39 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PVRBUFFERPOOL))
40 #define GST_PVRBUFFERPOOL(obj) \
41 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PVRBUFFERPOOL, \
44 typedef struct _GstPvrBufferPool GstPvrBufferPool;
45 typedef struct _GstDucatiBuffer GstDucatiBuffer;
47 struct _GstPvrBufferPool
51 /* output (padded) size including any codec padding: */
52 gint padded_width, padded_height;
54 PVR2DCONTEXTHANDLE pvr_context;
58 gboolean running; /* with lock */
59 GstElement *element; /* the element that owns us.. */
65 GstPvrBufferPool * gst_pvr_bufferpool_new (GstElement * element,
66 GstCaps * caps, gint num_buffers, gint size,
67 PVR2DCONTEXTHANDLE pvr_context);
68 void gst_pvr_bufferpool_stop_running (GstPvrBufferPool * pool, gboolean unwrap);
69 GstDucatiBuffer * gst_pvr_bufferpool_get (GstPvrBufferPool * self,
72 #define GST_PVR_BUFFERPOOL_LOCK(self) g_mutex_lock ((self)->lock)
73 #define GST_PVR_BUFFERPOOL_UNLOCK(self) g_mutex_unlock ((self)->lock)
75 struct _GstDucatiBuffer {
78 GstPvrBufferPool *pool; /* buffer-pool that this buffer belongs to */
79 GstBuffer *orig; /* original buffer, if we need to copy output */
80 PVR2DMEMINFO *src_mem; /* Memory wrapped by pvr */
84 GstBuffer * gst_ducati_buffer_get (GstDucatiBuffer * self);
85 PVR2DMEMINFO * gst_ducati_buffer_get_meminfo (GstDucatiBuffer * self);
89 #endif /* __GSTPVRBUFFERPOOL_H__ */