aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/util/av
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util/av')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java27
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/av/SubBitmapEvent.java5
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/av/SubEmptyEvent.java2
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/av/SubTextEvent.java11
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/av/SubtitleEvent.java19
5 files changed, 41 insertions, 23 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
index 958dc72b5..191b96e56 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
@@ -704,7 +704,10 @@ public interface GLMediaPlayer extends TextureSequence {
public int[] getVStreams();
/**
- * Return an array of detected video stream languages, matching {@link #getVStreams()} array and its indices.
+ * Return an array of detected video stream language codes, matching {@link #getVStreams()} array and its indices.
+ * <p>
+ * The language code is supposed to be 3-letters of `ISO 639-2 language codes`.
+ * </p>
*/
public String[] getVLangs();
@@ -722,7 +725,10 @@ public interface GLMediaPlayer extends TextureSequence {
public int[] getAStreams();
/**
- * Return an array of detected audio stream languages, matching {@link #getAStreams()} array and its indices.
+ * Return an array of detected audio stream language codes, matching {@link #getAStreams()} array and its indices.
+ * <p>
+ * The language code is supposed to be 3-letters of `ISO 639-2 language codes`.
+ * </p>
*/
public String[] getALangs();
@@ -740,7 +746,10 @@ public interface GLMediaPlayer extends TextureSequence {
public int[] getSStreams();
/**
- * Return an array of detected subtitle stream languages, matching {@link #getSStreams()} array and its indices.
+ * Return an array of detected subtitle stream language codes, matching {@link #getSStreams()} array and its indices.
+ * <p>
+ * The language code is supposed to be 3-letters of `ISO 639-2 language codes`.
+ * </p>
*/
public String[] getSLangs();
@@ -758,9 +767,12 @@ public interface GLMediaPlayer extends TextureSequence {
public boolean hasStreamID(int id);
/**
- * Return the matching language of given stream ID, matching one of the stream IDs in {@link #getVStreams()}, {@link #getAStreams()} or {@link #getSStreams()}.
+ * Return the matching language code of given stream ID, matching one of the stream IDs in {@link #getVStreams()}, {@link #getAStreams()} or {@link #getSStreams()}.
* <p>
- * If the stream ID is not available, {@code "und"} is returned
+ * The language code is supposed to be 3-letters of `ISO 639-2 language codes`.
+ * </p>
+ * <p>
+ * If the stream ID is not available, {@code und} is returned
* </p>
*/
public String getLang(int id);
@@ -975,11 +987,6 @@ public interface GLMediaPlayer extends TextureSequence {
*/
public Chapter getChapter(int msec);
- /**
- * Returns the stream language metadata for the given stream id if available, otherwise {@code null}.
- */
- public String getStreamLang(int id);
-
/** Returns a string representation of this player, incl. state and audio/video details. */
@Override
public String toString();
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/SubBitmapEvent.java b/src/jogl/classes/com/jogamp/opengl/util/av/SubBitmapEvent.java
index 0032aeffc..078450d2e 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/SubBitmapEvent.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/SubBitmapEvent.java
@@ -53,6 +53,7 @@ public class SubBitmapEvent extends SubtitleEvent {
/**
* Texture Event ctor
* @param codec the {@link CodecID}
+ * @param lang language code, supposed to be 3-letters of `ISO 639-2 language codes`
* @param pos texture position
* @param dim texture dimension
* @param tex the {@link Texture} or {@code null} if unused
@@ -60,8 +61,8 @@ public class SubBitmapEvent extends SubtitleEvent {
* @param pts_end pts end in ms, often {@link #isEndDefined()} for bitmap'ed types see {@link #pts_end}
* @param owner {@link Texture} owner code-stub to release the texture
*/
- public SubBitmapEvent(final CodecID codec, final Vec2i pos, final Vec2i dim, final Texture tex, final int pts_start, final int pts_end, final TextureOwner owner) {
- super(SubtitleEvent.Type.Bitmap, codec, pts_start, pts_end);
+ public SubBitmapEvent(final CodecID codec, final String lang, final Vec2i pos, final Vec2i dim, final Texture tex, final int pts_start, final int pts_end, final TextureOwner owner) {
+ super(SubtitleEvent.Type.Bitmap, codec, lang, pts_start, pts_end);
position = pos;
dimension = dim;
texture = tex;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/SubEmptyEvent.java b/src/jogl/classes/com/jogamp/opengl/util/av/SubEmptyEvent.java
index d6796dc4d..3f98665a0 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/SubEmptyEvent.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/SubEmptyEvent.java
@@ -34,7 +34,7 @@ public class SubEmptyEvent extends SubtitleEvent {
* Empty event ctor
*/
public SubEmptyEvent(final int pts_start, final int pts_end) {
- super(SubtitleEvent.Type.Empty, CodecID.NONE, pts_start, pts_end);
+ super(SubtitleEvent.Type.Empty, CodecID.NONE, "und", pts_start, pts_end);
}
@Override
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/SubTextEvent.java b/src/jogl/classes/com/jogamp/opengl/util/av/SubTextEvent.java
index d699d9300..622c5d29a 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/SubTextEvent.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/SubTextEvent.java
@@ -93,13 +93,14 @@ public class SubTextEvent extends SubtitleEvent {
/**
* ASS/SAA Event Line ctor
* @param codec the {@link CodecID}
- * @param fmt input format of {@code ass}, currently only {@link SubTextEvent.TextFormat#ASS} and {@link SubTextEvent.TextFormat#TEXT} is supported
+ * @param lang language code, supposed to be 3-letters of `ISO 639-2 language codes`
+ * @param fmt input format of {@code ass}
* @param ass ASS/SAA compatible event line according to {@link ASSType}
- * @param pts_start pts start in ms, provided for {@link SubTextEvent.TextFormat#ASS} and {@link SubTextEvent.TextFormat#TEXT}
- * @param pts_end pts end in ms, provided for {@link SubTextEvent.TextFormat#ASS} and {@link SubTextEvent.TextFormat#TEXT}
+ * @param pts_start pts start in ms
+ * @param pts_end pts end in ms
*/
- public SubTextEvent(final CodecID codec, final TextFormat fmt, final String ass, final int pts_start, final int pts_end) {
- super(SubtitleEvent.Type.Text, codec, pts_start, pts_end);
+ public SubTextEvent(final CodecID codec, final String lang, final TextFormat fmt, final String ass, final int pts_start, final int pts_end) {
+ super(SubtitleEvent.Type.Text, codec, lang, pts_start, pts_end);
this.textFormat = fmt;
ASSType assType = ASSType.TEXT;
int start = -1;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/SubtitleEvent.java b/src/jogl/classes/com/jogamp/opengl/util/av/SubtitleEvent.java
index e75fff3f8..34efe34fb 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/SubtitleEvent.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/SubtitleEvent.java
@@ -23,6 +23,8 @@ public abstract class SubtitleEvent {
public final Type type;
/** {@link CodecID} of this subtitle event. */
public final CodecID codec;
+ /** Language code, supposed to be 3-letters of `ISO 639-2 language codes` */
+ public final String lang;
/** PTS start time in milliseconds to start showing this subtitle event. */
public final int pts_start;
/**
@@ -35,9 +37,18 @@ public abstract class SubtitleEvent {
*/
public final int pts_end;
- public SubtitleEvent(final Type type, final CodecID codec, final int pts_start, final int pts_end) {
+ /**
+ *
+ * @param type
+ * @param codec the {@link CodecID}
+ * @param lang language code, supposed to be 3-letters of `ISO 639-2 language codes`
+ * @param pts_start pts start in ms, see {@link #pts_start}
+ * @param pts_end pts end in ms, see {@link #pts_end}
+ */
+ public SubtitleEvent(final Type type, final CodecID codec, final String lang, final int pts_start, final int pts_end) {
this.type = type;
this.codec = codec;
+ this.lang = lang;
this.pts_start = pts_start;
this.pts_end = pts_end;
}
@@ -54,8 +65,6 @@ public abstract class SubtitleEvent {
final boolean ied = isEndDefined();
final String pts_start_s = 0 <= pts_start ? PTS.toTimeStr(pts_start, true) : "undef";
final String pts_end_s = 0 <= pts_end && ied ? PTS.toTimeStr(pts_end, true) : "undef";
- return "Sub[codec "+codec+", type "+type+", ["+pts_start_s+".."+pts_end_s+"] "+(ied?getDuration():"undef")+" ms";
+ return "Sub[codec "+codec+", lang '"+lang+"', type "+type+", ["+pts_start_s+".."+pts_end_s+"] "+(ied?getDuration():"undef")+" ms";
}
-
-
-} \ No newline at end of file
+}