Surface MediaCodecInfo isHardwareAccelerated / isSoftwareOnly / isVendor
Android Q has added new isHardwareAccelerated, isSoftwareOnly and isVendor methods to MediaCodecInfo. We should consider:
- Surfacing this information in ExoPlayer's
MediaCodecInfo. It would probably make sense for us to approximate this information for earlier API levels as well (e.g. based on decoder name). - Once this information is surfaced, we should potentially look at whether it should be factored into track selection decisions. For example, preferring H264 over HEVC in cases where the H264 decoder is hardware and the HEVC decoder is software.
@ojw28 the issue I opened on Android's issue tracker was added to a "hotlist" that I don't have access to (https://issuetracker.google.com/issues?q=hotlistid:1498427). Maybe as a Google employee you can have a look there and see what it means.
Anyway, even though it seems like this new API resolves my request, they haven't marked it as such and they haven't marked it as a duplicate.
Another interesting point - this is isSoftwareOnly()'s Javadoc:
Query if the codec is software only. Software-only codecs are more secure as they run in a tighter security sandbox. On the other hand, software-only codecs do not provide any performance guarantees.
Emphasis mine; this seems reverse to me: software-only means that hardware decryption (by Widevine L1 or PlayReady SL2000+) is separate from decoding -- this should actually weaken the security, unless I'm missing something.
The hotlists aren't anything of relevance/interest. I don't think "secure" in that comment you quote is describing content protection. It's describing isolation. For example resistance to attacks such as a carefully crafted content bitstream being able to crash the device.
In any case, let's use this issue to track the actual feature request; these are rather tangential discussions.
Issue fixed by commit above.
@kim-vde @ojw28 do you know if these new "c2" prefixes have existed before Android Q?
@noamtamim Those prefixes have been introduced in Android P.