Skip to content
Open
Show file tree
Hide file tree
Changes from 8 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
11 changes: 11 additions & 0 deletions app/src/main/java/org/jellyfin/androidtv/constant/Codec.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@ object Codec {
object Container {
@Suppress("ObjectPropertyName", "ObjectPropertyNaming")
const val `3GP` = "3gp"
const val AAC = "aac"
const val AC3 = "ac3"
const val AMR = "amr"
const val ASF = "asf"
const val AVI = "avi"
const val DVR_MS = "dvr-ms"
const val EAC3 = "eac3"
const val FLAC = "flac"
const val FLV = "flv"
const val HLS = "hls"
const val M2V = "m2v"
const val M4A = "m4a"
const val M4V = "m4v"
const val MKV = "mkv"
const val MOV = "mov"
Expand All @@ -17,10 +24,12 @@ object Codec {
const val MPEG = "mpeg"
const val MPEGTS = "mpegts"
const val MPG = "mpg"
const val OGG = "ogg"
const val OGM = "ogm"
const val OGV = "ogv"
const val TS = "ts"
const val VOB = "vob"
const val WAV = "wav"
const val WEBM = "webm"
const val WMV = "wmv"
const val WTV = "wtv"
Expand Down Expand Up @@ -62,7 +71,9 @@ object Codec {
const val H264 = "h264"
const val HEVC = "hevc"
const val MPEG = "mpeg"
const val MPEG1VIDEO = "mpeg1video"
const val MPEG2VIDEO = "mpeg2video"
const val MPEG4 = "mpeg4"
const val VP8 = "vp8"
const val VP9 = "vp9"
const val AV1 = "av1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ fun Scope.createPlaybackManager() = playbackManager(androidContext()) {
)
install(media3SessionPlugin(get(), mediaSessionOptions))

val deviceProfileBuilder = { createDeviceProfile(androidContext(), userPreferences, get()) }
val deviceProfileBuilder = { createDeviceProfile(userPreferences) }
install(jellyfinPlugin(get(), deviceProfileBuilder, setOf(MediaSegmentType.INTRO), ProcessLifecycleOwner.get().lifecycle))

// Options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import org.jellyfin.androidtv.util.profile.DeviceProfileKt;
import org.jellyfin.androidtv.util.sdk.compat.JavaCompat;
import org.jellyfin.sdk.api.client.ApiClient;
import org.jellyfin.sdk.model.ServerVersion;
import org.jellyfin.sdk.model.api.BaseItemDto;
import org.jellyfin.sdk.model.api.BaseItemKind;
import org.jellyfin.sdk.model.api.DeviceProfile;
Expand Down Expand Up @@ -542,11 +541,7 @@ private VideoOptions buildExoPlayerOptions(
if (!isLiveTv && currentMediaSource != null) {
internalOptions.setMediaSourceId(currentMediaSource.getId());
}
DeviceProfile internalProfile = DeviceProfileKt.createDeviceProfile(
mFragment.getContext(),
userPreferences.getValue(),
get(ServerVersion.class)
);
DeviceProfile internalProfile = DeviceProfileKt.createDeviceProfile(userPreferences.getValue());
internalOptions.setProfile(internalProfile);
return internalOptions;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package org.jellyfin.androidtv.util.profile
import android.os.Build

/**
* List of devie models with known HEVC DoVi/HDR10+ playback issues.
* List of device models with known HEVC DoVi/HDR10+ playback issues.
*/
private val modelsWithDoViHdr10PlusBug = listOf(
"AFTKRT", // Amazon Fire TV 4K Max (2nd Gen)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.jellyfin.androidtv.util.profile

import android.media.MediaCodecInfo.CodecProfileLevel
import android.media.MediaCodecList
import android.util.Size
import androidx.media3.common.MimeTypes
Expand Down Expand Up @@ -53,5 +54,16 @@

fun supportsVc1(): Boolean = codecQuery.hasCodecForMime(MimeTypes.VIDEO_VC1)

fun supportsVp8(): Boolean = codecQuery.hasCodecForMime(MimeTypes.VIDEO_VP8)
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed

fun supportsVp9(): Boolean = codecQuery.hasCodecForMime(MimeTypes.VIDEO_VP9)
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed

// MPEG-2 decoders also handle MPEG-1, Android does not register a separate MPEG-1 mime type
fun supportsMpeg2(): Boolean = codecQuery.hasCodecForMime(MimeTypes.VIDEO_MPEG2)

// DivX/Xvid need Advanced Simple Profile, a Simple Profile only decoder cannot play them
fun supportsMpeg4Asp(): Boolean =
codecQuery.getDecoderLevel(MimeTypes.VIDEO_MP4V, CodecProfileLevel.MPEG4ProfileAdvancedSimple) > 0

fun getMaxResolution(mime: String): Size = codecQuery.getMaxResolution(mime)
}
Loading