mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Add a default no-op implementation for SubtitleParser.reset
Most implementations were already no-ops. PiperOrigin-RevId: 557503628
This commit is contained in:
parent
d42c58f152
commit
d3894e6691
@ -91,6 +91,8 @@ public interface SubtitleParser {
|
||||
* Clears any data stored inside this parser from previous {@link #parse(byte[])} calls.
|
||||
*
|
||||
* <p>This must be called after a seek or other similar discontinuity in the source data.
|
||||
*
|
||||
* <p>The default implementation is a no-op.
|
||||
*/
|
||||
void reset();
|
||||
default void reset() {}
|
||||
}
|
||||
|
@ -53,9 +53,6 @@ public final class PgsParser implements SubtitleParser {
|
||||
cueBuilder = new CueBuilder();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {}
|
||||
|
||||
@Override
|
||||
public ImmutableList<CuesWithTiming> parse(byte[] data, int offset, int length) {
|
||||
buffer.reset(data, /* limit= */ offset + length);
|
||||
|
@ -117,9 +117,6 @@ public final class SsaParser implements SubtitleParser {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ImmutableList<CuesWithTiming> parse(byte[] data, int offset, int length) {
|
||||
|
@ -151,9 +151,6 @@ public final class SubripParser implements SubtitleParser {
|
||||
return cues.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {}
|
||||
|
||||
/**
|
||||
* Determine UTF encoding of the byte array from a byte order mark (BOM), defaulting to UTF-8 if
|
||||
* no BOM is found.
|
||||
|
@ -191,9 +191,6 @@ public final class TtmlParser implements SubtitleParser {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {}
|
||||
|
||||
private static FrameAndTickRate parseFrameAndTickRates(XmlPullParser xmlParser) {
|
||||
int frameRate = DEFAULT_FRAME_RATE;
|
||||
String frameRateString = xmlParser.getAttributeValue(TTP, "frameRate");
|
||||
|
@ -122,9 +122,6 @@ public final class Tx3gParser implements SubtitleParser {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {}
|
||||
|
||||
@Override
|
||||
public ImmutableList<CuesWithTiming> parse(byte[] data, int offset, int length) {
|
||||
parsableByteArray.reset(data, /* limit= */ offset + length);
|
||||
|
@ -76,9 +76,6 @@ public final class Mp4WebvttParser implements SubtitleParser {
|
||||
new CuesWithTiming(cues, /* startTimeUs= */ C.TIME_UNSET, /* durationUs= */ C.TIME_UNSET));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {}
|
||||
|
||||
private static Cue parseVttCueBox(ParsableByteArray sampleData, int remainingCueBoxBytes) {
|
||||
@Nullable Cue.Builder cueBuilder = null;
|
||||
@Nullable CharSequence cueText = null;
|
||||
|
@ -88,9 +88,6 @@ public final class WebvttParser implements SubtitleParser {
|
||||
return subtitle.toCuesWithTimingList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {}
|
||||
|
||||
/**
|
||||
* Positions the input right before the next event, and returns the kind of event found. Does not
|
||||
* consume any data from such event, if any.
|
||||
|
Loading…
x
Reference in New Issue
Block a user