DrawableOverlay
@UnstableApi
public abstract class DrawableOverlay extends BitmapOverlay
| java.lang.Object | |||
| ↳ | androidx.media3.effect.TextureOverlay | ||
| ↳ | androidx.media3.effect.BitmapOverlay | ||
| ↳ | androidx.media3.effect.DrawableOverlay |
Creates a TextureOverlay from Drawable.
Uses a canvas to draw DrawableOverlay onto BitmapOverlay, which is then displayed on each frame.
Summary
Public constructors |
|---|
Public methods |
|
|---|---|
static DrawableOverlay |
createStaticDrawableOverlay(Creates a |
Bitmap |
getBitmap(long presentationTimeUs)Returns the overlay bitmap displayed at the specified timestamp. |
abstract Drawable |
getDrawable(long presentationTimeUs)Returns the overlay |
Inherited methods |
||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||
|
Public constructors
Public methods
createStaticDrawableOverlay
public static DrawableOverlay createStaticDrawableOverlay(
Drawable drawable,
StaticOverlaySettings overlaySettings
)
Creates a DrawableOverlay that shows the Drawable with the same StaticOverlaySettings throughout the whole video.
| Parameters | |
|---|---|
Drawable drawable |
The |
StaticOverlaySettings overlaySettings |
The |
getBitmap
public Bitmap getBitmap(long presentationTimeUs)
Returns the overlay bitmap displayed at the specified timestamp.
| Parameters | |
|---|---|
long presentationTimeUs |
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
public abstract Drawable getDrawable(long presentationTimeUs)
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 | |
|---|---|
long presentationTimeUs |
The presentation timestamp of the current frame, in microseconds. |