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 classMediaCodecInfoBuilder.CodecCapabilitiesBuilderBuilder forMediaCodecInfo.CodecCapabilities.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MediaCodecInfobuild()static MediaCodecInfoBuildernewBuilder()Create a newMediaCodecInfoBuilder.MediaCodecInfoBuildersetCapabilities(MediaCodecInfo.CodecCapabilities... capabilities)Sets codec capabilities.MediaCodecInfoBuildersetIsEncoder(boolean isEncoder)Sets the codec role.MediaCodecInfoBuildersetIsHardwareAccelerated(boolean isHardwareAccelerated)Sets whether the codec is hardware accelerated or not.MediaCodecInfoBuildersetIsSoftwareOnly(boolean isSoftwareOnly)Sets whether the codec is softwrare only or not.MediaCodecInfoBuildersetIsVendor(boolean isVendor)Sets the codec provider.MediaCodecInfoBuildersetName(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 encodertrueor 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 manufacturertrueor 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 onlytrueor 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 acceleratedtrueor notfalse. Default value isfalse.
-
setCapabilities
public MediaCodecInfoBuilder setCapabilities(MediaCodecInfo.CodecCapabilities... capabilities)
Sets codec capabilities.Use
MediaCodecInfoBuilder.CodecCapabilitiesBuildercan be to create an instance ofMediaCodecInfo.CodecCapabilities.- Parameters:
capabilities- one or multipleMediaCodecInfo.CodecCapabilities.- Throws:
NullPointerException- if capabilities is null.
-
build
public MediaCodecInfo build()
-
-