Package org.robolectric.shadows
Class MediaCodecInfoBuilder
- java.lang.Object
-
- org.robolectric.shadows.MediaCodecInfoBuilder
-
public class MediaCodecInfoBuilder extends Object
Builder forMediaCodecInfo
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MediaCodecInfoBuilder.CodecCapabilitiesBuilder
Builder forMediaCodecInfo.CodecCapabilities
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods 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 Detail
-
newBuilder
public static MediaCodecInfoBuilder newBuilder()
Create a newMediaCodecInfoBuilder
.
-
setName
public MediaCodecInfoBuilder setName(String name)
Sets the codec name.- Parameters:
name
- codec name.- Throws:
NullPointerException
- if name is null.
-
setIsEncoder
public MediaCodecInfoBuilder setIsEncoder(boolean isEncoder)
Sets the codec role.- Parameters:
isEncoder
- a boolean to indicate whether the codec is an encodertrue
or a decoderfalse
. Default value isfalse
.
-
setIsVendor
public MediaCodecInfoBuilder setIsVendor(boolean isVendor)
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
public MediaCodecInfoBuilder setIsSoftwareOnly(boolean isSoftwareOnly)
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
public MediaCodecInfoBuilder setIsHardwareAccelerated(boolean isHardwareAccelerated)
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
public MediaCodecInfoBuilder setCapabilities(MediaCodecInfo.CodecCapabilities... capabilities)
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
public MediaCodecInfo build()
-
-