Skip to content

Commit

Permalink
Re #1757: Initial implementation of iOS OpenGL ES renderer. To use it…
Browse files Browse the repository at this point in the history
…, application needs to add:

#define PJMEDIA_VIDEO_DEV_HAS_OPENGL 1
#define PJMEDIA_VIDEO_DEV_HAS_OPENGL_ES 1
#define PJMEDIA_VIDEO_DEV_HAS_IOS_OPENGL 1



git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4812 74dad513-b988-da41-8d7b-12977e46ad98
  • Loading branch information
ming committed Apr 8, 2014
1 parent 37095df commit 6d4d857
Show file tree
Hide file tree
Showing 6 changed files with 962 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pjmedia/build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export PJMEDIA_AUDIODEV_LDFLAGS += $(PJLIB_LDLIB) \
#
export PJMEDIA_VIDEODEV_SRCDIR = ../src/pjmedia-videodev
export PJMEDIA_VIDEODEV_OBJS += errno.o videodev.o avi_dev.o ffmpeg_dev.o \
colorbar_dev.o v4l2_dev.o
colorbar_dev.o v4l2_dev.o opengl_dev.o
export PJMEDIA_VIDEODEV_CFLAGS += $(_CFLAGS)
export PJMEDIA_VIDEODEV_CXXFLAGS += $(_CXXFLAGS)
export PJMEDIA_VIDEODEV_LDFLAGS += $(PJLIB_LDLIB) \
Expand Down
2 changes: 1 addition & 1 deletion pjmedia/build/os-auto.mak.in
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ endif
# iOS video device
#
ifeq ($(AC_PJMEDIA_VIDEO),iphone_os)
export PJMEDIA_VIDEODEV_OBJS += ios_dev.o
export PJMEDIA_VIDEODEV_OBJS += ios_dev.o ios_opengl_dev.o
endif

#
Expand Down
49 changes: 49 additions & 0 deletions pjmedia/include/pjmedia-videodev/opengl_dev.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/* $Id$ */
/*
* Copyright (C) 2013-2014 Teluu Inc. (http://www.teluu.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef PJMEDIA_VIDEODEV_OPENGL_DEV_H__
#define PJMEDIA_VIDEODEV_OPENGL_DEV_H__

#include <pjmedia-videodev/videodev_imp.h>

/* OpenGL implementation on each platform needs to implement this and
* stream operations.
*/
pj_status_t
pjmedia_vid_dev_opengl_imp_create_stream(pj_pool_t *pool,
pjmedia_vid_dev_param *param,
const pjmedia_vid_dev_cb *cb,
void *user_data,
pjmedia_vid_dev_stream **p_vid_strm);

/* OpenGL buffers opaque structure. */
typedef struct gl_buffers gl_buffers;

/* Create OpenGL buffers. */
void pjmedia_vid_dev_opengl_create_buffers(pj_pool_t *pool,
gl_buffers **glb);
/* Initialize OpenGL buffers. */
pj_status_t pjmedia_vid_dev_opengl_init_buffers(gl_buffers *glb);
/* Render a texture. */
pj_status_t pjmedia_vid_dev_opengl_draw(gl_buffers *glb,
unsigned int texture,
unsigned int name);
/* Destroy OpenGL buffers. */
void pjmedia_vid_dev_opengl_destroy_buffers(gl_buffers *glb);

#endif /* PJMEDIA_VIDEODEV_OPENGL_DEV_H__ */
Loading

0 comments on commit 6d4d857

Please sign in to comment.