28package com.jogamp.opengl.util.av;
30import java.time.format.DateTimeParseException;
32import com.jogamp.common.av.PTS;
33import com.jogamp.common.util.StringUtil;
92 private static boolean DEBUG =
false;
105 this.textFormat = fmt;
111 String
style =
"Default";
115 boolean done =
false;
117 final int len =
null != ass ? ass.length() : 0;
121 for(
int i=0; 10 > part && len > i; ) {
123 text = ass.substring(i);
127 final int j = ass.indexOf(
',', i);
131 final String v = ass.substring(i, j);
135 start = PTS.toMillis(v,
true);
138 end = PTS.toMillis(v,
true);
150 }
catch(
final DateTimeParseException pe) {
152 System.err.println(
"ASS.DIALG parsing error of part "+part+
" '"+v+
"' of '"+ass+
"'");
164 for(
int i=0; 9 > part && len > i; ) {
166 text = ass.substring(i);
170 final int j = ass.indexOf(
',', i);
174 final String v = ass.substring(i, j);
178 seqnr = Integer.valueOf(v);
181 layer = Integer.valueOf(v);
193 }
catch(
final NumberFormatException nfe) {
195 System.err.println(
"ASS.EVENT parsing error of part "+part+
" '"+v+
"' of '"+ass+
"'");
218 this.text =
text.replace(
"\\N",
"\n");
219 this.lines = StringUtil.getLineCount(this.text);
227 final String start_s = 0 <=
start ? PTS.toTimeStr(
start,
true) :
"undef";
228 final String end_s = 0 <=
end ? PTS.toTimeStr(
end,
true) :
"undef";
Text Event Line including ASS/SAA of SubtitleEvent.
final int end
End time in milliseconds, or -1.
final int start
Start time in milliseconds, or -1.
final TextFormat textFormat
TextFormat of this text subtitle event.
void release()
Release the resources, if any, back to the owner.
SubTextEvent(final CodecID codec, final String lang, final TextFormat fmt, final String ass, final int pts_start, final int pts_end)
ASS/SAA Event Line ctor.
final String text
Actual subtitle text.
final ASSType assType
ASSType sub-type
final int lines
Number of lines of text, i.e.
final String lang
Language code, supposed to be 3-letters of ISO 639-2 language codes
final String getStartString()
final int pts_end
PTS end time in milliseconds to end showing this subtitle event.
final int pts_start
PTS start time in milliseconds to start showing this subtitle event.
final CodecID codec
CodecID of this subtitle event.
FFmpeg/libAV analog AVCodecID.
EVENT
FFMpeg ASS event-line output w/o start, end (Given by FFmpeg 5.
DIALOGUE
ASS dialogue-line output w/ start and end (Given by FFmpeg 4.
ASS
Multiple ASS formats may be passed, see ASSType.
SubtitleEvent Implementation Type