androidexoplayerandroid-mediacodecdecoderhdr

How to confirm that whether decoder support HLG or HDR format in Android?


Now, i know that we can get the profiles from the MediaCodecInfo.CodecCapabilities.profiles. For example, if decoder is hevc, the profiles can be HEVCProfileMain10HDR10 or HEVCProfileMain10HDR10Plus. Is it means that it both support hdr10+ and hdr10 if profile name equals HEVCProfileMain10HDR10Plus? And then, in [Android developer document][1]

[1]: https://source.android.com/docs/core/display/hdr#vp9-hlg-pq says that if decoder is vp9 and the profile name equals VP9Profile2HDR or VP9Profile2HDR10Plus, it will support HLG. Why not say vp9 support hdr or hdr10+?


Solution

  • If a codec supports multiple profiles (HEVCProfileMain10, HEVCProfileMain10HDR10, HEVCProfileMain10HDR10Plus) then we can expect to see all of them listed in the MediaCodecInfo.CodecCapabilities.profileLevels array.

    Note that when the documentation mentions "HDR video" it means "high dynamic range video" in general. While HDR10 and HDR10+ are specific formats of HDR video (along with HLG10 and Dolby Vision).

    So, for example, VP9 Profile 3 (HDR) supports 2 color depths (10 or 12 bit) and 2 transfer functions (PQ or HLG). But HDR10 implies 10-bits and PQ, while HLG10 implies 10-bits and HLG.

    Furthermore, HEVC Main 10 profile supports multiple transfer functions too. For example, HEVCProfileMain10 handles HLG and HEVCProfileMain10HDR10 handles PQ. And the number 10 in the name stands for 10 bits per sample.