Commit d074c7b 1 parent 593e674 commit d074c7b Copy full SHA for d074c7b
File tree 2 files changed +13
-4
lines changed
app/src/main/java/app/grapheneos/camera
2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -441,7 +441,7 @@ class CamConfig(private val mActivity: MainActivity) {
441
441
442
442
var enableEIS: Boolean
443
443
get() {
444
- return isStabilizationSupported () && mActivity.settingsDialog.enableEISToggle.isChecked
444
+ return isVideoStabilizationSupported () && mActivity.settingsDialog.enableEISToggle.isChecked
445
445
}
446
446
set(value) {
447
447
val editor = commonPref.edit()
@@ -557,7 +557,16 @@ class CamConfig(private val mActivity: MainActivity) {
557
557
camera!! .cameraInfo.isZslSupported
558
558
}
559
559
560
- fun isStabilizationSupported () : Boolean {
560
+ fun isVideoStabilizationSupported () : Boolean {
561
+ return isRecorderStabilizationSupported()
562
+ }
563
+
564
+ private fun isPreviewStabilizationSupported () : Boolean {
565
+ return Preview .getPreviewCapabilities(getCurrentCameraInfo()).isStabilizationSupported
566
+ }
567
+
568
+
569
+ private fun isRecorderStabilizationSupported () : Boolean {
561
570
return Recorder .getVideoCapabilities(getCurrentCameraInfo()).isStabilizationSupported
562
571
}
563
572
@@ -1196,7 +1205,7 @@ class CamConfig(private val mActivity: MainActivity) {
1196
1205
ResolutionSelector .Builder ().setAspectRatioStrategy(aspectRatioStrategy).build()
1197
1206
)
1198
1207
1199
- if (isVideoMode) {
1208
+ if (isVideoMode && isPreviewStabilizationSupported() ) {
1200
1209
previewBuilder.setPreviewStabilizationEnabled(enableEIS)
1201
1210
}
1202
1211
Original file line number Diff line number Diff line change @@ -400,7 +400,7 @@ class SettingsDialog(val mActivity: MainActivity) :
400
400
includeAudioSetting.visibility = View .VISIBLE
401
401
enableEISSetting.visibility = View .GONE
402
402
videoQualitySetting.visibility = View .VISIBLE
403
- enableEISSetting.visibility = if (camConfig.isStabilizationSupported ()) {
403
+ enableEISSetting.visibility = if (camConfig.isVideoStabilizationSupported ()) {
404
404
View .VISIBLE
405
405
} else {
406
406
View .GONE
You can’t perform that action at this time.
0 commit comments