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 occured 43 * @GST_GL_UPLOAD_UNSUPPORTED: The configuration is unsupported. 44 * @GST_GL_UPLOAD_RECONFIGURE: This element requires a reconfiguration. 45 */ 46 typedef 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 */ 62 struct _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 */ 79 struct _GstGLUploadClass 80 { 81 GstObjectClass object_class; 82 83 /* <private> */ 84 gpointer _padding[GST_PADDING]; 85 }; 86 87 GST_GL_API 88 GstCaps * gst_gl_upload_get_input_template_caps (void); 89 90 GST_GL_API 91 GstGLUpload * gst_gl_upload_new (GstGLContext * context); 92 93 GST_GL_API 94 void gst_gl_upload_set_context (GstGLUpload * upload, 95 GstGLContext * context); 96 97 GST_GL_API 98 GstCaps * gst_gl_upload_transform_caps (GstGLUpload * upload, 99 GstGLContext * context, 100 GstPadDirection direction, 101 GstCaps * caps, 102 GstCaps * filter); 103 GST_GL_API 104 gboolean gst_gl_upload_set_caps (GstGLUpload * upload, 105 GstCaps * in_caps, 106 GstCaps * out_caps); 107 GST_GL_API 108 void gst_gl_upload_get_caps (GstGLUpload * upload, 109 GstCaps ** in_caps, 110 GstCaps ** out_caps); 111 GST_GL_API 112 void gst_gl_upload_propose_allocation (GstGLUpload * upload, 113 GstQuery * decide_query, 114 GstQuery * query); 115 116 GST_GL_API 117 GstGLUploadReturn gst_gl_upload_perform_with_buffer (GstGLUpload * upload, 118 GstBuffer * buffer, 119 GstBuffer ** outbuf_ptr); 120 121 G_END_DECLS 122 123 #endif /* __GST_GL_UPLOAD_H__ */ 124