gstglupload.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * GStreamer
  3. * Copyright (C) 2012 Matthew Waters <[email protected]>
  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. #ifndef __GST_GL_UPLOAD_H__
  21. #define __GST_GL_UPLOAD_H__
  22. #include <gst/video/video.h>
  23. #include <gst/gstmemory.h>
  24. #include <gst/gl/gstgl_fwd.h>
  25. G_BEGIN_DECLS
  26. GType gst_gl_upload_get_type (void);
  27. #define GST_TYPE_GL_UPLOAD (gst_gl_upload_get_type())
  28. #define GST_GL_UPLOAD(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_UPLOAD,GstGLUpload))
  29. #define GST_GL_UPLOAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_GL_UPLOAD,GstGLUploadClass))
  30. #define GST_IS_GL_UPLOAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GL_UPLOAD))
  31. #define GST_IS_GL_UPLOAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GL_UPLOAD))
  32. #define GST_GL_UPLOAD_CAST(obj) ((GstGLUpload*)(obj))
  33. /**
  34. * GstGLUpload
  35. *
  36. * Opaque #GstGLUpload object
  37. */
  38. struct _GstGLUpload
  39. {
  40. /* <private> */
  41. GstObject parent;
  42. GstGLContext *context;
  43. GstGLColorConvert *convert;
  44. /* input data */
  45. GstVideoInfo in_info;
  46. gboolean initted;
  47. GstGLMemory *in_tex[GST_VIDEO_MAX_PLANES];
  48. GstGLMemory *out_tex;
  49. /* <private> */
  50. GstGLUploadPrivate *priv;
  51. gpointer _reserved[GST_PADDING];
  52. };
  53. /**
  54. * GstGLUploadClass:
  55. *
  56. * The #GstGLUploadClass struct only contains private data
  57. */
  58. struct _GstGLUploadClass
  59. {
  60. GstObjectClass object_class;
  61. };
  62. GstGLUpload * gst_gl_upload_new (GstGLContext * context);
  63. void gst_gl_upload_set_format (GstGLUpload * upload, GstVideoInfo * in_info);
  64. GstVideoInfo * gst_gl_upload_get_format (GstGLUpload * upload);
  65. gboolean gst_gl_upload_perform_with_buffer (GstGLUpload * upload, GstBuffer * buffer, guint * tex_id);
  66. void gst_gl_upload_release_buffer (GstGLUpload * upload);
  67. gboolean gst_gl_upload_perform_with_data (GstGLUpload * upload, GLuint * texture_id,
  68. gpointer data[GST_VIDEO_MAX_PLANES]);
  69. gboolean gst_gl_upload_perform_with_gl_texture_upload_meta (GstGLUpload *upload, GstVideoGLTextureUploadMeta *meta, guint texture_id[4]);
  70. G_END_DECLS
  71. #endif /* __GST_GL_UPLOAD_H__ */