mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-09 16:11:20 +02:00
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:
parent
8b33dd6d1f
commit
10233eb459
3 changed files with 31 additions and 0 deletions
|
|
@ -67,6 +67,7 @@ object Codec {
|
||||||
const val VP8 = "vp8"
|
const val VP8 = "vp8"
|
||||||
const val VP9 = "vp9"
|
const val VP9 = "vp9"
|
||||||
const val AV1 = "av1"
|
const val AV1 = "av1"
|
||||||
|
const val VC1 = "vc1"
|
||||||
}
|
}
|
||||||
|
|
||||||
object Subtitle {
|
object Subtitle {
|
||||||
|
|
|
||||||
|
|
@ -92,9 +92,11 @@ fun createDeviceProfile(
|
||||||
val avcHigh10Level = mediaTest.getAVCHigh10Level()
|
val avcHigh10Level = mediaTest.getAVCHigh10Level()
|
||||||
val supportsAV1 = mediaTest.supportsAV1()
|
val supportsAV1 = mediaTest.supportsAV1()
|
||||||
val supportsAV1Main10 = mediaTest.supportsAV1Main10()
|
val supportsAV1Main10 = mediaTest.supportsAV1Main10()
|
||||||
|
val supportsVC1 = mediaTest.supportsVc1()
|
||||||
val maxResolutionAVC = mediaTest.getMaxResolution(MimeTypes.VIDEO_H264)
|
val maxResolutionAVC = mediaTest.getMaxResolution(MimeTypes.VIDEO_H264)
|
||||||
val maxResolutionHevc = mediaTest.getMaxResolution(MimeTypes.VIDEO_H265)
|
val maxResolutionHevc = mediaTest.getMaxResolution(MimeTypes.VIDEO_H265)
|
||||||
val maxResolutionAV1 = mediaTest.getMaxResolution(MimeTypes.VIDEO_AV1)
|
val maxResolutionAV1 = mediaTest.getMaxResolution(MimeTypes.VIDEO_AV1)
|
||||||
|
val maxResolutionVC1 = mediaTest.getMaxResolution(MimeTypes.VIDEO_VC1)
|
||||||
|
|
||||||
// / HDR capabilities
|
// / HDR capabilities
|
||||||
|
|
||||||
|
|
@ -171,6 +173,7 @@ fun createDeviceProfile(
|
||||||
Codec.Video.HEVC,
|
Codec.Video.HEVC,
|
||||||
Codec.Video.MPEG,
|
Codec.Video.MPEG,
|
||||||
Codec.Video.MPEG2VIDEO,
|
Codec.Video.MPEG2VIDEO,
|
||||||
|
Codec.Video.VC1,
|
||||||
Codec.Video.VP8,
|
Codec.Video.VP8,
|
||||||
Codec.Video.VP9,
|
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
|
// Get max resolutions for common codecs
|
||||||
// AVC
|
// AVC
|
||||||
codecProfile {
|
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
|
// / HDR exclude list
|
||||||
|
|
||||||
// TODO Use VideoRangeType enum with Jellyfin 10.11 based SDK
|
// TODO Use VideoRangeType enum with Jellyfin 10.11 based SDK
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import android.media.MediaFormat
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.util.Size
|
import android.util.Size
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
|
import androidx.media3.common.MimeTypes
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
|
|
||||||
class MediaCodecCapabilitiesTest(
|
class MediaCodecCapabilitiesTest(
|
||||||
|
|
@ -214,6 +215,8 @@ class MediaCodecCapabilitiesTest(
|
||||||
}?.second ?: 0
|
}?.second ?: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun supportsVc1(): Boolean = hasCodecForMime(MimeTypes.VIDEO_VC1)
|
||||||
|
|
||||||
private fun getDecoderLevel(
|
private fun getDecoderLevel(
|
||||||
mime: String,
|
mime: String,
|
||||||
profile: Int,
|
profile: Int,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue