| 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 | |
| 21 | #include <pjmedia-videodev/videodev_imp.h> |
| 22 | |
| 23 | /* OpenGL implementation on each platform needs to implement these functions |
| 24 | * and stream operations. |
| 25 | */ |
| 26 | /* Get capabilities of the implementation */ |
| 27 | int pjmedia_vid_dev_opengl_imp_get_cap(void); |
| 28 | |
| 29 | /* Create OpenGL stream */ |
| 30 | pj_status_t |
| 31 | pjmedia_vid_dev_opengl_imp_create_stream(pj_pool_t *pool, |
| 32 | pjmedia_vid_dev_param *param, |
| 33 | const pjmedia_vid_dev_cb *cb, |
| 34 | void *user_data, |
| 35 | pjmedia_vid_dev_stream **p_vid_strm); |
| 36 | |
| 37 | /****************************************************************************/ |
| 38 | /* OpenGL buffers opaque structure. */ |
| 39 | typedef struct gl_buffers gl_buffers; |
| 40 | |
| 41 | /* Create OpenGL buffers. */ |
| 42 | void pjmedia_vid_dev_opengl_create_buffers(pj_pool_t *pool, pj_bool_t direct, |
| 43 | gl_buffers **glb); |
| 44 | /* Initialize OpenGL buffers. */ |
| 45 | pj_status_t pjmedia_vid_dev_opengl_init_buffers(gl_buffers *glb); |
| 46 | /* Render a texture. */ |
| 47 | pj_status_t pjmedia_vid_dev_opengl_draw(gl_buffers *glb,unsigned int width, |
| 48 | unsigned int height, void *pixels); |
| 49 | /* Destroy OpenGL buffers. */ |
| 50 | void pjmedia_vid_dev_opengl_destroy_buffers(gl_buffers *glb); |
| 51 | |
| 52 | #endif /* __PJMEDIA_VIDEODEV_OPENGL_DEV_H__ */ |