RendererCapabilities
@UnstableApi
interface RendererCapabilities
BaseRenderer |
An abstract base class suitable for most |
NoSampleRenderer |
A |
CameraMotionRenderer |
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
Nested types |
---|
@Documented Level of renderer support for adaptive format switches. |
@Documented Level of renderer support for audio offload. |
@Documented Combined renderer capabilities. |
@Documented Level of decoder support. |
@Documented Level of renderer support for hardware acceleration. |
interface RendererCapabilities.Listener Listener for renderer capabilities events. |
@Documented Level of renderer support for tunneling. |
Constants |
|
---|---|
const Int |
The |
const Int |
The |
const Int |
ADAPTIVE_SEAMLESS = 16 The |
const Int |
A mask to apply to |
const Int |
The renderer supports audio offload and gapless transitions with this format. |
const Int |
Audio offload is not supported with this format. |
const Int |
The renderer supports audio offload and speed changes with this format. |
const Int |
AUDIO_OFFLOAD_SUPPORTED = 512 The renderer supports audio offload with this format. |
const Int |
AUDIO_OFFLOAD_SUPPORT_MASK = 3584 A mask to apply to |
const Int |
The format exceeds the primary decoder's capabilities but is supported by fallback decoder |
const Int |
The format's MIME type is unsupported and the renderer may use a decoder for a fallback MIME type. |
const Int |
DECODER_SUPPORT_MASK = 384 A mask to apply to |
const Int |
DECODER_SUPPORT_PRIMARY = 128 The renderer is able to use the primary decoder for the format's MIME type. |
const Int |
A mask to apply to |
const Int |
The renderer is not able to use hardware acceleration. |
const Int |
The renderer is able to use hardware acceleration. |
const Int |
A mask to apply to |
const Int |
The |
const Int |
TUNNELING_SUPPORTED = 32 The |
const Int |
A mask to apply to |
Constants
ADAPTIVE_NOT_SEAMLESS
const val ADAPTIVE_NOT_SEAMLESS = 8: Int
The Renderer
can adapt between formats, but may suffer a brief discontinuity (~50-100ms) when adaptation occurs.
ADAPTIVE_NOT_SUPPORTED
const val ADAPTIVE_NOT_SUPPORTED = 0: Int
The Renderer
does not support adaptation between formats.
ADAPTIVE_SEAMLESS
const val ADAPTIVE_SEAMLESS = 16: Int
The Renderer
can seamlessly adapt between formats.
ADAPTIVE_SUPPORT_MASK
const val ADAPTIVE_SUPPORT_MASK = 24: Int
A mask to apply to Capabilities
to obtain the AdaptiveSupport
only.
AUDIO_OFFLOAD_GAPLESS_SUPPORTED
const val AUDIO_OFFLOAD_GAPLESS_SUPPORTED = 1024: Int
The renderer supports audio offload and gapless transitions with this format.
AUDIO_OFFLOAD_NOT_SUPPORTED
const val AUDIO_OFFLOAD_NOT_SUPPORTED = 0: Int
Audio offload is not supported with this format.
AUDIO_OFFLOAD_SPEED_CHANGE_SUPPORTED
const val AUDIO_OFFLOAD_SPEED_CHANGE_SUPPORTED = 2048: Int
The renderer supports audio offload and speed changes with this format.
AUDIO_OFFLOAD_SUPPORTED
const val AUDIO_OFFLOAD_SUPPORTED = 512: Int
The renderer supports audio offload with this format.
AUDIO_OFFLOAD_SUPPORT_MASK
const val AUDIO_OFFLOAD_SUPPORT_MASK = 3584: Int
A mask to apply to Capabilities
to obtain AudioOffloadSupport
only.
DECODER_SUPPORT_FALLBACK
const val DECODER_SUPPORT_FALLBACK = 0: Int
The format exceeds the primary decoder's capabilities but is supported by fallback decoder
DECODER_SUPPORT_FALLBACK_MIMETYPE
const val DECODER_SUPPORT_FALLBACK_MIMETYPE = 256: Int
The format's MIME type is unsupported and the renderer may use a decoder for a fallback MIME type.
DECODER_SUPPORT_MASK
const val DECODER_SUPPORT_MASK = 384: Int
A mask to apply to Capabilities
to obtain DecoderSupport
only.
DECODER_SUPPORT_PRIMARY
const val DECODER_SUPPORT_PRIMARY = 128: Int
The renderer is able to use the primary decoder for the format's MIME type.
FORMAT_SUPPORT_MASK
const val FORMAT_SUPPORT_MASK = 7: Int
A mask to apply to Capabilities
to obtain the C.FormatSupport
only.
HARDWARE_ACCELERATION_NOT_SUPPORTED
const val HARDWARE_ACCELERATION_NOT_SUPPORTED = 0: Int
The renderer is not able to use hardware acceleration.
HARDWARE_ACCELERATION_SUPPORTED
const val HARDWARE_ACCELERATION_SUPPORTED = 64: Int
The renderer is able to use hardware acceleration.
HARDWARE_ACCELERATION_SUPPORT_MASK
const val HARDWARE_ACCELERATION_SUPPORT_MASK = 64: Int
A mask to apply to Capabilities
to obtain HardwareAccelerationSupport
only.
TUNNELING_NOT_SUPPORTED
const val TUNNELING_NOT_SUPPORTED = 0: Int
The Renderer
does not support tunneled output.
TUNNELING_SUPPORT_MASK
const val TUNNELING_SUPPORT_MASK = 32: Int
A mask to apply to Capabilities
to obtain TunnelingSupport
only.
Public functions
create
@RendererCapabilities.Capabilities
java-static fun create(@C.FormatSupport formatSupport: Int): Int
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 formatSupport: Int |
The |
Returns | |
---|---|
Int |
The combined |
create
@RendererCapabilities.Capabilities
java-static fun create(
@C.FormatSupport formatSupport: Int,
@RendererCapabilities.AdaptiveSupport adaptiveSupport: Int,
@RendererCapabilities.TunnelingSupport tunnelingSupport: Int
): Int
Returns Capabilities
combining the given C.FormatSupport
, and TunnelingSupport
.
HardwareAccelerationSupport
is set to HARDWARE_ACCELERATION_NOT_SUPPORTED
, DecoderSupport
is set to DECODER_SUPPORT_PRIMARY
, and is set to AUDIO_OFFLOAD_NOT_SUPPORTED
.
Parameters | |
---|---|
@C.FormatSupport formatSupport: Int |
The |
@RendererCapabilities.AdaptiveSupport adaptiveSupport: Int |
The |
@RendererCapabilities.TunnelingSupport tunnelingSupport: Int |
The |
Returns | |
---|---|
Int |
The combined |
create
@RendererCapabilities.Capabilities
java-static fun create(
@C.FormatSupport formatSupport: Int,
@RendererCapabilities.AdaptiveSupport adaptiveSupport: Int,
@RendererCapabilities.TunnelingSupport tunnelingSupport: Int,
@RendererCapabilities.AudioOffloadSupport audioOffloadSupport: Int
): Int
Returns Capabilities
combining the given C.FormatSupport
, , TunnelingSupport
, and AudioOffloadSupport
.
HardwareAccelerationSupport
is set to HARDWARE_ACCELERATION_NOT_SUPPORTED
and DecoderSupport
is set to DECODER_SUPPORT_PRIMARY
.
Parameters | |
---|---|
@C.FormatSupport formatSupport: Int |
The |
@RendererCapabilities.AdaptiveSupport adaptiveSupport: Int |
The |
@RendererCapabilities.TunnelingSupport tunnelingSupport: Int |
The |
@RendererCapabilities.AudioOffloadSupport audioOffloadSupport: Int |
The |
Returns | |
---|---|
Int |
The combined |
create
@RendererCapabilities.Capabilities
java-static fun create(
@C.FormatSupport formatSupport: Int,
@RendererCapabilities.AdaptiveSupport adaptiveSupport: Int,
@RendererCapabilities.TunnelingSupport tunnelingSupport: Int,
@RendererCapabilities.HardwareAccelerationSupport hardwareAccelerationSupport: Int,
@RendererCapabilities.DecoderSupport decoderSupport: Int
): Int
Returns Capabilities
combining the given C.FormatSupport
, , TunnelingSupport
, HardwareAccelerationSupport
, and .
AudioOffloadSupport
is set to AUDIO_OFFLOAD_NOT_SUPPORTED
.
Parameters | |
---|---|
@C.FormatSupport formatSupport: Int |
The |
@RendererCapabilities.AdaptiveSupport adaptiveSupport: Int |
The |
@RendererCapabilities.TunnelingSupport tunnelingSupport: Int |
The |
@RendererCapabilities.HardwareAccelerationSupport hardwareAccelerationSupport: Int |
|
@RendererCapabilities.DecoderSupport decoderSupport: Int |
The |
Returns | |
---|---|
Int |
The combined |
create
@RendererCapabilities.Capabilities
java-static fun create(
@C.FormatSupport formatSupport: Int,
@RendererCapabilities.AdaptiveSupport adaptiveSupport: Int,
@RendererCapabilities.TunnelingSupport tunnelingSupport: Int,
@RendererCapabilities.HardwareAccelerationSupport hardwareAccelerationSupport: Int,
@RendererCapabilities.DecoderSupport decoderSupport: Int,
@RendererCapabilities.AudioOffloadSupport audioOffloadSupport: Int
): Int
Returns Capabilities
combining the given C.FormatSupport
, , TunnelingSupport
, HardwareAccelerationSupport
, and AudioOffloadSupport
.
Parameters | |
---|---|
@C.FormatSupport formatSupport: Int |
The |
@RendererCapabilities.AdaptiveSupport adaptiveSupport: Int |
The |
@RendererCapabilities.TunnelingSupport tunnelingSupport: Int |
The |
@RendererCapabilities.HardwareAccelerationSupport hardwareAccelerationSupport: Int |
|
@RendererCapabilities.DecoderSupport decoderSupport: Int |
The |
@RendererCapabilities.AudioOffloadSupport audioOffloadSupport: Int |
Returns | |
---|---|
Int |
The combined |
getAdaptiveSupport
@RendererCapabilities.AdaptiveSupport
java-static fun getAdaptiveSupport(@RendererCapabilities.Capabilities supportFlags: Int): Int
Returns the AdaptiveSupport
from the combined Capabilities
.
Parameters | |
---|---|
@RendererCapabilities.Capabilities supportFlags: Int |
The combined |
Returns | |
---|---|
Int |
The |
getAudioOffloadSupport
@RendererCapabilities.AudioOffloadSupport
java-static fun getAudioOffloadSupport(
@RendererCapabilities.Capabilities supportFlags: Int
): Int
Returns the AudioOffloadSupport
from the combined Capabilities
.
Parameters | |
---|---|
@RendererCapabilities.Capabilities supportFlags: Int |
The combined |
Returns | |
---|---|
Int |
The |
getDecoderSupport
@RendererCapabilities.DecoderSupport
java-static fun getDecoderSupport(@RendererCapabilities.Capabilities supportFlags: Int): Int
Returns the DecoderSupport
from the combined Capabilities
.
Parameters | |
---|---|
@RendererCapabilities.Capabilities supportFlags: Int |
The combined |
Returns | |
---|---|
Int |
The |
getFormatSupport
@C.FormatSupport
java-static fun getFormatSupport(@RendererCapabilities.Capabilities supportFlags: Int): Int
Returns the C.FormatSupport
from the combined Capabilities
.
Parameters | |
---|---|
@RendererCapabilities.Capabilities supportFlags: Int |
The combined |
Returns | |
---|---|
Int |
The |
getHardwareAccelerationSupport
@RendererCapabilities.HardwareAccelerationSupport
java-static fun getHardwareAccelerationSupport(
@RendererCapabilities.Capabilities supportFlags: Int
): Int
Returns the HardwareAccelerationSupport
from the combined Capabilities
.
Parameters | |
---|---|
@RendererCapabilities.Capabilities supportFlags: Int |
The combined |
Returns | |
---|---|
Int |
The |
getTrackType
@C.TrackType
fun getTrackType(): Int
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
java-static fun getTunnelingSupport(@RendererCapabilities.Capabilities supportFlags: Int): Int
Returns the TunnelingSupport
from the combined Capabilities
.
Parameters | |
---|---|
@RendererCapabilities.Capabilities supportFlags: Int |
The combined |
Returns | |
---|---|
Int |
The |
isFormatSupported
java-static fun isFormatSupported(
@RendererCapabilities.Capabilities supportFlags: Int,
allowExceedsCapabilities: Boolean
): Boolean
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 supportFlags: Int |
The combined |
allowExceedsCapabilities: Boolean |
Whether |
Returns | |
---|---|
Boolean |
Whether the |
setListener
fun setListener(listener: RendererCapabilities.Listener!): Unit
Sets the Listener
.
Parameters | |
---|---|
listener: RendererCapabilities.Listener! |
The listener to be set. |
supportsFormat
@RendererCapabilities.Capabilities
fun supportsFormat(format: Format!): Int
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
fun supportsMixedMimeTypeAdaptation(): Int
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. |