diff options
author | Alok Kediya <kediya@codeaurora.org> | 2013-11-07 13:53:09 +0530 |
---|---|---|
committer | Alok Kediya <kediya@codeaurora.org> | 2013-11-07 13:53:09 +0530 |
commit | f5b1181157b6d7f65376c0068768f8f3f94b5d69 (patch) | |
tree | 08cd6dba279b86f87d09445db8c79a6415ae85ed /src/com/android/camera/Storage.java | |
parent | 60bd26f5167be74685609f50a6f1b416e53a7439 (diff) | |
download | android_packages_apps_Snap-f5b1181157b6d7f65376c0068768f8f3f94b5d69.tar.gz android_packages_apps_Snap-f5b1181157b6d7f65376c0068768f8f3f94b5d69.tar.bz2 android_packages_apps_Snap-f5b1181157b6d7f65376c0068768f8f3f94b5d69.zip |
Camera2: Adds support for longshot/burst mode
- The longshot/burst pipeline mode uses an
optimized path for triggering 'takePicture()'
on each shutter callback. This should improve
the shot-2-shot time. In addition to this
there is also support for jpeg callbacks
that only contain a jpeg file path. The
callback in this case will only move the
file stored by the lower layers in the
correct directory.
- The longshot burst pipeline can be enabled
via this property:
"persist.camera.longshot.enable"<-"0/1"
- This change will allow longshot mode to
be triggered in non-zsl mode as well.
(Cherry picked from: I693366a7d06d3b386a8d96f86ee9a0574749c50b)
(Cherry picked from: Id630b2033f18d1c04a636597e910e695a8692ac8)
Change-Id: Idda8d58fc6d889128c1812c9c5ddadca3993c246
Diffstat (limited to 'src/com/android/camera/Storage.java')
-rw-r--r-- | src/com/android/camera/Storage.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/com/android/camera/Storage.java b/src/com/android/camera/Storage.java index 00bd8d1c4..49435e4c0 100644 --- a/src/com/android/camera/Storage.java +++ b/src/com/android/camera/Storage.java @@ -82,6 +82,12 @@ public class Storage { public static Uri addImage(ContentResolver resolver, String title, long date, Location location, int orientation, ExifInterface exif, byte[] jpeg, int width, int height, String pictureFormat) { + int jpegLength = 0; + + if (jpeg != null) { + jpegLength = jpeg.length; + } + // Save the image. String path = generateFilepath(title, pictureFormat); if (exif != null && (pictureFormat == null || @@ -91,7 +97,7 @@ public class Storage { } catch (Exception e) { Log.e(TAG, "Failed to write data", e); } - } else { + } else if (jpeg != null) { if (!(pictureFormat.equalsIgnoreCase("jpeg") || pictureFormat == null)) { File dir = new File(RAW_DIRECTORY); dir.mkdirs(); @@ -99,7 +105,7 @@ public class Storage { writeFile(path, jpeg); } return addImage(resolver, title, date, location, orientation, - jpeg.length, path, width, height, pictureFormat); + jpegLength, path, width, height, pictureFormat); } // Add the image to media store. |