本文整理匯總了Java中android.media.MediaCodecList.REGULAR_CODECS屬性的典型用法代碼示例。如果您正苦於以下問題:Java MediaCodecList.REGULAR_CODECS屬性的具體用法?Java MediaCodecList.REGULAR_CODECS怎麽用?Java MediaCodecList.REGULAR_CODECS使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類android.media.MediaCodecList
的用法示例。
在下文中一共展示了MediaCodecList.REGULAR_CODECS屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getAvailableEncoders
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public static List<String> getAvailableEncoders(int sampleRate) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
MediaFormat format = MediaFormatFactory.createMediaFormat(MediaFormatFactory.Type.FLAC, sampleRate);
MediaCodecList mcl = new MediaCodecList(MediaCodecList.REGULAR_CODECS);
String encoderAsStr = mcl.findEncoderForFormat(format);
List<String> encoders = new ArrayList<>();
for (MediaCodecInfo info : mcl.getCodecInfos()) {
if (info.isEncoder()) {
if (info.getName().equals(encoderAsStr)) {
encoders.add("*** " + info.getName() + ": " + TextUtils.join(", ", info.getSupportedTypes()));
} else {
encoders.add(info.getName() + ": " + TextUtils.join(", ", info.getSupportedTypes()));
}
}
}
return encoders;
}
return Collections.emptyList();
}
示例2: getMediaCodecList
@SuppressWarnings("deprecation")
@SuppressLint("NewApi")
private static LinkedList<MediaCodecInfo> getMediaCodecList() {
LinkedList<MediaCodecInfo> infoList = new LinkedList<>();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
MediaCodecList mcl = new MediaCodecList(MediaCodecList.REGULAR_CODECS);
Collections.addAll(infoList, mcl.getCodecInfos());
}
else {
for (int i = 0; i < MediaCodecList.getCodecCount(); i++) {
infoList.add(MediaCodecList.getCodecInfoAt(i));
}
}
return infoList;
}
示例3: MediaCodecListCompatV21
public MediaCodecListCompatV21(boolean includeSecure) {
codecKind = includeSecure ? MediaCodecList.ALL_CODECS : MediaCodecList.REGULAR_CODECS;
}
示例4: MediaCodecListCompatV21
public MediaCodecListCompatV21(boolean includeSecure) {
codecKind = includeSecure ? MediaCodecList.ALL_CODECS : MediaCodecList.REGULAR_CODECS;
}
示例5: MediaCodecListCompatV21
public MediaCodecListCompatV21(boolean includeSecure) {
int codecKind = includeSecure ? MediaCodecList.ALL_CODECS : MediaCodecList.REGULAR_CODECS;
mediaCodecInfos = new MediaCodecList(codecKind).getCodecInfos();
}