使用GLSurfaceView进行相机预览

时间:2015-11-03 15:58:43

标签: android opengl-es android-camera glsurfaceview

我正在尝试使用GLSurfaceView实现Android相机预览。以下是Github

上的代码
@Override
    public void onDrawFrame(GL10 gl) {
        Timber.d("mVideoInputSource.isReady(): " + mVideoInputSource.isReady());

        if (this.mVideoInputSource.isReady()) {
            Timber.d("mVideoInputSource.nextFrame() is called ");
            this.mVideoInputSource.nextFrame();
        }
    }

    public void nextFrame() {
        if (this.mSurfaceTexture != null) {
            this.mSurfaceTexture.updateTexImage();
            this.mSurfaceTexture.getTransformMatrix(this.mTransform);
            mFullScreen.drawFrame(mTextureId, this.mTransform);
            checkOrientationChanged();
        }
    }

运行程序后,我只得到黑屏。有人会突出显示,如果我在这里失踪了吗?

0 个答案:

没有答案