Video must be displayed in the adroid. The requirements for camera and 3D are as follows:
1) video is displayed at the end and full screen
2) if 3D is displayed in the middle and no image is required to be transparent, you can see the following video in a place without 3D images.
3) camera is displayed at the top layer.
The implementation scheme is as follows:
1) create a surfaceview for video
2) create a glsurfaceview for 3D
3) create a surfaceview for camera
The reference code is as follows:
Mediaview = (surfaceview) findviewbyid (R. Id. media_surfaceview );
Cameraview = (surfaceview) findviewbyid (R. Id. camera_surfaceview );
Glview = new gl2jniview (getapplication (), true, 16, 0 );
// Place glview in the middle
Glview. setzordermediaoverlay (true );
// Put cameraview at the top
Cameraview. setzorderontop (true );
Linearlayout. layoutparams para = new linearlayout. layoutparams (linearlayout. layoutparams. fill_parent,
Linearlayout. layoutparams. fill_parent );
This. addcontentview (mglview, para );
For details about glsurface transparency, see ndk samples gl2jniview.
Of course, before reneder a frame, you shocould call: glclearcolor)
3D transparency has two key points:
1. glsurfaceview must be transparent.
2. the OpenGL render must be transparent.