我正在努力提高Android视频会议项目的视频显示效率.视频显示以本机opengl代码实现. opengl代码以opengl版本1的原生实现.下面给出的代码用于显示视频的每个帧.
int ofi_vc_video_display::render_video_frame(unsigned char *frame_buffer)
{
// Check the frame is available or not. If available display the frame.
if (frame_buffer != NULL){
// Clear the screen buffers.
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Bind the frame data to the texture.
glTexSubImage2D(GL_TEXTURE_2D,
0,
0,
0,
frame_width,
frame_height,
GL_RGB,
GL_UNSIGNED_BYTE,
frame_buffer);
// Check for the error status.
while ((gl_error_status=glGetError()) != GL_NO_ERROR) {
error_status = gl_error_status;
}
// Transform and rotate the texture.
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glTranslatef(0