RendererCapabilities
@UnstableApi
public interface RendererCapabilities
BaseRenderer |
An abstract base class suitable for most |
NoSampleRenderer |
A |
CameraMotionRenderer |
A |
CapturingRenderersFactory.CapturingMediaCodecVideoRenderer |
A |
DecoderAudioRenderer |
Decodes and renders audio using a |
DecoderVideoRenderer |
Decodes and renders video using a |
FakeAudioRenderer |
A |
FakeMediaClockRenderer |
Fake abstract |
FakeRenderer |
Fake |
FakeVideoRenderer |
A |
ImageRenderer |
A |
MediaCodecAudioRenderer |
Decodes and renders audio using |
MediaCodecRenderer |
An abstract renderer that uses |
MediaCodecVideoRenderer |
Decodes and renders video using |
MetadataRenderer |
A renderer for metadata. |
TextRenderer |
A |
Defines the capabilities of a Renderer.
Summary
Constants |
|
|---|---|
default static final int |
The |
default static final int |
The |
default static final int |
ADAPTIVE_SEAMLESS = 16The |
default static final int |
A mask to apply to |
default static final int |
The renderer supports audio offload and gapless transitions with this format. |
default static final int |
Audio offload is not supported with this format. |
default static final int |
The renderer supports audio offload and speed changes with this format. |
default static final int |
AUDIO_OFFLOAD_SUPPORTED = 512The renderer supports audio offload with this format. |
default static final int |
AUDIO_OFFLOAD_SUPPORT_MASK = 3584A mask to apply to |
default static final int |
The format exceeds the primary decoder's capabilities but is supported by fallback decoder |
default static final int |
The format's MIME type is unsupported and the renderer may use a decoder for a fallback MIME type. |
default static final int |
DECODER_SUPPORT_MASK = 384A mask to apply to |
default static final int |
DECODER_SUPPORT_PRIMARY = 128The renderer is able to use the primary decoder for the format's MIME type. |
default static final int |
A mask to apply to |
default static final int |
The renderer is not able to use hardware acceleration. |
default static final int |
The renderer is able to use hardware acceleration. |
default static final int |
A mask to apply to |
default static final int |
The |
default static final int |
TUNNELING_SUPPORTED = 32The |
default static final int |
A mask to apply to |
Constants
ADAPTIVE_NOT_SEAMLESS
default static final int ADAPTIVE_NOT_SEAMLESS = 8
The Renderer can adapt between formats, but may suffer a brief discontinuity (~50-100ms) when adaptation occurs.
ADAPTIVE_NOT_SUPPORTED
default static final int ADAPTIVE_NOT_SUPPORTED = 0
The Renderer does not support adaptation between formats.
ADAPTIVE_SEAMLESS
default static final int ADAPTIVE_SEAMLESS = 16
The Renderer can seamlessly adapt between formats.
ADAPTIVE_SUPPORT_MASK
default static final int ADAPTIVE_SUPPORT_MASK = 24
A mask to apply to Capabilities to obtain the AdaptiveSupport only.
AUDIO_OFFLOAD_GAPLESS_SUPPORTED
default static final int AUDIO_OFFLOAD_GAPLESS_SUPPORTED = 1024
The renderer supports audio offload and gapless transitions with this format.
AUDIO_OFFLOAD_NOT_SUPPORTED
default static final int AUDIO_OFFLOAD_NOT_SUPPORTED = 0
Audio offload is not supported with this format.
AUDIO_OFFLOAD_SPEED_CHANGE_SUPPORTED
default static final int AUDIO_OFFLOAD_SPEED_CHANGE_SUPPORTED = 2048
The renderer supports audio offload and speed changes with this format.
AUDIO_OFFLOAD_SUPPORTED
default static final int AUDIO_OFFLOAD_SUPPORTED = 512
The renderer supports audio offload with this format.
AUDIO_OFFLOAD_SUPPORT_MASK
default static final int AUDIO_OFFLOAD_SUPPORT_MASK = 3584
A mask to apply to Capabilities to obtain AudioOffloadSupport only.
DECODER_SUPPORT_FALLBACK
default static final int DECODER_SUPPORT_FALLBACK = 0
The format exceeds the primary decoder's capabilities but is supported by fallback decoder
DECODER_SUPPORT_FALLBACK_MIMETYPE
default static final int DECODER_SUPPORT_FALLBACK_MIMETYPE = 256
The format's MIME type is unsupported and the renderer may use a decoder for a fallback MIME type.
DECODER_SUPPORT_MASK
default static final int DECODER_SUPPORT_MASK = 384
A mask to apply to Capabilities to obtain DecoderSupport only.
DECODER_SUPPORT_PRIMARY
default static final int DECODER_SUPPORT_PRIMARY = 128
The renderer is able to use the primary decoder for the format's MIME type.
FORMAT_SUPPORT_MASK
default static final int FORMAT_SUPPORT_MASK = 7
A mask to apply to Capabilities to obtain the C.FormatSupport only.
HARDWARE_ACCELERATION_NOT_SUPPORTED
default static final int HARDWARE_ACCELERATION_NOT_SUPPORTED = 0
The renderer is not able to use hardware acceleration.
HARDWARE_ACCELERATION_SUPPORTED
default static final int HARDWARE_ACCELERATION_SUPPORTED = 64
The renderer is able to use hardware acceleration.
HARDWARE_ACCELERATION_SUPPORT_MASK
default static final int HARDWARE_ACCELERATION_SUPPORT_MASK = 64
A mask to apply to Capabilities to obtain HardwareAccelerationSupport only.
TUNNELING_NOT_SUPPORTED
default static final int TUNNELING_NOT_SUPPORTED = 0
The Renderer does not support tunneled output.
TUNNELING_SUPPORTED
default static final int TUNNELING_SUPPORTED = 32
The Renderer supports tunneled output.
TUNNELING_SUPPORT_MASK
default static final int TUNNELING_SUPPORT_MASK = 32
A mask to apply to Capabilities to obtain TunnelingSupport only.
Public methods
create
@RendererCapabilities.Capabilities
default static int create(@C.FormatSupport int formatSupport)
Returns Capabilities for the given C.FormatSupport.
AdaptiveSupport is set to ADAPTIVE_NOT_SUPPORTED, TunnelingSupport is set to TUNNELING_NOT_SUPPORTED, HardwareAccelerationSupport is set to HARDWARE_ACCELERATION_NOT_SUPPORTED, DecoderSupport is set to DECODER_SUPPORT_PRIMARY and AudioOffloadSupport is set to AUDIO_OFFLOAD_NOT_SUPPORTED.
| Parameters | |
|---|---|
@C.FormatSupport int formatSupport |
The |
| Returns | |
|---|---|
int |
The combined |
create
@RendererCapabilities.Capabilities
default static int create(
@C.FormatSupport int formatSupport,
@RendererCapabilities.AdaptiveSupport int adaptiveSupport,
@RendererCapabilities.TunnelingSupport int tunnelingSupport
)
Returns Capabilities combining the given C.FormatSupport, AdaptiveSupport and TunnelingSupport.
HardwareAccelerationSupport is set to HARDWARE_ACCELERATION_NOT_SUPPORTED, DecoderSupport is set to DECODER_SUPPORT_PRIMARY, and AudioOffloadSupport is set to AUDIO_OFFLOAD_NOT_SUPPORTED.
| Parameters | |
|---|---|
@C.FormatSupport int formatSupport |
The |
@RendererCapabilities.AdaptiveSupport int adaptiveSupport |
The |
@RendererCapabilities.TunnelingSupport int tunnelingSupport |
The |
| Returns | |
|---|---|
int |
The combined |
create
@RendererCapabilities.Capabilities
default static int create(
@C.FormatSupport int formatSupport,
@RendererCapabilities.AdaptiveSupport int adaptiveSupport,
@RendererCapabilities.TunnelingSupport int tunnelingSupport,
@RendererCapabilities.AudioOffloadSupport int audioOffloadSupport
)
Returns Capabilities combining the given C.FormatSupport, AdaptiveSupport, TunnelingSupport, and AudioOffloadSupport.
HardwareAccelerationSupport is set to HARDWARE_ACCELERATION_NOT_SUPPORTED and DecoderSupport is set to DECODER_SUPPORT_PRIMARY.
| Parameters | |
|---|---|
@C.FormatSupport int formatSupport |
The |
@RendererCapabilities.AdaptiveSupport int adaptiveSupport |
The |
@RendererCapabilities.TunnelingSupport int tunnelingSupport |
The |
@RendererCapabilities.AudioOffloadSupport int audioOffloadSupport |
The |
| Returns | |
|---|---|
int |
The combined |
create
@RendererCapabilities.Capabilities
default static int create(
@C.FormatSupport int formatSupport,
@RendererCapabilities.AdaptiveSupport int adaptiveSupport,
@RendererCapabilities.TunnelingSupport int tunnelingSupport,
@RendererCapabilities.HardwareAccelerationSupport int hardwareAccelerationSupport,
@RendererCapabilities.DecoderSupport int decoderSupport
)
Returns Capabilities combining the given C.FormatSupport, AdaptiveSupport, TunnelingSupport, HardwareAccelerationSupport, and DecoderSupport.
AudioOffloadSupport is set to AUDIO_OFFLOAD_NOT_SUPPORTED.
| Parameters | |
|---|---|
@C.FormatSupport int formatSupport |
The |
@RendererCapabilities.AdaptiveSupport int adaptiveSupport |
The |
@RendererCapabilities.TunnelingSupport int tunnelingSupport |
The |
@RendererCapabilities.HardwareAccelerationSupport int hardwareAccelerationSupport |
|
@RendererCapabilities.DecoderSupport int decoderSupport |
The |
| Returns | |
|---|---|
int |
The combined |
create
@RendererCapabilities.Capabilities
default static int create(
@C.FormatSupport int formatSupport,
@RendererCapabilities.AdaptiveSupport int adaptiveSupport,
@RendererCapabilities.TunnelingSupport int tunnelingSupport,
@RendererCapabilities.HardwareAccelerationSupport int hardwareAccelerationSupport,
@RendererCapabilities.DecoderSupport int decoderSupport,
@RendererCapabilities.AudioOffloadSupport int audioOffloadSupport
)
Returns Capabilities combining the given C.FormatSupport, AdaptiveSupport, TunnelingSupport, HardwareAccelerationSupport, DecoderSupport and AudioOffloadSupport.
| Parameters | |
|---|---|
@C.FormatSupport int formatSupport |
The |
@RendererCapabilities.AdaptiveSupport int adaptiveSupport |
The |
@RendererCapabilities.TunnelingSupport int tunnelingSupport |
The |
@RendererCapabilities.HardwareAccelerationSupport int hardwareAccelerationSupport |
|
@RendererCapabilities.DecoderSupport int decoderSupport |
The |
@RendererCapabilities.AudioOffloadSupport int audioOffloadSupport |
| Returns | |
|---|---|
int |
The combined |
getAdaptiveSupport
@RendererCapabilities.AdaptiveSupport
default static int getAdaptiveSupport(@RendererCapabilities.Capabilities int supportFlags)
Returns the AdaptiveSupport from the combined Capabilities.
| Parameters | |
|---|---|
@RendererCapabilities.Capabilities int supportFlags |
The combined |
| Returns | |
|---|---|
int |
The |
getAudioOffloadSupport
@RendererCapabilities.AudioOffloadSupport
default static int getAudioOffloadSupport(
@RendererCapabilities.Capabilities int supportFlags
)
Returns the AudioOffloadSupport from the combined Capabilities.
| Parameters | |
|---|---|
@RendererCapabilities.Capabilities int supportFlags |
The combined |
| Returns | |
|---|---|
int |
The |
getDecoderSupport
@RendererCapabilities.DecoderSupport
default static int getDecoderSupport(@RendererCapabilities.Capabilities int supportFlags)
Returns the DecoderSupport from the combined Capabilities.
| Parameters | |
|---|---|
@RendererCapabilities.Capabilities int supportFlags |
The combined |
| Returns | |
|---|---|
int |
The |
getFormatSupport
@C.FormatSupport
default static int getFormatSupport(@RendererCapabilities.Capabilities int supportFlags)
Returns the C.FormatSupport from the combined Capabilities.
| Parameters | |
|---|---|
@RendererCapabilities.Capabilities int supportFlags |
The combined |
| Returns | |
|---|---|
int |
The |
getHardwareAccelerationSupport
@RendererCapabilities.HardwareAccelerationSupport
default static int getHardwareAccelerationSupport(
@RendererCapabilities.Capabilities int supportFlags
)
Returns the HardwareAccelerationSupport from the combined Capabilities.
| Parameters | |
|---|---|
@RendererCapabilities.Capabilities int supportFlags |
The combined |
| Returns | |
|---|---|
int |
The |
getTrackType
@C.TrackType
abstract int getTrackType()
Returns the track type that the Renderer handles. For example, a video renderer will return TRACK_TYPE_VIDEO, an audio renderer will return TRACK_TYPE_AUDIO, a text renderer will return TRACK_TYPE_TEXT, and so on.
| Returns | |
|---|---|
int |
The |
| See also | |
|---|---|
getTrackType |
getTunnelingSupport
@RendererCapabilities.TunnelingSupport
default static int getTunnelingSupport(@RendererCapabilities.Capabilities int supportFlags)
Returns the TunnelingSupport from the combined Capabilities.
| Parameters | |
|---|---|
@RendererCapabilities.Capabilities int supportFlags |
The combined |
| Returns | |
|---|---|
int |
The |
isFormatSupported
default static boolean isFormatSupported(
@RendererCapabilities.Capabilities int supportFlags,
boolean allowExceedsCapabilities
)
Returns whether the C.FormatSupport from the combined Capabilities indicates the format is supported.
A format is considered supported if its C.FormatSupport value is FORMAT_HANDLED, or optionally FORMAT_EXCEEDS_CAPABILITIES if enabled by
allowExceedsCapabilities.
| Parameters | |
|---|---|
@RendererCapabilities.Capabilities int supportFlags |
The combined |
boolean allowExceedsCapabilities |
Whether |
| Returns | |
|---|---|
boolean |
Whether the |
setListener
default void setListener(RendererCapabilities.Listener listener)
Sets the Listener.
| Parameters | |
|---|---|
RendererCapabilities.Listener listener |
The listener to be set. |
supportsFormat
@RendererCapabilities.Capabilities
abstract int supportsFormat(Format format)
Returns the extent to which the Renderer supports a given format.
| Parameters | |
|---|---|
Format format |
The format. |
| Returns | |
|---|---|
int |
The |
| Throws | |
|---|---|
androidx.media3.exoplayer.ExoPlaybackException |
If an error occurs. |
supportsMixedMimeTypeAdaptation
@RendererCapabilities.AdaptiveSupport
abstract int supportsMixedMimeTypeAdaptation()
Returns the extent to which the Renderer supports adapting between supported formats that have different MIME types.
| Returns | |
|---|---|
int |
The |
| Throws | |
|---|---|
androidx.media3.exoplayer.ExoPlaybackException |
If an error occurs. |