SurfaceAssetLoader
@UnstableApi
public final class SurfaceAssetLoader implements 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 |
|---|
public interface SurfaceAssetLoader.CallbackCallbacks for |
public final class SurfaceAssetLoader.Factory implements AssetLoader.FactoryFactory for |
Constants |
|
|---|---|
static final String |
MEDIA_ITEM_URI_SCHEME = "transformer_surface_asset"URI scheme for creating a |
Public fields |
|
|---|---|
final EditedMediaItem |
Public methods |
|
|---|---|
ImmutableMap<Integer, String> |
Return the used decoders' names. |
EditedMediaItem |
Returns the |
int |
@Transformer.ProgressStateReturns the current |
void |
release()Stops loading data and releases all resources associated with the asset loader. |
void |
setContentFormat(Format contentFormat)Sets the video content format, which must have a raw video sample MIME type, width, height and color info. |
void |
Signals that no further input frames will be rendered. |
void |
start()Starts the asset loader. |
Inherited Constants |
||||
|---|---|---|---|---|
|
Constants
MEDIA_ITEM_URI_SCHEME
public static final String MEDIA_ITEM_URI_SCHEME = "transformer_surface_asset"
URI scheme for creating a MediaItem that signals that the media is provided from this asset loader.
Public fields
Public methods
getDecoderNames
public ImmutableMap<Integer, String> getDecoderNames()
Return the used decoders' names.
| Returns | |
|---|---|
ImmutableMap<Integer, String> |
The decoders' names keyed by |
getEditedMediaItem
public EditedMediaItem getEditedMediaItem()
Returns the EditedMediaItem being loaded by this instance.
getProgress
@Transformer.ProgressState
public int getProgress(ProgressHolder progressHolder)
Returns the current Transformer.ProgressState and updates progressHolder with the current progress if it is available.
| Parameters | |
|---|---|
ProgressHolder progressHolder |
A |
| Returns | |
|---|---|
int |
release
public void release()
Stops loading data and releases all resources associated with the asset loader.
setContentFormat
public void setContentFormat(Format contentFormat)
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
public void signalEndOfInput()
Signals that no further input frames will be rendered. May be called on any thread.