Java 类android.opengl.EGLExt 实例源码

项目:EZFilter    文件:GLSurfaceView.java   
private int[] filterConfigSpec(int[] configSpec) {
    if (mEGLContextClientVersion != 2 && mEGLContextClientVersion != 3) {
        return configSpec;
    }
    /* We know none of the subclasses define EGL_RENDERABLE_TYPE.
     * And we know the configSpec is well formed.
     */
    int len = configSpec.length;
    int[] newConfigSpec = new int[len + 2];
    System.arraycopy(configSpec, 0, newConfigSpec, 0, len - 1);
    newConfigSpec[len - 1] = EGL10.EGL_RENDERABLE_TYPE;
    if (mEGLContextClientVersion == 2) {
        newConfigSpec[len] = EGL14.EGL_OPENGL_ES2_BIT;  /* EGL_OPENGL_ES2_BIT */
    } else {
        newConfigSpec[len] = EGLExt.EGL_OPENGL_ES3_BIT_KHR; /* EGL_OPENGL_ES3_BIT_KHR */
    }
    newConfigSpec[len + 1] = EGL10.EGL_NONE;
    return newConfigSpec;
}
项目:EZFilter    文件:GLTextureView.java   
private int[] filterConfigSpec(int[] configSpec) {
    if (mEGLContextClientVersion != 2 && mEGLContextClientVersion != 3) {
        return configSpec;
    }
    /* We know none of the subclasses define EGL_RENDERABLE_TYPE.
     * And we know the configSpec is well formed.
     */
    int len = configSpec.length;
    int[] newConfigSpec = new int[len + 2];
    System.arraycopy(configSpec, 0, newConfigSpec, 0, len - 1);
    newConfigSpec[len - 1] = EGL10.EGL_RENDERABLE_TYPE;
    if (mEGLContextClientVersion == 2) {
        newConfigSpec[len] = EGL14.EGL_OPENGL_ES2_BIT;  /* EGL_OPENGL_ES2_BIT */
    } else {
        newConfigSpec[len] = EGLExt.EGL_OPENGL_ES3_BIT_KHR; /* EGL_OPENGL_ES3_BIT_KHR */
    }
    newConfigSpec[len + 1] = EGL10.EGL_NONE;
    return newConfigSpec;
}
项目:android-openGL-canvas    文件:GLThread.java   
private int[] filterConfigSpec(int[] configSpec) {
    if (contextClientVersion != 2 && contextClientVersion != 3) {
        return configSpec;
    }
    /* We know none of the subclasses define EGL_RENDERABLE_TYPE.
     * And we know the configSpec is well formed.
     */
    int len = configSpec.length;
    int[] newConfigSpec = new int[len + 2];
    System.arraycopy(configSpec, 0, newConfigSpec, 0, len - 1);
    newConfigSpec[len - 1] = EGL10.EGL_RENDERABLE_TYPE;
    if (contextClientVersion == 2) {
        newConfigSpec[len] = EGL14.EGL_OPENGL_ES2_BIT;  /* EGL_OPENGL_ES2_BIT */
    } else {
        newConfigSpec[len] = EGLExt.EGL_OPENGL_ES3_BIT_KHR; /* EGL_OPENGL_ES3_BIT_KHR */
    }
    newConfigSpec[len + 1] = EGL10.EGL_NONE;
    return newConfigSpec;
}
项目:360-Video-Player-for-Android    文件:RajawaliTextureView.java   
private int[] filterConfigSpec(int[] configSpec) {
    if (mEGLContextClientVersion != 2 && mEGLContextClientVersion != 3) {
        return configSpec;
    }
    /* We know none of the subclasses define EGL_RENDERABLE_TYPE.
     * And we know the configSpec is well formed.
     */
    int len = configSpec.length;
    int[] newConfigSpec = new int[len + 2];
    System.arraycopy(configSpec, 0, newConfigSpec, 0, len - 1);
    newConfigSpec[len - 1] = EGL10.EGL_RENDERABLE_TYPE;
    if (mEGLContextClientVersion == 2) {
        newConfigSpec[len] = EGL14.EGL_OPENGL_ES2_BIT;  /* EGL_OPENGL_ES2_BIT */
    } else {
        newConfigSpec[len] = EGLExt.EGL_OPENGL_ES3_BIT_KHR; /* EGL_OPENGL_ES3_BIT_KHR */
    }
    newConfigSpec[len + 1] = EGL10.EGL_NONE;
    return newConfigSpec;
}
项目:VR-Defense-Game    文件:TextureView.java   
private int[] filterConfigSpec(int[] configSpec) {
    if (mEGLContextClientVersion != 2 && mEGLContextClientVersion != 3) {
        return configSpec;
    }
    /* We know none of the subclasses define EGL_RENDERABLE_TYPE.
     * And we know the configSpec is well formed.
     */
    int len = configSpec.length;
    int[] newConfigSpec = new int[len + 2];
    System.arraycopy(configSpec, 0, newConfigSpec, 0, len - 1);
    newConfigSpec[len - 1] = EGL10.EGL_RENDERABLE_TYPE;
    if (mEGLContextClientVersion == 2) {
        newConfigSpec[len] = EGL14.EGL_OPENGL_ES2_BIT;  /* EGL_OPENGL_ES2_BIT */
    } else {
        newConfigSpec[len] = EGLExt.EGL_OPENGL_ES3_BIT_KHR; /* EGL_OPENGL_ES3_BIT_KHR */
    }
    newConfigSpec[len + 1] = EGL10.EGL_NONE;
    return newConfigSpec;
}
项目:java6-android-glframework    文件:GLSurfaceView2.java   
private int[] filterConfigSpec(int[] configSpec)
{
   int majorGLVersion = eglContextGLESVersion.getMajorVersion();

   if (majorGLVersion != 2 && majorGLVersion != 3)
   {
      return configSpec;
   }
      /* We know none of the subclasses define EGL_RENDERABLE_TYPE.
       * And we know the configSpec is well formed.
       */
   int len = configSpec.length;
   int[] newConfigSpec = new int[len + 2];
   System.arraycopy(configSpec, 0, newConfigSpec, 0, len - 1);
   newConfigSpec[len - 1] = EGL14.EGL_RENDERABLE_TYPE;
   if (majorGLVersion == 2)
   {
      newConfigSpec[len] = EGL14.EGL_OPENGL_ES2_BIT;  /* EGL_OPENGL_ES2_BIT */
   }
   else
   {
      newConfigSpec[len] = EGLExt.EGL_OPENGL_ES3_BIT_KHR; /* EGL_OPENGL_ES3_BIT_KHR */
   }
   newConfigSpec[len + 1] = EGL14.EGL_NONE;
   return newConfigSpec;
}
项目:Fatigue-Detection    文件:EglCore.java   
/**
 * Finds a suitable EGLConfig.
 *
 * @param flags Bit flags from constructor.
 * @param version Must be 2 or 3.
 */
private EGLConfig getConfig(int flags, int version) {
    int renderableType = EGL14.EGL_OPENGL_ES2_BIT;
    if (version >= 3) {
        renderableType |= EGLExt.EGL_OPENGL_ES3_BIT_KHR;
    }

    // The actual surface is generally RGBA or RGBX, so situationally omitting alpha
    // doesn't really help.  It can also lead to a huge performance hit on glReadPixels()
    // when reading into a GL_RGBA buffer.
    int[] attribList = {
            EGL14.EGL_RED_SIZE, 8,
            EGL14.EGL_GREEN_SIZE, 8,
            EGL14.EGL_BLUE_SIZE, 8,
            EGL14.EGL_ALPHA_SIZE, 8,
            //EGL14.EGL_DEPTH_SIZE, 16,
            //EGL14.EGL_STENCIL_SIZE, 8,
            EGL14.EGL_RENDERABLE_TYPE, renderableType,
            EGL14.EGL_NONE, 0,      // placeholder for recordable [@-3]
            EGL14.EGL_NONE
    };
    if ((flags & FLAG_RECORDABLE) != 0) {
        attribList[attribList.length - 3] = EGL_RECORDABLE_ANDROID;
        attribList[attribList.length - 2] = 1;
    }
    EGLConfig[] configs = new EGLConfig[1];
    int[] numConfigs = new int[1];
    if (!EGL14.eglChooseConfig(mEGLDisplay, attribList, 0, configs, 0, configs.length,
            numConfigs, 0)) {
        Log.w(TAG, "unable to find RGB8888 / " + version + " EGLConfig");
        return null;
    }
    return configs[0];
}
项目:mpeg-encoder    文件:GLTools.java   
/**
 * Sends the presentation time stamp to EGL.
 * @param display an EGL display connection instance
 * @param surface an EGL rendering surface
 * @param nSecs time is expressed in nanoseconds.
 */
public static void setPresentationTime(@NonNull EGLDisplay display,
        @NonNull EGLSurface surface, long nSecs) {
    //noinspection StatementWithEmptyBody
    if (!EGLExt.eglPresentationTimeANDROID(display, surface, nSecs)) {
        logError();
        throw new RuntimeException("Unable to set presentation time (" + nSecs +"ns)." +
                getDisplayString(display) + "; " + getSurfaceString(surface));
    } else {/*
        logDebug("Set presentation time (" + nSecs +"ns)." +
                getDisplayString(display) + "; " + getSurfaceString(surface));*/
    }
}
项目:grafika    文件:EglCore.java   
/**
 * Finds a suitable EGLConfig.
 *
 * @param flags Bit flags from constructor.
 * @param version Must be 2 or 3.
 */
private EGLConfig getConfig(int flags, int version) {
    int renderableType = EGL14.EGL_OPENGL_ES2_BIT;
    if (version >= 3) {
        renderableType |= EGLExt.EGL_OPENGL_ES3_BIT_KHR;
    }

    // The actual surface is generally RGBA or RGBX, so situationally omitting alpha
    // doesn't really help.  It can also lead to a huge performance hit on glReadPixels()
    // when reading into a GL_RGBA buffer.
    int[] attribList = {
            EGL14.EGL_RED_SIZE, 8,
            EGL14.EGL_GREEN_SIZE, 8,
            EGL14.EGL_BLUE_SIZE, 8,
            EGL14.EGL_ALPHA_SIZE, 8,
            //EGL14.EGL_DEPTH_SIZE, 16,
            //EGL14.EGL_STENCIL_SIZE, 8,
            EGL14.EGL_RENDERABLE_TYPE, renderableType,
            EGL14.EGL_NONE, 0,      // placeholder for recordable [@-3]
            EGL14.EGL_NONE
    };
    if ((flags & FLAG_RECORDABLE) != 0) {
        attribList[attribList.length - 3] = EGL_RECORDABLE_ANDROID;
        attribList[attribList.length - 2] = 1;
    }
    EGLConfig[] configs = new EGLConfig[1];
    int[] numConfigs = new int[1];
    if (!EGL14.eglChooseConfig(mEGLDisplay, attribList, 0, configs, 0, configs.length,
            numConfigs, 0)) {
        Log.w(TAG, "unable to find RGB8888 / " + version + " EGLConfig");
        return null;
    }
    return configs[0];
}
项目:Agora-Screen-Sharing-Android    文件:EglCore.java   
/**
 * Finds a suitable EGLConfig.
 *
 * @param flags   Bit flags from constructor.
 * @param version Must be 2 or 3.
 */
private EGLConfig getConfig(int flags, int version) {
    int renderableType = EGL14.EGL_OPENGL_ES2_BIT;
    if (version >= 3) {
        renderableType |= EGLExt.EGL_OPENGL_ES3_BIT_KHR;
    }

    // The actual surface is generally RGBA or RGBX, so situationally omitting alpha
    // doesn't really help.  It can also lead to a huge performance hit on glReadPixels()
    // when reading into a GL_RGBA buffer.
    int[] attribList = {
            EGL14.EGL_RED_SIZE, 8,
            EGL14.EGL_GREEN_SIZE, 8,
            EGL14.EGL_BLUE_SIZE, 8,
            EGL14.EGL_ALPHA_SIZE, 8,
            //EGL14.EGL_DEPTH_SIZE, 16,
            //EGL14.EGL_STENCIL_SIZE, 8,
            EGL14.EGL_RENDERABLE_TYPE, renderableType,
            EGL14.EGL_NONE, 0,      // placeholder for recordable [@-3]
            EGL14.EGL_NONE
    };
    if ((flags & FLAG_RECORDABLE) != 0) {
        attribList[attribList.length - 3] = EGL_RECORDABLE_ANDROID;
        attribList[attribList.length - 2] = 1;
    }
    EGLConfig[] configs = new EGLConfig[1];
    int[] numConfigs = new int[1];
    if (!EGL14.eglChooseConfig(mEGLDisplay, attribList, 0, configs, 0, configs.length,
            numConfigs, 0)) {
        Log.w(TAG, "unable to find RGB8888 / " + version + " EGLConfig");
        return null;
    }
    return configs[0];
}
项目:AppRTC-Android    文件:EglBase14.java   
@Override
public void swapBuffers(long timeStampNs) {
  checkIsNotReleased();
  if (eglSurface == EGL14.EGL_NO_SURFACE) {
    throw new RuntimeException("No EGLSurface - can't swap buffers");
  }
  synchronized (EglBase.lock) {
    // See
    // https://android.googlesource.com/platform/frameworks/native/+/tools_r22.2/opengl/specs/EGL_ANDROID_presentation_time.txt
    EGLExt.eglPresentationTimeANDROID(eglDisplay, eglSurface, timeStampNs);
    EGL14.eglSwapBuffers(eglDisplay, eglSurface);
  }
}
项目:EditPhoto    文件:EglCore.java   
/**
 * Finds a suitable EGLConfig.
 *
 * @param flags Bit flags from constructor.
 * @param version Must be 2 or 3.
 */
private EGLConfig getConfig(int flags, int version) {
    int renderableType = EGL14.EGL_OPENGL_ES2_BIT;
    if (version >= 3) {
        renderableType |= EGLExt.EGL_OPENGL_ES3_BIT_KHR;
    }

    // The actual surface is generally RGBA or RGBX, so situationally omitting alpha
    // doesn't really help.  It can also lead to a huge performance hit on glReadPixels()
    // when reading into a GL_RGBA buffer.
    int[] attribList = {
            EGL14.EGL_RED_SIZE, 8, EGL14.EGL_GREEN_SIZE, 8, EGL14.EGL_BLUE_SIZE, 8,
            EGL14.EGL_ALPHA_SIZE, 8,
            //EGL14.EGL_DEPTH_SIZE, 16,
            //EGL14.EGL_STENCIL_SIZE, 8,
            EGL14.EGL_RENDERABLE_TYPE, renderableType, EGL14.EGL_NONE, 0,
            // placeholder for recordable [@-3]
            EGL14.EGL_NONE
    };
    if ((flags & FLAG_RECORDABLE) != 0) {
        attribList[attribList.length - 3] = EGL_RECORDABLE_ANDROID;
        attribList[attribList.length - 2] = 1;
    }
    EGLConfig[] configs = new EGLConfig[1];
    int[] numConfigs = new int[1];
    if (!EGL14.eglChooseConfig(mEGLDisplay, attribList, 0, configs, 0, configs.length,
            numConfigs, 0)) {
        Log.w(TAG, "unable to find RGB8888 / " + version + " EGLConfig");
        return null;
    }
    return configs[0];
}
项目:mao-android    文件:EglCore.java   
/**
 * Finds a suitable EGLConfig.
 *
 * @param flags   Bit flags from constructor.
 * @param version Must be 2 or 3.
 */
private EGLConfig getConfig(int flags, int version) {
    int renderableType = EGL14.EGL_OPENGL_ES2_BIT;
    if (version >= 3) {
        renderableType |= EGLExt.EGL_OPENGL_ES3_BIT_KHR;
    }

    // The actual surface is generally RGBA or RGBX, so situationally omitting alpha
    // doesn't really help.  It can also lead to a huge performance hit on glReadPixels()
    // when reading into a GL_RGBA buffer.
    int[] attribList = {
            EGL14.EGL_RED_SIZE, 8,
            EGL14.EGL_GREEN_SIZE, 8,
            EGL14.EGL_BLUE_SIZE, 8,
            EGL14.EGL_ALPHA_SIZE, 8,
            //EGL14.EGL_DEPTH_SIZE, 16,
            //EGL14.EGL_STENCIL_SIZE, 8,
            EGL14.EGL_RENDERABLE_TYPE, renderableType,
            EGL14.EGL_NONE, 0,      // placeholder for recordable [@-3]
            EGL14.EGL_NONE
    };
    if ((flags & FLAG_RECORDABLE) != 0) {
        attribList[attribList.length - 3] = EGL_RECORDABLE_ANDROID;
        attribList[attribList.length - 2] = 1;
    }
    EGLConfig[] configs = new EGLConfig[1];
    int[] numConfigs = new int[1];
    if (!EGL14.eglChooseConfig(mEGLDisplay, attribList, 0, configs, 0, configs.length,
            numConfigs, 0)) {
        Log.w(TAG, "unable to find RGB8888 / " + version + " EGLConfig");
        return null;
    }
    return configs[0];
}
项目:AndroidRTC    文件:EglBase14.java   
public void swapBuffers(long timeStampNs) {
  checkIsNotReleased();
  if (eglSurface == EGL14.EGL_NO_SURFACE) {
    throw new RuntimeException("No EGLSurface - can't swap buffers");
  }
  synchronized (EglBase.lock) {
    // See
    // https://android.googlesource.com/platform/frameworks/native/+/tools_r22.2/opengl/specs/EGL_ANDROID_presentation_time.txt
    EGLExt.eglPresentationTimeANDROID(eglDisplay, eglSurface, timeStampNs);
    EGL14.eglSwapBuffers(eglDisplay, eglSurface);
  }
}
项目:VideoCRE    文件:EglBase14.java   
@Override
public void swapBuffers(long timestampNs) {
  checkIsNotReleased();
  if (eglSurface == EGL14.EGL_NO_SURFACE) {
    throw new RuntimeException("No EGLSurface - can't swap buffers");
  }
  synchronized (EglBase.lock) {
    // See
    // https://android.googlesource.com/platform/frameworks/native/+/tools_r22.2/opengl/specs/EGL_ANDROID_presentation_time.txt
    if (timestampNs != -1) {
      EGLExt.eglPresentationTimeANDROID(eglDisplay, eglSurface, timestampNs);
    }
    EGL14.eglSwapBuffers(eglDisplay, eglSurface);
  }
}
项目:android-openGL-canvas    文件:EglHelperAPI17.java   
/**
 * Sends the presentation time stamp to EGL.
 *
 * @param nsecs Timestamp, in nanoseconds.
 */
@Override
public void setPresentationTime(long nsecs) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2 && nsecs != 0) {
        EGLExt.eglPresentationTimeANDROID(mEglDisplay, mEglSurface, nsecs);
    }
}
项目:android-openGL-canvas    文件:GLThread.java   
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public android.opengl.EGLConfig chooseConfig(android.opengl.EGLDisplay display, boolean recordable) {
    int renderableType = EGL14.EGL_OPENGL_ES2_BIT;
    if (contextClientVersion >= 3) {
        renderableType |= EGLExt.EGL_OPENGL_ES3_BIT_KHR;
    }

    // The actual surface is generally RGBA or RGBX, so situationally omitting alpha
    // doesn't really help.  It can also lead to a huge performance hit on glReadPixels()
    // when reading into a GL_RGBA buffer.
    int[] attribList = {
            EGL14.EGL_RED_SIZE, 8,
            EGL14.EGL_GREEN_SIZE, 8,
            EGL14.EGL_BLUE_SIZE, 8,
            EGL14.EGL_ALPHA_SIZE, 8,
            //EGL14.EGL_DEPTH_SIZE, 16,
            //EGL14.EGL_STENCIL_SIZE, 8,
            EGL14.EGL_RENDERABLE_TYPE, renderableType,
            EGL14.EGL_NONE, 0,      // placeholder for recordable [@-3]
            EGL14.EGL_NONE
    };
    if (recordable) {
        attribList[attribList.length - 3] = EGL_RECORDABLE_ANDROID;
        attribList[attribList.length - 2] = 1;
    }
    android.opengl.EGLConfig[] configs = new android.opengl.EGLConfig[1];
    int[] numConfigs = new int[1];
    if (!EGL14.eglChooseConfig(display, attribList, 0, configs, 0, configs.length,
            numConfigs, 0)) {
        Log.w("GLThread", "unable to find RGB8888 / " + contextClientVersion + " EGLConfig");
        return null;
    }
    return configs[0];
}
项目:IjkVRPlayer    文件:EglCore.java   
/**
 * Finds a suitable EGLConfig.
 *
 * @param flags Bit flags from constructor.
 * @param version Must be 2 or 3.
 */
private EGLConfig getConfig(int flags, int version) {
    int renderableType = EGL14.EGL_OPENGL_ES2_BIT;
    if (version >= 3) {
        renderableType |= EGLExt.EGL_OPENGL_ES3_BIT_KHR;
    }

    // The actual surface is generally RGBA or RGBX, so situationally omitting alpha
    // doesn't really help.  It can also lead to a huge performance hit on glReadPixels()
    // when reading into a GL_RGBA buffer.
    int[] attribList = {
            EGL14.EGL_RED_SIZE, 8,
            EGL14.EGL_GREEN_SIZE, 8,
            EGL14.EGL_BLUE_SIZE, 8,
            EGL14.EGL_ALPHA_SIZE, 8,
            //EGL14.EGL_DEPTH_SIZE, 16,
            //EGL14.EGL_STENCIL_SIZE, 8,
            EGL14.EGL_RENDERABLE_TYPE, renderableType,
            EGL14.EGL_NONE, 0,      // placeholder for recordable [@-3]
            EGL14.EGL_NONE
    };
    if ((flags & FLAG_RECORDABLE) != 0) {
        attribList[attribList.length - 3] = EGL_RECORDABLE_ANDROID;
        attribList[attribList.length - 2] = 1;
    }
    EGLConfig[] configs = new EGLConfig[1];
    int[] numConfigs = new int[1];
    if (!EGL14.eglChooseConfig(mEGLDisplay, attribList, 0, configs, 0, configs.length,
            numConfigs, 0)) {
        Log.w(TAG, "unable to find RGB8888 / " + version + " EGLConfig");
        return null;
    }
    return configs[0];
}
项目:libcommon    文件:EGLBase14.java   
private int swap(final EGLSurface surface, final long presentationTimeNs) {
//      if (DEBUG) Log.v(TAG, "swap:");
        EGLExt.eglPresentationTimeANDROID(mEglDisplay, surface, presentationTimeNs);
        if (!EGL14.eglSwapBuffers(mEglDisplay, surface)) {
            final int err = EGL14.eglGetError();
//          if (DEBUG) Log.w(TAG, "swap:err=" + err);
            return err;
        }
        return EGL14.EGL_SUCCESS;
    }
项目:MockCamera    文件:EglCore.java   
/**
 * Finds a suitable EGLConfig.
 *
 * @param flags   Bit flags from constructor.
 * @param version Must be 2 or 3.
 */
private EGLConfig getConfig(int flags, int version) {
    int renderableType = EGL14.EGL_OPENGL_ES2_BIT;
    if (version >= 3) {
        renderableType |= EGLExt.EGL_OPENGL_ES3_BIT_KHR;
    }

    // The actual surface is generally RGBA or RGBX, so situationally omitting alpha
    // doesn't really help.  It can also lead to a huge performance hit on glReadPixels()
    // when reading into a GL_RGBA buffer.
    int[] attribList = {
            EGL14.EGL_RED_SIZE, 8,
            EGL14.EGL_GREEN_SIZE, 8,
            EGL14.EGL_BLUE_SIZE, 8,
            EGL14.EGL_ALPHA_SIZE, 8,
            //EGL14.EGL_DEPTH_SIZE, 16,
            //EGL14.EGL_STENCIL_SIZE, 8,
            EGL14.EGL_RENDERABLE_TYPE, renderableType,
            EGL14.EGL_NONE, 0,      // placeholder for recordable [@-3]
            EGL14.EGL_NONE
    };
    if ((flags & FLAG_RECORDABLE) != 0) {
        attribList[attribList.length - 3] = EGL_RECORDABLE_ANDROID;
        attribList[attribList.length - 2] = 1;
    }
    EGLConfig[] configs = new EGLConfig[1];
    int[] numConfigs = new int[1];
    if (!EGL14.eglChooseConfig(eGLDisplay, attribList, 0, configs, 0, configs.length,
            numConfigs, 0)) {
        Log.w(TAG, "unable to find RGB8888 / " + version + " EGLConfig");
        return null;
    }
    return configs[0];
}
项目:mediacodec    文件:EglCore.java   
/**
 * Finds a suitable EGLConfig.
 *
 * @param flags Bit flags from constructor.
 * @param version Must be 2 or 3.
 */
private EGLConfig getConfig(int flags, int version) {
    int renderableType = EGL14.EGL_OPENGL_ES2_BIT;
    if (version >= 3) {
        renderableType |= EGLExt.EGL_OPENGL_ES3_BIT_KHR;
    }

    // The actual surface is generally RGBA or RGBX, so situationally omitting alpha
    // doesn't really help.  It can also lead to a huge performance hit on glReadPixels()
    // when reading into a GL_RGBA buffer.
    int[] attribList = {
            EGL14.EGL_RED_SIZE, 8,
            EGL14.EGL_GREEN_SIZE, 8,
            EGL14.EGL_BLUE_SIZE, 8,
            EGL14.EGL_ALPHA_SIZE, 8,
            //EGL14.EGL_DEPTH_SIZE, 16,
            //EGL14.EGL_STENCIL_SIZE, 8,
            EGL14.EGL_RENDERABLE_TYPE, renderableType,
            EGL14.EGL_NONE, 0,      // placeholder for recordable [@-3]
            EGL14.EGL_NONE
    };
    if ((flags & FLAG_RECORDABLE) != 0) {
        attribList[attribList.length - 3] = EGL_RECORDABLE_ANDROID;
        attribList[attribList.length - 2] = 1;
    }
    EGLConfig[] configs = new EGLConfig[1];
    int[] numConfigs = new int[1];
    if (!EGL14.eglChooseConfig(mEGLDisplay, attribList, 0, configs, 0, configs.length,
            numConfigs, 0)) {
        Log.w(TAG, "unable to find RGB8888 / " + version + " EGLConfig");
        return null;
    }
    return configs[0];
}
项目:360-Video-Player-for-Android    文件:Capabilities.java   
private static void checkGLVersion() {
    // Get an EGL context and display
    final EGL10 egl = (EGL10) EGLContext.getEGL();
    final EGLDisplay display = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);

    final int[] version = new int[2];
    if (!egl.eglInitialize(display, version)) throw new IllegalStateException("Failed to initialize and EGL context while getting device capabilities.");
    mEGLMajorVersion = version[0];
    mEGLMinorVersion = version[1];
    // RajLog.d("Device EGL Version: " + version[0] + "." + version[1]);

    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) {
        // The API for GLES3 doesnt exist on this device
        // RajLog.d("Device is API level cannot support OpenGL ES 3.");
        mGLESMajorVersion = 2;
    } else {
        // The API for GLES3 might exist, we need to check
        // RajLog.d("Attempting to get an OpenGL ES 3 config.");
        final int[] configAttribs = {EGL10.EGL_RED_SIZE, 4, EGL10.EGL_GREEN_SIZE, 4, EGL10.EGL_BLUE_SIZE, 4,
            EGL10.EGL_RENDERABLE_TYPE, EGLExt.EGL_OPENGL_ES3_BIT_KHR, EGL10.EGL_NONE};

        final EGLConfig[] configs = new EGLConfig[10];
        final int[] num_config = new int[1];
        egl.eglChooseConfig(display, configAttribs, configs, 10, num_config);
        egl.eglTerminate(display);
        mGLESMajorVersion = num_config[0] > 0 ? 3 : 2;
    }

    // RajLog.d("Determined GLES Major version to be: " + mGLESMajorVersion);
    sGLChecked = true;
}
项目:EffectCamera    文件:EglCore.java   
/**
 * Finds a suitable EGLConfig.
 *
 * @param flags Bit flags from constructor.
 * @param version Must be 2 or 3.
 */
private EGLConfig getConfig(int flags, int version) {
    int renderableType = EGL14.EGL_OPENGL_ES2_BIT;
    if (version >= 3) {
        renderableType |= EGLExt.EGL_OPENGL_ES3_BIT_KHR;
    }

    // The actual surface is generally RGBA or RGBX, so situationally omitting alpha
    // doesn't really help.  It can also lead to a huge performance hit on glReadPixels()
    // when reading into a GL_RGBA buffer.
    int[] attribList = {
            EGL14.EGL_RED_SIZE, 8,
            EGL14.EGL_GREEN_SIZE, 8,
            EGL14.EGL_BLUE_SIZE, 8,
            EGL14.EGL_ALPHA_SIZE, 8,
            //EGL14.EGL_DEPTH_SIZE, 16,
            //EGL14.EGL_STENCIL_SIZE, 8,
            EGL14.EGL_RENDERABLE_TYPE, renderableType,
            EGL14.EGL_NONE, 0,      // placeholder for recordable [@-3]
            EGL14.EGL_NONE
    };
    if ((flags & FLAG_RECORDABLE) != 0) {
        attribList[attribList.length - 3] = EGL_RECORDABLE_ANDROID;
        attribList[attribList.length - 2] = 1;
    }
    EGLConfig[] configs = new EGLConfig[1];
    int[] numConfigs = new int[1];
    if (!EGL14.eglChooseConfig(mEGLDisplay, attribList, 0, configs, 0, configs.length,
            numConfigs, 0)) {
        Log.w(TAG, "unable to find RGB8888 / " + version + " EGLConfig");
        return null;
    }
    return configs[0];
}
项目:pause-resume-video-recording    文件:EglCore.java   
/**
 * Finds a suitable EGLConfig.
 *
 * @param flags Bit flags from constructor.
 * @param version Must be 2 or 3.
 */
private EGLConfig getConfig(int flags, int version) {
    int renderableType = EGL14.EGL_OPENGL_ES2_BIT;
    if (version >= 3) {
        renderableType |= EGLExt.EGL_OPENGL_ES3_BIT_KHR;
    }

    // The actual surface is generally RGBA or RGBX, so situationally omitting alpha
    // doesn't really help.  It can also lead to a huge performance hit on glReadPixels()
    // when reading into a GL_RGBA buffer.
    int[] attribList = {
            EGL14.EGL_RED_SIZE, 8,
            EGL14.EGL_GREEN_SIZE, 8,
            EGL14.EGL_BLUE_SIZE, 8,
            EGL14.EGL_ALPHA_SIZE, 8,
            //EGL14.EGL_DEPTH_SIZE, 16,
            //EGL14.EGL_STENCIL_SIZE, 8,
            EGL14.EGL_RENDERABLE_TYPE, renderableType,
            EGL14.EGL_NONE, 0,      // placeholder for recordable [@-3]
            EGL14.EGL_NONE
    };
    if ((flags & FLAG_RECORDABLE) != 0) {
        attribList[attribList.length - 3] = EGL_RECORDABLE_ANDROID;
        attribList[attribList.length - 2] = 1;
    }
    EGLConfig[] configs = new EGLConfig[1];
    int[] numConfigs = new int[1];
    if (!EGL14.eglChooseConfig(mEGLDisplay, attribList, 0, configs, 0, configs.length,
            numConfigs, 0)) {
        Log.w(TAG, "unable to find RGB8888 / " + version + " EGLConfig");
        return null;
    }
    return configs[0];
}
项目:HardwareEncodingTest    文件:EglCore.java   
/**
 * Finds a suitable EGLConfig.
 *
 * @param flags Bit flags from constructor.
 * @param version Must be 2 or 3.
 */
private EGLConfig getConfig(int flags, int version) {
    int renderableType = EGL14.EGL_OPENGL_ES2_BIT;
    if (version >= 3) {
        renderableType |= EGLExt.EGL_OPENGL_ES3_BIT_KHR;
    }

    // The actual surface is generally RGBA or RGBX, so situationally omitting alpha
    // doesn't really help.  It can also lead to a huge performance hit on glReadPixels()
    // when reading into a GL_RGBA buffer.
    int[] attribList = {
            EGL14.EGL_RED_SIZE, 8,
            EGL14.EGL_GREEN_SIZE, 8,
            EGL14.EGL_BLUE_SIZE, 8,
            EGL14.EGL_ALPHA_SIZE, 8,
            //EGL14.EGL_DEPTH_SIZE, 16,
            //EGL14.EGL_STENCIL_SIZE, 8,
            EGL14.EGL_RENDERABLE_TYPE, renderableType,
            EGL14.EGL_NONE, 0,      // placeholder for recordable [@-3]
            EGL14.EGL_NONE
    };
    if ((flags & FLAG_RECORDABLE) != 0) {
        attribList[attribList.length - 3] = EGL_RECORDABLE_ANDROID;
        attribList[attribList.length - 2] = 1;
    }
    EGLConfig[] configs = new EGLConfig[1];
    int[] numConfigs = new int[1];
    if (!EGL14.eglChooseConfig(mEGLDisplay, attribList, 0, configs, 0, configs.length,
            numConfigs, 0)) {
        Log.w(TAG, "unable to find RGB8888 / " + version + " EGLConfig");
        return null;
    }
    return configs[0];
}
项目:binea_project_for_android    文件:EglCore.java   
/**
 * Finds a suitable EGLConfig.
 *
 * @param flags Bit flags from constructor.
 * @param version Must be 2 or 3.
 */
private EGLConfig getConfig(int flags, int version) {
    int renderableType = EGL14.EGL_OPENGL_ES2_BIT;
    if (version >= 3) {
        renderableType |= EGLExt.EGL_OPENGL_ES3_BIT_KHR;
    }

    // The actual surface is generally RGBA or RGBX, so situationally omitting alpha
    // doesn't really help.  It can also lead to a huge performance hit on glReadPixels()
    // when reading into a GL_RGBA buffer.
    int[] attribList = {
            EGL14.EGL_RED_SIZE, 8,
            EGL14.EGL_GREEN_SIZE, 8,
            EGL14.EGL_BLUE_SIZE, 8,
            EGL14.EGL_ALPHA_SIZE, 8,
            //EGL14.EGL_DEPTH_SIZE, 16,
            //EGL14.EGL_STENCIL_SIZE, 8,
            EGL14.EGL_RENDERABLE_TYPE, renderableType,
            EGL14.EGL_NONE, 0,      // placeholder for recordable [@-3]
            EGL14.EGL_NONE
    };
    if ((flags & FLAG_RECORDABLE) != 0) {
        attribList[attribList.length - 3] = EGL_RECORDABLE_ANDROID;
        attribList[attribList.length - 2] = 1;
    }
    EGLConfig[] configs = new EGLConfig[1];
    int[] numConfigs = new int[1];
    if (!EGL14.eglChooseConfig(mEGLDisplay, attribList, 0, configs, 0, configs.length,
            numConfigs, 0)) {
        Log.w(TAG, "unable to find RGB8888 / " + version + " EGLConfig");
        return null;
    }
    return configs[0];
}
项目:AndroidPlayground    文件:EglCore.java   
/**
 * Finds a suitable EGLConfig.
 *
 * @param flags Bit flags from constructor.
 * @param version Must be 2 or 3.
 */
private EGLConfig getConfig(int flags, int version) {
    int renderableType = EGL14.EGL_OPENGL_ES2_BIT;
    if (version >= 3) {
        renderableType |= EGLExt.EGL_OPENGL_ES3_BIT_KHR;
    }

    // The actual surface is generally RGBA or RGBX, so situationally omitting alpha
    // doesn't really help.  It can also lead to a huge performance hit on glReadPixels()
    // when reading into a GL_RGBA buffer.
    int[] attribList = {
            EGL14.EGL_RED_SIZE, 8,
            EGL14.EGL_GREEN_SIZE, 8,
            EGL14.EGL_BLUE_SIZE, 8,
            EGL14.EGL_ALPHA_SIZE, 8,
            //EGL14.EGL_DEPTH_SIZE, 16,
            //EGL14.EGL_STENCIL_SIZE, 8,
            EGL14.EGL_RENDERABLE_TYPE, renderableType,
            EGL14.EGL_NONE, 0,      // placeholder for recordable [@-3]
            EGL14.EGL_NONE
    };
    if ((flags & FLAG_RECORDABLE) != 0) {
        attribList[attribList.length - 3] = EGL_RECORDABLE_ANDROID;
        attribList[attribList.length - 2] = 1;
    }
    EGLConfig[] configs = new EGLConfig[1];
    int[] numConfigs = new int[1];
    if (!EGL14.eglChooseConfig(mEGLDisplay, attribList, 0, configs, 0, configs.length,
            numConfigs, 0)) {
        Log.w(TAG, "unable to find RGB8888 / " + version + " EGLConfig");
        return null;
    }
    return configs[0];
}
项目:PerchBroadcast-Android-SDK    文件:EglCore.java   
/**
 * Finds a suitable EGLConfig.
 *
 * @param flags Bit flags from constructor.
 * @param version Must be 2 or 3.
 */
private EGLConfig getConfig(int flags, int version) {
    int renderableType = EGL14.EGL_OPENGL_ES2_BIT;
    if (version >= 3) {
        renderableType |= EGLExt.EGL_OPENGL_ES3_BIT_KHR;
    }

    // The actual surface is generally RGBA or RGBX, so situationally omitting alpha
    // doesn't really help.  It can also lead to a huge performance hit on glReadPixels()
    // when reading into a GL_RGBA buffer.
    int[] attribList = {
            EGL14.EGL_RED_SIZE, 8,
            EGL14.EGL_GREEN_SIZE, 8,
            EGL14.EGL_BLUE_SIZE, 8,
            EGL14.EGL_ALPHA_SIZE, 8,
            //EGL14.EGL_DEPTH_SIZE, 16,
            //EGL14.EGL_STENCIL_SIZE, 8,
            EGL14.EGL_RENDERABLE_TYPE, renderableType,
            EGL14.EGL_NONE, 0,      // placeholder for recordable [@-3]
            EGL14.EGL_NONE
    };
    if ((flags & FLAG_RECORDABLE) != 0) {
        attribList[attribList.length - 3] = EGL_RECORDABLE_ANDROID;
        attribList[attribList.length - 2] = 1;
    }
    EGLConfig[] configs = new EGLConfig[1];
    int[] numConfigs = new int[1];
    if (!EGL14.eglChooseConfig(mEGLDisplay, attribList, 0, configs, 0, configs.length,
            numConfigs, 0)) {
        Log.w(TAG, "unable to find RGB8888 / " + version + " EGLConfig");
        return null;
    }
    return configs[0];
}
项目:cineio-broadcast-android    文件:EglCore.java   
/**
 * Finds a suitable EGLConfig.
 *
 * @param flags   Bit flags from constructor.
 * @param version Must be 2 or 3.
 */
