There's no really good and straightforward solution, but there's a number of things you can check. It all depends on what you really want to do though - do you want to avoid all MediaTek chipsets, or just one specific one? In some cases, these kinds of issues can also change across different generations of the driver for the encoder.
You can check Build.BOARD
, and hope that it is the same across multiple devices with the same chipset. In most cases it's probably not, though.
You can also try to read the ro.board.platform
system property - it's not publicly available within the Build
class, but you can try to access the android.os.SystemProperties.get
method (via reflection, to make sure to fail safely in case it has changed).
You can also try to decide based on the encoder name, as exposed via MediaCodec.getName()
and MediaCodecInfo.getName()
. This is probably the most straightforward way to do what you want. For some chipset manufacturers, the encoder has got the same name regardless of chipset, while some may have slightly different names in different chipset generations.