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
- aMediaFormat
supported by the codec. It is a requirement for mediaFormat to haveMediaFormat.KEY_MIME
set. Other keys are optional. SettingMediaFormat.KEY_WIDTH
,MediaFormat.KEY_MAX_WIDTH
andMediaFormat.KEY_HEIGHT
,MediaFormat.KEY_MAX_HEIGHT
will set the minimum and maximum width, height respectively. For backwards compatibility, setting onlyMediaFormat.KEY_WIDTH
,MediaFormat.KEY_HEIGHT
will only set the maximum width, height respectively.
-
setRequiredFeatures
public MediaCodecInfoBuilder.CodecCapabilitiesBuilder setRequiredFeatures(String[] requiredFeatures) Sets required features.- Parameters:
requiredFeatures
- An array ofMediaCodecInfo.CodecCapabilities
FEATURE 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.CodecProfileLevel
supported 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.CodecCapabilities
for possible values.
-
build
-