1/*
2 * GStreamer
3 * Copyright (C) 2012 Matthew Waters <ystreet00@gmail.com>
4 * Copyright (C) 2015 Matthew Waters <matthew@centricular.com>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
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 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20 */
21
22#ifndef _GST_GL_MEMORY_PBO_H_
23#define _GST_GL_MEMORY_PBO_H_
24
25#include <gst/gl/gstglmemory.h>
26
27G_BEGIN_DECLS
28
29#define GST_TYPE_GL_MEMORY_PBO_ALLOCATOR (gst_gl_memory_pbo_allocator_get_type())
30GST_GL_API
31GType gst_gl_memory_pbo_allocator_get_type(void);
32
33#define GST_IS_GL_MEMORY_PBO_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GL_MEMORY_PBO_ALLOCATOR))
34#define GST_IS_GL_MEMORY_PBO_ALLOCATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_GL_MEMORY_PBO_ALLOCATOR))
35#define GST_GL_MEMORY_PBO_ALLOCATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_GL_MEMORY_PBO_ALLOCATOR, GstGLMemoryPBOAllocatorClass))
36#define GST_GL_MEMORY_PBO_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_GL_MEMORY_PBO_ALLOCATOR, GstGLMemoryPBOAllocator))
37#define GST_GL_MEMORY_PBO_ALLOCATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GL_MEMORY_PBO_ALLOCATOR, GstGLMemoryPBOAllocatorClass))
38#define GST_GL_MEMORY_PBO_ALLOCATOR_CAST(obj) ((GstGLMemoryPBOAllocator *)(obj))
39
40/**
41 * GstGLMemoryPBO:
42 *
43 * Private instance
44 */
45struct _GstGLMemoryPBO
46{
47 /*< private >*/
48 GstGLMemory mem;
49
50 GstGLBuffer *pbo;
51
52 gpointer _padding[GST_PADDING];
53};
54
55/**
56 * GST_GL_MEMORY_PBO_ALLOCATOR_NAME:
57 *
58 * The name of the GL Memory PBO allocator
59 */
60#define GST_GL_MEMORY_PBO_ALLOCATOR_NAME "GLMemoryPBO"
61
62/**
63 * GST_TYPE_GL_MEMORY_PBO
64 *
65 * Since: 1.20
66 * Deprecated: 1.22: This type has no use.
67 */
68#define GST_TYPE_GL_MEMORY_PBO (gst_gl_memory_pbo_get_type())
69GST_GL_DEPRECATED
70GType gst_gl_memory_pbo_get_type(void);
71
72GST_GL_API
73void gst_gl_memory_pbo_init_once (void);
74GST_GL_API
75gboolean gst_is_gl_memory_pbo (GstMemory * mem);
76
77GST_GL_API
78void gst_gl_memory_pbo_download_transfer (GstGLMemoryPBO * gl_mem);
79GST_GL_API
80void gst_gl_memory_pbo_upload_transfer (GstGLMemoryPBO * gl_mem);
81
82GST_GL_API
83gboolean gst_gl_memory_pbo_copy_into_texture (GstGLMemoryPBO *gl_mem,
84 guint tex_id,
85 GstGLTextureTarget target,
86 GstGLFormat tex_format,
87 gint width,
88 gint height,
89 gint stride,
90 gboolean respecify);
91
92/**
93 * GstGLMemoryPBOAllocator:
94 *
95 * Opaque #GstGLMemoryPBOAllocator struct
96 */
97struct _GstGLMemoryPBOAllocator
98{
99 GstGLMemoryAllocator parent;
100
101 /*< private >*/
102 gpointer _padding[GST_PADDING];
103};
104
105/**
106 * GstGLMemoryPBOAllocatorClass:
107 *
108 * Only contains private data
109 */
110struct _GstGLMemoryPBOAllocatorClass
111{
112 GstGLMemoryAllocatorClass parent_class;
113
114 /*< private >*/
115 gpointer _padding[GST_PADDING];
116};
117
118G_END_DECLS
119
120#endif /* _GST_GL_MEMORY_PBO_H_ */
121

source code of include/gstreamer-1.0/gst/gl/gstglmemorypbo.h