Support VC-1 direct play if device supports it (#362)

Adds VC-1 to ExoPlayer direct play profile, if the device supports it.

Also proposed to add this to the official app in
https://github.com/jellyfin/jellyfin-androidtv/pull/5208
This commit is contained in:
damontecres 2025-12-02 10:56:39 -05:00 committed by GitHub
parent 8b33dd6d1f
commit 10233eb459
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 31 additions and 0 deletions

View file

@ -67,6 +67,7 @@ object Codec {
const val VP8 = "vp8"
const val VP9 = "vp9"
const val AV1 = "av1"
const val VC1 = "vc1"
}
object Subtitle {

View file

@ -92,9 +92,11 @@ fun createDeviceProfile(
val avcHigh10Level = mediaTest.getAVCHigh10Level()
val supportsAV1 = mediaTest.supportsAV1()
val supportsAV1Main10 = mediaTest.supportsAV1Main10()
val supportsVC1 = mediaTest.supportsVc1()
val maxResolutionAVC = mediaTest.getMaxResolution(MimeTypes.VIDEO_H264)
val maxResolutionHevc = mediaTest.getMaxResolution(MimeTypes.VIDEO_H265)
val maxResolutionAV1 = mediaTest.getMaxResolution(MimeTypes.VIDEO_AV1)
val maxResolutionVC1 = mediaTest.getMaxResolution(MimeTypes.VIDEO_VC1)
// / HDR capabilities
@ -171,6 +173,7 @@ fun createDeviceProfile(
Codec.Video.HEVC,
Codec.Video.MPEG,
Codec.Video.MPEG2VIDEO,
Codec.Video.VC1,
Codec.Video.VP8,
Codec.Video.VP9,
)
@ -329,6 +332,19 @@ fun createDeviceProfile(
}
}
// VC1 profile
codecProfile {
type = CodecType.VIDEO
codec = Codec.Video.VC1
conditions {
when {
!supportsVC1 -> ProfileConditionValue.VIDEO_PROFILE equals "none"
else -> ProfileConditionValue.VIDEO_PROFILE notEquals "none"
}
}
}
// Get max resolutions for common codecs
// AVC
codecProfile {
@ -363,6 +379,17 @@ fun createDeviceProfile(
}
}
// VC1
codecProfile {
type = CodecType.VIDEO
codec = Codec.Video.VC1
conditions {
ProfileConditionValue.WIDTH lowerThanOrEquals maxResolutionVC1.width
ProfileConditionValue.HEIGHT lowerThanOrEquals maxResolutionVC1.height
}
}
// / HDR exclude list
// TODO Use VideoRangeType enum with Jellyfin 10.11 based SDK

View file

@ -9,6 +9,7 @@ import android.media.MediaFormat
import android.os.Build
import android.util.Size
import androidx.core.content.ContextCompat
import androidx.media3.common.MimeTypes
import timber.log.Timber
class MediaCodecCapabilitiesTest(
@ -214,6 +215,8 @@ class MediaCodecCapabilitiesTest(
}?.second ?: 0
}
fun supportsVc1(): Boolean = hasCodecForMime(MimeTypes.VIDEO_VC1)
private fun getDecoderLevel(
mime: String,
profile: Int,