ExoPlayer icon indicating copy to clipboard operation
ExoPlayer copied to clipboard

Surface MediaCodecInfo isHardwareAccelerated / isSoftwareOnly / isVendor

Open ojw28 opened this issue 7 years ago • 6 comments

Android Q has added new isHardwareAccelerated, isSoftwareOnly and isVendor methods to MediaCodecInfo. We should consider:

  1. 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).
  2. 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 avatar May 06 '19 20:05 ojw28

@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.

noamtamim avatar May 07 '19 06:05 noamtamim

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.

noamtamim avatar May 07 '19 06:05 noamtamim

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.

ojw28 avatar May 07 '19 15:05 ojw28

Issue fixed by commit above.

kim-vde avatar Sep 11 '19 16:09 kim-vde

@kim-vde @ojw28 do you know if these new "c2" prefixes have existed before Android Q?

noamtamim avatar Sep 11 '19 17:09 noamtamim

@noamtamim Those prefixes have been introduced in Android P.

kim-vde avatar Sep 13 '19 13:09 kim-vde