mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Fix some minor issues/typos
PiperOrigin-RevId: 499808853
This commit is contained in:
parent
bbe78b10c1
commit
9835e91439
3 changed files with 40 additions and 38 deletions
|
|
@ -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
|
* 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
|
* 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;
|
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.
|
* 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.
|
* displayed on the frame.
|
||||||
*
|
*
|
||||||
* @param presentationTimeUs The presentation timestamp of the current frame, in microseconds.
|
* @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.
|
* 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 {
|
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;
|
public static final int TEXT_SIZE_PIXELS = 100;
|
||||||
|
|
||||||
private @MonotonicNonNull Bitmap lastBitmap;
|
private @MonotonicNonNull Bitmap lastBitmap;
|
||||||
|
|
@ -79,41 +116,6 @@ public abstract class TextOverlay extends BitmapOverlay {
|
||||||
return checkNotNull(lastBitmap);
|
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)
|
@RequiresApi(23)
|
||||||
private static final class Api23 {
|
private static final class Api23 {
|
||||||
@DoNotInline
|
@DoNotInline
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue