Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find out whether a codec supports hardware-acceleration on Android?

Tags:

android

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?

like image 658
fyraimar Avatar asked Oct 16 '13 07:10

fyraimar


People also ask

How do I use hardware acceleration on Android?

We can enable hardware acceleration at application level by adding “android : hardwareAccelerated” attribute to application tag.

How do I enable GPU acceleration on Android?

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.


2 Answers

Starting with Android 10 the MediaCodecAPI provides a method isHardwareAccelerated() through the MediaCodecInfo object for each Codec.

like image 119
user1033552 Avatar answered Oct 29 '22 09:10

user1033552


My smartphone has the Qualcomm Snapdragon 425 (MSM8917) SoC, and using the MediaCodecInfo app I see two encoding alternatives for the AVC(H264) codec:

  • OMX.qcom.video.encoder.avc
  • OMX.google.h264.encoder

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.

like image 32
Eduardo Avatar answered Oct 29 '22 09:10

Eduardo