Let me start by saying that HDR is really confusing to me. Please forgive me if I am misunderstanding anything.
I have an app that sends decoded video frames to `AVSampleBufferDisplayLayer`. I use the Core Video function `CVImageBufferCreateColorSpaceFromAttachments` to create the `CGColorSpace`, which I then attach to the image buffer. This works great for non-HDR content.
However, when I specify an HDR transfer function (PQ or HLG), the Core Video function returns the Generic RGB color space on macOS 10.14. On macOS 10.15, specifying HLG produces a color space with parametric tone response curves configured for Rec. 709 and a “device to PCS conversion table”/“PCS to device conversion table” that has matrix curves corresponding to HLG. Specifying PQ on macOS 10.15 still produces the Generic RGB color space.
Questions:
1. Is the color space returned for HLG on macOS 10.15 correct? Why are there two different curves in the ICC profile?
2. Why does the Core Video function not return a correct color space for PQ (even on macOS 10.15)?
3. There is also some metadata for PQ content (mastering display color volume and content light level info). Where do I specify that?
4. Does HLG need metadata or is specifying the color space enough?