DrawableOverlay


@UnstableApi
abstract class DrawableOverlay : BitmapOverlay


Creates a TextureOverlay from Drawable.

Uses a canvas to draw DrawableOverlay onto BitmapOverlay, which is then displayed on each frame.

Summary

Public constructors

Public functions

java-static DrawableOverlay!
createStaticDrawableOverlay(
    drawable: Drawable!,
    overlaySettings: OverlaySettings!
)

Creates a TextOverlay that shows the Drawable with the same throughout the whole video.

Bitmap!
getBitmap(presentationTimeUs: Long)

Returns the overlay bitmap displayed at the specified timestamp.

abstract Drawable!
getDrawable(presentationTimeUs: Long)

Returns the overlay Drawable displayed at the specified timestamp.

Inherited functions

From androidx.media3.effect.BitmapOverlay
java-static BitmapOverlay!

Creates a BitmapOverlay that shows the overlayBitmap in the same position and size throughout the whole video.

java-static BitmapOverlay!
createStaticBitmapOverlay(
    overlayBitmap: Bitmap!,
    overlaySettings: OverlaySettings!
)

Creates a BitmapOverlay that shows the overlayBitmap in the same throughout the whole video.

java-static BitmapOverlay!
createStaticBitmapOverlay(
    context: Context!,
    overlayBitmapUri: Uri!,
    overlaySettings: OverlaySettings!
)

Creates a BitmapOverlay that shows the input at overlayBitmapUri with the same OverlaySettings throughout the whole video.

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

Releases all resources.

From androidx.media3.effect.TextureOverlay
Unit
configure(videoSize: Size!)

Set up resources for the overlay given the input video’s dimensions.

OverlaySettings!
getOverlaySettings(presentationTimeUs: Long)

Returns the OverlaySettings controlling how the overlay is displayed at the specified timestamp.

Public constructors

DrawableOverlay

DrawableOverlay()

Public functions

createStaticDrawableOverlay

java-static fun createStaticDrawableOverlay(
    drawable: Drawable!,
    overlaySettings: OverlaySettings!
): DrawableOverlay!

Creates a TextOverlay that shows the Drawable with the same throughout the whole video.

Parameters
drawable: Drawable!

The Drawable to be displayed.

overlaySettings: OverlaySettings!

The OverlaySettings configuring how the overlay is displayed on the frames.

getBitmap

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.

getDrawable

abstract fun getDrawable(presentationTimeUs: Long): Drawable!

Returns the overlay Drawable displayed at the specified timestamp.

The drawable must have its bounds set via setBounds for drawable to be displayed on the frame.

Parameters
presentationTimeUs: Long

The presentation timestamp of the current frame, in microseconds.