1 /* GStreamer
2  * Copyright (C) <2005> Julien Moutte <julien@moutte.net>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef __GST_XVIMAGEALLOCATOR_H__
21 #define __GST_XVIMAGEALLOCATOR_H__
22 
23 typedef struct _GstXvImageMemory GstXvImageMemory;
24 
25 typedef struct _GstXvImageAllocator GstXvImageAllocator;
26 typedef struct _GstXvImageAllocatorClass GstXvImageAllocatorClass;
27 
28 #include "xvcontext.h"
29 
30 G_BEGIN_DECLS
31 
32 /* allocator functions */
33 #define GST_TYPE_XVIMAGE_ALLOCATOR      (gst_xvimage_allocator_get_type())
34 #define GST_IS_XVIMAGE_ALLOCATOR(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_XVIMAGE_ALLOCATOR))
35 #define GST_XVIMAGE_ALLOCATOR(obj)      (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_XVIMAGE_ALLOCATOR, GstXvImageAllocator))
36 #define GST_XVIMAGE_ALLOCATOR_CAST(obj) ((GstXvImageAllocator*)(obj))
37 
38 GType gst_xvimage_allocator_get_type (void);
39 
40 /* the allocator */
41 GstXvImageAllocator * gst_xvimage_allocator_new         (GstXvContext * context);
42 
43 GstXvContext *        gst_xvimage_allocator_peek_context (GstXvImageAllocator * allocator);
44 
45 GstMemory *           gst_xvimage_allocator_alloc       (GstXvImageAllocator * allocator,
46                                                          gint im_format,
47                                                          const GstVideoInfo * info,
48                                                          gint padded_width,
49                                                          gint padded_height,
50                                                          const GstVideoRectangle *crop,
51                                                          GError ** error);
52 
53 /* memory from the allocator */
54 gboolean              gst_xvimage_memory_is_from_context (GstMemory *mem,
55                                                           GstXvContext * context);
56 
57 gint                  gst_xvimage_memory_get_format     (GstXvImageMemory *mem);
58 XvImage *             gst_xvimage_memory_get_xvimage    (GstXvImageMemory *mem);
59 gboolean              gst_xvimage_memory_get_crop       (GstXvImageMemory *mem,
60                                                          GstVideoRectangle *crop);
61 
62 void                  gst_xvimage_memory_render         (GstXvImageMemory *mem,
63                                                          GstVideoRectangle *src_crop,
64                                                          GstXWindow *window,
65                                                          GstVideoRectangle *dst_crop,
66                                                          gboolean draw_border);
67 
68 G_END_DECLS
69 
70 #endif /*__GST_XVIMAGEALLOCATOR_H__*/
71