RendererCapabilities


@UnstableApi
interface RendererCapabilities

Known direct subclasses
BaseRenderer

An abstract base class suitable for most Renderer implementations.

NoSampleRenderer

A Renderer implementation whose track type is TRACK_TYPE_NONE and does not consume data from its SampleStream.

Known indirect subclasses
CameraMotionRenderer

A Renderer that parses the camera motion track.

DecoderAudioRenderer

Decodes and renders audio using a Decoder.

DecoderVideoRenderer

Decodes and renders video using a Decoder.

FakeAudioRenderer

A FakeRenderer that supports TRACK_TYPE_AUDIO.

FakeMediaClockRenderer

Fake abstract Renderer which is also a MediaClock.

FakeRenderer

Fake Renderer that supports any format with the matching track type.

FakeVideoRenderer

A FakeRenderer that supports TRACK_TYPE_VIDEO.

ImageRenderer

A Renderer implementation for images.

MediaCodecAudioRenderer

Decodes and renders audio using MediaCodec and an AudioSink.

MediaCodecRenderer

An abstract renderer that uses MediaCodec to decode samples for rendering.

MediaCodecVideoRenderer

Decodes and renders video using MediaCodec.

MetadataRenderer

A renderer for metadata.

TextRenderer

A Renderer for text.


Defines the capabilities of a Renderer.

Summary

Nested types

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(value = )
annotation RendererCapabilities.AdaptiveSupport

Level of renderer support for adaptive format switches.

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(value = )
annotation RendererCapabilities.AudioOffloadSupport

Level of renderer support for audio offload.

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(value = )
annotation RendererCapabilities.Capabilities

Combined renderer capabilities.

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(value = )
annotation RendererCapabilities.DecoderSupport

Level of decoder support.

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(value = )
annotation RendererCapabilities.HardwareAccelerationSupport

Level of renderer support for hardware acceleration.

Listener for renderer capabilities events.

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(value = )
annotation RendererCapabilities.TunnelingSupport

Level of renderer support for tunneling.

Constants

const Int

The Renderer can adapt between formats, but may suffer a brief discontinuity (~50-100ms) when adaptation occurs.

const Int

The Renderer does not support adaptation between formats.

const Int

The Renderer can seamlessly adapt between formats.

const Int

A mask to apply to Capabilities to obtain the AdaptiveSupport only.

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

The renderer supports audio offload with this format.

const Int

A mask to apply to Capabilities to obtain AudioOffloadSupport only.

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

A mask to apply to Capabilities to obtain DecoderSupport only.

const Int

The renderer is able to use the primary decoder for the format's MIME type.

const Int

A mask to apply to Capabilities to obtain the C.FormatSupport only.

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 Capabilities to obtain HardwareAccelerationSupport only.

const Int

The Renderer does not support tunneled output.

const Int

The Renderer supports tunneled output.

const Int

A mask to apply to Capabilities to obtain TunnelingSupport only.

Public functions

Unit

Clears the Listener.

java-static Int

Returns Capabilities for the given C.FormatSupport.

java-static Int

Returns Capabilities combining the given C.FormatSupport, and TunnelingSupport.

java-static Int
@RendererCapabilities.Capabilities
create(
    @C.FormatSupport formatSupport: Int,
    @RendererCapabilities.AdaptiveSupport adaptiveSupport: Int,
    @RendererCapabilities.TunnelingSupport tunnelingSupport: Int,
    @RendererCapabilities.AudioOffloadSupport audioOffloadSupport: Int
)

Returns Capabilities combining the given C.FormatSupport, , TunnelingSupport, and AudioOffloadSupport.

java-static Int
@RendererCapabilities.Capabilities
create(
    @C.FormatSupport formatSupport: Int,
    @RendererCapabilities.AdaptiveSupport adaptiveSupport: Int,
    @RendererCapabilities.TunnelingSupport tunnelingSupport: Int,
    @RendererCapabilities.HardwareAccelerationSupport hardwareAccelerationSupport: Int,
    @RendererCapabilities.DecoderSupport decoderSupport: Int
)

Returns Capabilities combining the given C.FormatSupport, , TunnelingSupport, HardwareAccelerationSupport, and .

java-static Int
@RendererCapabilities.Capabilities
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
)

Returns Capabilities combining the given C.FormatSupport, , TunnelingSupport, HardwareAccelerationSupport, and AudioOffloadSupport.

java-static Int

Returns the AdaptiveSupport from the combined Capabilities.

java-static Int

Returns the AudioOffloadSupport from the combined Capabilities.

java-static Int

Returns the DecoderSupport from the combined Capabilities.

java-static Int

Returns the C.FormatSupport from the combined Capabilities.

java-static Int

Returns the HardwareAccelerationSupport from the combined Capabilities.

String!

Returns the name of the Renderer.

Int

Returns the track type that the Renderer handles.

java-static Int

Returns the TunnelingSupport from the combined Capabilities.

java-static Boolean
isFormatSupported(
    @RendererCapabilities.Capabilities supportFlags: Int,
    allowExceedsCapabilities: Boolean
)

Returns whether the C.FormatSupport from the combined Capabilities indicates the format is supported.

Unit

Sets the Listener.

Int

Returns the extent to which the Renderer supports a given format.

Int

Returns the extent to which the Renderer supports adapting between supported formats that have different MIME types.

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_SUPPORTED

const val TUNNELING_SUPPORTED = 32: Int

The Renderer supports tunneled output.

TUNNELING_SUPPORT_MASK

const val TUNNELING_SUPPORT_MASK = 32: Int

A mask to apply to Capabilities to obtain TunnelingSupport only.

Public functions

clearListener

fun clearListener(): Unit

Clears the Listener.

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.

Returns
Int

The combined Capabilities.

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.

Returns
Int

The combined Capabilities.

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 Capabilities.

Returns
Int

The AdaptiveSupport only.

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 Capabilities.

Returns
Int

The AudioOffloadSupport only.

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 Capabilities.

Returns
Int

The DecoderSupport only.

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 Capabilities.

Returns
Int

The C.FormatSupport only.

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 Capabilities.

Returns
Int

The HardwareAccelerationSupport only.

getName

fun getName(): String!

Returns the name of the Renderer.

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 track type.

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 Capabilities.

Returns
Int

The TunnelingSupport only.

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 Capabilities.

allowExceedsCapabilities: Boolean

Whether FORMAT_EXCEEDS_CAPABILITIES should be considered as supported.

Returns
Boolean

Whether the Capabilities indicate a format is supported.

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 Capabilities for this format.

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 AdaptiveSupport for adapting between supported formats that have different MIME types.