instead of using the OnImageSavedCallback, we now use the OnImageCaptureCallback and we play the sound in the onCapturedSuccess method to prevent the user from hearing the sound before the actual capture takes place
add ImageSaver and ImageUtil based on CameraX implementation
add sealed interfaces ImageCaptureOutput and VideoCaptureOutput to prevent confusion on the supported output format for images and video
ImageSaver supports saving images with all MediaOutput.ImageCaptureOutput that can be saved to disk; MediaStoreOutput, OutputStreamMediaOutput and FileMediaOutput (unused at the moment), it throws an UnsupportedOperation when trying to save a BitmapOutput.
with ImageSaver, we now have control of whether the Exif attributes are written to disk and so we can get rid of ExifRemover
delete the extension method ImageProxy.toJpegByteArray as we have a similar method in ImageUtils class
the shutter sound is good now, but the screen dimming still happens right after pressing photo capture. Lets make sure that screen dimming happens together with the shutter sound.
Notes
OnImageSavedCallback
, we now use theOnImageCaptureCallback
and we play the sound in theonCapturedSuccess
method to prevent the user from hearing the sound before the actual capture takes placeImageSaver
and ImageUtil based on CameraX implementationImageCaptureOutput
andVideoCaptureOutput
to prevent confusion on the supported output format for images and videoImageSaver
supports saving images with allMediaOutput.ImageCaptureOutput
that can be saved to disk;MediaStoreOutput
,OutputStreamMediaOutput
andFileMediaOutput
(unused at the moment), it throws anUnsupportedOperation
when trying to save aBitmapOutput
.ImageSaver
, we now have control of whether the Exif attributes are written to disk and so we can get rid ofExifRemover
ImageProxy.toJpegByteArray
as we have a similar method inImageUtils
class