· Enable video and audio configuration properties on CameraView component

- Audio bit rate
- Audio sample rate
- Audio channels
- Video bit rate

· Revert changes from commit #a5a72e10e427232a25ff49123a9189c51c72e742
pull/354/head
Iván Álvarez Pereira 7 years ago
parent 4e217ee4c4
commit 65c1507355
  1. 3
      cameraview/src/main/java/com/otaliastudios/cameraview/Camera1.java
  2. 2
      cameraview/src/main/java/com/otaliastudios/cameraview/CameraController.java
  3. 2
      demo/src/main/res/layout/activity_camera.xml

@ -692,10 +692,11 @@ class Camera1 extends CameraController implements Camera.PreviewCallback, Camera
mCamera.unlock(); mCamera.unlock();
mMediaRecorder.setCamera(mCamera); mMediaRecorder.setCamera(mCamera);
mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA); mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
if (mAudio == Audio.ON) { if (mAudio == Audio.ON) {
// Must be called before setOutputFormat. // Must be called before setOutputFormat.
mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
} }
CamcorderProfile profile = getCamcorderProfile(); CamcorderProfile profile = getCamcorderProfile();
mMediaRecorder.setOutputFormat(profile.fileFormat); mMediaRecorder.setOutputFormat(profile.fileFormat);

@ -303,7 +303,7 @@ abstract class CameraController implements
} }
final void setAudioSampleRate(int audioSampleRate) { final void setAudioSampleRate(int audioSampleRate) {
mAudioBitRate = audioSampleRate; mAudioSampleRate = audioSampleRate;
} }
final void setAudioChannels(int audioChannels){ final void setAudioChannels(int audioChannels){

@ -29,7 +29,7 @@
app:cameraGrid="off" app:cameraGrid="off"
app:cameraJpegQuality="100" app:cameraJpegQuality="100"
app:cameraPlaySounds="true" app:cameraPlaySounds="true"
app:cameraSessionType="picture" app:cameraSessionType="video"
app:cameraVideoBitRate="128000" /> app:cameraVideoBitRate="128000" />
<!-- Controls --> <!-- Controls -->

Loading…
Cancel
Save