public class DefaultRenderersFactory extends java.lang.Object implements RenderersFactory
RenderersFactory
implementation.Modifier and Type | Class and Description |
---|---|
static interface |
DefaultRenderersFactory.ExtensionRendererMode
Modes for using extension renderers.
|
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_ALLOWED_VIDEO_JOINING_TIME_MS
The default maximum duration for which a video renderer can attempt to seamlessly join an
ongoing playback.
|
static int |
EXTENSION_RENDERER_MODE_OFF
Do not allow use of extension renderers.
|
static int |
EXTENSION_RENDERER_MODE_ON
Allow use of extension renderers.
|
static int |
EXTENSION_RENDERER_MODE_PREFER
Allow use of extension renderers.
|
protected static int |
MAX_DROPPED_VIDEO_FRAME_COUNT_TO_NOTIFY |
Constructor and Description |
---|
DefaultRenderersFactory(android.content.Context context) |
DefaultRenderersFactory(android.content.Context context,
DrmSessionManager<FrameworkMediaCrypto> drmSessionManager)
Deprecated.
Use
DefaultRenderersFactory(Context) and pass DrmSessionManager
directly to SimpleExoPlayer or ExoPlayerFactory . |
DefaultRenderersFactory(android.content.Context context,
DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
int extensionRendererMode)
Deprecated.
Use
DefaultRenderersFactory(Context, int) and pass DrmSessionManager directly to SimpleExoPlayer or ExoPlayerFactory . |
DefaultRenderersFactory(android.content.Context context,
DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
int extensionRendererMode,
long allowedVideoJoiningTimeMs)
Deprecated.
Use
DefaultRenderersFactory(Context, int, long) and pass DrmSessionManager directly to SimpleExoPlayer or ExoPlayerFactory . |
DefaultRenderersFactory(android.content.Context context,
int extensionRendererMode) |
DefaultRenderersFactory(android.content.Context context,
int extensionRendererMode,
long allowedVideoJoiningTimeMs) |
Modifier and Type | Method and Description |
---|---|
protected AudioProcessor[] |
buildAudioProcessors()
Builds an array of
AudioProcessor s that will process PCM audio before output. |
protected void |
buildAudioRenderers(android.content.Context context,
DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
AudioProcessor[] audioProcessors,
android.os.Handler eventHandler,
AudioRendererEventListener eventListener,
int extensionRendererMode,
java.util.ArrayList<Renderer> out)
Builds audio renderers for use by the player.
|
protected void |
buildMetadataRenderers(android.content.Context context,
MetadataOutput output,
android.os.Looper outputLooper,
int extensionRendererMode,
java.util.ArrayList<Renderer> out)
Builds metadata renderers for use by the player.
|
protected void |
buildMiscellaneousRenderers(android.content.Context context,
android.os.Handler eventHandler,
int extensionRendererMode,
java.util.ArrayList<Renderer> out)
Builds any miscellaneous renderers used by the player.
|
protected void |
buildTextRenderers(android.content.Context context,
TextOutput output,
android.os.Looper outputLooper,
int extensionRendererMode,
java.util.ArrayList<Renderer> out)
Builds text renderers for use by the player.
|
protected void |
buildVideoRenderers(android.content.Context context,
DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
long allowedVideoJoiningTimeMs,
android.os.Handler eventHandler,
VideoRendererEventListener eventListener,
int extensionRendererMode,
java.util.ArrayList<Renderer> out)
Builds video renderers for use by the player.
|
Renderer[] |
createRenderers(android.os.Handler eventHandler,
VideoRendererEventListener videoRendererEventListener,
AudioRendererEventListener audioRendererEventListener,
TextOutput textRendererOutput,
MetadataOutput metadataRendererOutput,
DrmSessionManager<FrameworkMediaCrypto> drmSessionManager)
Builds the
Renderer instances for a SimpleExoPlayer . |
public static final long DEFAULT_ALLOWED_VIDEO_JOINING_TIME_MS
public static final int EXTENSION_RENDERER_MODE_OFF
public static final int EXTENSION_RENDERER_MODE_ON
TrackSelector
that prefers the first suitable renderer will therefore
prefer to use a core renderer to an extension renderer in the case that both are able to play
a given track.public static final int EXTENSION_RENDERER_MODE_PREFER
TrackSelector
that prefers the first suitable renderer will therefore
prefer to use an extension renderer to a core renderer in the case that both are able to play
a given track.protected static final int MAX_DROPPED_VIDEO_FRAME_COUNT_TO_NOTIFY
public DefaultRenderersFactory(android.content.Context context)
context
- A Context
.@Deprecated public DefaultRenderersFactory(android.content.Context context, @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager)
DefaultRenderersFactory(Context)
and pass DrmSessionManager
directly to SimpleExoPlayer
or ExoPlayerFactory
.public DefaultRenderersFactory(android.content.Context context, int extensionRendererMode)
context
- A Context
.extensionRendererMode
- The extension renderer mode, which determines if and how available
extension renderers are used. Note that extensions must be included in the application
build for them to be considered available.@Deprecated public DefaultRenderersFactory(android.content.Context context, @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager, int extensionRendererMode)
DefaultRenderersFactory(Context, int)
and pass DrmSessionManager
directly to SimpleExoPlayer
or ExoPlayerFactory
.public DefaultRenderersFactory(android.content.Context context, int extensionRendererMode, long allowedVideoJoiningTimeMs)
context
- A Context
.extensionRendererMode
- The extension renderer mode, which determines if and how available
extension renderers are used. Note that extensions must be included in the application
build for them to be considered available.allowedVideoJoiningTimeMs
- The maximum duration for which video renderers can attempt to
seamlessly join an ongoing playback.@Deprecated public DefaultRenderersFactory(android.content.Context context, @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager, int extensionRendererMode, long allowedVideoJoiningTimeMs)
DefaultRenderersFactory(Context, int, long)
and pass DrmSessionManager
directly to SimpleExoPlayer
or ExoPlayerFactory
.public Renderer[] createRenderers(android.os.Handler eventHandler, VideoRendererEventListener videoRendererEventListener, AudioRendererEventListener audioRendererEventListener, TextOutput textRendererOutput, MetadataOutput metadataRendererOutput, @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager)
RenderersFactory
Renderer
instances for a SimpleExoPlayer
.createRenderers
in interface RenderersFactory
eventHandler
- A handler to use when invoking event listeners and outputs.videoRendererEventListener
- An event listener for video renderers.audioRendererEventListener
- An event listener for audio renderers.textRendererOutput
- An output for text renderers.metadataRendererOutput
- An output for metadata renderers.drmSessionManager
- A drm session manager used by renderers.instances
.protected void buildVideoRenderers(android.content.Context context, @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager, long allowedVideoJoiningTimeMs, android.os.Handler eventHandler, VideoRendererEventListener eventListener, int extensionRendererMode, java.util.ArrayList<Renderer> out)
context
- The Context
associated with the player.drmSessionManager
- An optional DrmSessionManager
. May be null if the player
will not be used for DRM protected playbacks.allowedVideoJoiningTimeMs
- The maximum duration in milliseconds for which video
renderers can attempt to seamlessly join an ongoing playback.eventHandler
- A handler associated with the main thread's looper.eventListener
- An event listener.extensionRendererMode
- The extension renderer mode.out
- An array to which the built renderers should be appended.protected void buildAudioRenderers(android.content.Context context, @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager, AudioProcessor[] audioProcessors, android.os.Handler eventHandler, AudioRendererEventListener eventListener, int extensionRendererMode, java.util.ArrayList<Renderer> out)
context
- The Context
associated with the player.drmSessionManager
- An optional DrmSessionManager
. May be null if the player
will not be used for DRM protected playbacks.audioProcessors
- An array of AudioProcessor
s that will process PCM audio
buffers before output. May be empty.eventHandler
- A handler to use when invoking event listeners and outputs.eventListener
- An event listener.extensionRendererMode
- The extension renderer mode.out
- An array to which the built renderers should be appended.protected void buildTextRenderers(android.content.Context context, TextOutput output, android.os.Looper outputLooper, int extensionRendererMode, java.util.ArrayList<Renderer> out)
context
- The Context
associated with the player.output
- An output for the renderers.outputLooper
- The looper associated with the thread on which the output should be
called.extensionRendererMode
- The extension renderer mode.out
- An array to which the built renderers should be appended.protected void buildMetadataRenderers(android.content.Context context, MetadataOutput output, android.os.Looper outputLooper, int extensionRendererMode, java.util.ArrayList<Renderer> out)
context
- The Context
associated with the player.output
- An output for the renderers.outputLooper
- The looper associated with the thread on which the output should be
called.extensionRendererMode
- The extension renderer mode.out
- An array to which the built renderers should be appended.protected void buildMiscellaneousRenderers(android.content.Context context, android.os.Handler eventHandler, int extensionRendererMode, java.util.ArrayList<Renderer> out)
context
- The Context
associated with the player.eventHandler
- A handler to use when invoking event listeners and outputs.extensionRendererMode
- The extension renderer mode.out
- An array to which the built renderers should be appended.protected AudioProcessor[] buildAudioProcessors()
AudioProcessor
s that will process PCM audio before output.