Camera: Add debug code to dump JPEG images
- Debugging can be turned on by running:
adb shell cmd media.camera set-image-dump-mask 1
- Current flag setting can be queried by:
adb shell cmd media.camera get-image-dump-mask
- JPEG images are stored in /data/misc/cameraserver
- Image name is in the format of:
IMG_[YYYY][MM][DD]_[HH][MM][SS]_[TIMESTAMP].jpg
Test: Run adb command, run StillCapture test, and check output files
Bug: 172365775
Change-Id: Iec573ab68dcf5752ff036733b83b4088da8199cb
diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h
index d26c62d..43b03e6 100644
--- a/services/camera/libcameraservice/CameraService.h
+++ b/services/camera/libcameraservice/CameraService.h
@@ -398,6 +398,8 @@
// Check what API level is used for this client. This is used to determine which
// superclass this can be cast to.
virtual bool canCastToApiClient(apiLevel level) const;
+
+ void setImageDumpMask(int /*mask*/) { }
protected:
// Initialized in constructor
@@ -1036,6 +1038,12 @@
// Get the rotate-and-crop AUTO override behavior
status_t handleGetRotateAndCrop(int out);
+ // Set the mask for image dump to disk
+ status_t handleSetImageDumpMask(const Vector<String16>& args);
+
+ // Get the mask for image dump to disk
+ status_t handleGetImageDumpMask(int out);
+
// Prints the shell command help
status_t printHelp(int out);
@@ -1077,6 +1085,9 @@
// Current override rotate-and-crop mode
uint8_t mOverrideRotateAndCropMode = ANDROID_SCALER_ROTATE_AND_CROP_AUTO;
+
+ // Current image dump mask
+ uint8_t mImageDumpMask = 0;
};
} // namespace android