Commit 1b08cc54 authored by Simon Morlat's avatar Simon Morlat

fix compilation problem with opengl on android

parent 7dc27b82
......@@ -35,4 +35,13 @@ public class Factory{
public void setDeviceInfo(String manufacturer, String model, String platform, int flags, int delay, int recommended_rate) {
setDeviceInfo(mNativePtr, manufacturer, model, platform, flags, delay, recommended_rate);
}
private native String getEncoderText(long nativePtr, String mime);
public String getEncoderText(String mime){
return getEncoderText(mNativePtr, mime);
}
private native String getDecoderText(long nativePtr, String mime);
public String getDecoderText(String mime){
return getDecoderText(mNativePtr, mime);
}
};
......@@ -872,6 +872,33 @@ JNIEXPORT jboolean JNICALL Java_org_linphone_mediastream_Factory_filterFromNameE
return result;
}
JNIEXPORT jstring JNICALL Java_org_linphone_mediastream_Factory_getEncoderText(JNIEnv* env, jobject obj,
jlong factoryPtr, jstring jmime) {
MSFactory *factory = (MSFactory*)factoryPtr;
const char *mime = (*env)->GetStringUTFChars(env, jmime, NULL);
jstring jtext = NULL;
if (mime){
MSFilterDesc *desc = ms_factory_get_encoder(factory, mime);
if (desc) jtext =(*env)->NewStringUTF(env, desc->text);
(*env)->ReleaseStringUTFChars(env, jmime, mime);
}
return jtext;
}
JNIEXPORT jstring JNICALL Java_org_linphone_mediastream_Factory_getDecoderText(JNIEnv* env, jobject obj,
jlong factoryPtr, jstring jmime) {
MSFactory *factory = (MSFactory*)factoryPtr;
const char *mime = (*env)->GetStringUTFChars(env, jmime, NULL);
jstring jtext = NULL;
if (mime){
MSFilterDesc *desc = ms_factory_get_decoder(factory, mime);
if (desc) jtext = (*env)->NewStringUTF(env, desc->text);
(*env)->ReleaseStringUTFChars(env, jmime, mime);
}
return jtext;
}
#ifdef _MSC_VER
#pragma warning(disable : 4996)
#else
......
#include "opengl_functions.h"
// =============================================================================
#ifdef ANDROID
#define CAST(type, fn) (type)fn
#else
#define CAST(type, fn) fn
#endif
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->glActiveTexture = CAST(resolveGlActiveTexture,glActiveTexture);
f->glAttachShader = CAST(resolveGlAttachShader,glAttachShader);
f->glBindAttribLocation = CAST(resolveGlBindAttribLocation,glBindAttribLocation);
f->glBindTexture = CAST(resolveGlBindTexture,glBindTexture);
f->glClear = CAST(resolveGlClear,glClear);
f->glClearColor = CAST(resolveGlClearColor, glClearColor);
f->glCompileShader = CAST(resolveGlCompileShader, glCompileShader);
f->glCreateProgram = CAST(resolveGlCreateProgram, glCreateProgram);
f->glCreateShader = CAST(resolveGlCreateShader, glCreateShader);
f->glDeleteProgram = CAST(resolveGlDeleteProgram, glDeleteProgram);
f->glDeleteShader = CAST(resolveGlDeleteShader, glDeleteShader);
f->glDeleteTextures = CAST(resolveGlDeleteTextures, glDeleteTextures);
f->glDisable = CAST(resolveGlDisable,glDisable);
f->glDrawArrays = CAST(resolveGlDrawArrays, glDrawArrays);
f->glEnableVertexAttribArray = CAST(resolveGlEnableVertexAttribArray, glEnableVertexAttribArray);
f->glGenTextures = CAST(resolveGlGenTextures,glGenTextures);
f->glGetError = CAST(resolveGlGetError, glGetError);
f->glGetProgramInfoLog = CAST(resolveGlGetProgramInfoLog, glGetProgramInfoLog);
f->glGetProgramiv = CAST(resolveGlGetProgramiv, glGetProgramiv);
f->glGetShaderInfoLog = CAST(resolveGlGetShaderInfoLog, glGetShaderInfoLog);
f->glGetShaderiv = CAST(resolveGlGetShaderiv, glGetShaderiv);
f->glGetString = CAST(resolveGlGetString, glGetString);
f->glGetUniformLocation = CAST(resolveGlGetUniformLocation, glGetUniformLocation);
f->glLinkProgram = CAST(resolveGlLinkProgram, glLinkProgram);
f->glPixelStorei = CAST(resolveGlPixelStorei, 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;
f->glTexImage2D = CAST(resolveGlTexImage2D, glTexImage2D);
f->glTexParameteri = CAST(resolveGlTexParameteri, glTexParameteri);
f->glTexSubImage2D = CAST(resolveGlTexSubImage2D, glTexSubImage2D);
f->glUniform1f = CAST(resolveGlUniform1f, glUniform1f);
f->glUniform1i = CAST(resolveGlUniform1i, glUniform1i);
f->glUniformMatrix4fv = CAST(resolveGlUniformMatrix4fv, glUniformMatrix4fv);
f->glUseProgram = CAST(resolveGlUseProgram, glUseProgram);
f->glValidateProgram = CAST(resolveGlValidateProgram, glValidateProgram);
f->glVertexAttribPointer = CAST(resolveGlVertexAttribPointer, glVertexAttribPointer);
f->glViewport = CAST(resolveGlViewport, glViewport);
#endif
}
......@@ -46,3 +46,7 @@ JNIEXPORT void JNICALL Java_org_linphone_mediastream_Factory_setDeviceInfo(JNIEn
ReleaseStringUTFChars(env, jmodel, model);
ReleaseStringUTFChars(env, jplatform, platform);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment