类javax.microedition.khronos.egl.EGLSurface源码实例Demo

下面列出了怎么用javax.microedition.khronos.egl.EGLSurface的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: PhotoMovie   文件: GLTextureView.java
public EGLSurface createWindowSurface(EGL10 egl, EGLDisplay display,
                                      EGLConfig config, Object nativeWindow) {
    EGLSurface result = null;
    try {
        result = egl.eglCreateWindowSurface(display, config, nativeWindow, null);
    } catch (IllegalArgumentException e) {
        // This exception indicates that the surface flinger surface
        // is not valid. This can happen if the surface flinger surface has
        // been torn down, but the application has not yet been
        // notified via SurfaceHolder.Callback.surfaceDestroyed.
        // In theory the application should be notified first,
        // but in practice sometimes it is not. See b/4588890
        Log.e(TAG, "eglCreateWindowSurface", e);
    }
    return result;
}
 
源代码2 项目: VideoRecorder   文件: GLTextureView.java
public EGLSurface createWindowSurface(EGL10 egl, EGLDisplay display,
        EGLConfig config, Object nativeWindow) {
    EGLSurface result = null;
    try {
        result = egl.eglCreateWindowSurface(display, config, nativeWindow, null);
    } catch (IllegalArgumentException e) {
        // This exception indicates that the surface flinger surface
        // is not valid. This can happen if the surface flinger surface has
        // been torn down, but the application has not yet been
        // notified via SurfaceHolder.Callback.surfaceDestroyed.
        // In theory the application should be notified first,
        // but in practice sometimes it is not. See b/4588890
        Log.e(TAG, "eglCreateWindowSurface", e);
    }
    return result;
}
 
源代码3 项目: DanDanPlayForAndroid   文件: GLThread.java
@Override
public EGLSurface createWindowSurface(EGL10 egl, EGLDisplay display,
                                      EGLConfig config, Object nativeWindow) {

    int[] surfaceAttribs = {
            EGL10.EGL_NONE
    };
    EGLSurface result = null;
    try {
        result = egl.eglCreateWindowSurface(display, config, nativeWindow, surfaceAttribs);
    } catch (IllegalArgumentException e) {
        // This exception indicates that the surface flinger surface
        // is not valid. This can happen if the surface flinger surface has
        // been torn down, but the application has not yet been
        // notified via SurfaceHolder.Callback.surfaceDestroyed.
        // In theory the application should be notified first,
        // but in practice sometimes it is not. See b/4588890
        Log.e("DefaultWindow", "eglCreateWindowSurface", e);
    }
    return result;
}
 
源代码4 项目: DanDanPlayForAndroid   文件: GLThread.java
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
@Override
public android.opengl.EGLSurface createWindowSurface(android.opengl.EGLDisplay display, android.opengl.EGLConfig config, Object nativeWindow) {
    int[] surfaceAttribs = {
            EGL14.EGL_NONE
    };
    android.opengl.EGLSurface result = null;
    try {
        result = EGL14.eglCreateWindowSurface(display, config, nativeWindow, surfaceAttribs, 0);
    } catch (IllegalArgumentException e) {
        // This exception indicates that the surface flinger surface
        // is not valid. This can happen if the surface flinger surface has
        // been torn down, but the application has not yet been
        // notified via SurfaceHolder.Callback.surfaceDestroyed.
        // In theory the application should be notified first,
        // but in practice sometimes it is not. See b/4588890
        Log.e("DefaultWindow", "eglCreateWindowSurface", e);
    }
    return result;
}
 
源代码5 项目: unity-ads-android   文件: GLSurfaceView.java
public EGLSurface createWindowSurface(EGL10 egl, EGLDisplay display,
									  EGLConfig config, Object nativeWindow) {
	EGLSurface result = null;
	try {
		result = egl.eglCreateWindowSurface(display, config, nativeWindow, null);
	} catch (IllegalArgumentException e) {
		// This exception indicates that the surface flinger surface
		// is not valid. This can happen if the surface flinger surface has
		// been torn down, but the application has not yet been
		// notified via SurfaceHolder.Callback.surfaceDestroyed.
		// In theory the application should be notified first,
		// but in practice sometimes it is not. See b/4588890
		Log.e(TAG, "eglCreateWindowSurface", e);
	}
	return result;
}
 
源代码6 项目: MusicPlayer   文件: GLTextureView.java
public EGLSurface createWindowSurface(EGL10 egl, EGLDisplay display,
                                      EGLConfig config, Object nativeWindow) {
    EGLSurface result = null;
    try {
        result = egl.eglCreateWindowSurface(display, config, nativeWindow, null);
    } catch (IllegalArgumentException e) {
        // This exception indicates that the surface flinger surface
        // is not valid. This can happen if the surface flinger surface has
        // been torn down, but the application has not yet been
        // notified via SurfaceHolder.Callback.surfaceDestroyed.
        // In theory the application should be notified first,
        // but in practice sometimes it is not. See b/4588890
        Log.e(TAG, "eglCreateWindowSurface", e);
    }
    return result;
}
 
源代码7 项目: alpha-movie   文件: GLTextureView.java
public EGLSurface createWindowSurface(EGL10 egl, EGLDisplay display,
                                      EGLConfig config, Object nativeWindow) {
    EGLSurface result = null;
    try {
        result = egl.eglCreateWindowSurface(display, config, nativeWindow, null);
    } catch (IllegalArgumentException e) {
        // This exception indicates that the surface flinger surface
        // is not valid. This can happen if the surface flinger surface has
        // been torn down, but the application has not yet been
        // notified via SurfaceHolder.Callback.surfaceDestroyed.
        // In theory the application should be notified first,
        // but in practice sometimes it is not. See b/4588890
        Log.e(TAG, "eglCreateWindowSurface", e);
    }
    return result;
}
 
源代码8 项目: libcommon   文件: EGLBase10.java
/**
	 * change context to draw this window surface
	 * @return
	 */
	private final boolean makeCurrent(final EGLSurface surface) {
//		if (DEBUG) Log.v(TAG, "makeCurrent:");
/*		if (mEglDisplay == null) {
            if (DEBUG) Log.d(TAG, "makeCurrent:eglDisplay not initialized");
        } */
        if (surface == null || surface == EGL10.EGL_NO_SURFACE) {
            final int error = mEgl.eglGetError();
            if (error == EGL10.EGL_BAD_NATIVE_WINDOW) {
                Log.e(TAG, "makeCurrent:EGL_BAD_NATIVE_WINDOW");
            }
            return false;
        }
        // attach EGL rendering context to specific EGL window surface
        if (!mEgl.eglMakeCurrent(mEglDisplay, surface, surface, mContext.eglContext)) {
			Log.w("TAG", "eglMakeCurrent" + mEgl.eglGetError());
			return false;
        }
        return true;
	}
 
源代码9 项目: EZFilter   文件: GLSurfaceView.java
public EGLSurface createWindowSurface(EGL10 egl, EGLDisplay display,
                                      EGLConfig config, Object nativeWindow) {
    EGLSurface result = null;
    try {
        result = egl.eglCreateWindowSurface(display, config, nativeWindow, null);
    } catch (IllegalArgumentException e) {
        // This exception indicates that the surface flinger surface
        // is not valid. This can happen if the surface flinger surface has
        // been torn down, but the application has not yet been
        // notified via SurfaceHolder.Callback.surfaceDestroyed.
        // In theory the application should be notified first,
        // but in practice sometimes it is not. See b/4588890
        Log.e(TAG, "eglCreateWindowSurface", e);
    }
    return result;
}
 
源代码10 项目: EZFilter   文件: GLTextureView.java
public EGLSurface createWindowSurface(EGL10 egl, EGLDisplay display,
                                      EGLConfig config, Object nativeWindow) {
    EGLSurface result = null;
    try {
        result = egl.eglCreateWindowSurface(display, config, nativeWindow, null);
    } catch (IllegalArgumentException e) {
        // This exception indicates that the surface flinger surface
        // is not valid. This can happen if the surface flinger surface has
        // been torn down, but the application has not yet been
        // notified via SurfaceHolder.Callback.surfaceDestroyed.
        // In theory the application should be notified first,
        // but in practice sometimes it is not. See b/4588890
        Log.e(TAG, "eglCreateWindowSurface", e);
    }
    return result;
}
 
源代码11 项目: ZGDanmaku   文件: GLTextureView.java
public EGLSurface createWindowSurface(EGL10 egl, EGLDisplay display,
                                      EGLConfig config, Object nativeWindow) {
    EGLSurface result = null;
    try {
        result = egl.eglCreateWindowSurface(display, config, nativeWindow, null);
    } catch (IllegalArgumentException e) {
        // This exception indicates that the surface flinger surface
        // is not valid. This can happen if the surface flinger surface has
        // been torn down, but the application has not yet been
        // notified via SurfaceHolder.Callback.surfaceDestroyed.
        // In theory the application should be notified first,
        // but in practice sometimes it is not. See b/4588890
        Log.e(TAG, "eglCreateWindowSurface", e);
    }
    return result;
}
 
源代码12 项目: android-RoundedTextureView   文件: GLTextureView.java
public EGLSurface createWindowSurface(EGL10 egl, EGLDisplay display, EGLConfig config,
    Object nativeWindow) {
  EGLSurface result = null;
  try {
    result = egl.eglCreateWindowSurface(display, config, nativeWindow, null);
  } catch (IllegalArgumentException e) {
    // This exception indicates that the surface flinger surface
    // is not valid. This can happen if the surface flinger surface has
    // been torn down, but the application has not yet been
    // notified via SurfaceHolder.Callback.surfaceDestroyed.
    // In theory the application should be notified first,
    // but in practice sometimes it is not. See b/4588890
    Log.e(TAG, "eglCreateWindowSurface", e);
  }
  return result;
}
 
源代码13 项目: android-openGL-canvas   文件: GLThread.java
@Override
public EGLSurface createWindowSurface(EGL10 egl, EGLDisplay display,
                                      EGLConfig config, Object nativeWindow) {

    int[] surfaceAttribs = {
            EGL10.EGL_NONE
    };
    EGLSurface result = null;
    try {
        result = egl.eglCreateWindowSurface(display, config, nativeWindow, surfaceAttribs);
    } catch (IllegalArgumentException e) {
        // This exception indicates that the surface flinger surface
        // is not valid. This can happen if the surface flinger surface has
        // been torn down, but the application has not yet been
        // notified via SurfaceHolder.Callback.surfaceDestroyed.
        // In theory the application should be notified first,
        // but in practice sometimes it is not. See b/4588890
        Log.e("DefaultWindow", "eglCreateWindowSurface", e);
    }
    return result;
}
 
源代码14 项目: VIA-AI   文件: WindowSurfaceFactory.java
public EGLSurface createWindowSurface(EGL10 egl, EGLDisplay display,
                                      EGLConfig config, Object nativeWindow) {
    EGLSurface result = null;
    d = display;
    c = config;
    try {
        mEGLPreviewSurface = egl.eglCreateWindowSurface(display, config, nativeWindow, null);
    } catch (IllegalArgumentException e) {
        Log.e(TAG, "eglCreateWindowSurface (native)", e);
    }
    // this return will trigger Renderer
    result = mEGLPreviewSurface;
    return result;
}
 
源代码15 项目: HokoBlur   文件: EglBuffer.java
private EGLSurface createSurface(int width, int height) {
    int[] surfaceAttrs = {
            EGL10.EGL_WIDTH, width,
            EGL10.EGL_HEIGHT, height,
            EGL10.EGL_NONE
    };

    EGLSurface eglSurface = mEgl.eglCreatePbufferSurface(mEGLDisplay, mEglConfigs[0], surfaceAttrs);

    mEgl.eglMakeCurrent(mEGLDisplay, eglSurface, eglSurface, getEGLContext());

    return eglSurface;

}
 
源代码16 项目: HokoBlur   文件: EglBuffer.java
public Bitmap getBlurBitmap(Bitmap bitmap) {
    final int w = bitmap.getWidth();
    final int h = bitmap.getHeight();

    try {
        EGLSurface eglSurface = createSurface(w, h);
        if (eglSurface == null) {
            Log.e(TAG, "Create surface error");
            return bitmap;
        }

        OffScreenBlurRenderer renderer = getRenderer();
        if (renderer != null) {
            renderer.onDrawFrame(bitmap);
            mEgl.eglSwapBuffers(mEGLDisplay, eglSurface);
        } else {
            Log.e(TAG, "Renderer is unavailable");
            return bitmap;
        }
        convertToBitmap(bitmap);
    } catch (Throwable t) {
        Log.e(TAG, "Blur the bitmap error", t);
    } finally {
        unbindEglCurrent();
    }

    return bitmap;

}
 
源代码17 项目: DanDanPlayForAndroid   文件: EGLLogWrapper.java
public boolean eglCopyBuffers(EGLDisplay display, EGLSurface surface,
                              Object native_pixmap) {
    begin("eglCopyBuffers");
    arg("display", display);
    arg("surface", surface);
    arg("native_pixmap", native_pixmap);
    end();

    boolean result = mEgl10.eglCopyBuffers(display, surface, native_pixmap);
    returns(result);
    checkError();
    return result;
}
 
源代码18 项目: DanDanPlayForAndroid   文件: EGLLogWrapper.java
public EGLSurface eglCreatePixmapSurface(EGLDisplay display,
                                         EGLConfig config, Object native_pixmap, int[] attrib_list) {
    begin("eglCreatePixmapSurface");
    arg("display", display);
    arg("config", config);
    arg("native_pixmap", native_pixmap);
    arg("attrib_list", attrib_list);
    end();

    EGLSurface result = mEgl10.eglCreatePixmapSurface(display, config,
            native_pixmap, attrib_list);
    returns(result);
    checkError();
    return result;
}
 
源代码19 项目: DanDanPlayForAndroid   文件: EGLLogWrapper.java
public EGLSurface eglCreateWindowSurface(EGLDisplay display,
                                         EGLConfig config, Object native_window, int[] attrib_list) {
    begin("eglCreateWindowSurface");
    arg("display", display);
    arg("config", config);
    arg("native_window", native_window);
    arg("attrib_list", attrib_list);
    end();

    EGLSurface result = mEgl10.eglCreateWindowSurface(display, config,
            native_window, attrib_list);
    returns(result);
    checkError();
    return result;
}
 
源代码20 项目: DanDanPlayForAndroid   文件: EGLLogWrapper.java
public EGLSurface eglGetCurrentSurface(int readdraw) {
    begin("eglGetCurrentSurface");
    arg("readdraw", readdraw);
    end();

    EGLSurface result = mEgl10.eglGetCurrentSurface(readdraw);
    returns(result);

    checkError();
    return result;
}
 
源代码21 项目: DanDanPlayForAndroid   文件: EGLLogWrapper.java
public boolean eglSwapBuffers(EGLDisplay display, EGLSurface surface) {
    begin("eglSwapBuffers");
    arg("display", display);
    arg("surface", surface);
    end();
    boolean result = mEgl10.eglSwapBuffers(display, surface);
    returns(result);
    checkError();
    return result;
}
 
源代码22 项目: DanDanPlayForAndroid   文件: EGLLogWrapper.java
private void arg(String name, EGLSurface object) {
    if (object == EGL10.EGL_NO_SURFACE) {
        arg(name, "EGL10.EGL_NO_SURFACE");
    } else {
        arg(name, toString(object));
    }
}
 
