1/*
2 * GStreamer
3 * Copyright (C) 2012 Matthew Waters <ystree00@gmail.com>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
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 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */
20
21#ifndef __GST_GL_UPLOAD_H__
22#define __GST_GL_UPLOAD_H__
23
24#include <gst/video/video.h>
25
26#include <gst/gl/gstgl_fwd.h>
27
28G_BEGIN_DECLS
29
30GST_GL_API
31GType gst_gl_upload_get_type (void);
32#define GST_TYPE_GL_UPLOAD (gst_gl_upload_get_type())
33#define GST_GL_UPLOAD(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_UPLOAD,GstGLUpload))
34#define GST_GL_UPLOAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_GL_UPLOAD,GstGLUploadClass))
35#define GST_IS_GL_UPLOAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GL_UPLOAD))
36#define GST_IS_GL_UPLOAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GL_UPLOAD))
37#define GST_GL_UPLOAD_CAST(obj) ((GstGLUpload*)(obj))
38
39/**
40 * GstGLUploadReturn:
41 * @GST_GL_UPLOAD_DONE: No further processing required
42 * @GST_GL_UPLOAD_ERROR: An unspecified error occured
43 * @GST_GL_UPLOAD_UNSUPPORTED: The configuration is unsupported.
44 * @GST_GL_UPLOAD_RECONFIGURE: This element requires a reconfiguration.
45 */
46typedef enum
47{
48 GST_GL_UPLOAD_DONE = 1,
49
50 GST_GL_UPLOAD_ERROR = -1,
51 GST_GL_UPLOAD_UNSUPPORTED = -2,
52 GST_GL_UPLOAD_RECONFIGURE = -3,
53 /* <private> */
54 GST_GL_UPLOAD_UNSHARED_GL_CONTEXT = -100,
55} GstGLUploadReturn;
56
57/**
58 * GstGLUpload
59 *
60 * Opaque #GstGLUpload object
61 */
62struct _GstGLUpload
63{
64 GstObject parent;
65
66 GstGLContext *context;
67
68 /* <private> */
69 GstGLUploadPrivate *priv;
70
71 gpointer _reserved[GST_PADDING];
72};
73
74/**
75 * GstGLUploadClass:
76 *
77 * The #GstGLUploadClass struct only contains private data
78 */
79struct _GstGLUploadClass
80{
81 GstObjectClass object_class;
82
83 /* <private> */
84 gpointer _padding[GST_PADDING];
85};
86
87GST_GL_API
88GstCaps * gst_gl_upload_get_input_template_caps (void);
89
90GST_GL_API
91GstGLUpload * gst_gl_upload_new (GstGLContext * context);
92
93GST_GL_API
94void gst_gl_upload_set_context (GstGLUpload * upload,
95 GstGLContext * context);
96
97GST_GL_API
98GstCaps * gst_gl_upload_transform_caps (GstGLUpload * upload,
99 GstGLContext * context,
100 GstPadDirection direction,
101 GstCaps * caps,
102 GstCaps * filter);
103GST_GL_API
104gboolean gst_gl_upload_set_caps (GstGLUpload * upload,
105 GstCaps * in_caps,
106 GstCaps * out_caps);
107GST_GL_API
108void gst_gl_upload_get_caps (GstGLUpload * upload,
109 GstCaps ** in_caps,
110 GstCaps ** out_caps);
111GST_GL_API
112void gst_gl_upload_propose_allocation (GstGLUpload * upload,
113 GstQuery * decide_query,
114 GstQuery * query);
115
116GST_GL_API
117GstGLUploadReturn gst_gl_upload_perform_with_buffer (GstGLUpload * upload,
118 GstBuffer * buffer,
119 GstBuffer ** outbuf_ptr);
120
121G_END_DECLS
122
123#endif /* __GST_GL_UPLOAD_H__ */
124