aboutsummaryrefslogtreecommitdiffstats
path: root/src/demos/com
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-02-05 20:56:16 +0100
committerSven Göthel <[email protected]>2024-02-05 20:56:16 +0100
commit9bf746d7c8d1e4a3b0c363b54fe9e7a96578228a (patch)
tree4742028d0a7b85038f4e4c504b31314383780b86 /src/demos/com
parenteff91a9e29fc97d7e5051d9900e79ba9d044fb3a (diff)
Bug 1492: GLMediaPlayer: Add playStream(..) variant passing desired audio- and subtitle language
Diffstat (limited to 'src/demos/com')
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/UIMediaGrid01.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/UIMediaGrid01.java b/src/demos/com/jogamp/opengl/demos/graph/ui/UIMediaGrid01.java
index dd841f3f9..f9949e70c 100644
--- a/src/demos/com/jogamp/opengl/demos/graph/ui/UIMediaGrid01.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/UIMediaGrid01.java
@@ -93,6 +93,8 @@ public class UIMediaGrid01 {
private static final List<String> MEDIA_SUFFIXES = Arrays.asList("mp4", "mkv", "m2v", "avi");
private static int aid = GLMediaPlayer.STREAM_ID_AUTO;
private static int sid = GLMediaPlayer.STREAM_ID_NONE;
+ private static String alang = null;
+ private static String slang = null;
private static int start_pos = 0;
private static float videoAspectRatio = 16f/9f;
private static boolean letterBox = true;
@@ -121,6 +123,12 @@ public class UIMediaGrid01 {
} else if(args[idx[0]].equals("-sid")) {
idx[0]++;
sid = MiscUtils.atoi(args[idx[0]], sid);
+ } else if(args[idx[0]].equals("-alang")) {
+ idx[0]++;
+ alang = args[idx[0]];
+ } else if(args[idx[0]].equals("-slang")) {
+ idx[0]++;
+ slang = args[idx[0]];
} else if(args[idx[0]].equals("-start")) {
idx[0]++;
start_pos = MiscUtils.atoi(args[idx[0]], start_pos);
@@ -150,7 +158,7 @@ public class UIMediaGrid01 {
System.err.println(options);
System.err.println("mediaDir "+mediaDir);
System.err.println("maxMediaFiles "+maxMediaFiles);
- System.err.println("aid "+aid);
+ System.err.println("aid "+aid+", alang "+alang+"; sid "+sid+", slang "+slang);
System.err.println("texCount "+texCount);
System.err.println("boxRatio "+videoAspectRatio);
System.err.println("letterBox "+letterBox);
@@ -400,7 +408,7 @@ public class UIMediaGrid01 {
}
final MediaPlayer graphMPlayer = new MediaPlayer(options.renderModes, scene, glMPlayer, medium, defRatio, letterBox, zoomSize, customCtrls);
grid.addShape( graphMPlayer );
- glMPlayer.playStream(medium, GLMediaPlayer.STREAM_ID_AUTO, aid, sid, texCount);
+ glMPlayer.playStream(medium, GLMediaPlayer.STREAM_ID_AUTO, alang, aid, slang, sid, texCount);
if( start_pos > 0 ) {
glMPlayer.seek(start_pos * 1000);
}