1/* 2 * Copyright (C) 2011 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17#ifndef ANDROID_FILTERFW_JNI_GL_ENVIRONMENT_H 18#define ANDROID_FILTERFW_JNI_GL_ENVIRONMENT_H 19 20#include <jni.h> 21 22#ifdef __cplusplus 23extern "C" { 24#endif 25 26JNIEXPORT jboolean JNICALL 27Java_android_filterfw_core_GLEnvironment_nativeAllocate(JNIEnv* env, jobject thiz); 28 29JNIEXPORT jboolean JNICALL 30Java_android_filterfw_core_GLEnvironment_nativeDeallocate(JNIEnv* env, jobject thiz); 31 32JNIEXPORT jboolean JNICALL 33Java_android_filterfw_core_GLEnvironment_nativeInitWithNewContext(JNIEnv* env, jobject thiz); 34 35JNIEXPORT jboolean JNICALL 36Java_android_filterfw_core_GLEnvironment_nativeInitWithCurrentContext(JNIEnv* env, jobject thiz); 37 38JNIEXPORT jboolean JNICALL 39Java_android_filterfw_core_GLEnvironment_nativeIsActive(JNIEnv* env, jobject thiz); 40 41JNIEXPORT jboolean JNICALL 42Java_android_filterfw_core_GLEnvironment_nativeIsContextActive(JNIEnv* env, jobject thiz); 43 44JNIEXPORT jboolean JNICALL 45Java_android_filterfw_core_GLEnvironment_nativeIsAnyContextActive(JNIEnv* env, jclass clazz); 46 47JNIEXPORT jboolean JNICALL 48Java_android_filterfw_core_GLEnvironment_nativeActivate(JNIEnv* env, jobject thiz); 49 50JNIEXPORT jboolean JNICALL 51Java_android_filterfw_core_GLEnvironment_nativeDeactivate(JNIEnv* env, jobject thiz); 52 53JNIEXPORT jboolean JNICALL 54Java_android_filterfw_core_GLEnvironment_nativeSwapBuffers(JNIEnv* env, jobject thiz); 55 56JNIEXPORT jint JNICALL 57Java_android_filterfw_core_GLEnvironment_nativeAddSurface(JNIEnv* env, 58 jobject thiz, 59 jobject surface); 60 61JNIEXPORT jint JNICALL 62Java_android_filterfw_core_GLEnvironment_nativeAddSurfaceWidthHeight(JNIEnv* env, 63 jobject thiz, 64 jobject surface, 65 jint width, 66 jint height); 67 68// The call to hook up the SurfaceMediaSource (in MediaServer) to the GL. 69// We get a sp<ISurfaceTexure> from the MediaServer and talks to MediaServer 70// over a binder interface. GL hooked up to the MediaServer by using the native 71// window created using the <ISurfaceTexture> handle 72JNIEXPORT jint JNICALL 73Java_android_filterfw_core_GLEnvironment_nativeAddSurfaceFromMediaRecorder( 74 JNIEnv* env, 75 jobject thiz, 76 jobject mediarecorder); 77 78JNIEXPORT jboolean JNICALL 79Java_android_filterfw_core_GLEnvironment_nativeActivateSurfaceId(JNIEnv* env, 80 jobject thiz, 81 jint surfaceId); 82 83JNIEXPORT jboolean JNICALL 84Java_android_filterfw_core_GLEnvironment_nativeRemoveSurfaceId(JNIEnv* env, 85 jobject thiz, 86 jint surfaceId); 87 88JNIEXPORT jboolean JNICALL 89Java_android_filterfw_core_GLEnvironment_nativeSetSurfaceTimestamp(JNIEnv* env, 90 jobject thiz, 91 jlong timestamp); 92 93#ifdef __cplusplus 94} 95#endif 96 97#endif // ANDROID_FILTERFW_JNI_GL_ENVIRONMENT_H 98