List of usage examples for android.media MediaCodecInfo getSupportedTypes
public final String[] getSupportedTypes()
From source file:Main.java
public static MediaCodecInfo selectCodec(String mimeType) { int numCodecs = MediaCodecList.getCodecCount(); for (int i = 0; i < numCodecs; i++) { MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i); if (!codecInfo.isEncoder()) { continue; }// ww w . j a v a 2s . c o m String[] types = codecInfo.getSupportedTypes(); for (int j = 0; j < types.length; j++) { if (types[j].equalsIgnoreCase(mimeType)) { return codecInfo; } } } return null; }
From source file:Main.java
/** * Returns the first codec capable of encoding the specified MIME type, or null if no * match was found.// w w w. ja v a 2 s. c o m * * @param mimeType String * @return MediaCodecInfo */ public static MediaCodecInfo selectCodec(String mimeType) { int numCodecs = MediaCodecList.getCodecCount(); for (int i = 0; i < numCodecs; i++) { MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i); if (!codecInfo.isEncoder()) { continue; } String[] types = codecInfo.getSupportedTypes(); for (String type : types) { if (type.equalsIgnoreCase(mimeType)) { return codecInfo; } } } return null; }