diff options
author | Sven Gothel <[email protected]> | 2023-12-30 21:18:16 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-12-30 21:18:16 +0100 |
commit | 68b2dad19bd6d84f18b22f967ce320b448e8a270 (patch) | |
tree | e4d49a1eadc12ef9a456f1eb1d5303eddfe192c8 /src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java | |
parent | c6e39c6e313a34688ca0164d7a34b6465e92396f (diff) |
GLMediaPlayer/FFMPEGMediaPlayer: Add chapter metadata support and use com.jogamp.common.av.PTS.millisToTimeStr(..)
Chapter metadata is now supported via our FFMPEGMediaPlayer implementation.
Added public method: 'Chapters[] GLMediaPlayer.getChapters()'
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java | 17 |
1 files changed, 15 insertions, 2 deletions
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); } } - } |