diff options
| author | James Dong <jdong@google.com> | 2010-11-17 11:37:25 -0800 |
|---|---|---|
| committer | James Dong <jdong@google.com> | 2010-11-17 11:40:40 -0800 |
| commit | 147bd5fe09aaed4c66967bd0b033c6c82accfbb3 (patch) | |
| tree | 9c6ff5f89d554e99120a66209f3b2e98d0e19a86 | |
| parent | 80715aae46e5a7a9aa378002301ba9d76f093776 (diff) | |
| download | LegacyCamera-147bd5fe09aaed4c66967bd0b033c6c82accfbb3.zip LegacyCamera-147bd5fe09aaed4c66967bd0b033c6c82accfbb3.tar.gz LegacyCamera-147bd5fe09aaed4c66967bd0b033c6c82accfbb3.tar.bz2 | |
Adapt the file extension of the recorded files to the requested file format.
bug - 3202417
Change-Id: Icb865419abc47726dc59c3fada4e4d789430b78a
| -rw-r--r-- | src/com/android/camera/VideoCamera.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index af193a9..0bda10d 100644 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -1087,7 +1087,7 @@ public class VideoCamera extends NoSearchActivity Log.e(TAG, "Fail to close fd", e); } } else { - createVideoPath(); + createVideoPath(mProfile.fileFormat); mMediaRecorder.setOutputFile(mVideoFilename); } } @@ -1150,10 +1150,15 @@ public class VideoCamera extends NoSearchActivity if (mCameraDevice != null) mCameraDevice.lock(); } - private void createVideoPath() { + private void createVideoPath(int outputFileFormat) { long dateTaken = System.currentTimeMillis(); String title = createName(dateTaken); String filename = title + ".3gp"; // Used when emailing. + String mime = "video/3gpp"; + if (outputFileFormat == MediaRecorder.OutputFormat.MPEG_4) { + filename = title + ".mp4"; + mime = "video/mp4"; + } String cameraDirPath = ImageManager.CAMERA_IMAGE_BUCKET_NAME; String filePath = cameraDirPath + "/" + filename; File cameraDir = new File(cameraDirPath); @@ -1162,7 +1167,7 @@ public class VideoCamera extends NoSearchActivity values.put(Video.Media.TITLE, title); values.put(Video.Media.DISPLAY_NAME, filename); values.put(Video.Media.DATE_TAKEN, dateTaken); - values.put(Video.Media.MIME_TYPE, "video/3gpp"); + values.put(Video.Media.MIME_TYPE, mime); values.put(Video.Media.DATA, filePath); mVideoFilename = filePath; Log.v(TAG, "Current camera video filename: " + mVideoFilename); |
