我正在尝试使用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();
}
}
运行程序后,我只得到黑屏。有人会突出显示,如果我在这里失踪了吗?