This commit is contained in:
Maxr1998
2021-03-22 22:04:13 +01:00
parent 7ef11319e9
commit cbc870b8c9
2 changed files with 13 additions and 1 deletions
@@ -1,6 +1,7 @@
package org.jellyfin.mobile.player
import android.media.MediaCodecInfo.CodecCapabilities
import android.os.Build
import org.jellyfin.mobile.player.ExoPlayerFormats.getAudioCodec
import org.jellyfin.mobile.player.ExoPlayerFormats.getAudioProfile
import org.jellyfin.mobile.player.ExoPlayerFormats.getVideoCodec
@@ -9,6 +10,7 @@ import org.jellyfin.mobile.player.ExoPlayerFormats.getVideoProfile
import org.json.JSONArray
import org.json.JSONException
import org.json.JSONObject
import timber.log.Timber
import java.util.*
class ExoPlayerCodec(codecCapabilities: CodecCapabilities) {
@@ -27,10 +29,18 @@ class ExoPlayerCodec(codecCapabilities: CodecCapabilities) {
// Check if this mimeType represents a video codec
val videoCodec = getVideoCodec(mimeType)
if (videoCodec != null) {
if (mimeType.endsWith("vp9")) {
Timber.d("Caps: ${codecCapabilities.videoCapabilities}")
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
codecCapabilities.videoCapabilities.supportedPerformancePoints?.forEach { performancePoint ->
Timber.d("PP: $performancePoint")
}
}
}
codec = videoCodec
isAudio = false
maxWidth = codecCapabilities.videoCapabilities.supportedWidths.upper
maxHeight = codecCapabilities.videoCapabilities.supportedHeights.upper
maxHeight = 100000 //codecCapabilities.videoCapabilities.supportedHeights.upper
maxBitrate = codecCapabilities.videoCapabilities.bitrateRange.upper
maxChannels = null
maxSampleRate = null
@@ -42,6 +42,8 @@ class QualityOptions {
qualityOptions.add(QualityOption(name = "Auto", selected = isAutomaticBitrateEnabled))
}
qualityOptions.add(QualityOption(name = "Unlimited", maxHeight = 64000, bitrate = 1000000000))
// Quality options are indexed by bitrate. If you must duplicate them, make sure each of them are unique (by making the last digit a 1)
if (width >= 3800) {
qualityOptions.add(QualityOption(name = "4K - 120 Mbps", maxHeight = 2160, bitrate = 120000000))