mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-06-27 09:02:59 +02:00
try to handle changing video quality and image resolution
- CameraX video allowed predefined buckets of qualities UHD, FHD, HD, SD (defined in VideoQuality enum), the CameraXPreview is configured to use the highest quality and CameraX will select the closest corresponding resolution supported by the device. - tentatively add ChangeResolutionDialogX (which would be renamed back to ChangeResolutionDialog) to give user option to select photo resolution and video qualities - add ImageQualityManager which performs the same operation for getting all resolutions supported by a device using the Camera2 API, as defined in the legacy CameraPreview - add VideoQualityManager to manage saving/ getting user selected quality.
This commit is contained in:
@ -3,6 +3,7 @@ package com.simplemobiletools.camera.helpers
|
||||
import android.content.Context
|
||||
import android.os.Environment
|
||||
import androidx.camera.core.CameraSelector
|
||||
import com.simplemobiletools.camera.models.VideoQuality
|
||||
import com.simplemobiletools.commons.helpers.BaseConfig
|
||||
import java.io.File
|
||||
|
||||
@ -62,6 +63,20 @@ class Config(context: Context) : BaseConfig(context) {
|
||||
get() = prefs.getInt(FRONT_PHOTO_RESOLUTION_INDEX, 0)
|
||||
set(frontPhotoResIndex) = prefs.edit().putInt(FRONT_PHOTO_RESOLUTION_INDEX, frontPhotoResIndex).apply()
|
||||
|
||||
var backVideoQuality: VideoQuality
|
||||
get() {
|
||||
val backQuality = prefs.getString(BACK_VIDEO_QUALITY, VideoQuality.UHD.name)
|
||||
return VideoQuality.values().first { it.name == backQuality }
|
||||
}
|
||||
set(backVideoQuality) = prefs.edit().putString(BACK_VIDEO_QUALITY, backVideoQuality.name).apply()
|
||||
|
||||
var frontVideoQuality: VideoQuality
|
||||
get() {
|
||||
val frontQuality = prefs.getString(FRONT_VIDEO_QUALITY, VideoQuality.UHD.name)
|
||||
return VideoQuality.values().first { it.name == frontQuality }
|
||||
}
|
||||
set(frontVideoQuality) = prefs.edit().putString(FRONT_VIDEO_QUALITY, frontVideoQuality.name).apply()
|
||||
|
||||
var frontVideoResIndex: Int
|
||||
get() = prefs.getInt(FRONT_VIDEO_RESOLUTION_INDEX, 0)
|
||||
set(frontVideoResIndex) = prefs.edit().putInt(FRONT_VIDEO_RESOLUTION_INDEX, frontVideoResIndex).apply()
|
||||
|
Reference in New Issue
Block a user