/** * @return the maximum frame size for an H264 stream that can be decoded on the device. */ public static int maxH264DecodableFrameSize() throws DecoderQueryException { Pair<String, CodecCapabilities> info = getMediaCodecInfo(MimeTypes.VIDEO_H264, false); if (info == null) { return 0; } int maxH264DecodableFrameSize = 0; CodecCapabilities capabilities = info.second; for (int i = 0; i < capabilities.profileLevels.length; i++) { CodecProfileLevel profileLevel = capabilities.profileLevels[i]; maxH264DecodableFrameSize = Math.max( avcLevelToMaxFrameSize(profileLevel.level), maxH264DecodableFrameSize); } return maxH264DecodableFrameSize; }