SsaParser
@UnstableApi
class SsaParser : SubtitleParser
A SubtitleParser for SSA/ASS.
Summary
Constants |
|
|---|---|
const Int |
The |
Public constructors |
|---|
|
Constructs an instance with optional format and header info. |
Public functions |
|
|---|---|
Int |
Returns the |
Unit |
parse(Parses |
Inherited functions |
||||||
|---|---|---|---|---|---|---|
|
Constants
CUE_REPLACEMENT_BEHAVIOR
@Format.CueReplacementBehavior
const val CUE_REPLACEMENT_BEHAVIOR = 1: Int
The CueReplacementBehavior for consecutive CuesWithTiming emitted by this implementation.
Public constructors
SsaParser
SsaParser(initializationData: (Mutable)List<ByteArray!>?)
Constructs an instance with optional format and header info.
| Parameters | |
|---|---|
initializationData: (Mutable)List<ByteArray!>? |
Optional initialization data for the parser. If not null or empty, the initialization data must consist of two byte arrays. The first must contain an SSA format line. The second must contain an SSA header that will be assumed common to all samples. The header is everything in an SSA file before the |
Public functions
getCueReplacementBehavior
@Format.CueReplacementBehavior
fun getCueReplacementBehavior(): Int
Returns the CueReplacementBehavior for consecutive CuesWithTiming emitted by this implementation.
A given instance must always return the same value from this method.
parse
fun parse(
data: ByteArray!,
offset: Int,
length: Int,
outputOptions: SubtitleParser.OutputOptions!,
output: Consumer<CuesWithTiming!>!
): Unit
Parses data (and any data stored from previous invocations) and emits any resulting complete CuesWithTiming instances via output.
Any samples not used from data will be persisted and used during subsequent calls to this method.
startTimeUs in an emitted instance is derived only from the provided sample data, so has to be considered together with any relevant subsampleOffsetUs. If the provided sample doesn't contain any timing information then at most one CuesWithTiming instance will be emitted, with startTimeUs set to TIME_UNSET, in which case subsampleOffsetUsmust be OFFSET_SAMPLE_RELATIVE.
| Parameters | |
|---|---|
data: ByteArray! |
The subtitle data to parse. This must contain only complete samples. For subtitles muxed inside a media container, a sample is usually defined by the container. For subtitles read from a text file, a sample is usually the entire contents of the text file. |
offset: Int |
The index in |
length: Int |
The number of bytes to read from |
outputOptions: SubtitleParser.OutputOptions! |
Options to control how instances are emitted to |
output: Consumer<CuesWithTiming!>! |
A consumer for |