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 | |
28 | G_BEGIN_DECLS |
29 | |
30 | GST_GL_API |
31 | GType 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 occurred |
43 | * @GST_GL_UPLOAD_UNSUPPORTED: The configuration is unsupported. |
44 | * @GST_GL_UPLOAD_RECONFIGURE: This element requires a reconfiguration. |
45 | * @GST_GL_UPLOAD_UNSHARED_GL_CONTEXT: private return value. |
46 | */ |
47 | typedef enum |
48 | { |
49 | GST_GL_UPLOAD_DONE = 1, |
50 | |
51 | GST_GL_UPLOAD_ERROR = -1, |
52 | GST_GL_UPLOAD_UNSUPPORTED = -2, |
53 | GST_GL_UPLOAD_RECONFIGURE = -3, |
54 | |
55 | GST_GL_UPLOAD_UNSHARED_GL_CONTEXT = -100, |
56 | } GstGLUploadReturn; |
57 | |
58 | /** |
59 | * GstGLUpload |
60 | * |
61 | * Opaque #GstGLUpload object |
62 | */ |
63 | struct _GstGLUpload |
64 | { |
65 | GstObject parent; |
66 | |
67 | GstGLContext *context; |
68 | |
69 | /*< private >*/ |
70 | GstGLUploadPrivate *priv; |
71 | |
72 | gpointer _reserved[GST_PADDING]; |
73 | }; |
74 | |
75 | /** |
76 | * GstGLUploadClass: |
77 | * |
78 | * The #GstGLUploadClass struct only contains private data |
79 | */ |
80 | struct _GstGLUploadClass |
81 | { |
82 | GstObjectClass object_class; |
83 | |
84 | /*< private >*/ |
85 | gpointer _padding[GST_PADDING]; |
86 | }; |
87 | |
88 | GST_GL_API |
89 | GstCaps * gst_gl_upload_get_input_template_caps (void); |
90 | |
91 | GST_GL_API |
92 | GstGLUpload * gst_gl_upload_new (GstGLContext * context); |
93 | |
94 | GST_GL_API |
95 | void gst_gl_upload_set_context (GstGLUpload * upload, |
96 | GstGLContext * context); |
97 | |
98 | GST_GL_API |
99 | GstCaps * gst_gl_upload_transform_caps (GstGLUpload * upload, |
100 | GstGLContext * context, |
101 | GstPadDirection direction, |
102 | GstCaps * caps, |
103 | GstCaps * filter); |
104 | GST_GL_API |
105 | gboolean gst_gl_upload_set_caps (GstGLUpload * upload, |
106 | GstCaps * in_caps, |
107 | GstCaps * out_caps); |
108 | GST_GL_API |
109 | void gst_gl_upload_get_caps (GstGLUpload * upload, |
110 | GstCaps ** in_caps, |
111 | GstCaps ** out_caps); |
112 | GST_GL_API |
113 | void gst_gl_upload_propose_allocation (GstGLUpload * upload, |
114 | GstQuery * decide_query, |
115 | GstQuery * query); |
116 | |
117 | GST_GL_API |
118 | GstGLUploadReturn gst_gl_upload_perform_with_buffer (GstGLUpload * upload, |
119 | GstBuffer * buffer, |
120 | GstBuffer ** outbuf_ptr); |
121 | |
122 | G_END_DECLS |
123 | |
124 | #endif /* __GST_GL_UPLOAD_H__ */ |
125 | |