summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/MediaSaveService.java
diff options
context:
space:
mode:
authorAlok Kediya <kediya@codeaurora.org>2013-09-28 17:12:35 +0530
committerLinux Build Service Account <lnxbuild@localhost>2013-10-31 19:39:35 -0600
commitd8887ed7c40a161431c6b4db32dddcb46859692f (patch)
treeb1063bba921681c8a0894c423abbb200accdc5c7 /src/com/android/camera/MediaSaveService.java
parent28c3196d6ecc29322d15b0f6f46ceba8af2244ac (diff)
downloadandroid_packages_apps_Snap-d8887ed7c40a161431c6b4db32dddcb46859692f.tar.gz
android_packages_apps_Snap-d8887ed7c40a161431c6b4db32dddcb46859692f.tar.bz2
android_packages_apps_Snap-d8887ed7c40a161431c6b4db32dddcb46859692f.zip
Camera: Add support for raw snapshot
Previously picture format only have option for jpeg and raw, but detailed raw image format is misssing from menu to choose. Also, changes to save raw image to coorect path are included. (cherrypicked from commit c0028f9dbe178c3fed1bcb4af96eb0db4d2e2973) Change-Id: Ifab7fd80e4a83370b2dc6932340005a06cc3552f (cherry picked from commit 27f9245f35d0284c17d8d2fdf5576ea3879e7d33) (cherry picked from commit 3c66703af119c06697f16303fadadbe956646cb3)
Diffstat (limited to 'src/com/android/camera/MediaSaveService.java')
-rw-r--r--src/com/android/camera/MediaSaveService.java17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/com/android/camera/MediaSaveService.java b/src/com/android/camera/MediaSaveService.java
index e8ec08d57..7761f7f4c 100644
--- a/src/com/android/camera/MediaSaveService.java
+++ b/src/com/android/camera/MediaSaveService.java
@@ -28,7 +28,7 @@ import android.os.Binder;
import android.os.IBinder;
import android.provider.MediaStore.Video;
import android.util.Log;
-
+import com.android.camera.PhotoModule;
import com.android.camera.exif.ExifInterface;
import java.io.File;
@@ -87,14 +87,14 @@ public class MediaSaveService extends Service {
public void addImage(final byte[] data, String title, long date, Location loc,
int width, int height, int orientation, ExifInterface exif,
- OnMediaSavedListener l, ContentResolver resolver) {
+ OnMediaSavedListener l, ContentResolver resolver, String pictureFormat) {
if (isQueueFull()) {
Log.e(TAG, "Cannot add image when the queue is full");
return;
}
ImageSaveTask t = new ImageSaveTask(data, title, date,
(loc == null) ? null : new Location(loc),
- width, height, orientation, exif, resolver, l);
+ width, height, orientation, exif, resolver, l, pictureFormat);
mMemoryUse += data.length;
if (isQueueFull()) {
@@ -108,13 +108,14 @@ public class MediaSaveService extends Service {
OnMediaSavedListener l, ContentResolver resolver) {
// When dimensions are unknown, pass 0 as width and height,
// and decode image for width and height later in a background thread
- addImage(data, title, date, loc, 0, 0, orientation, exif, l, resolver);
+ addImage(data, title, date, loc, 0, 0, orientation, exif, l, resolver,
+ PhotoModule.PIXEL_FORMAT_JPEG);
}
public void addImage(final byte[] data, String title, Location loc,
int width, int height, int orientation, ExifInterface exif,
OnMediaSavedListener l, ContentResolver resolver) {
addImage(data, title, System.currentTimeMillis(), loc, width, height,
- orientation, exif, l, resolver);
+ orientation, exif, l, resolver,PhotoModule.PIXEL_FORMAT_JPEG);
}
public void addVideo(String path, long duration, ContentValues values,
@@ -148,10 +149,11 @@ public class MediaSaveService extends Service {
private ExifInterface exif;
private ContentResolver resolver;
private OnMediaSavedListener listener;
+ private String pictureFormat;
public ImageSaveTask(byte[] data, String title, long date, Location loc,
int width, int height, int orientation, ExifInterface exif,
- ContentResolver resolver, OnMediaSavedListener listener) {
+ ContentResolver resolver, OnMediaSavedListener listener, String pictureFormat) {
this.data = data;
this.title = title;
this.date = date;
@@ -162,6 +164,7 @@ public class MediaSaveService extends Service {
this.exif = exif;
this.resolver = resolver;
this.listener = listener;
+ this.pictureFormat = pictureFormat;
}
@Override
@@ -180,7 +183,7 @@ public class MediaSaveService extends Service {
height = options.outHeight;
}
return Storage.addImage(
- resolver, title, date, loc, orientation, exif, data, width, height);
+ resolver, title, date, loc, orientation, exif, data, width, height, pictureFormat);
}
@Override