I am creating a custom camera application,and I have found a serious issue with Nexus 7. When I record the video with front camera, the recorded video is smooth and reproduces the same colors, but if the recording was done with Back Camera, the color reproduced are red changes to blue and yellow to cyan. This issue is happening only in Nexus 7. Can some one help out with a solution.
mMediaRecorder = new MediaRecorder();
// Step 1: Unlock and set camera to MediaRecorder
mCamera.unlock();
mMediaRecorder.setCamera(mCamera);
mMediaRecorder.setMaxDuration(25000);
if (mCameraPosition == CameraInfo.CAMERA_FACING_FRONT) {
if (orientation == Configuration.ORIENTATION_LANDSCAPE)
mMediaRecorder.setOrientationHint(0);
else if (orientation == Configuration.ORIENTATION_PORTRAIT)
mMediaRecorder.setOrientationHint(270);
else if (orientation == REVERSED_LANDSCAPE) {
mMediaRecorder.setOrientationHint(180);
} else {
mMediaRecorder.setOrientationHint(90);
}
} else {
if (orientation == Configuration.ORIENTATION_PORTRAIT) {
mMediaRecorder.setOrientationHint(angle);
} else if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
mMediaRecorder.setOrientationHint(0);
} else if (orientation == REVERSED_LANDSCAPE) {
mMediaRecorder.setOrientationHint(180);
} else {
mMediaRecorder.setOrientationHint(270);
}
}
// Step 2: Set sources
mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
// Step 3: Set a CamcorderProfile (requires API Level 8 or higher)
mMediaRecorder.setProfile(CamcorderProfile.get(mCameraPosition,
CamcorderProfile.QUALITY_720P));
// Step 4: Set output file
mMediaRecorder.setOutputFile(getOutputMediaFile(MEDIA_TYPE_VIDEO)
.toString());
// Step 5: Set the preview output
mMediaRecorder.setPreviewDisplay(mPreview.getHolder().getSurface());
// Step 6: Prepare configured MediaRecorder
try {
mMediaRecorder.prepare();
} catch (IllegalStateException e) {
e.printStackTrace();
releaseMediaRecorder();
return false;
} catch (IOException e) {
e.printStackTrace();
releaseMediaRecorder();
return false;
}