SurfaceAssetLoader
@UnstableApi
class SurfaceAssetLoader : AssetLoader
Asset loader that outputs video data passed to its input Surface.
To use this asset loader, pass a callback to the factory's constructor to get access to the underlying asset loader and Surface to write to once they are ready. Then pass the factory to setAssetLoaderFactory.
The media item passed to transformer must have a URI starting with the scheme MEDIA_ITEM_URI_SCHEME.
Call signalEndOfInput when the input stream ends, which will cause the transformation to complete.
Summary
Nested types |
|---|
interface SurfaceAssetLoader.CallbackCallbacks for |
|
Factory for |
Constants |
|
|---|---|
const String! |
MEDIA_ITEM_URI_SCHEME = "transformer_surface_asset"URI scheme for creating a |
Public functions |
|
|---|---|
ImmutableMap<Int!, String!>! |
Return the used decoders' names. |
Int |
@Transformer.ProgressStateReturns the current |
Unit |
release()Stops loading data and releases all resources associated with the asset loader. |
Unit |
setContentFormat(contentFormat: Format!)Sets the video content format, which must have a raw video sample MIME type, width, height and color info. |
Unit |
Signals that no further input frames will be rendered. |
Unit |
start()Starts the asset loader. |
Public properties |
|
|---|---|
EditedMediaItem! |
Inherited Constants |
|---|
Constants
MEDIA_ITEM_URI_SCHEME
const val MEDIA_ITEM_URI_SCHEME = "transformer_surface_asset": String!
URI scheme for creating a MediaItem that signals that the media is provided from this asset loader.
Public functions
getDecoderNames
fun getDecoderNames(): ImmutableMap<Int!, String!>!
Return the used decoders' names.
| Returns | |
|---|---|
ImmutableMap<Int!, String!>! |
The decoders' names keyed by |
getProgress
@Transformer.ProgressState
fun getProgress(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 |
release
fun release(): Unit
Stops loading data and releases all resources associated with the asset loader.
setContentFormat
fun setContentFormat(contentFormat: Format!): Unit
Sets the video content format, which must have a raw video sample MIME type, width, height and color info. May be called on any thread.
signalEndOfInput
fun signalEndOfInput(): Unit
Signals that no further input frames will be rendered. May be called on any thread.