Skip to content

Commit

Permalink
Merge pull request #1990 from jellyfin/2.1.z
Browse files Browse the repository at this point in the history
  • Loading branch information
cewert authored Oct 15, 2024
2 parents 5cfb65a + d3f0196 commit f07e5ea
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 39 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# If you want to get_images, you'll also need convert from ImageMagick
##########################################################################

VERSION := 2.1.7
VERSION := 2.1.8

## usage

Expand Down
2 changes: 1 addition & 1 deletion manifest
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
title=Jellyfin
major_version=2
minor_version=1
build_version=7
build_version=8

### Main Menu Icons / Channel Poster Artwork

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jellyfin-roku",
"type": "module",
"version": "2.1.7",
"version": "2.1.8",
"description": "Roku app for Jellyfin media server",
"dependencies": {
"@rokucommunity/bslib": "0.1.1",
Expand Down
7 changes: 4 additions & 3 deletions source/api/Items.bs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ function ItemPostPlaybackInfo(id as string, mediaSourceId = "" as string, audioT
params.EnableDirectPlay = false
end if

if audioTrackIndex > -1
selectedAudioStream = m.global.session.video.json.MediaStreams[audioTrackIndex]
myGLobal = m.global

if audioTrackIndex > -1 and myGLobal.session.video.json.MediaStreams <> invalid
selectedAudioStream = myGLobal.session.video.json.MediaStreams[audioTrackIndex]

if selectedAudioStream <> invalid
params.AudioStreamIndex = audioTrackIndex
Expand All @@ -62,7 +64,6 @@ function ItemPostPlaybackInfo(id as string, mediaSourceId = "" as string, audioT
end for
end if
end if

end if
end if

Expand Down
92 changes: 66 additions & 26 deletions source/utils/deviceCapabilities.bs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,9 @@ function getContainerProfiles() as object
end function

function getCodecProfiles() as object
globalUserSettings = m.global.session.user.settings
myGlobal = m.global
globalUserSettings = myGlobal.session.user.settings

codecProfiles = []
profileSupport = {
"h264": {},
Expand Down Expand Up @@ -555,26 +557,45 @@ function getCodecProfiles() as object
hevcVideoRangeTypes = "SDR"
vp9VideoRangeTypes = "SDR"
av1VideoRangeTypes = "SDR"
canPlayDovi = false

dp = di.GetDisplayProperties()
if dp.Hdr10
hevcVideoRangeTypes = hevcVideoRangeTypes + "|HDR10"
vp9VideoRangeTypes = vp9VideoRangeTypes + "|HDR10"
av1VideoRangeTypes = av1VideoRangeTypes + "|HDR10"
end if
if dp.Hdr10Plus
av1VideoRangeTypes = av1VideoRangeTypes + "|HDR10+"
end if
if dp.HLG
hevcVideoRangeTypes = hevcVideoRangeTypes + "|HLG"
vp9VideoRangeTypes = vp9VideoRangeTypes + "|HLG"
av1VideoRangeTypes = av1VideoRangeTypes + "|HLG"
end if
if dp.DolbyVision
h264VideoRangeTypes = h264VideoRangeTypes + "|DOVI"
hevcVideoRangeTypes = hevcVideoRangeTypes + "|DOVI"
'vp9VideoRangeTypes = vp9VideoRangeTypes + ",DOVI" no evidence that vp9 can hold DOVI
av1VideoRangeTypes = av1VideoRangeTypes + "|DOVI"
if canPlay4k()
dp = di.GetDisplayProperties()

if dp.DolbyVision
canPlayDovi = true

h264VideoRangeTypes = h264VideoRangeTypes + "|DOVI|DOVIWithSDR"
hevcVideoRangeTypes = hevcVideoRangeTypes + "|DOVI|DOVIWithSDR"
av1VideoRangeTypes = av1VideoRangeTypes + "|DOVI|DOVIWithSDR"
end if

if dp.Hdr10
hevcVideoRangeTypes = hevcVideoRangeTypes + "|HDR10"
vp9VideoRangeTypes = vp9VideoRangeTypes + "|HDR10"
av1VideoRangeTypes = av1VideoRangeTypes + "|HDR10"

if canPlayDovi
hevcVideoRangeTypes = hevcVideoRangeTypes + "|DOVIWithHDR10"
av1VideoRangeTypes = av1VideoRangeTypes + "|DOVIWithHDR10"
end if
end if

if dp.Hdr10Plus
av1VideoRangeTypes = av1VideoRangeTypes + "|HDR10+"
end if

if dp.HLG
hevcVideoRangeTypes = hevcVideoRangeTypes + "|HLG"
vp9VideoRangeTypes = vp9VideoRangeTypes + "|HLG"
av1VideoRangeTypes = av1VideoRangeTypes + "|HLG"

if canPlayDovi
hevcVideoRangeTypes = hevcVideoRangeTypes + "|DOVIWithHLG"
vp9VideoRangeTypes = vp9VideoRangeTypes + "|DOVIWithHLG"
av1VideoRangeTypes = av1VideoRangeTypes + "|DOVIWithHLG"
end if
end if
end if

' H264
Expand Down Expand Up @@ -605,12 +626,6 @@ function getCodecProfiles() as object
"Value": "true",
"IsRequired": false
},
{
"Condition": "LessThanEqual",
"Property": "VideoBitDepth",
"Value": "8",
"IsRequired": false
},
{
"Condition": "EqualsAny",
"Property": "VideoProfile",
Expand Down Expand Up @@ -1094,3 +1109,28 @@ function setPreferredCodec(codecString as string, preferredCodec as string) as s
return newCodecString
end if
end function

' does the connected display support playing 4k video?
function canPlay4k() as boolean
deviceInfo = CreateObject("roDeviceInfo")
hdmiStatus = CreateObject("roHdmiStatus")

' Check if the output mode is 2160p or higher
maxVideoHeight = m.global.device.videoHeight
if maxVideoHeight = invalid then return false
if maxVideoHeight.ToInt() < 2160
return false
end if

' Check if HDCP 2.2 is enabled, skip check for TVs
if deviceInfo.GetModelType() = "STB" and hdmiStatus.IsHdcpActive("2.2") <> true
return false
end if

' Check if the Roku player can decode 4K 60fps HEVC streams
if deviceInfo.CanDecodeVideo({ Codec: "hevc", Profile: "main", Level: "5.1" }).result <> true
return false
end if

return true
end function
7 changes: 2 additions & 5 deletions source/utils/globals.bs
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,8 @@ sub SaveDeviceToGlobal()
print "ERROR parsing deviceInfo.GetVideoMode()"
end if
videoWidth = heightToWidth[videoHeight]
if videoHeight = "2160" and extraData = "b10"
bitDepth = 10
else if videoHeight = "4320"
bitDepth = 12
end if
if extraData <> invalid and extraData = "b10" then bitDepth = 10
if videoHeight = "4320" then bitDepth = 12

m.global.addFields({
device: {
Expand Down

0 comments on commit f07e5ea

Please sign in to comment.