void OMXInstance_UpdateJavaAttributes(OMXToolBasicAV_t *pAV)
{
    if(NULL==pAV || 0==pAV->jni_instance) {
        fprintf(stderr, "OMXInstance_UpdateJavaAttributes failed");
        return;
    }
    int shallBeDetached = 0;
    JNIEnv  * env = JoglCommon_GetJNIEnv (1 /* daemon */, &shallBeDetached); 
    if(NULL!=env) {
        (*env)->CallVoidMethod(env, (jobject)pAV->jni_instance, jni_mid_updateAttributes,
                               pAV->width, pAV->height, 
                               pAV->bitrate, 0, 0, 
                               pAV->framerate, (uint32_t)(pAV->length*pAV->framerate), pAV->length,
                               (*env)->NewStringUTF(env, pAV->videoCodec),
                               (*env)->NewStringUTF(env, pAV->audioCodec) );
        // detaching thread not required - daemon
        // JoglCommon_ReleaseJNIEnv(shallBeDetached);
    }
}
示例#2
0
// GLDEBUGAMD(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
static void GLDebugMessageAMDCallback(GLuint id, GLenum category, GLenum severity, 
                                      GLsizei length, const GLchar *message, GLvoid *userParam) {
    DebugHandlerType * handle = (DebugHandlerType*) (intptr_t) userParam;
    jobject obj = handle->obj;
    JNIEnv *env = NULL;
    int shallBeDetached ;
    DBG_PRINT("GLDebugMessageAMDCallback: 00 - %s, jobject %p, extType %d\n", message, (void*)handle->obj, handle->extType);

    env = JoglCommon_GetJNIEnv (1 /* asDaemon */, &shallBeDetached);
    if( NULL == env ) {
        DBG_PRINT("GLDebugMessageARBCallback: Null JNIEnv\n");
        return;
    }
    (*env)->CallVoidMethod(env, obj, glDebugMessageAMD, 
                              (jint) id, (jint) category, (jint) severity, 
                              (*env)->NewStringUTF(env, message));
    // detached attached thread not required - daemon
    // JoglCommon_ReleaseJNIEnv(shallBeDetached);
    DBG_PRINT("GLDebugMessageAMDCallback: 0X\n");
    /**
     * On Java 32bit on 64bit Windows,
     * the unit test com.jogamp.opengl.test.junit.jogl.acore.TestGLDebug00NEWT crashes after this point.
     */
}