Search code examples
androidandroid-mediacodechdrdolby

How to check whether a decoder in Android support dolby vision video?


In android developer documentlink, it says that AVC and HEVC are support Dolby Vision video if their profile list contains specific value, such as'int DolbyVisionProfileDvavPer = 0x01', 'int DolbyVisionProfileDvavPen = 0x02' and so on. While 'int HEVCProfileMain = 0x01' in HEVC profile list has same value with 'DolbyVisionProfileDvavPer', is there any method to distinguish them if i want to check whether HEVC support dolby vision video through profile value.


Solution

  • Indeed, different profiles have common integer values. In order to differentiate between then you have to look at the combination of the MIME type and the profile value.

    You start by asking the supported MIME types using MediaCodecInfo::getSupportedTypes

    Then you query the capabilities for a specific MIME type from the list (e.g. MIMETYPE_VIDEO_DOLBY_VISION) using MediaCodecInfo::getCapabilitiesForType

    At this point you know against which set of values to compare the profile (e.g. DolbyVisionProfileDvavPer, DolbyVisionProfileDvavPen, etc.).