本文整理汇总了Java中android.media.MediaCodecInfo.CodecProfileLevel.AVCLevel12方法的典型用法代码示例。如果您正苦于以下问题:Java CodecProfileLevel.AVCLevel12方法的具体用法?Java CodecProfileLevel.AVCLevel12怎么用?Java CodecProfileLevel.AVCLevel12使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.media.MediaCodecInfo.CodecProfileLevel
的用法示例。
在下文中一共展示了CodecProfileLevel.AVCLevel12方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: avcLevelToMaxFrameSize
import android.media.MediaCodecInfo.CodecProfileLevel; //导入方法依赖的package包/类
/**
* Conversion values taken from ISO 14496-10 Table A-1.
*
* @param avcLevel one of CodecProfileLevel.AVCLevel* constants.
* @return maximum frame size that can be decoded by a decoder with the specified avc level
* (or {@code -1} if the level is not recognized)
*/
private static int avcLevelToMaxFrameSize(int avcLevel) {
switch (avcLevel) {
case CodecProfileLevel.AVCLevel1: return 99 * 16 * 16;
case CodecProfileLevel.AVCLevel1b: return 99 * 16 * 16;
case CodecProfileLevel.AVCLevel12: return 396 * 16 * 16;
case CodecProfileLevel.AVCLevel13: return 396 * 16 * 16;
case CodecProfileLevel.AVCLevel2: return 396 * 16 * 16;
case CodecProfileLevel.AVCLevel21: return 792 * 16 * 16;
case CodecProfileLevel.AVCLevel22: return 1620 * 16 * 16;
case CodecProfileLevel.AVCLevel3: return 1620 * 16 * 16;
case CodecProfileLevel.AVCLevel31: return 3600 * 16 * 16;
case CodecProfileLevel.AVCLevel32: return 5120 * 16 * 16;
case CodecProfileLevel.AVCLevel4: return 8192 * 16 * 16;
case CodecProfileLevel.AVCLevel41: return 8192 * 16 * 16;
case CodecProfileLevel.AVCLevel42: return 8704 * 16 * 16;
case CodecProfileLevel.AVCLevel5: return 22080 * 16 * 16;
case CodecProfileLevel.AVCLevel51: return 36864 * 16 * 16;
default: return -1;
}
}
示例2: avcLevelToMaxFrameSize
import android.media.MediaCodecInfo.CodecProfileLevel; //导入方法依赖的package包/类
/**
* Conversion values taken from ISO 14496-10 Table A-1.
*
* @param avcLevel one of CodecProfileLevel.AVCLevel* constants.
* @return maximum frame size that can be decoded by a decoder with the specified avc level
* (or {@code -1} if the level is not recognized)
*/
private static int avcLevelToMaxFrameSize(int avcLevel) {
switch (avcLevel) {
case CodecProfileLevel.AVCLevel1: return 99 * 16 * 16;
case CodecProfileLevel.AVCLevel1b: return 99 * 16 * 16;
case CodecProfileLevel.AVCLevel12: return 396 * 16 * 16;
case CodecProfileLevel.AVCLevel13: return 396 * 16 * 16;
case CodecProfileLevel.AVCLevel2: return 396 * 16 * 16;
case CodecProfileLevel.AVCLevel21: return 792 * 16 * 16;
case CodecProfileLevel.AVCLevel22: return 1620 * 16 * 16;
case CodecProfileLevel.AVCLevel3: return 1620 * 16 * 16;
case CodecProfileLevel.AVCLevel31: return 3600 * 16 * 16;
case CodecProfileLevel.AVCLevel32: return 5120 * 16 * 16;
case CodecProfileLevel.AVCLevel4: return 8192 * 16 * 16;
case CodecProfileLevel.AVCLevel41: return 8192 * 16 * 16;
case CodecProfileLevel.AVCLevel42: return 8704 * 16 * 16;
case CodecProfileLevel.AVCLevel5: return 22080 * 16 * 16;
case CodecProfileLevel.AVCLevel51: return 36864 * 16 * 16;
case CodecProfileLevel.AVCLevel52: return 36864 * 16 * 16;
default: return -1;
}
}
示例3: avcLevelToMaxFrameSize
import android.media.MediaCodecInfo.CodecProfileLevel; //导入方法依赖的package包/类
/**
* Conversion values taken from: https://en.wikipedia.org/wiki/H.264/MPEG-4_AVC.
*
* @param avcLevel one of CodecProfileLevel.AVCLevel* constants.
* @return maximum frame size that can be decoded by a decoder with the specified avc level
* (or {@code -1} if the level is not recognized)
*/
private static int avcLevelToMaxFrameSize(int avcLevel) {
switch (avcLevel) {
case CodecProfileLevel.AVCLevel1: return 25344;
case CodecProfileLevel.AVCLevel1b: return 25344;
case CodecProfileLevel.AVCLevel12: return 101376;
case CodecProfileLevel.AVCLevel13: return 101376;
case CodecProfileLevel.AVCLevel2: return 101376;
case CodecProfileLevel.AVCLevel21: return 202752;
case CodecProfileLevel.AVCLevel22: return 414720;
case CodecProfileLevel.AVCLevel3: return 414720;
case CodecProfileLevel.AVCLevel31: return 921600;
case CodecProfileLevel.AVCLevel32: return 1310720;
case CodecProfileLevel.AVCLevel4: return 2097152;
case CodecProfileLevel.AVCLevel41: return 2097152;
case CodecProfileLevel.AVCLevel42: return 2228224;
case CodecProfileLevel.AVCLevel5: return 5652480;
case CodecProfileLevel.AVCLevel51: return 9437184;
default: return -1;
}
}
示例4: avcLevelToMaxFrameSize
import android.media.MediaCodecInfo.CodecProfileLevel; //导入方法依赖的package包/类
/**
* Conversion values taken from ISO 14496-10 Table A-1.
*
* @param avcLevel one of CodecProfileLevel.AVCLevel* constants.
* @return maximum frame size that can be decoded by a decoder with the specified avc level
* (or {@code -1} if the level is not recognized)
*/
private static int avcLevelToMaxFrameSize(int avcLevel) {
switch (avcLevel) {
case CodecProfileLevel.AVCLevel1: return 99 * 16 * 16;
case CodecProfileLevel.AVCLevel1b: return 99 * 16 * 16;
case CodecProfileLevel.AVCLevel12: return 396 * 16 * 16;
case CodecProfileLevel.AVCLevel13: return 396 * 16 * 16;
case CodecProfileLevel.AVCLevel2: return 396 * 16 * 16;
case CodecProfileLevel.AVCLevel21: return 792 * 16 * 16;
case CodecProfileLevel.AVCLevel22: return 1620 * 16 * 16;
case CodecProfileLevel.AVCLevel3: return 1620 * 16 * 16;
case CodecProfileLevel.AVCLevel31: return 3600 * 16 * 16;
case CodecProfileLevel.AVCLevel32: return 5120 * 16 * 16;
case CodecProfileLevel.AVCLevel4: return 8192 * 16 * 16;
case CodecProfileLevel.AVCLevel41: return 8192 * 16 * 16;
case CodecProfileLevel.AVCLevel42: return 8704 * 16 * 16;
case CodecProfileLevel.AVCLevel5: return 22080 * 16 * 16;
case CodecProfileLevel.AVCLevel51: return 36864 * 16 * 16;
default: return -1;
}
}
示例5: getLevelName
import android.media.MediaCodecInfo.CodecProfileLevel; //导入方法依赖的package包/类
public static String getLevelName(int level) {
switch (level) {
case CodecProfileLevel.AVCLevel1:
return "1";
case CodecProfileLevel.AVCLevel1b:
return "1b";
case CodecProfileLevel.AVCLevel11:
return "11";
case CodecProfileLevel.AVCLevel12:
return "12";
case CodecProfileLevel.AVCLevel13:
return "13";
case CodecProfileLevel.AVCLevel2:
return "2";
case CodecProfileLevel.AVCLevel21:
return "21";
case CodecProfileLevel.AVCLevel22:
return "22";
case CodecProfileLevel.AVCLevel3:
return "3";
case CodecProfileLevel.AVCLevel31:
return "31";
case CodecProfileLevel.AVCLevel32:
return "32";
case CodecProfileLevel.AVCLevel4:
return "4";
case CodecProfileLevel.AVCLevel41:
return "41";
case CodecProfileLevel.AVCLevel42:
return "42";
case CodecProfileLevel.AVCLevel5:
return "5";
case CodecProfileLevel.AVCLevel51:
return "51";
case 65536: // CodecProfileLevel.AVCLevel52:
return "52";
default:
return "0";
}
}
示例6: parseAvcLevel
import android.media.MediaCodecInfo.CodecProfileLevel; //导入方法依赖的package包/类
@SuppressLint("InlinedApi")
private static int parseAvcLevel(byte[] data) {
int levelIdc = data[8] & 0xFF;
switch (levelIdc) {
case 9:
return CodecProfileLevel.AVCLevel1b;
case 10:
return CodecProfileLevel.AVCLevel1;
case 11:
return CodecProfileLevel.AVCLevel11;
case 12:
return CodecProfileLevel.AVCLevel12;
case 13:
return CodecProfileLevel.AVCLevel13;
case 20:
return CodecProfileLevel.AVCLevel2;
case 21:
return CodecProfileLevel.AVCLevel21;
case 22:
return CodecProfileLevel.AVCLevel22;
case 30:
return CodecProfileLevel.AVCLevel3;
case 31:
return CodecProfileLevel.AVCLevel31;
case 32:
return CodecProfileLevel.AVCLevel32;
case 40:
return CodecProfileLevel.AVCLevel4;
case 41:
return CodecProfileLevel.AVCLevel41;
case 42:
return CodecProfileLevel.AVCLevel42;
case 50:
return CodecProfileLevel.AVCLevel5;
case 51:
return CodecProfileLevel.AVCLevel51;
default:
return 0;
}
}