CapturingRenderersFactory


@UnstableApi
public class CapturingRenderersFactory implements RenderersFactory, Dumper.Dumpable


A RenderersFactory that captures interactions with the audio and video instances and ImageOutput instances.

The captured interactions can be used in a test assertion via the Dumper.Dumpable interface.

Summary

Nested types

A factory for Renderer instances that handle TRACK_TYPE_TEXT tracks.

Public constructors

Creates an instance.

Public methods

Renderer[]
createRenderers(
    Handler eventHandler,
    VideoRendererEventListener videoRendererEventListener,
    AudioRendererEventListener audioRendererEventListener,
    TextOutput textRendererOutput,
    MetadataOutput metadataRendererOutput
)

Builds the Renderer instances for an ExoPlayer.

void
dump(Dumper dumper)

Dumps the fields of the object using the dumper.

CapturingRenderersFactory

Sets the ImageDecoder.Factory used by the ImageRenderer.

CapturingRenderersFactory

Sets the factory for Renderer instances that handle TRACK_TYPE_TEXT tracks.

Public constructors

CapturingRenderersFactory

public CapturingRenderersFactory(Context context)

Creates an instance.

Parameters
Context context

The Context.

Public methods

createRenderers

public Renderer[] createRenderers(
    Handler eventHandler,
    VideoRendererEventListener videoRendererEventListener,
    AudioRendererEventListener audioRendererEventListener,
    TextOutput textRendererOutput,
    MetadataOutput metadataRendererOutput
)

Builds the Renderer instances for an ExoPlayer.

Parameters
Handler eventHandler

A handler to use when invoking event listeners and outputs.

VideoRendererEventListener videoRendererEventListener

An event listener for video renderers.

AudioRendererEventListener audioRendererEventListener

An event listener for audio renderers.

TextOutput textRendererOutput

An output for text renderers.

MetadataOutput metadataRendererOutput

An output for metadata renderers.

Returns
Renderer[]

The instances.

dump

public void dump(Dumper dumper)

Dumps the fields of the object using the dumper.

Parameters
Dumper dumper

The Dumper to be used to dump fields.

setImageDecoderFactory

public CapturingRenderersFactory setImageDecoderFactory(ImageDecoder.Factory imageDecoderFactory)

Sets the ImageDecoder.Factory used by the ImageRenderer.

Parameters
ImageDecoder.Factory imageDecoderFactory

The ImageDecoder.Factory.

Returns
CapturingRenderersFactory

This factory, for convenience.

setTextRendererFactory

@CanIgnoreReturnValue
public CapturingRenderersFactory setTextRendererFactory(
    CapturingRenderersFactory.TextRendererFactory textRendererFactory
)

Sets the factory for Renderer instances that handle TRACK_TYPE_TEXT tracks.

Returns
CapturingRenderersFactory

This factory, for convenience.