Closed Alanko5 closed 10 months ago
不要用 AVDisplayCriteria(refreshRate: refreshRate, formatDescription。继续用我们原有的AVDisplayCriteria(refreshRate: refreshRate, videoDynamicRange: dynamicRange.rawValue) 就可以了。目前formatDescription里面是没有dv信息,所以无法判断是dv
没有函数了。你换成这样写
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
}
Describe the bug displayManager.preferredDisplayCriteria = AVDisplayCriteria(refreshRate: refreshRate, formatDescription: formatDescription)
To Reproduce starts video with DV tvOS switch TV to HDR
Platform (please complete the following information):
Screenshots
<<<< AudioFormatDescription >>>> figAudioFormatDescriptionEnsureRichestDecodableLayout signalled err=-12718 (kCMFormatDescriptionError_ValueNotAvailable) (no formats in format list) at FigAudioFormatDescription.c:2148
(Fig) CMVideoFormatDescriptionCreate signalled err=-12710 (kFigFormatDescriptionError_InvalidParameter) (!codecType) at FigVideoFormatDescription.c:417