diff options
author | Chih-Chung Chang <chihchung@google.com> | 2009-07-29 14:50:07 +0800 |
---|---|---|
committer | Chih-Chung Chang <chihchung@google.com> | 2009-07-29 14:52:40 +0800 |
commit | 947455a44af2b912e9c342b36eb9ab619fab2a66 (patch) | |
tree | 8e33fa1fe79328aa3507a8e779c45ed810b9bf48 /src/com/android/camera/VideoCamera.java | |
parent | ab8c77fda5b33b67d3b558e7bc49c1ca8ac29047 (diff) | |
download | LegacyCamera-947455a44af2b912e9c342b36eb9ab619fab2a66.zip LegacyCamera-947455a44af2b912e9c342b36eb9ab619fab2a66.tar.gz LegacyCamera-947455a44af2b912e9c342b36eb9ab619fab2a66.tar.bz2 |
Sets more parameters for media recorder.
Diffstat (limited to 'src/com/android/camera/VideoCamera.java')
-rw-r--r-- | src/com/android/camera/VideoCamera.java | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index 9d5ddc8..0d10b09 100644 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -829,9 +829,17 @@ public class VideoCamera extends Activity implements View.OnClickListener, // if the frame rate is too large, it can cause camera to become // unstable. We need to fix the MediaRecorder to disable the support // of setting frame rate for now. - mMediaRecorder.setVideoFrameRate(mProfile.mFps); + mMediaRecorder.setVideoFrameRate(mProfile.mVideoFps); mMediaRecorder.setVideoSize( mProfile.mVideoWidth, mProfile.mVideoHeight); + mMediaRecorder.setParameters(String.format( + "video-param-encoding-bitrate=%d", mProfile.mVideoBitrate)); + mMediaRecorder.setParameters(String.format( + "audio-param-encoding-bitrate=%d", mProfile.mAudioBitrate)); + mMediaRecorder.setParameters(String.format( + "audio-param-number-of-channels=%d", mProfile.mAudioChannels)); + mMediaRecorder.setParameters(String.format( + "audio-param-sampling-rate=%d", mProfile.mAudioSamplingRate)); mMediaRecorder.setVideoEncoder(mProfile.mVideoEncoder); mMediaRecorder.setAudioEncoder(mProfile.mAudioEncoder); mMediaRecorder.setPreviewDisplay(mSurfaceHolder.getSurface()); @@ -1355,7 +1363,11 @@ class MediaRecorderProfile { public final int mAudioEncoder; public final int mVideoWidth; public final int mVideoHeight; - public final int mFps; + public final int mVideoFps; + public final int mVideoBitrate; + public final int mAudioBitrate; + public final int mAudioChannels; + public final int mAudioSamplingRate; MediaRecorderProfile(boolean hiQuality) { mHiQuality = hiQuality; @@ -1380,9 +1392,25 @@ class MediaRecorderProfile { "ro.media.enc.lprof.vid.height", 288, 144); - mFps = getInt("ro.media.enc.hprof.vid.fps", - "ro.media.enc.lprof.vid.fps", - 20, 20); + mVideoFps = getInt("ro.media.enc.hprof.vid.fps", + "ro.media.enc.lprof.vid.fps", + 20, 20); + + mVideoBitrate = getInt("ro.media.enc.hprof.vid.bps", + "ro.media.enc.lprof.vid.bps", + 360000, 192000); + + mAudioBitrate = getInt("ro.media.enc.hprof.aud.bps", + "ro.media.enc.lprof.aud.bps", + 23450, 23450); + + mAudioChannels = getInt("ro.media.enc.hprof.aud.ch", + "ro.media.enc.lprof.aud.ch", + 1, 1); + + mAudioSamplingRate = getInt("ro.media.enc.hprof.aud.hz", + "ro.media.enc.lprof.aud.hz", + 8000, 8000); } private int getFromTable(String highKey, String lowKey, |