Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ android {
compileSdk = 36

versionCode = 23
versionName = "1.34.0"
versionName = "1.34.0-unlock-high-fps-01"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,32 +332,16 @@ class SettingsFragment : PreferenceFragmentCompat() {
videoResolutionListPreference.entryValues = this
}

// Inflates video fps
val supportedFramerates = streamerInfo.video.getSupportedFramerates(
requireContext(), encoder, requireContext().defaultCameraId
)
videoFpsListPreference.entryValues.filter { fps ->
supportedFramerates.any { it.contains(fps.toString().toIntOrNull() ?: 0) }
// Inflates video fps based on video encoder capabilities (not camera)
val supportedFramerateRange = streamerInfo.video.getSupportedFramerate(encoder)
val defaultFpsList = resources.getStringArray(R.array.FpsEntries)
defaultFpsList.filter { fps ->
supportedFramerateRange.contains(fps.toIntOrNull() ?: 0)
}.toTypedArray().run {
videoFpsListPreference.entries = this
videoFpsListPreference.entryValues = this
}
videoFpsListPreference.setOnPreferenceChangeListener { _, newValue ->
val fps = (newValue as? String)?.toIntOrNull() ?: return@setOnPreferenceChangeListener true
val cameraManager = requireContext().getSystemService(Context.CAMERA_SERVICE) as android.hardware.camera2.CameraManager
val unsupportedCameras = cameraManager.cameraIdList.filter {
!cameraManager.getCameraCharacteristics(it).isFpsSupported(fps)
}
if (unsupportedCameras.isNotEmpty()) {
DialogUtils.showAlertDialog(
requireContext(), getString(R.string.warning), resources.getQuantityString(
R.plurals.camera_frame_rate_not_supported,
unsupportedCameras.size,
unsupportedCameras.joinToString(", "),
fps
)
)
}
videoFpsListPreference.setOnPreferenceChangeListener { _, _ ->
true
}

Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values/array.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
<item>24</item>
<item>25</item>
<item>30</item>
<item>50</item>
<item>60</item>
<item>100</item>
<item>120</item>
</string-array>

<string-array name="moblin_regulator_mode_entries">
Expand Down