Forums - Android Studio Demo screen black

1 post / 0 new
Android Studio Demo screen black
879428217
Join Date: 15 Dec 20
Posts: 1
Posted: Thu, 2020-12-17 01:45

build a AS Demo success but screen is black

 

// Initialize the renderer
mRenderer = new FastCVSampleRenderer( this );
mGLSurface = mRenderer.getGLSurfaceView();
mGLSurface.setZOrderMediaOverlay(true);
mGLSurface.setVisibility( View.VISIBLE );
mGLSurface.setRenderMode( GLSurfaceView.RENDERMODE_WHEN_DIRTY );
mRootViewGroup.addView(mGLSurface);

// Camera surface is required for Camera to send
// preview frame callback on some devices.
// The order this is added to the rootViewGroup matters to ensure it is
// below GLSurface. GLSurface is actually used for rendering.

// Further note, when splash screen is not used this should be added
// after GLSurfaceView. Really tricky to get ordering correct.

mCamera = Camera.open();
mCamSurface = new CameraSurface( this, mCamera );
mRootViewGroup.addView(mCamSurface);

bringControlsToFront();
startPreview();
System.gc();

in this block, mCameSurface run success, but mGLSurface is black, I tried to adjust their order, but it also failed.

  • Up0
  • Down0

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.