BitmapOverlay
@UnstableApi
abstract class BitmapOverlay : TextureOverlay
CanvasOverlay |
A |
DrawableOverlay |
Creates a |
TextOverlay |
Creates a |
LottieOverlay |
A |
Creates TextureOverlays from Bitmaps.
Useful for overlaying images and animated images (e.g. GIFs).
Summary
Public constructors |
|---|
Public functions |
|
|---|---|
java-static BitmapOverlay! |
createStaticBitmapOverlay(overlayBitmap: Bitmap!)Creates a |
java-static BitmapOverlay! |
createStaticBitmapOverlay(Creates a |
java-static BitmapOverlay! |
createStaticBitmapOverlay(Creates a |
abstract Bitmap! |
Returns the overlay bitmap displayed at the specified timestamp. |
Int |
getTextureId(presentationTimeUs: Long)Returns the overlay texture identifier displayed at the specified timestamp. |
Size! |
getTextureSize(presentationTimeUs: Long)Returns the pixel width and height of the overlay texture displayed at the specified timestamp. |
FloatArray<Float>! |
getVertexTransformation(presentationTimeUs: Long)Returns a 4x4 OpenGL matrix, controlling how the vertices of the overlay are displayed at the specified timestamp. |
Unit |
release()Releases all resources. |
Inherited functions |
||||
|---|---|---|---|---|
|
Public constructors
Public functions
createStaticBitmapOverlay
java-static fun createStaticBitmapOverlay(overlayBitmap: Bitmap!): BitmapOverlay!
Creates a BitmapOverlay that shows the overlayBitmap in the same position and size throughout the whole video.
| Parameters | |
|---|---|
overlayBitmap: Bitmap! |
The bitmap to overlay on the video. |
createStaticBitmapOverlay
java-static fun createStaticBitmapOverlay(
overlayBitmap: Bitmap!,
overlaySettings: StaticOverlaySettings!
): BitmapOverlay!
Creates a BitmapOverlay that shows the overlayBitmap in the same OverlaySettings throughout the whole video.
| Parameters | |
|---|---|
overlayBitmap: Bitmap! |
The bitmap to overlay on the video. |
overlaySettings: StaticOverlaySettings! |
The |
createStaticBitmapOverlay
java-static fun createStaticBitmapOverlay(
context: Context!,
overlayBitmapUri: Uri!,
overlaySettings: StaticOverlaySettings!
): BitmapOverlay!
Creates a BitmapOverlay that shows the input at overlayBitmapUri with the same StaticOverlaySettings throughout the whole video.
| Parameters | |
|---|---|
context: Context! |
The |
overlayBitmapUri: Uri! |
The |
overlaySettings: StaticOverlaySettings! |
The |
getBitmap
abstract fun getBitmap(presentationTimeUs: Long): Bitmap!
Returns the overlay bitmap displayed at the specified timestamp.
| Parameters | |
|---|---|
presentationTimeUs: Long |
The presentation timestamp of the current frame, in microseconds. |
| Throws | |
|---|---|
androidx.media3.common.VideoFrameProcessingException |
If an error occurs while processing or drawing the frame. |
getTextureId
fun getTextureId(presentationTimeUs: Long): Int
Returns the overlay texture identifier displayed at the specified timestamp.
| Parameters | |
|---|---|
presentationTimeUs: Long |
The presentation timestamp of the current frame, in microseconds. |
| Throws | |
|---|---|
androidx.media3.common.VideoFrameProcessingException |
If an error occurs while processing or drawing the frame. |
getTextureSize
fun getTextureSize(presentationTimeUs: Long): Size!
Returns the pixel width and height of the overlay texture displayed at the specified timestamp.
This method must be called after #getTextureId(long).
Gets the width and height of the cached bitmap.
| Parameters | |
|---|---|
presentationTimeUs: Long |
The presentation timestamp of the current frame, in microseconds. |
getVertexTransformation
fun getVertexTransformation(presentationTimeUs: Long): FloatArray<Float>!
Returns a 4x4 OpenGL matrix, controlling how the vertices of the overlay are displayed at the specified timestamp.
Applied before #getOverlaySettings overlay settings.
Flips the overlay vertically to convert between Android and OpenGL texture coordinate systems.
release
fun release(): Unit
Releases all resources.
| Throws | |
|---|---|
androidx.media3.common.VideoFrameProcessingException |
If an error occurs while releasing resources. |