boolean result = CodecDescriptionList.isEncodeSupportedByMime(Format.AUDIO_FLAC);
調(diào)用 CodecDescriptionList 類的靜態(tài) isDecoderSupportedByFormat/isEncoderSupportedByFormat 方法,判斷某設(shè)備是否支持指定 Format 的編解碼器,支持返回 true ,否則返回 false。代碼示例如下:
Format format = new Format();
format.putStringValue(Format.MIME, Format.VIDEO_AVC);
format.putIntValue(Format.WIDTH, 2560);
format.putIntValue(Format.HEIGHT, 1440);
format.putIntValue(Format.FRAME_RATE, 30);
format.putIntValue(Format.FRAME_INTERVAL, 1);
boolean result = CodecDescriptionList.isDecoderSupportedByFormat(format);
result = CodecDescriptionList.isEncoderSupportedByFormat(format);
更多建議: