핸드폰 화면상에는 카메라뷰와, opengl ES로 구현한 이미지가 동시에 잘보입니다..
그러나 녹화하고나면 opengl의 view는 녹화가 안되고 그냥 카메라 부분만 녹화가 됩니다..
어찌보면 당연한거 같긴한데..
어떻게해야 opengl의 surfaceview까지 촬영할수있을까요?
참고로 Opengl ES 2.0을 사용중입니다.
아래 코드는 카메라 뷰와 opengles뷰를 합치는 코드부분입니다..
((굳이 opengl view가 아니더라도 겹쳐지는 버튼이나 이미지뷰를 영상과 같이 녹화하고싶습니다!)
DisplayMetrics displaymetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
int height = displaymetrics.heightPixels;
int width = displaymetrics.widthPixels;
GLSurfaceView = new GameGLSurfaceView(this, width, height);
setContentView(GLSurfaceView); //OpenGl화면으로 가기
LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
RelativeLayout linear = (RelativeLayout)inflater.inflate(R.layout.activity_chat, null);
RelativeLayout.LayoutParams paramlinear = new RelativeLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
RelativeLayout.LayoutParams.MATCH_PARENT);
this.addContentView(linear, paramlinear);//이 부분이 레이아웃을겹치는 부분
surfaceView = (SurfaceView) findViewById(R.id.surfaceView);
surfaceHolder = surfaceView.getHolder();
surfaceHolder.addCallback(this);
surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
mCamera = Camera.open();
surfaceView.setClickable(true);
surfaceView.setOnClickListener(this);