mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-06-27 09:02:59 +02:00
properly play media sound on image capture
- 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 capture 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
This commit is contained in:
@ -33,7 +33,7 @@ class MediaOutputHelper(
|
||||
private val mediaStorageDir = activity.config.savePhotosFolder
|
||||
private val contentResolver = activity.contentResolver
|
||||
|
||||
fun getImageMediaOutput(): MediaOutput {
|
||||
fun getImageMediaOutput(): MediaOutput.ImageCaptureOutput {
|
||||
return try {
|
||||
if (is3rdPartyIntent) {
|
||||
if (outputUri != null) {
|
||||
@ -56,7 +56,7 @@ class MediaOutputHelper(
|
||||
}
|
||||
}
|
||||
|
||||
fun getVideoMediaOutput(): MediaOutput {
|
||||
fun getVideoMediaOutput(): MediaOutput.VideoCaptureOutput {
|
||||
return try {
|
||||
if (is3rdPartyIntent) {
|
||||
if (outputUri != null) {
|
||||
|
Reference in New Issue
Block a user