Package org.robolectric.shadows
Class MediaCodecInfoBuilder.CodecCapabilitiesBuilder
java.lang.Object
org.robolectric.shadows.MediaCodecInfoBuilder.CodecCapabilitiesBuilder
- Enclosing class:
- MediaCodecInfoBuilder
Builder for
MediaCodecInfo.CodecCapabilities.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates a newMediaCodecInfoBuilder.CodecCapabilitiesBuilder.setColorFormats(int[] colorFormats) Sets color formats.setIsEncoder(boolean isEncoder) Sets codec role.setMediaFormat(MediaFormat mediaFormat) Sets media format.setProfileLevels(MediaCodecInfo.CodecProfileLevel[] profileLevels) Sets profiles and levels.setRequiredFeatures(String[] requiredFeatures) Sets required features.
-
Method Details
-
newBuilder
Creates a newMediaCodecInfoBuilder.CodecCapabilitiesBuilder. -
setMediaFormat
Sets media format.- Parameters:
mediaFormat- aMediaFormatsupported by the codec. It is a requirement for mediaFormat to haveMediaFormat.KEY_MIMEset. Other keys are optional. SettingMediaFormat.KEY_WIDTH,MediaFormat.KEY_MAX_WIDTHandMediaFormat.KEY_HEIGHT,MediaFormat.KEY_MAX_HEIGHTwill set the minimum and maximum width, height respectively. For backwards compatibility, setting onlyMediaFormat.KEY_WIDTH,MediaFormat.KEY_HEIGHTwill only set the maximum width, height respectively.
-
setRequiredFeatures
public MediaCodecInfoBuilder.CodecCapabilitiesBuilder setRequiredFeatures(String[] requiredFeatures) Sets required features.- Parameters:
requiredFeatures- An array ofMediaCodecInfo.CodecCapabilitiesFEATURE strings.
-
setIsEncoder
Sets codec role.- Parameters:
isEncoder- a boolean to indicate whether the codec is an encoder or a decoder. Default value is false.
-
setProfileLevels
public MediaCodecInfoBuilder.CodecCapabilitiesBuilder setProfileLevels(MediaCodecInfo.CodecProfileLevel[] profileLevels) Sets profiles and levels.- Parameters:
profileLevels- an array ofMediaCodecInfo.CodecProfileLevelsupported by the codec.- Throws:
NullPointerException- if profileLevels is null.
-
setColorFormats
Sets color formats.- Parameters:
colorFormats- an array of color formats supported by the video codec. Refer toMediaCodecInfo.CodecCapabilitiesfor possible values.
-
build
-