Posts

Post not yet marked as solved
1 Replies
1.2k Views
Hi, We're trying to render HDR video frames with CAMetalLayer in our iOS app, using BGR10_XR - https://developer.apple.com/documentation/metal/mtlpixelformat/mtlpixelformatbgr10_xr?language=objc format. The WWDC2020 presentation Optimize the Core Image pipeline for your video app - https://developer.apple.com/videos/play/wwdc2020/10008/ gives a really nice example of how to do this at 7:01. The CAMetalLayer documentations describe the same at Using Color Spaces to Display HDR Content - https://developer.apple.com/documentation/metal/drawable_objects/displaying_hdr_content_in_a_metal_layer/using_color_spaces_to_display_hdr_content and at wantsExtendedDynamicRangeContent - https://developer.apple.com/documentation/quartzcore/cametallayer/1478161-wantsextendeddynamicrangecontent clearly stating the CAMetalLayer won't clamp extended range values only if wantsExtendedDynamicRangeContent is set to true. An example of how this would work: let metalLayer = CAMetalLayer() metalLayer.wantsExtendedDynamicRangeContent = true metalLayer.pixelFormat = .bgr10_xr let name = CGColorSpace.itur_2020_HLG metalLayer.colorspace = CGColorSpace(name: name) What we get now in our iOS app is exactly what the documentation describes: the rendered content is clamped to 1.0 on the screen, resulting in an overexposed video. It looks like iOS apps with a pipeline like the one in Optimize the Core Image pipeline for your video app - https://developer.apple.com/videos/play/wwdc2020/10008/ will be able to render HDR videos only when wantsExtendedDynamicRangeContent - https://developer.apple.com/documentation/quartzcore/cametallayer/1478161-wantsextendeddynamicrangecontent becomes available on iOS as well. Is there any plan to add this CAMetalLayer property on iOS too? And if there's any when do you think it's gonna be available?
Posted Last updated
.