I wonder what are the possible causes for this exception.
Stack trace: java.io.IOException: Failed to find matching codec OMX.google.h264.decoder, error 0x80000000
at android.media.MediaCodec.native_setup(MediaCodec.java)
at android.media.MediaCodec.<init>(MediaCodec.java:1912)
at android.media.MediaCodec.createByCodecName(MediaCodec.java:1890)
The app actually searches the codec list and ensures OMX.google.h264.decoder exists before trying to use it.
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
MediaCodecList mRegularCodecs = new MediaCodecList(MediaCodecList.ALL_CODECS);
for (MediaCodecInfo mci : mRegularCodecs.getCodecInfos()) {
if (mci.getName().contains("OMX.google.h264.decoder")) {
try {
MediaCodec mc = MediaCodec.createByCodecName("OMX.google.h264.decoder");
} catch (Exception ex) {
//log mci.getName() to show it is indeed "OMX.google.h264.decoder"
}
} else {
//do nothing
}
}
}
This works fine usually. The exception is rare. Could anyone shed some light on this? Could this be a temporary glitch of the OS and the app should keep trying?
Even if a specific codec exists on the device it's not guaranteed to always be available.
Here are a couple of reasons for it not being available:
Considering this my recommendation is: