diff --git a/libraries/effect/src/main/java/androidx/media3/effect/DrawableOverlay.java b/libraries/effect/src/main/java/androidx/media3/effect/DrawableOverlay.java index c11a368097..934bedf18c 100644 --- a/libraries/effect/src/main/java/androidx/media3/effect/DrawableOverlay.java +++ b/libraries/effect/src/main/java/androidx/media3/effect/DrawableOverlay.java @@ -37,6 +37,9 @@ public abstract class DrawableOverlay extends BitmapOverlay { /** * Returns the overlay {@link Drawable} displayed at the specified timestamp. * + *

The drawable must have it's bounds set via {@link Drawable#setBounds} for drawable to be + * displayed on the frame. + * * @param presentationTimeUs The presentation timestamp of the current frame, in microseconds. */ public abstract Drawable getDrawable(long presentationTimeUs); @@ -45,8 +48,7 @@ public abstract class DrawableOverlay extends BitmapOverlay { public Bitmap getBitmap(long presentationTimeUs) { Drawable overlayDrawable = getDrawable(presentationTimeUs); // TODO(b/227625365): Drawable doesn't implement the equals method, so investigate other methods - // of - // detecting the need to redraw the bitmap. + // of detecting the need to redraw the bitmap. if (!overlayDrawable.equals(lastDrawable)) { lastDrawable = overlayDrawable; lastBitmap = @@ -61,9 +63,10 @@ public abstract class DrawableOverlay extends BitmapOverlay { } /** - * Creates a {@link TextOverlay} that shows the {@code overlayDrawable} with the same {@link + * Creates a {@link TextOverlay} that shows the {@link Drawable} with the same {@link * OverlaySettings} throughout the whole video. * + * @param drawable The {@link Drawable} to be displayed. * @param overlaySettings The {@link OverlaySettings} configuring how the overlay is displayed on * the frames. */ @@ -74,6 +77,11 @@ public abstract class DrawableOverlay extends BitmapOverlay { public Drawable getDrawable(long presentationTimeUs) { return drawable; } + + @Override + public OverlaySettings getOverlaySettings(long presentationTimeUs) { + return overlaySettings; + } }; } }