Package org.robolectric.shadows
Class MediaCodecInfoBuilder
java.lang.Object
org.robolectric.shadows.MediaCodecInfoBuilder
public class MediaCodecInfoBuilder extends Object
Builder for
MediaCodecInfo
.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MediaCodecInfoBuilder.CodecCapabilitiesBuilder
Builder forMediaCodecInfo.CodecCapabilities
. -
Method Summary
Modifier and Type Method Description MediaCodecInfo
build()
static MediaCodecInfoBuilder
newBuilder()
Create a newMediaCodecInfoBuilder
.MediaCodecInfoBuilder
setCapabilities(MediaCodecInfo.CodecCapabilities... capabilities)
Sets codec capabilities.MediaCodecInfoBuilder
setIsEncoder(boolean isEncoder)
Sets the codec role.MediaCodecInfoBuilder
setIsHardwareAccelerated(boolean isHardwareAccelerated)
Sets whether the codec is hardware accelerated or not.MediaCodecInfoBuilder
setIsSoftwareOnly(boolean isSoftwareOnly)
Sets whether the codec is softwrare only or not.MediaCodecInfoBuilder
setIsVendor(boolean isVendor)
Sets the codec provider.MediaCodecInfoBuilder
setName(String name)
Sets the codec name.
-
Method Details
-
newBuilder
Create a newMediaCodecInfoBuilder
. -
setName
Sets the codec name.- Parameters:
name
- codec name.- Throws:
NullPointerException
- if name is null.
-
setIsEncoder
Sets the codec role.- Parameters:
isEncoder
- a boolean to indicate whether the codec is an encodertrue
or a decoderfalse
. Default value isfalse
.
-
setIsVendor
Sets the codec provider.- Parameters:
isVendor
- a boolean to indicate whether the codec is provided by the device manufacturertrue
or by the Android platformfalse
. Default value isfalse
.
-
setIsSoftwareOnly
Sets whether the codec is softwrare only or not.- Parameters:
isSoftwareOnly
- a boolean to indicate whether the codec is software onlytrue
or notfalse
. Default value isfalse
.
-
setIsHardwareAccelerated
Sets whether the codec is hardware accelerated or not.- Parameters:
isHardwareAccelerated
- a boolean to indicate whether the codec is hardware acceleratedtrue
or notfalse
. Default value isfalse
.
-
setCapabilities
Sets codec capabilities.Use
MediaCodecInfoBuilder.CodecCapabilitiesBuilder
can be to create an instance ofMediaCodecInfo.CodecCapabilities
.- Parameters:
capabilities
- one or multipleMediaCodecInfo.CodecCapabilities
.- Throws:
NullPointerException
- if capabilities is null.
-
build
-