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
cocoa-cb: add support for macOS color space transformation (EDR/HDR) #14017
Conversation
e2952e3
to
0f19c67
Compare
Download the artifacts for this pull request: |
271285c
to
a1db286
Compare
on macOS 12 + Xcode 13.1 + SDK 12. can't find 2 of the 4 colour spaces introduced in 12.0, indicating an SDK problem
on macOS 12 + Xcode 14.2 + SDK 13.1. no building problems but following runtime error, indicating a general problem with those two new colour spaces and macOS 12 + CoreGraphic (framework version 12)
on macOS 13 + Xcode 14.2 + SDK 13.1 (same setup as second test), there are no problems regarding those colour spaces, indicating a problem with macOS 12 as a platform. removing the two affected colour spaces on macOS 12 + Xcode 14.2 + SDK 13.1 shields no problems. TLDR macOS 12 has a CoreGraphics framework issue, macOS SDK 12 is broken for those two colour spaces. the latest SDK available on macOS 12 is SDK 13, that fixes the build problems but not the runtime crash. is fixed with SDK 13 and macOS 13. to fix this, we can't just guard those two colour spaces with a build time and runtime check for macOS+SDK 13, since the symbol not found crash will still occur. for now i will just remove those two (undocumented) colour spaces. i had similar issues with colour spaces introduced in macOS 10.14.6. build tests for reference: |
oh my god I'm so excited about this one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not tested, but looks ok.
Not sure this is working? Compiled this version just now. FIle is proven to be a proper HDR video when remuxed to MP4 for QuickTime, I use it as my test file for ages, It is streamed from the internet, my config is below. Works with IINA although IINA's HDR colors are completely wrong and way too dark compared to QuickTime. Pretty sure video doesn't activate HDR (I'd see the brightness change) on the other hand it does look way too dark the same way IINA does. M1 Pro mac, built-in display.
|
this is for cocoa-cb/libmpv and not vo=gpu(-next). you are using the macvk backend.
[edit] |
i am not sure how i should help you? you neither provide a log nor did you tell us what options you used for testing. if you expect HDR to work automatically, then that's now what this does. you have to manually specify the right csp like mentioned. |
I want to test on my intel macbookpro 2017, what's the right csp? How to write mpv.conf, just like:
|
i can't really tell. it depends on your hardware and display characteristics. though that is mentioned in the documentation. also this PR is probably the wrong place for discussing this. you should rather open a discussion. |
fwiw I managed to get some HDR working by playing around with those parameters (it looked wrong, but it was HDR), so in that sense I can confirm it working. Appreciate the help. |
i tested it some more on my TV and it also seems to work properly when setup/configured correctly. i might write up something in the wiki how to configure everything correctly in the future. though still need to test quite a lot still. |
by default utilises the color space of the screen on which the window is located. if a specific value is defined, it will instead be utilised. depending on the chosen color space the macOS EDR (HDR) support is activated and that OS's transformation (tone mapping) is used. Fixes mpv-player#7341
up to date version of #8485, with some added new colour spaces. also only for cocoa-cb since it's not necessary for the macvk vulkan backend or rather would break it.
this will most likely be the last new feature for the cocoa-cb/libmpv/opengl backend from me. just wanted to add this already done feature that was resting for years.
it might come in handy for future backends though.
Fixes #7341