TextureAssetLoader
@UnstableApi
class TextureAssetLoader : AssetLoader
An AssetLoader implementation that loads videos from traditional GLES texture instances.
Typically instantiated in a custom AssetLoader.Factory saving a reference to the created TextureAssetLoader. Provide video frames as input by calling queueInputTexture, then signal the end of input when finished. Those methods must be called from the same thread, which can be any thread.
Summary
Public constructors |
|---|
Creates an instance. |
Public functions |
|
|---|---|
ImmutableMap<Int!, String!>! |
Return the used decoders' names. |
Int |
@Transformer.ProgressStateReturns the current |
Boolean |
Attempts to provide an input texture. |
Unit |
Stops loading data and releases all resources associated with the asset loader. |
Unit |
Signals that no further input frames will be rendered. |
Unit |
Starts the asset loader. |
Inherited Constants |
|---|
Public constructors
TextureAssetLoader
TextureAssetLoader(
editedMediaItem: EditedMediaItem!,
assetLoaderListener: AssetLoader.Listener!,
format: Format!,
frameProcessedListener: OnInputFrameProcessedListener!
)
Creates an instance.
The durationUs, width and height must be set.
| Parameters | |
|---|---|
editedMediaItem: EditedMediaItem! |
Information about the media item for which frames are provided. |
assetLoaderListener: AssetLoader.Listener! |
Listener for asset loading events. |
format: Format! |
Information about the format of video frames. |
frameProcessedListener: OnInputFrameProcessedListener! |
Listener for the event when a frame has been processed. The listener receives a GL sync object (if supported) to allow reusing the texture after it's no longer in use. |
Public functions
getDecoderNames
fungetDecoderNames(): ImmutableMap<Int!, String!>!
Return the used decoders' names.
| Returns | |
|---|---|
ImmutableMap<Int!, String!>! |
The decoders' names keyed by |
getProgress
@Transformer.ProgressState
fungetProgress(progressHolder: ProgressHolder!): Int
Returns the current Transformer.ProgressState and updates progressHolder with the current progress if it is available.
| Parameters | |
|---|---|
progressHolder: ProgressHolder! |
A |
| Returns | |
|---|---|
Int |
queueInputTexture
funqueueInputTexture(texId: Int, presentationTimeUs: Long): Boolean
Attempts to provide an input texture.
Must be called on the same thread as signalEndOfVideoInput.
| Parameters | |
|---|---|
texId: Int |
The ID of the texture to queue. |
presentationTimeUs: Long |
The presentation time for the texture, in microseconds. |
| Returns | |
|---|---|
Boolean |
Whether the texture was successfully queued. If |
release
funrelease(): Unit
Stops loading data and releases all resources associated with the asset loader.
signalEndOfVideoInput
funsignalEndOfVideoInput(): Unit
Signals that no further input frames will be rendered.
Must be called on the same thread as queueInputTexture.