private EGLConfig getConfig(int flags, int version) {
    int renderableType = EGL14.EGL_OPENGL_ES2_BIT;
    if (version >= 3) {
        renderableType |= EGLExt.EGL_OPENGL_ES3_BIT_KHR;
    }

    // The actual surface is generally RGBA or RGBX, so situationally omitting alpha
    // doesn't really help.  It can also lead to a huge performance hit on glReadPixels()
    // when reading into a GL_RGBA buffer.
    int[] attribList = {
            EGL14.EGL_RED_SIZE, 8,
            EGL14.EGL_GREEN_SIZE, 8,
            EGL14.EGL_BLUE_SIZE, 8,
            EGL14.EGL_ALPHA_SIZE, 8,
            //EGL14.EGL_DEPTH_SIZE, 16,
            //EGL14.EGL_STENCIL_SIZE, 8,
            EGL14.EGL_RENDERABLE_TYPE, renderableType,
            EGL14.EGL_NONE, 0,      // placeholder for recordable [@-3]
            EGL14.EGL_NONE
    };
    if ((flags & FLAG_RECORDABLE) != 0) {
        attribList[attribList.length - 3] = EGL_RECORDABLE_ANDROID;
        attribList[attribList.length - 2] = 1;
    }
    EGLConfig[] configs = new EGLConfig[1];
    int[] numConfigs = new int[1];
    if (!EGL14.eglChooseConfig(mEGLDisplay, attribList, 0, configs, 0, configs.length,
            numConfigs, 0)) {
        Log.w(TAG, "unable to find RGB8888 / " + version + " EGLConfig");
        return null;
    }
    return configs[0];
}
项目:kickflip-android-sdk    文件:EglCore.java   
/**
 * Finds a suitable EGLConfig.
 *
 * @param flags Bit flags from constructor.
 * @param version Must be 2 or 3.
 */
private EGLConfig getConfig(int flags, int version) {
    int renderableType = EGL14.EGL_OPENGL_ES2_BIT;
    if (version >= 3) {
        renderableType |= EGLExt.EGL_OPENGL_ES3_BIT_KHR;
    }

    // The actual surface is generally RGBA or RGBX, so situationally omitting alpha
    // doesn't really help.  It can also lead to a huge performance hit on glReadPixels()
    // when reading into a GL_RGBA buffer.
    int[] attribList = {
            EGL14.EGL_RED_SIZE, 8,
            EGL14.EGL_GREEN_SIZE, 8,
            EGL14.EGL_BLUE_SIZE, 8,
            EGL14.EGL_ALPHA_SIZE, 8,
            //EGL14.EGL_DEPTH_SIZE, 16,
            //EGL14.EGL_STENCIL_SIZE, 8,
            EGL14.EGL_RENDERABLE_TYPE, renderableType,
            EGL14.EGL_NONE, 0,      // placeholder for recordable [@-3]
            EGL14.EGL_NONE
    };
    if ((flags & FLAG_RECORDABLE) != 0) {
        attribList[attribList.length - 3] = EGL_RECORDABLE_ANDROID;
        attribList[attribList.length - 2] = 1;
    }
    EGLConfig[] configs = new EGLConfig[1];
    int[] numConfigs = new int[1];
    if (!EGL14.eglChooseConfig(mEGLDisplay, attribList, 0, configs, 0, configs.length,
            numConfigs, 0)) {
        Log.w(TAG, "unable to find RGB8888 / " + version + " EGLConfig");
        return null;
    }
    return configs[0];
}
项目:AAVT    文件:EglHelper.java   
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
public void setPresentationTime(EGLSurface surface, long time){
    EGLExt.eglPresentationTimeANDROID(mEGLDisplay,surface,time);
}
项目:libRtmp    文件:RecorderImpl.java   
void setPresentationTime(long nsecs) {
    EGLExt.eglPresentationTimeANDROID(mEGLDisplay, mEGLSurface, nsecs);
}
项目:19porn    文件:InputSurface.java   
public void setPresentationTime(long nsecs) {
    EGLExt.eglPresentationTimeANDROID(mEGLDisplay, mEGLSurface, nsecs);
}
项目:airgram    文件:InputSurface.java   
public void setPresentationTime(long nsecs) {
    EGLExt.eglPresentationTimeANDROID(mEGLDisplay, mEGLSurface, nsecs);
}
项目:Hotspot-master-devp    文件:InputSurface.java   
/**
 * Sends the presentation time stamp to EGL.  Time is expressed in nanoseconds.
 */
public void setPresentationTime(long nsecs) {
    EGLExt.eglPresentationTimeANDROID(mEGLDisplay, mEGLSurface, nsecs);
}
项目:Fatigue-Detection    文件:EglCore.java   
/**
 * Sends the presentation time stamp to EGL.  Time is expressed in nanoseconds.
 */
public void setPresentationTime(EGLSurface eglSurface, long nsecs) {
    EGLExt.eglPresentationTimeANDROID(mEGLDisplay, eglSurface, nsecs);
}
项目:grafika    文件:EglCore.java   
/**
 * Sends the presentation time stamp to EGL.  Time is expressed in nanoseconds.
 */
public void setPresentationTime(EGLSurface eglSurface, long nsecs) {
    EGLExt.eglPresentationTimeANDROID(mEGLDisplay, eglSurface, nsecs);
}
项目:MediaCodecRecorder    文件:GLContext.java   
public void setPresentationTime(EGLSurface eglSurface, long nsecs) {
    EGLExt.eglPresentationTimeANDROID(mEGLDisplay, eglSurface, nsecs);
}
项目:sdl_video_streaming_android_sample    文件:InputSurface.java   
/**
 * Sends the presentation time stamp to EGL.  Time is expressed in nanoseconds.
 */
public void setPresentationTime(long nsecs) {
    EGLExt.eglPresentationTimeANDROID(mEGLDisplay, mEGLSurface, nsecs);
}
项目:Agora-Screen-Sharing-Android    文件:EglCore.java   
/**
 * Sends the presentation time stamp to EGL.  Time is expressed in nanoseconds.
 */
public void setPresentationTime(EGLSurface eglSurface, long nsecs) {
    EGLExt.eglPresentationTimeANDROID(mEGLDisplay, eglSurface, nsecs);
}