private void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture) {
        mainHandler.post(
                () -> {
                    SurfaceTexture oldSurfaceTexture = this.surfaceTexture;
                    Surface oldSurface = GLSurfaceRenderView.this.surface;
                    this.surfaceTexture = surfaceTexture;
                    this.surface = new Surface(surfaceTexture);
                    releaseSurface(oldSurfaceTexture, oldSurface);
                    if (player != null) {
                        player.setSurface(surface);
                    }
                });
    }
@param processor            Processor that draws to the view.
@param requireSecureContext Whether a GL context supporting protected content should be
                            created, if supported by the device.
dkplayer-sample/src/main/java/xyz/doikki/dkplayer/widget/render/gl/GLSurfaceRenderView.java