Add a full decoder dump to the exception string

This commit is contained in:
Cameron Gutman 2014-09-03 21:34:55 -07:00
parent b5e585834d
commit 85a011eb84

View File

@ -77,7 +77,8 @@ public class MediaCodecDecoderRenderer implements VideoDecoderRenderer {
return false; return false;
} }
public static void dumpDecoders() throws Exception { public static String dumpDecoders() throws Exception {
String str = "";
for (int i = 0; i < MediaCodecList.getCodecCount(); i++) { for (int i = 0; i < MediaCodecList.getCodecCount(); i++) {
MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i); MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i);
@ -86,16 +87,17 @@ public class MediaCodecDecoderRenderer implements VideoDecoderRenderer {
continue; continue;
} }
LimeLog.info("Decoder: "+codecInfo.getName()); str += "Decoder: "+codecInfo.getName()+"\n";
for (String type : codecInfo.getSupportedTypes()) { for (String type : codecInfo.getSupportedTypes()) {
LimeLog.info("\t"+type); str += "\t"+type+"\n";
CodecCapabilities caps = codecInfo.getCapabilitiesForType(type); CodecCapabilities caps = codecInfo.getCapabilitiesForType(type);
for (CodecProfileLevel profile : caps.profileLevels) { for (CodecProfileLevel profile : caps.profileLevels) {
LimeLog.info("\t\t"+profile.profile+" "+profile.level); str += "\t\t"+profile.profile+" "+profile.level+"\n";
} }
} }
} }
return str;
} }
private static MediaCodecInfo findFirstDecoder() { private static MediaCodecInfo findFirstDecoder() {
@ -586,6 +588,13 @@ public class MediaCodecDecoderRenderer implements VideoDecoderRenderer {
str += "Buffer codec flags: "+currentCodecFlags+"\n"; str += "Buffer codec flags: "+currentCodecFlags+"\n";
} }
str += "Full decoder dump:\n";
try {
str += dumpDecoders();
} catch (Exception e) {
str += e.getMessage();
}
str += originalException.toString(); str += originalException.toString();
return str; return str;