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/common/CameraDeviceBase.h b/services/camera/libcameraservice/common/CameraDeviceBase.h
index a537ef5..77e660f 100644
--- a/services/camera/libcameraservice/common/CameraDeviceBase.h
+++ b/services/camera/libcameraservice/common/CameraDeviceBase.h
@@ -367,6 +367,14 @@
* Get the status tracker of the camera device
*/
virtual wp<camera3::StatusTracker> getStatusTracker() = 0;
+
+ /**
+ * Set bitmask for image dump flag
+ */
+ void setImageDumpMask(int mask) { mImageDumpMask = mask; }
+
+protected:
+ bool mImageDumpMask = 0;
};
}; // namespace android