mirror of
https://github.com/samsonjs/media.git
synced 2026-04-24 14:37:45 +00:00
Fix some minor issues/typos
PiperOrigin-RevId: 499808853
This commit is contained in:
parent
d8ea770e9b
commit
a59c2b8222
4 changed files with 42 additions and 40 deletions
|
|
@ -21,8 +21,8 @@ Release notes
|
|||
* Use theme when loading drawables on API 21+
|
||||
([#220](https://github.com/androidx/media/issues/220)).
|
||||
* Throw a ParserException instead of a NullPointerException if the sample
|
||||
* table (stbl) is missing a required sample description (stsd) when
|
||||
* parsing trak atoms.
|
||||
table (stbl) is missing a required sample description (stsd) when
|
||||
parsing trak atoms.
|
||||
* Audio:
|
||||
* Use the compressed audio format bitrate to calculate the min buffer size
|
||||
for `AudioTrack` in direct playbacks (passthrough).
|
||||
|
|
|
|||
|
|
@ -37,7 +37,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.
|
||||
|
|
|
|||
|
|
@ -33,10 +33,47 @@ 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.
|
||||
*/
|
||||
@UnstableApi
|
||||
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;
|
||||
|
|
@ -81,41 +118,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
|
||||
|
|
|
|||
|
|
@ -212,7 +212,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;
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue