Example usage for android.opengl GLSurfaceView getHolder

List of usage examples for android.opengl GLSurfaceView getHolder

Introduction

In this page you can find the example usage for android.opengl GLSurfaceView getHolder.

Prototype

public SurfaceHolder getHolder() 

Source Link

Document

Return the SurfaceHolder providing access and control over this SurfaceView's underlying surface.

Usage

From source file:net.nanocosmos.bintu.demo.encoder.activities.StreamActivity.java

@Override
public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
    Surface foo = new Surface(surface);
    SurfaceView foo1 = new SurfaceView(this);
    foo = foo1.getHolder().getSurface();
    GLSurfaceView foo2 = new GLSurfaceView(this);
    foo = foo2.getHolder().getSurface();

    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
        initStreamLib();/*from   w  w w  . j a v a2  s. com*/
    } else {
        appPermissions = new CheckAppPermissions(this);
        boolean needPermission = false;
        if (streamVideo) {
            needPermission |= !appPermissions.checkCameraPermissions();
        }
        if (streamAudio) {
            needPermission |= !appPermissions.checkRecordAudioPermission();
        }
        if (recordMp4) {
            needPermission |= !appPermissions.checkWriteExternalStoragePermission();
        }

        if (needPermission) {
            appPermissions.requestMissingPermissions();
        } else {
            initStreamLib();
        }
    }
}