Using Android's MediaCodec API, I can get a list of codecs registered in the system.
All the things I can get from this API are the name, supported media types and whether it is an encoder or decoder.
But how can I figure out whether a codec supports hardware-acceleration?
We can enable hardware acceleration at application level by adding “android : hardwareAccelerated” attribute to application tag.
Go back to Settings, scroll down and you should be able to see a new option called Developer options. Tap on it. Scroll down to the Hardware accelerated rendering and enable the toggle next to Force GPU rendering.
Starting with Android 10 the MediaCodecAPI provides a method isHardwareAccelerated() through the MediaCodecInfo
object for each Codec.
My smartphone has the Qualcomm Snapdragon 425 (MSM8917) SoC, and using the MediaCodecInfo app I see two encoding alternatives for the AVC(H264) codec:
As far as I know, you get access to the hardware encoding/decoding through the "qcom" package (Qualcomm), in my case, and the google one is just a software based alternative that comes with Android in case no hardware acceleration is available.
A more experienced person could confirm this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With