源代码23 项目: libcommon   文件: EGLBase10.java
private final int swap(final EGLSurface surface) {
//		if (DEBUG) Log.v(TAG, "swap:");
        if (!mEgl.eglSwapBuffers(mEglDisplay, surface)) {
        	final int err = mEgl.eglGetError();
//        	if (DEBUG) Log.w(TAG, "swap:err=" + err);
            return err;
        }
        return EGL10.EGL_SUCCESS;
    }
 
源代码24 项目: libcommon   文件: EGLBase10.java
private final int getSurfaceHeight(final EGLSurface surface) {
	final int[] value = new int[1];
	final boolean ret = mEgl.eglQuerySurface(mEglDisplay,
		surface, EGL10.EGL_HEIGHT, value);
	if (!ret) value[0] = 0;
	return value[0];
}
 
源代码25 项目: android-openGL-canvas   文件: EGLLogWrapper.java
public EGLSurface eglCreatePbufferSurface(EGLDisplay display,
                                          EGLConfig config, int[] attrib_list) {
    begin("eglCreatePbufferSurface");
    arg("display", display);
    arg("config", config);
    arg("attrib_list", attrib_list);
    end();

    EGLSurface result = mEgl10.eglCreatePbufferSurface(display, config,
            attrib_list);
    returns(result);
    checkError();
    return result;
}
 
源代码26 项目: android-openGL-canvas   文件: EGLLogWrapper.java
public EGLSurface eglCreatePixmapSurface(EGLDisplay display,
                                         EGLConfig config, Object native_pixmap, int[] attrib_list) {
    begin("eglCreatePixmapSurface");
    arg("display", display);
    arg("config", config);
    arg("native_pixmap", native_pixmap);
    arg("attrib_list", attrib_list);
    end();

    EGLSurface result = mEgl10.eglCreatePixmapSurface(display, config,
            native_pixmap, attrib_list);
    returns(result);
    checkError();
    return result;
}
 
源代码27 项目: android-openGL-canvas   文件: EGLLogWrapper.java
public EGLSurface eglCreateWindowSurface(EGLDisplay display,
                                         EGLConfig config, Object native_window, int[] attrib_list) {
    begin("eglCreateWindowSurface");
    arg("display", display);
    arg("config", config);
    arg("native_window", native_window);
    arg("attrib_list", attrib_list);
    end();

    EGLSurface result = mEgl10.eglCreateWindowSurface(display, config,
            native_window, attrib_list);
    returns(result);
    checkError();
    return result;
}
 
源代码28 项目: android-openGL-canvas   文件: EGLLogWrapper.java
public boolean eglDestroySurface(EGLDisplay display, EGLSurface surface) {
    begin("eglDestroySurface");
    arg("display", display);
    arg("surface", surface);
    end();

    boolean result = mEgl10.eglDestroySurface(display, surface);
    returns(result);
    checkError();
    return result;
}
 
源代码29 项目: android-openGL-canvas   文件: EGLLogWrapper.java
public EGLSurface eglGetCurrentSurface(int readdraw) {
    begin("eglGetCurrentSurface");
    arg("readdraw", readdraw);
    end();

    EGLSurface result = mEgl10.eglGetCurrentSurface(readdraw);
    returns(result);

    checkError();
    return result;
}
 
源代码30 项目: android-openGL-canvas   文件: EGLLogWrapper.java
public boolean eglMakeCurrent(EGLDisplay display, EGLSurface draw,
                              EGLSurface read, EGLContext context) {
    begin("eglMakeCurrent");
    arg("display", display);
    arg("draw", draw);
    arg("read", read);
    arg("context", context);
    end();
    boolean result = mEgl10.eglMakeCurrent(display, draw, read, context);
    returns(result);
    checkError();
    return result;
}