SubtitleOutputBuffer
@UnstableApi
public abstract class SubtitleOutputBuffer extends DecoderOutputBuffer implements Subtitle
| java.lang.Object | |||
| ↳ | androidx.media3.decoder.Buffer | ||
| ↳ | androidx.media3.decoder.DecoderOutputBuffer | ||
| ↳ | androidx.media3.extractor.text.SubtitleOutputBuffer |
Base class for SubtitleDecoder output buffers.
Summary
Public constructors |
|---|
Public methods |
|
|---|---|
void |
clear()Clears the buffer. |
List<Cue> |
getCues(long timeUs)Retrieve the cues that should be displayed at a given time. |
long |
getEventTime(int index)Returns the event time at a specified index. |
int |
Returns the number of event times, where events are defined as points in time at which the cues returned by |
int |
getNextEventTimeIndex(long timeUs)Returns the index of the first event that occurs after a given time (exclusive). |
void |
setContent(long timeUs, Subtitle subtitle, long subsampleOffsetUs)Sets the content of the output buffer, consisting of a |
Inherited fields |
||||||
|---|---|---|---|---|---|---|
|
Inherited methods |
||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||
|
Public constructors
Public methods
getCues
public List<Cue> getCues(long timeUs)
Retrieve the cues that should be displayed at a given time.
| Parameters | |
|---|---|
long timeUs |
The time in microseconds. |
getEventTime
public long getEventTime(int index)
Returns the event time at a specified index.
| Parameters | |
|---|---|
int index |
The index of the event time to obtain. |
| Returns | |
|---|---|
long |
The event time in microseconds. |
getEventTimeCount
public int getEventTimeCount()
Returns the number of event times, where events are defined as points in time at which the cues returned by getCues changes.
| Returns | |
|---|---|
int |
The number of event times. |
getNextEventTimeIndex
public int getNextEventTimeIndex(long timeUs)
Returns the index of the first event that occurs after a given time (exclusive).
| Parameters | |
|---|---|
long timeUs |
The time in microseconds. |
| Returns | |
|---|---|
int |
The index of the next event, or |
setContent
public void setContent(long timeUs, Subtitle subtitle, long subsampleOffsetUs)
Sets the content of the output buffer, consisting of a Subtitle and associated metadata.
| Parameters | |
|---|---|
long timeUs |
The time of the start of the subtitle in microseconds. |
Subtitle subtitle |
The subtitle. |
long subsampleOffsetUs |
An offset that must be added to the subtitle's event times, or |