opengl_dev.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (C) 2013-2014 Teluu Inc. (http://www.teluu.com)
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. */
  18. #ifndef __PJMEDIA_VIDEODEV_OPENGL_DEV_H__
  19. #define __PJMEDIA_VIDEODEV_OPENGL_DEV_H__
  20. #include <pjmedia-videodev/videodev_imp.h>
  21. /* OpenGL implementation on each platform needs to implement these functions
  22. * and stream operations.
  23. */
  24. /* Get capabilities of the implementation */
  25. int pjmedia_vid_dev_opengl_imp_get_cap(void);
  26. /* Create OpenGL stream */
  27. pj_status_t
  28. pjmedia_vid_dev_opengl_imp_create_stream(pj_pool_t *pool,
  29. pjmedia_vid_dev_param *param,
  30. const pjmedia_vid_dev_cb *cb,
  31. void *user_data,
  32. pjmedia_vid_dev_stream **p_vid_strm);
  33. /****************************************************************************/
  34. /* OpenGL buffers opaque structure. */
  35. typedef struct gl_buffers gl_buffers;
  36. /* Create OpenGL buffers. */
  37. void pjmedia_vid_dev_opengl_create_buffers(pj_pool_t *pool, pj_bool_t direct,
  38. gl_buffers **glb);
  39. /* Initialize OpenGL buffers. */
  40. pj_status_t pjmedia_vid_dev_opengl_init_buffers(gl_buffers *glb);
  41. /* Render a texture. */
  42. pj_status_t pjmedia_vid_dev_opengl_draw(gl_buffers *glb,unsigned int width,
  43. unsigned int height, void *pixels);
  44. /* Destroy OpenGL buffers. */
  45. void pjmedia_vid_dev_opengl_destroy_buffers(gl_buffers *glb);
  46. #endif /* __PJMEDIA_VIDEODEV_OPENGL_DEV_H__ */