app/src/main/java/io/agora/openvcall/ScreenShareService.java
/**
     * To notify when the preview surface texture has been updated.
     * Called by the system camera module.
     *
     * @param surfaceTexture camera preview surface texture.
     */
To notify when the preview surface texture has been updated.
Called by the system camera module.

@param surfaceTexture camera preview surface texture.
To notify when the preview surface texture has been updated . Called by the system camera module . @param surfaceTexture camera preview surface texture .
@Override
    public void onFrameAvailable(SurfaceTexture surfaceTexture) {
        if (mTextureDestroyed) return;
        try {
            try {
                surfaceTexture.updateTexImage();
                surfaceTexture.getTransformMatrix(mTransform);
            } catch (Exception e) {
                e.printStackTrace();
            }
            calculateDisplayTransform();
            GLES20.glViewport(0, 0, mSurfaceWidth, mSurfaceHeight);
            agoraApplication.rtcEngine().pushExternalVideoFrame(
                    buildVideoFrame(mTextureId, mTransform));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
@ Override public void onFrameAvailable ( SurfaceTexture surfaceTexture ) { if ( mTextureDestroyed ) return ; try { try { surfaceTexture . updateTexImage ( ) ; surfaceTexture . getTransformMatrix ( mTransform ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } calculateDisplayTransform ( ) ; GLES20 . glViewport ( 0 , 0 , mSurfaceWidth , mSurfaceHeight ) ; agoraApplication . rtcEngine ( ) . pushExternalVideoFrame ( buildVideoFrame ( mTextureId , mTransform ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } }
To notify when the preview surface texture has been updated.
To notify when the preview surface texture has been updated .
// The rectangle ratio of frames and the screen surface // may be different, so cropping may happen when display // frames to the screen. //            mProgram.drawFrame(mTextureId, mTransform, mMVPMatrix);