Home | History | Annotate | Download | only in jni
      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
     23 extern "C" {
     24 #endif
     25 
     26 JNIEXPORT jboolean JNICALL
     27 Java_android_filterfw_core_GLEnvironment_nativeAllocate(JNIEnv* env, jobject thiz);
     28 
     29 JNIEXPORT jboolean JNICALL
     30 Java_android_filterfw_core_GLEnvironment_nativeDeallocate(JNIEnv* env, jobject thiz);
     31 
     32 JNIEXPORT jboolean JNICALL
     33 Java_android_filterfw_core_GLEnvironment_nativeInitWithNewContext(JNIEnv* env, jobject thiz);
     34 
     35 JNIEXPORT jboolean JNICALL
     36 Java_android_filterfw_core_GLEnvironment_nativeInitWithCurrentContext(JNIEnv* env, jobject thiz);
     37 
     38 JNIEXPORT jboolean JNICALL
     39 Java_android_filterfw_core_GLEnvironment_nativeIsActive(JNIEnv* env, jobject thiz);
     40 
     41 JNIEXPORT jboolean JNICALL
     42 Java_android_filterfw_core_GLEnvironment_nativeIsContextActive(JNIEnv* env, jobject thiz);
     43 
     44 JNIEXPORT jboolean JNICALL
     45 Java_android_filterfw_core_GLEnvironment_nativeIsAnyContextActive(JNIEnv* env, jclass clazz);
     46 
     47 JNIEXPORT jboolean JNICALL
     48 Java_android_filterfw_core_GLEnvironment_nativeActivate(JNIEnv* env, jobject thiz);
     49 
     50 JNIEXPORT jboolean JNICALL
     51 Java_android_filterfw_core_GLEnvironment_nativeDeactivate(JNIEnv* env, jobject thiz);
     52 
     53 JNIEXPORT jboolean JNICALL
     54 Java_android_filterfw_core_GLEnvironment_nativeSwapBuffers(JNIEnv* env, jobject thiz);
     55 
     56 JNIEXPORT jint JNICALL
     57 Java_android_filterfw_core_GLEnvironment_nativeAddSurface(JNIEnv* env,
     58                                                           jobject thiz,
     59                                                           jobject surface);
     60 
     61 JNIEXPORT jint JNICALL
     62 Java_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 <IGraphicBufferProducer> handle
     72 JNIEXPORT jint JNICALL
     73 Java_android_filterfw_core_GLEnvironment_nativeAddSurfaceFromMediaRecorder(
     74                                                       JNIEnv* env,
     75                                                       jobject thiz,
     76                                                       jobject mediarecorder);
     77 
     78 JNIEXPORT jboolean JNICALL
     79 Java_android_filterfw_core_GLEnvironment_nativeActivateSurfaceId(JNIEnv* env,
     80                                                                  jobject thiz,
     81                                                                  jint surfaceId);
     82 
     83 JNIEXPORT jboolean JNICALL
     84 Java_android_filterfw_core_GLEnvironment_nativeRemoveSurfaceId(JNIEnv* env,
     85                                                                jobject thiz,
     86                                                                jint surfaceId);
     87 
     88 JNIEXPORT jboolean JNICALL
     89 Java_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