Commit d1e6b825 authored by Ronan's avatar Ronan

many changes:

  - shader_util & opengles_display use generic opengl functions
  - add a opengl_functions structure to handle custom opengl calls
  - generic_opengl_display.c calls now opengl functions in render
parent f18f59c8
......@@ -50,6 +50,7 @@ set(HEADER_FILES
msitc.h
msjava.h
msjpegwriter.h
msogl.h
msmediaplayer.h
msqueue.h
msrtp.h
......
......@@ -28,6 +28,7 @@ mediastreamer2_include_HEADERS=allfilters.h \
msgenericplc.h \
msinterfaces.h \
msitc.h \
msogl.h \
msjava.h \
msjpegwriter.h \
msmediaplayer.h \
......@@ -57,4 +58,3 @@ mediastreamer2_include_HEADERS=allfilters.h \
msudp.h
EXTRA_DIST=$(mediastreamer2_include_HEADERS)
......@@ -96,9 +96,6 @@ struct _MSVideoDisplayDecodingSupport {
#define MS_VIDEO_DISPLAY_SET_DEVICE_ORIENTATION \
MS_FILTER_METHOD(MSFilterVideoDisplayInterface,11,int)
#define MS_VIDEO_DISPLAY_CALL_GENERIC_RENDER \
MS_FILTER_METHOD(MSFilterVideoDisplayInterface,12,void*)
/**
* Interface definitions for players
**/
......
This diff is collapsed.
......@@ -311,10 +311,12 @@ if(ENABLE_VIDEO)
if(APPLE)
if(IOS)
list(APPEND VOIP_SOURCE_FILES_C
utils/opengl_functions.c
utils/opengl_functions.h
utils/opengles_display.c
utils/opengles_display.h
utils/shaderUtil.c
utils/shaderUtil.h
utils/shader_util.c
utils/shader_util.h
voip/scaler.c
)
list(APPEND VOIP_SOURCE_FILES_OBJC
......@@ -329,10 +331,12 @@ if(ENABLE_VIDEO)
)
list(APPEND VOIP_SOURCE_FILES_C
utils/opengl_functions.c
utils/opengl_functions.h
utils/opengles_display.c
utils/opengles_display.h
utils/shaderUtil.c
utils/shaderUtil.h
utils/shader_util.c
utils/shader_util.h
)
endif()
endif()
......@@ -345,10 +349,12 @@ if(ENABLE_VIDEO)
android/mediacodech264enc.c
android/android-display.c
android/android-opengl-display.c
utils/opengl_functions.c
utils/opengl_functions.h
utils/opengles_display.c
utils/opengles_display.h
utils/shaderUtil.c
utils/shaderUtil.h
utils/shader_util.c
utils/shader_util.h
voip/scaler.c
)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armeabi-v7a")
......@@ -390,8 +396,9 @@ if(ENABLE_VIDEO)
endif()
if(GLX_FOUND)
list(APPEND VOIP_SOURCE_FILES_C
utils/opengl_functions.c
utils/opengles_display.c
utils/shaderUtil.c
utils/shader_util.c
videofilters/generic_opengl_display.c
videofilters/glxvideo.c
)
......
......@@ -230,7 +230,7 @@ libmediastreamer_voip_la_LIBTOOLFLAGS= --tag=CC
if BUILD_VIDEO
GLDISPLAY_FILES = utils/shaderUtil.c utils/shaderUtil.h utils/debug.h utils/opengles_display.c utils/opengles_display.h
GLDISPLAY_FILES = utils/opengl_functions.c utils/opengl_functions.h utils/shader_util.c utils/shader_util.h utils/opengl_debug.h utils/opengles_display.c utils/opengles_display.h
if BUILD_MACOSX
libmediastreamer_voip_la_SOURCES+= videofilters/videotoolbox.c
......
......@@ -64,7 +64,7 @@ static void android_display_uninit(MSFilter *f){
AndroidDisplay *ad=(AndroidDisplay*)f->data;
JNIEnv *jenv=ms_get_jni_env();
ms_message("%s %p %p", __FUNCTION__, f, ad->ogl);
if (ad->ogl) {
/* clear native ptr, to prevent rendering to occur now that ptr is invalid */
if (ad->android_video_window)
......@@ -98,7 +98,7 @@ static void android_display_process(MSFilter *f){
} else {
ms_warning("%s: opengldisplay not ready (%p)", __FUNCTION__, ad->ogl);
}
jenv=ms_get_jni_env();
(*jenv)->CallVoidMethod(jenv,ad->android_video_window,ad->request_render_id);
}
......@@ -119,11 +119,11 @@ static int android_display_set_window(MSFilter *f, void *arg){
jobject old_window;
if (window == ad->android_video_window) return 0;
ms_filter_lock(f);
old_window=ad->android_video_window;
if (ad->android_video_window) {
ms_message("Clearing old opengles_display (%p)", ad->ogl);
/* clear native ptr, to prevent rendering to occur now that ptr is invalid */
......@@ -132,15 +132,15 @@ static int android_display_set_window(MSFilter *f, void *arg){
ogl_display_uninit(ad->ogl, FALSE);
ms_free(ad->ogl);
ad->ogl = ogl_display_new();
}
if (window) {
ad->android_video_window=(*jenv)->NewGlobalRef(jenv, window);
ms_message("Sending opengles_display pointer (%p)", ad->ogl);
(*jenv)->CallVoidMethod(jenv,window,ad->set_opengles_display_id, (jlong)ad->ogl);
}else ad->android_video_window=NULL;
if (old_window)
(*jenv)->DeleteGlobalRef(jenv, old_window);
......
/*
File: debug.h
File: opengl_debug.h
Abstract: Utility functions for debugging.
Version: 1.13
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
Inc. ("Apple") in consideration of your agreement to the following
terms, and your use, installation, modification or redistribution of
this Apple software constitutes acceptance of these terms. If you do
not agree with these terms, please do not use, install, modify or
redistribute this Apple software.
In consideration of your agreement to abide by the following terms, and
subject to these terms, Apple grants you a personal, non-exclusive
license, under Apple's copyrights in this original Apple software (the
......@@ -25,13 +25,13 @@
implied, are granted by Apple herein, including but not limited to any
patent rights that may be infringed by your derivative works or by other
works in which the Apple Software may be incorporated.
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
......@@ -40,13 +40,15 @@
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Copyright (C) 2014 Apple Inc. All Rights Reserved.
*/
#define glError() { \
GLenum err = glGetError(); \
Original file modified by Belledonne Communications, Grenoble, France
Copyright (C) 2017
*/
#define glError(f) { \
GLenum err = f->glGetError(); \
if (err != GL_NO_ERROR) { \
printf("glError: %04x caught at %s:%u\n", err, __FILE__, __LINE__); \
} \
......
#include "opengl_functions.h"
// =============================================================================
void opengl_functions_default_init (OpenGlFunctions *f) {
#if !defined(_WIN32)
f->glActiveTexture = glActiveTexture;
f->glAttachShader = glAttachShader;
f->glBindAttribLocation = glBindAttribLocation;
f->glBindTexture = glBindTexture;
f->glClear = glClear;
f->glClearColor = glClearColor;
f->glCompileShader = glCompileShader;
f->glCreateProgram = glCreateProgram;
f->glCreateShader = glCreateShader;
f->glDeleteProgram = glDeleteProgram;
f->glDeleteShader = glDeleteShader;
f->glDeleteTextures = glDeleteTextures;
f->glDisable = glDisable;
f->glDrawArrays = glDrawArrays;
f->glEnableVertexAttribArray = glEnableVertexAttribArray;
f->glGenTextures = glGenTextures;
f->glGetError = glGetError;
f->glGetProgramInfoLog = glGetProgramInfoLog;
f->glGetProgramiv = glGetProgramiv;
f->glGetShaderInfoLog = glGetShaderInfoLog;
f->glGetShaderiv = glGetShaderiv;
f->glGetString = glGetString;
f->glGetUniformLocation = glGetUniformLocation;
f->glLinkProgram = glLinkProgram;
f->glPixelStorei = glPixelStorei;
f->glShaderSource = (resolveGlShaderSource)glShaderSource;
f->glTexImage2D = glTexImage2D;
f->glTexParameteri = glTexParameteri;
f->glTexSubImage2D = glTexSubImage2D;
f->glUniform1f = glUniform1f;
f->glUniform1i = glUniform1i;
f->glUniformMatrix4fv = glUniformMatrix4fv;
f->glUseProgram = glUseProgram;
f->glValidateProgram = glValidateProgram;
f->glVertexAttribPointer = glVertexAttribPointer;
f->glViewport = glViewport;
#endif
}
/*
* opengl_functions.c
* Copyright (C) 2017 Belledonne Communications, Grenoble, France
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef OPENGL_FUNCTIONS_H
#define OPENGL_FUNCTIONS_H
#include "mediastreamer2/msogl.h"
// -----------------------------------------------------------------------------
void opengl_functions_default_init (OpenGlFunctions *f);
#endif
This diff is collapsed.
/*
opengles_display.m
Copyright (C) 2011 Belledonne Communications, Grenoble, France
opengles_display.h
Copyright (C) 2017 Belledonne Communications, Grenoble, France
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
......@@ -17,33 +17,34 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef OPENGLESDISPLAY_H
#define OPENGLESDISPLAY_H
#ifndef OPENGLES_DISPLAY_H
#define OPENGLES_DISPLAY_H
#include "mediastreamer2/msvideo.h"
#include "mediastreamer2/msfilter.h"
#include "opengl_functions.h"
struct opengles_display;
/**
* Create opaque structure to handle OpenGL display
*/
struct opengles_display* ogl_display_new(void);
struct opengles_display *ogl_display_new (void);
/**
* Release opaque struct memory
*/
void ogl_display_free(struct opengles_display* gldisp);
void ogl_display_free (struct opengles_display *gldisp);
/**
* Perform initialization of opaque structure.
*
* @param f OpenGL functions to use. Can be NULL.
* @param width Width of the display area
* @param height Height of the display area.
*/
void ogl_display_init(struct opengles_display* gldisp, int width, int height);
void ogl_display_init (struct opengles_display *gldisp, const OpenGlFunctions *f, int width, int height);
/**
* Perform resize of opaque structure.
......@@ -53,38 +54,37 @@ void ogl_display_init(struct opengles_display* gldisp, int width, int height);
* @param width Width of the display area
* @param height Height of the display area.
*/
void ogl_display_set_size(struct opengles_display* gldisp, int width, int height);
void ogl_display_set_size (struct opengles_display *gldisp, int width, int height);
/**
* Uninit opaque structure.
*
* @param freeGLresources Are we allowed to release GL resources. GL resources
* @param freeGLresources Are we allowed to release GL resources. GL resources
* must only be freed within the correct GL context.
*/
void ogl_display_uninit(struct opengles_display* gldisp, bool_t freeGLresources);
void ogl_display_uninit (struct opengles_display *gldisp, bool_t freeGLresources);
/**
* Define the next yuv image to display. Note that yuv content will be copied.
*/
void ogl_display_set_yuv_to_display(struct opengles_display* gldisp, mblk_t *yuv);
void ogl_display_set_yuv_to_display (struct opengles_display *gldisp, mblk_t *yuv);
/**
* Define the next preview image to diaplsy. Note that yuv its content will be copied.
*/
void ogl_display_set_preview_yuv_to_display(struct opengles_display* gldisp, mblk_t *yuv);
void ogl_display_set_preview_yuv_to_display (struct opengles_display *gldisp, mblk_t *yuv);
void ogl_display_render(struct opengles_display* gldisp, int deviceAngleFromPortrait);
void ogl_display_render (struct opengles_display *gldisp, int deviceAngleFromPortrait);
/**
* @params contains the zoom parameters: [0] = zoom_factor, [1][2] = zoom center x/y (between [0,1], relative coords to the gl surface. 0.5/0.5 = center)
*/
void ogl_display_zoom(struct opengles_display* gldisp, float* params);
void ogl_display_zoom (struct opengles_display *gldisp, float *params);
#ifdef ANDROID
#include <jni.h>
JNIEXPORT void JNICALL Java_org_linphone_mediastream_video_display_OpenGLESDisplay_init(JNIEnv * env, jobject obj, jlong ptr, jint width, jint height);
JNIEXPORT void JNICALL Java_org_linphone_mediastream_video_display_OpenGLESDisplay_render(JNIEnv * env, jobject obj, jlong ptr);
JNIEXPORT void JNICALL Java_org_linphone_mediastream_video_display_OpenGLESDisplay_init (JNIEnv * env, jobject obj, jlong ptr, jint width, jint height);
JNIEXPORT void JNICALL Java_org_linphone_mediastream_video_display_OpenGLESDisplay_render (JNIEnv * env, jobject obj, jlong ptr);
#endif
#endif
/*
File: shaderUtil.c
File: shader_util.c
Abstract: Functions that compile, link and validate shader programs.
Version: 1.13
......@@ -43,152 +43,146 @@
Copyright (C) 2014 Apple Inc. All Rights Reserved.
*/
Original file modified by Belledonne Communications, Grenoble, France
Copyright (C) 2017
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include "shaderUtil.h"
#include "debug.h"
#include "shader_util.h"
#include "opengl_debug.h"
#define LogInfo printf
#define LogError printf
/* Compile a shader from the provided source(s) */
GLint glueCompileShader(GLenum target, GLsizei count, const GLchar *sources, GLuint *shader)
{
GLint logLength, status;
*shader = glCreateShader(target);
glShaderSource(*shader, count, &sources, NULL);
glCompileShader(*shader);
glGetShaderiv(*shader, GL_INFO_LOG_LENGTH, &logLength);
if (logLength > 0)
{
GLchar *log = (GLchar *)malloc(logLength);
glGetShaderInfoLog(*shader, logLength, &logLength, log);
LogInfo("Shader compile log:\n%s", log);
free(log);
}
GLint glueCompileShader (const OpenGlFunctions *f, GLenum target, GLsizei count, const GLchar *sources, GLuint *shader) {
GLint logLength, status;
glGetShaderiv(*shader, GL_COMPILE_STATUS, &status);
if (status == 0)
{
int i;
*shader = f->glCreateShader(target);
f->glShaderSource(*shader, count, &sources, NULL);
f->glCompileShader(*shader);
LogError("Failed to compile shader:\n");
for (i = 0; i < count; i++)
LogInfo("%s", &sources[i]);
}
glError();
return status;
}
f->glGetShaderiv(*shader, GL_INFO_LOG_LENGTH, &logLength);
if (logLength > 0) {
GLchar *log = (GLchar *)malloc(logLength);
f->glGetShaderInfoLog(*shader, logLength, &logLength, log);
LogInfo("Shader compile log:\n%s", log);
free(log);
}
f->glGetShaderiv(*shader, GL_COMPILE_STATUS, &status);
if (status == 0) {
int i;
/* Link a program with all currently attached shaders */
GLint glueLinkProgram(GLuint program)
{
GLint logLength, status;
glLinkProgram(program);
glGetProgramiv(program, GL_INFO_LOG_LENGTH, &logLength);
if (logLength > 0)
{
GLchar *log = (GLchar *)malloc(logLength);
glGetProgramInfoLog(program, logLength, &logLength, log);
LogInfo("Program link log:\n%s", log);
free(log);
}
LogError("Failed to compile shader:\n");
for (i = 0; i < count; i++)
LogInfo("%s", &sources[i]);
}
glGetProgramiv(program, GL_LINK_STATUS, &status);
if (status == 0)
LogError("Failed to link program %d", program);
glError();
glError(f);
return status;
return status;
}
/* Link a program with all currently attached shaders */
GLint glueLinkProgram (const OpenGlFunctions *f, GLuint program) {
GLint logLength, status;
/* Validate a program (for i.e. inconsistent samplers) */
GLint glueValidateProgram(GLuint program)
{
GLint logLength, status;
glValidateProgram(program);
glGetProgramiv(program, GL_INFO_LOG_LENGTH, &logLength);
if (logLength > 0)
{
GLchar *log = (GLchar *)malloc(logLength);
glGetProgramInfoLog(program, logLength, &logLength, log);
LogInfo("Program validate log:\n%s", log);
free(log);
}
f->glLinkProgram(program);
f->glGetProgramiv(program, GL_INFO_LOG_LENGTH, &logLength);
if (logLength > 0) {
GLchar *log = (GLchar *)malloc(logLength);
f->glGetProgramInfoLog(program, logLength, &logLength, log);
LogInfo("Program link log:\n%s", log);
free(log);
}
glGetProgramiv(program, GL_VALIDATE_STATUS, &status);
if (status == 0)
LogError("Failed to validate program %d", program);
glError();
f->glGetProgramiv(program, GL_LINK_STATUS, &status);
if (status == 0)
LogError("Failed to link program %d", program);
return status;
glError(f);
return status;
}
/* Validate a program (for i.e. inconsistent samplers) */
GLint glueValidateProgram (const OpenGlFunctions *f, GLuint program) {
GLint logLength, status;
/* Return named uniform location after linking */
GLint glueGetUniformLocation(GLuint program, const GLchar *uniformName)
{
GLint loc;
f->glValidateProgram(program);
f->glGetProgramiv(program, GL_INFO_LOG_LENGTH, &logLength);
if (logLength > 0) {
GLchar *log = (GLchar *)malloc(logLength);
f->glGetProgramInfoLog(program, logLength, &logLength, log);
LogInfo("Program validate log:\n%s", log);
free(log);
}
loc = glGetUniformLocation(program, uniformName);
f->glGetProgramiv(program, GL_VALIDATE_STATUS, &status);
if (status == 0)
LogError("Failed to validate program %d", program);
return loc;
glError(f);
return status;
}
/* Return named uniform location after linking */
GLint glueGetUniformLocation (const OpenGlFunctions *f, GLuint program, const GLchar *uniformName) {
return f->glGetUniformLocation(program, uniformName);
}
/* Convenience wrapper that compiles, links, enumerates uniforms and attribs */
GLint glueCreateProgram(const GLchar *vertSource, const GLchar *fragSource,
GLsizei attribNameCt, const GLchar **attribNames,
const GLint *attribLocations,
GLsizei uniformNameCt, const GLchar **uniformNames,
GLint *uniformLocations,
GLuint *program)
{
GLuint vertShader = 0, fragShader = 0, prog = 0, status = 1;
GLint i;
prog = glCreateProgram();
status *= glueCompileShader(GL_VERTEX_SHADER, 1, vertSource, &vertShader);
status *= glueCompileShader(GL_FRAGMENT_SHADER, 1, fragSource, &fragShader);
glAttachShader(prog, vertShader);
glAttachShader(prog, fragShader);
for (i = 0; i < attribNameCt; i++)
{
if(strlen(attribNames[i]))
glBindAttribLocation(prog, attribLocations[i], attribNames[i]);
GLint glueCreateProgram (
const OpenGlFunctions *f,
const GLchar *vertSource,
const GLchar *fragSource,
GLsizei attribNameCt,
const GLchar **attribNames,
const GLint *attribLocations,
GLsizei uniformNameCt,
const GLchar **uniformNames,
GLint *uniformLocations,
GLuint *program
) {
GLuint vertShader = 0, fragShader = 0, prog = 0, status = 1;
GLint i;
prog = f->glCreateProgram();
status *= glueCompileShader(f, GL_VERTEX_SHADER, 1, vertSource, &vertShader);
status *= glueCompileShader(f, GL_FRAGMENT_SHADER, 1, fragSource, &fragShader);
f->glAttachShader(prog, vertShader);
f->glAttachShader(prog, fragShader);
for (i = 0; i < attribNameCt; i++) {
if (strlen(attribNames[i]))
f->glBindAttribLocation(prog, attribLocations[i], attribNames[i]);
}
status *= glueLinkProgram(f, prog);
status *= glueValidateProgram(f, prog);
if (status) {
for (i = 0; i < uniformNameCt; i++) {
if (strlen(uniformNames[i]))
uniformLocations[i] = glueGetUniformLocation(f, prog, uniformNames[i]);
}
status *= glueLinkProgram(prog);
status *= glueValidateProgram(prog);
if (status)
{
for(i = 0; i < uniformNameCt; i++)
{
if(strlen(uniformNames[i]))
uniformLocations[i] = glueGetUniformLocation(prog, uniformNames[i]);
}
*program = prog;
}
if (vertShader)
glDeleteShader(vertShader);
if (fragShader)
glDeleteShader(fragShader);
glError();
*program = prog;
}
if (vertShader)
f->glDeleteShader(vertShader);
if (fragShader)
f->glDeleteShader(fragShader);
glError(f);
return status;
return status;
}
/*
File: shaderUtil.h
File: shader_util.h
Abstract: Functions that compile, link and validate shader programs.
Version: 1.13
......@@ -43,40 +43,37 @@
Copyright (C) 2014 Apple Inc. All Rights Reserved.
*/
Original file modified by Belledonne Communications, Grenoble, France
Copyright (C) 2017
*/
#ifndef SHADERUTIL_H
#define SHADERUTIL_H
#ifndef SHADER_UTIL_H
#define SHADER_UTIL_H
#ifdef __IOS
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>
#elif defined(__APPLE__)
#include <OpenGL/OpenGL.h>
#include <OpenGL/gl.h>
#elif defined( ANDROID )
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#else
#include <GL/glew.h>
#endif
#include "opengl_functions.h"
/* Shader Utilities */
GLint glueCompileShader(GLenum target, GLsizei count, const GLchar *sources, GLuint *shader);
GLint glueLinkProgram(GLuint program);
GLint glueValidateProgram(GLuint program);
GLint glueGetUniformLocation(GLuint program, const GLchar *name);
GLint glueCompileShader (const OpenGlFunctions *f, GLenum target, GLsizei count, const GLchar *sources, GLuint *shader);
GLint glueLinkProgram (const OpenGlFunctions *f, GLuint program);
GLint glueValidateProgram (const OpenGlFunctions *f, GLuint program);
GLint glueGetUniformLocation (const OpenGlFunctions *f, GLuint program, const GLchar *name);
/* Shader Conveniences */
GLint glueCreateProgram(const GLchar *vertSource, const GLchar *fragSource,
GLsizei attribNameCt, const GLchar **attribNames,
const GLint *attribLocations,
GLsizei uniformNameCt, const GLchar **uniformNames,
GLint *uniformLocations,
GLuint *program);
GLint glueCreateProgram (
const OpenGlFunctions *f,
const GLchar *vertSource,
const GLchar *fragSource,
GLsizei attribNameCt,
const GLchar **attribNames,
const GLint *attribLocations,
GLsizei uniformNameCt,
const GLchar **uniformNames,
GLint *uniformLocations,
GLuint *program
);
#ifdef __cplusplus
}
#endif
#endif /* SHADERUTIL_H */
#endif /* SHADER_UTIL_H */
/*
* ogl.c - A generic video display using OpenGL.
* generic_opengl_display.c - A generic video display using OpenGL.
*
* Copyright (C) 2017 Belledonne Communications, Grenoble, France
*
* 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 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