Package com.leia.sdk.views
Class InputViewsAsset
- java.lang.Object
-
- com.leia.sdk.views.InputViewsAsset
-
- Direct Known Subclasses:
RecyclerViewAsset
public class InputViewsAsset extends Object
InputViewsAsset represents a content that can be displayed usingInterlacedSurfaceView
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InputViewsAsset.BitmapHolder
Manages Bitmap lifetime and strict access between the main and render threads.static class
InputViewsAsset.Impl
Represents a concrete asset type implementation.static class
InputViewsAsset.PictureImpl
-
Field Summary
Fields Modifier and Type Field Description protected InputViewsAsset.Impl
mImpl
-
Constructor Summary
Constructors Constructor Description InputViewsAsset()
Deprecated.InputViewsAsset(InputViewsAsset.Impl impl)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
close()
Releases allocated resources.static InputViewsAsset
createEmptySurfaceForVideo()
This is an overloaded member function, provided for convenience.static InputViewsAsset
createEmptySurfaceForVideo(SurfaceTextureReadyCallback surfaceTextureReadyListener)
Creates an asset used to display a Surface.void
CreateEmptySurfaceForVideo(int initialWidth, int initialHeight, SurfaceTextureReadyCallback surfaceTextureReadyListener)
Deprecated.static InputViewsAsset
createSurfaceForVideo(Bitmap thumbnail, boolean recycleThumbnailOnRelease, SurfaceTextureReadyCallback surfaceTextureReadyCallback)
static InputViewsAsset
createSurfaceFromLoadedBitmap(Bitmap loadedBitmap, boolean recycleOnRelease)
This is an overloaded member function, provided for convenience.static InputViewsAsset
createSurfaceFromLoadedBitmap(Bitmap bitmap, boolean recycleOnRelease, SurfaceTextureReadyCallback surfaceTextureReadyListener)
Creates an asset used to display a Bitmap.void
CreateSurfaceFromLoadedBitmap(Bitmap loadedBitmap)
Deprecated.usecreateSurfaceFromLoadedBitmap(Bitmap, boolean)
instead.void
CreateSurfaceFromLoadedBitmap(Bitmap loadedBitmap, SurfaceTextureReadyCallback surfaceTextureReadyListener)
Deprecated.static InputViewsAsset
loadBitmapFromPathIntoSurface(String assetPath, Context context)
This is an overloaded member function, provided for convenience.static InputViewsAsset
loadBitmapFromPathIntoSurface(String assetPath, Context context, SurfaceTextureReadyCallback surfaceTextureReadyListener)
Creates an asset used to display a Bitmap.void
LoadBitmapFromPathIntoSurface(String assetPath, Context context)
Deprecated.useloadBitmapFromPathIntoSurface(String, Context)
instead.void
LoadBitmapFromPathIntoSurface(String assetPath, Context context, SurfaceTextureReadyCallback surfaceTextureReadyListener)
Deprecated.
-
-
-
Field Detail
-
mImpl
protected InputViewsAsset.Impl mImpl
-
-
Constructor Detail
-
InputViewsAsset
public InputViewsAsset(InputViewsAsset.Impl impl)
-
InputViewsAsset
@Deprecated public InputViewsAsset()
Deprecated.Left for backward compatibility. Will be removed eventually.
-
-
Method Detail
-
close
public void close()
Releases allocated resources. E.g. Bitmap.
-
createEmptySurfaceForVideo
public static InputViewsAsset createEmptySurfaceForVideo(SurfaceTextureReadyCallback surfaceTextureReadyListener)
Creates an asset used to display a Surface.- Parameters:
surfaceTextureReadyListener
- invoked from the GL thread when the input SurfaceTexture created. This SurfaceTexture can be wrapped into Surface and used as an output for ExoPlayer, MediaCodec, or any other Surface producer.- Returns:
- the surface asset
- See Also:
SurfaceTextureReadyCallback
-
createEmptySurfaceForVideo
public static InputViewsAsset createEmptySurfaceForVideo()
This is an overloaded member function, provided for convenience.
-
createSurfaceForVideo
public static InputViewsAsset createSurfaceForVideo(@Nullable Bitmap thumbnail, boolean recycleThumbnailOnRelease, SurfaceTextureReadyCallback surfaceTextureReadyCallback)
-
createSurfaceFromLoadedBitmap
public static InputViewsAsset createSurfaceFromLoadedBitmap(Bitmap bitmap, boolean recycleOnRelease, SurfaceTextureReadyCallback surfaceTextureReadyListener)
Creates an asset used to display a Bitmap. Created InputViewsAssets owns the bitmap, it must not be recycled while the asset holds a reference onto it. This bitmap is accessed from multiple threads. To safely recycle/release it, release the InputViewsAsset.- Parameters:
bitmap
- a Bitmap to displayrecycleOnRelease
- whether to recycle the bitmap on releasesurfaceTextureReadyListener
- invoked from the GL thread when a SurfaceTexture created for the bitmap- Returns:
- the picture asset
- See Also:
SurfaceTextureReadyCallback
,InterlacedSurfaceView.releaseInputViewsAsset()
-
createSurfaceFromLoadedBitmap
public static InputViewsAsset createSurfaceFromLoadedBitmap(Bitmap loadedBitmap, boolean recycleOnRelease)
This is an overloaded member function, provided for convenience.
-
loadBitmapFromPathIntoSurface
public static InputViewsAsset loadBitmapFromPathIntoSurface(String assetPath, Context context, SurfaceTextureReadyCallback surfaceTextureReadyListener)
Creates an asset used to display a Bitmap. Created InputViewsAsset owns the bitmap and will recycle it on release.- Parameters:
assetPath
- an asset path to load Bitmap fromcontext
- used to access app resourcessurfaceTextureReadyListener
- invoked from the GL thread when a SurfaceTexture created for the bitmap- Returns:
- the picture asset or null if failed to load a bitmap
- See Also:
SurfaceTextureReadyCallback
-
loadBitmapFromPathIntoSurface
public static InputViewsAsset loadBitmapFromPathIntoSurface(String assetPath, Context context)
This is an overloaded member function, provided for convenience.
-
CreateEmptySurfaceForVideo
@Deprecated public void CreateEmptySurfaceForVideo(int initialWidth, int initialHeight, SurfaceTextureReadyCallback surfaceTextureReadyListener)
Deprecated.Left for backward compatibility. Will be removed eventually.
-
CreateSurfaceFromLoadedBitmap
@Deprecated public void CreateSurfaceFromLoadedBitmap(Bitmap loadedBitmap)
Deprecated.usecreateSurfaceFromLoadedBitmap(Bitmap, boolean)
instead.Left for backward compatibility. Will be removed eventually.
-
CreateSurfaceFromLoadedBitmap
@Deprecated public void CreateSurfaceFromLoadedBitmap(Bitmap loadedBitmap, SurfaceTextureReadyCallback surfaceTextureReadyListener)
Deprecated.Left for backward compatibility. Will be removed eventually.
-
LoadBitmapFromPathIntoSurface
@Deprecated public void LoadBitmapFromPathIntoSurface(String assetPath, Context context) throws IOException
Deprecated.useloadBitmapFromPathIntoSurface(String, Context)
instead.Left for backward compatibility. Will be removed eventually.- Throws:
IOException
-
LoadBitmapFromPathIntoSurface
@Deprecated public void LoadBitmapFromPathIntoSurface(String assetPath, Context context, SurfaceTextureReadyCallback surfaceTextureReadyListener) throws IOException
Deprecated.Left for backward compatibility. Will be removed eventually.- Throws:
IOException
-
-