Commit 9835e914 by andrewlewis Committed by christosts

Fix some minor issues/typos

PiperOrigin-RevId: 499808853
parent bbe78b10
......@@ -208,7 +208,7 @@ public interface Renderer extends PlayerMessage.Target {
/**
* The type of a message that can be passed to a video renderer to set the desired output
* resolution. The message payload should be a {@link Size} of the desired output width and
* height. Use this method only when playing with video {@link Effect}.
* height. Use this method only when playing with video {@linkplain Effect effects}.
*/
int MSG_SET_VIDEO_OUTPUT_RESOLUTION = 13;
/**
......
......@@ -35,7 +35,7 @@ public abstract class DrawableOverlay extends BitmapOverlay {
/**
* Returns the overlay {@link Drawable} displayed at the specified timestamp.
*
* <p>The drawable must have it's bounds set via {@link Drawable#setBounds} for drawable to be
* <p>The drawable must have its 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.
......
......@@ -32,9 +32,46 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
/**
* Creates a {@link TextureOverlay} from text.
*
* <p>Uses a {@link SpannableString} store the text and support advanced per-character text styling.
* <p>Uses a {@link SpannableString} to store the text and support advanced per-character text
* styling.
*/
public abstract class TextOverlay extends BitmapOverlay {
/**
* Creates a {@link TextOverlay} that shows the {@code overlayText} with the same default settings
* in {@link OverlaySettings} throughout the whole video.
*/
public static TextOverlay createStaticTextOverlay(SpannableString overlayText) {
return new TextOverlay() {
@Override
public SpannableString getText(long presentationTimeUs) {
return overlayText;
}
};
}
/**
* Creates a {@link TextOverlay} that shows the {@code overlayText} with the same {@link
* OverlaySettings} throughout the whole video.
*
* @param overlaySettings The {@link OverlaySettings} configuring how the overlay is displayed on
* the frames.
*/
public static TextOverlay createStaticTextOverlay(
SpannableString overlayText, OverlaySettings overlaySettings) {
return new TextOverlay() {
@Override
public SpannableString getText(long presentationTimeUs) {
return overlayText;
}
@Override
public OverlaySettings getOverlaySettings(long presentationTimeUs) {
return overlaySettings;
}
};
}
public static final int TEXT_SIZE_PIXELS = 100;
private @MonotonicNonNull Bitmap lastBitmap;
......@@ -79,41 +116,6 @@ public abstract class TextOverlay extends BitmapOverlay {
return checkNotNull(lastBitmap);
}
/**
* Creates a {@link TextOverlay} that shows the {@code overlayText} with the same default settings
* in {@link OverlaySettings} throughout the whole video.
*/
public static TextOverlay createStaticTextOverlay(SpannableString overlayText) {
return new TextOverlay() {
@Override
public SpannableString getText(long presentationTimeUs) {
return overlayText;
}
};
}
/**
* Creates a {@link TextOverlay} that shows the {@code overlayText} with the same {@link
* OverlaySettings} throughout the whole video.
*
* @param overlaySettings The {@link OverlaySettings} configuring how the overlay is displayed on
* the frames.
*/
public static TextOverlay createStaticTextOverlay(
SpannableString overlayText, OverlaySettings overlaySettings) {
return new TextOverlay() {
@Override
public SpannableString getText(long presentationTimeUs) {
return overlayText;
}
@Override
public OverlaySettings getOverlaySettings(long presentationTimeUs) {
return overlaySettings;
}
};
}
@RequiresApi(23)
private static final class Api23 {
@DoNotInline
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment