Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FormatDescription DisplayCriteria: dynamic range problem. #669

Closed
djokt opened this issue Nov 26, 2023 · 3 comments
Closed

FormatDescription DisplayCriteria: dynamic range problem. #669

djokt opened this issue Nov 26, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@djokt
Copy link

djokt commented Nov 26, 2023

On Tracy, when we activate "FormatDescription DisplayCriteria", Dolby Vision content is played as HDR10.
(Tested on tvOS 17.1)

@djokt djokt added the bug Something isn't working label Nov 26, 2023
@Alanko5
Copy link

Alanko5 commented Nov 26, 2023

#633

@cdguy
Copy link

cdguy commented Nov 26, 2023

#633

@Alanko5 So you mean that only using this code would solve the problem?

override func updateVideo(refreshRate: Float, isDovi: Bool, formatDescription: CMFormatDescription?) {
#if os(tvOS) || os(xrOS)
guard let displayManager = UIApplication.shared.windows.first?.avDisplayManager,
displayManager.isDisplayCriteriaMatchingEnabled,
!displayManager.isDisplayModeSwitchInProgress
else {
return
}
if let formatDescription {
if KSOptions.displayCriteriaFormatDescriptionEnabled, #available(tvOS 17.0, *) {
displayManager.preferredDisplayCriteria = AVDisplayCriteria(refreshRate: refreshRate, formatDescription: formatDescription)
} else {
let dynamicRange = isDovi ? .dolbyVision : formatDescription.dynamicRange
displayManager.preferredDisplayCriteria = AVDisplayCriteria(refreshRate: refreshRate, videoDynamicRange: dynamicRange.rawValue)
}
}
#endif
}

@Alanko5
Copy link

Alanko5 commented Nov 26, 2023

Yes you need add bridging header for objc file header.
https://github.com/kingslay/KSPlayer/blob/119f75a6251ac0807b9a529e8ef335c1033ba4ab/Demo/SwiftUI/Shared/AVDisplayCriteriaKS.h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants