aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/jogamp')
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java11
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java12
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java17
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv0400Natives.java11
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv0500Natives.java11
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv0600Natives.java11
7 files changed, 70 insertions, 9 deletions
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index e493689da..e1472102c 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -1718,6 +1718,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
return;
}
if( wasUninitialized ) {
+ updateMetadata();
if( DEBUG ) {
logout.println("XXX Initialize @ updateAttributes: "+this);
}
@@ -1785,15 +1786,21 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
@Override
public final int getHeight() { return height; }
+ /** Implementation shall update metadata, e.g. {@link #getChapters()} if supported. Called after {@link State#Initialized} is reached. */
+ protected void updateMetadata() {}
+
+ @Override
+ public Chapter[] getChapters() { return new Chapter[0]; }
+
@Override
public final String toString() {
- final float tt = getDuration() / 1000.0f;
+ final String tt = PTS.millisToTimeStr(getDuration());
final String loc = ( null != streamLoc ) ? streamLoc.toString() : "<undefined stream>" ;
final int freeVideoFrames = null != videoFramesFree ? videoFramesFree.size() : 0;
final int decVideoFrames = null != videoFramesDecoded ? videoFramesDecoded.size() : 0;
final int video_scr_ms = av_scr.get(Clock.currentMillis());
final String camPath = null != cameraPath ? ", camera: "+cameraPath : "";
- return getClass().getSimpleName()+"["+state+", vSCR "+video_scr_ms+", frames[p "+presentedFrameCount+", d "+decodedFrameCount+", t "+videoFrames+" ("+tt+" s), z "+nullFrameCount+" / "+maxNullFrameCountUntilEOS+"], "+
+ return getClass().getSimpleName()+"["+state+", vSCR "+video_scr_ms+", "+getChapters().length+" chapters, duration "+tt+", frames[p "+presentedFrameCount+", d "+decodedFrameCount+", t "+videoFrames+", z "+nullFrameCount+" / "+maxNullFrameCountUntilEOS+"], "+
"speed "+playSpeed+", "+bps_stream+" bps, hasSW "+(null!=streamWorker)+
", Texture[count "+textureCount+", free "+freeVideoFrames+", dec "+decVideoFrames+", tagt "+toHexString(textureTarget)+", ifmt "+toHexString(textureInternalFormat)+", fmt "+toHexString(textureFormat)+", type "+toHexString(textureType)+"], "+
"Video[id "+vid+", <"+vcodec+">, "+width+"x"+height+", glOrient "+isInGLOrientation+", "+fps+" fps, "+frame_duration+" fdur, "+bps_video+" bps], "+
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
index 9b1782993..05a0ddb64 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
@@ -52,7 +52,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
private static final List<String> glueLibNames = new ArrayList<String>(); // none
- private static final int symbolCount = 60;
+ private static final int symbolCount = 61;
private static final String[] symbolNames = {
"avutil_version",
"avformat_version",
@@ -91,6 +91,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
"av_samples_get_buffer_size",
"av_get_bytes_per_sample", // 51.4.0
"av_opt_set_int", // 51.12.0
+ "av_dict_iterate", // 57.42.100
"av_dict_get",
"av_dict_count", // 54.* (opt)
"av_dict_set",
@@ -99,7 +100,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
"av_channel_layout_uninit", // >= 59 (opt)
"av_channel_layout_describe", // >= 59 (opt)
"av_opt_set_chlayout", // >= 59
- /* +16 = 39 */
+ /* +16 = 40 */
// libavformat
"avformat_alloc_context",
@@ -116,11 +117,11 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
"avformat_network_init", // 53.13.0 (opt)
"avformat_network_deinit", // 53.13.0 (opt)
"avformat_find_stream_info", // 53.3.0 (opt)
- /* +14 = 53 */
+ /* +14 = 54 */
// libavdevice
"avdevice_register_all", // supported in all versions (opt)
- /* +1 = 54 */
+ /* +1 = 55 */
// libswresample
"av_opt_set_sample_fmt", // actually lavu .. but exist only w/ swresample!
@@ -129,7 +130,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
"swr_free",
"swr_convert",
"swr_get_out_samples",
- /* +6 = 60 */
+ /* +6 = 61 */
};
// optional symbol names
@@ -138,6 +139,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
"av_dict_count", // 54.* (opt)
// libavutil
+ "av_dict_iterate", // >= 57.42.100
"av_channel_layout_default", // >= 59 (opt)
"av_channel_layout_uninit", // >= 59 (opt)
"av_channel_layout_describe", // >= 59 (opt)
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
index 8124ca6ca..f091056c2 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
@@ -43,7 +43,6 @@ import com.jogamp.common.av.TimeFrameI;
import com.jogamp.common.util.IOUtil;
import com.jogamp.common.util.PropertyAccess;
import com.jogamp.common.util.SecurityUtil;
-import com.jogamp.common.util.VersionNumber;
import com.jogamp.gluegen.runtime.ProcAddressTable;
import com.jogamp.opengl.util.GLPixelStorageModes;
import com.jogamp.opengl.util.av.GLMediaPlayer;
@@ -414,6 +413,21 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
}
@Override
+ protected void updateMetadata() {
+ final Chapter[] chapters = new Chapter[natives.getChapterCount0(moviePtr)];
+ for(int i=0; i<chapters.length; ++i) {
+ chapters[i] = new Chapter(natives.getChapterID0(moviePtr, i),
+ natives.getChapterStartPTS0(moviePtr, i), natives.getChapterEndPTS0(moviePtr, i),
+ natives.getChapterTitle0(moviePtr, i));
+ }
+ this.chapters = chapters;
+ }
+ private volatile Chapter[] chapters = new Chapter[0];
+
+ @Override
+ public Chapter[] getChapters() { return chapters; }
+
+ @Override
protected final void initGLImpl(final GL gl) throws IOException, GLException {
if(0==moviePtr) {
throw new GLException("FFMPEG native instance null");
@@ -973,6 +987,5 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
audioSink.enqueueData( audio_pts, sampleData, data_size);
}
}
-
}
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java
index 9099bfb08..03b61b9ef 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java
@@ -71,6 +71,12 @@ import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
abstract int getAudioPTS0(long moviePtr);
+ abstract int getChapterCount0(long moviePtr);
+ abstract int getChapterID0(long moviePtr, int idx);
+ abstract int getChapterStartPTS0(long moviePtr, int idx);
+ abstract int getChapterEndPTS0(long moviePtr, int idx);
+ abstract String getChapterTitle0(long moviePtr, int idx);
+
/**
* @return resulting current video PTS, or {@link TextureFrame#INVALID_PTS}
*/
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv0400Natives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv0400Natives.java
index 0f7d02904..bb60cbcc9 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv0400Natives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv0400Natives.java
@@ -75,4 +75,15 @@ class FFMPEGv0400Natives extends FFMPEGNatives {
@Override
native int seek0(long moviePtr, int position);
+
+ @Override
+ native int getChapterCount0(long moviePtr);
+ @Override
+ native int getChapterID0(long moviePtr, int idx);
+ @Override
+ native int getChapterStartPTS0(long moviePtr, int idx);
+ @Override
+ native int getChapterEndPTS0(long moviePtr, int idx);
+ @Override
+ native String getChapterTitle0(long moviePtr, int idx);
}
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv0500Natives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv0500Natives.java
index 8d62ac1c5..1ab4ee50a 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv0500Natives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv0500Natives.java
@@ -75,4 +75,15 @@ class FFMPEGv0500Natives extends FFMPEGNatives {
@Override
native int seek0(long moviePtr, int position);
+
+ @Override
+ native int getChapterCount0(long moviePtr);
+ @Override
+ native int getChapterID0(long moviePtr, int idx);
+ @Override
+ native int getChapterStartPTS0(long moviePtr, int idx);
+ @Override
+ native int getChapterEndPTS0(long moviePtr, int idx);
+ @Override
+ native String getChapterTitle0(long moviePtr, int idx);
}
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv0600Natives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv0600Natives.java
index 0de167285..bf68002ff 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv0600Natives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv0600Natives.java
@@ -75,4 +75,15 @@ class FFMPEGv0600Natives extends FFMPEGNatives {
@Override
native int seek0(long moviePtr, int position);
+
+ @Override
+ native int getChapterCount0(long moviePtr);
+ @Override
+ native int getChapterID0(long moviePtr, int idx);
+ @Override
+ native int getChapterStartPTS0(long moviePtr, int idx);
+ @Override
+ native int getChapterEndPTS0(long moviePtr, int idx);
+ @Override
+ native String getChapterTitle0(long moviePtr, int idx);
}