summaryrefslogtreecommitdiffstats
path: root/src/jogl/native/libav/ffmpeg_tool.h
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-08-14 07:02:59 +0200
committerSven Gothel <[email protected]>2013-08-14 07:02:59 +0200
commitc37629ea8fdcb11f7f8a18e37a4cde57d4ba6a01 (patch)
tree96e6ef2b8db44f3dd331ac78a0a52d5d5ea15e50 /src/jogl/native/libav/ffmpeg_tool.h
parentbc3776633ccad81199a96ff8116195133d862395 (diff)
GLMediaPlayer Multithreaded Decoding: GLMediaPlayer* (Part-3) - WIP
- GLMediaPlayer - Remove State.Stopped and method stop() - redundant, use pause() / destroy() - Add notion of stream IDs - Add API doc: State / Stream-ID incl. html-anchor - Expose video/audio PTS, .. - Expose optional AudioSink - Min multithreaded textureCount is 4 (EGL* and FFMPEG*) - GLMediaPlayerImpl - Move AudioSink rel. impl. to this class, allowing a tight video implementation reusing logic. - Remove 'synchronized' methods, synchronize on State where applicable - implement new methods (see above) - playSpeed is handled partially in AudioSink. If it exeeds AudioSink's capabilities, drop audio and rely solely on video sync. - video sync (WIP) - video pts delay based on geometric weight - reset video SCR if 'out of range', resync w/ PTS - - FramePusher - allow interruption when pausing/stopping, while waiting for next avail free frame to decode. - FFMPEGMediaPlayer - Add proper AudioDataFormat negotiation AudioSink <-> libav - Parse libav's SampleFormat - Remove AudioSink interaction (moved to GLMediaPlayerImpl) - Tests (MovieSimple, MovieCube): - Add aid/vid selection - Add KeyListener for actions: seek(..), play()/pause(), setPlaySpeed(..) - Dump perf-string each 2s - TODO: - Add audio sync in AudioSink, similar to GLMediaPlayer's weighted video delay, here: drop audio frames.
Diffstat (limited to 'src/jogl/native/libav/ffmpeg_tool.h')
-rw-r--r--src/jogl/native/libav/ffmpeg_tool.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/jogl/native/libav/ffmpeg_tool.h b/src/jogl/native/libav/ffmpeg_tool.h
index 2dff1110c..081e17323 100644
--- a/src/jogl/native/libav/ffmpeg_tool.h
+++ b/src/jogl/native/libav/ffmpeg_tool.h
@@ -58,6 +58,18 @@ typedef GLenum (APIENTRYP PFNGLGETERRORPROC) (void);
*/
#define AV_TIME_BASE_MSEC (AV_TIME_BASE/1000)
+#define AV_VERSION_MAJOR(i) ( ( i >> 16 ) & 0xFF )
+#define AV_VERSION_MINOR(i) ( ( i >> 8 ) & 0xFF )
+#define AV_VERSION_SUB(i) ( ( i >> 0 ) & 0xFF )
+
+/** Sync w/ GLMediaPlayer.STREAM_ID_NONE */
+#define AV_STREAM_ID_NONE -2
+
+/** Sync w/ GLMediaPlayer.STREAM_ID_AUTO */
+#define AV_STREAM_ID_AUTO -1
+
+#define AV_HAS_API_REQUEST_CHANNELS(pAV) (AV_VERSION_MAJOR(pAV->avcodecVersion) < 55)
+
static inline float my_av_q2f(AVRational a){
return a.num / (float) a.den;
}
@@ -68,6 +80,10 @@ static inline int32_t my_av_q2i32(int32_t snum, AVRational a){
typedef struct {
int32_t verbose;
+ uint32_t avcodecVersion;
+ uint32_t avformatVersion;
+ uint32_t avutilVersion;
+
PFNGLTEXSUBIMAGE2DPROC procAddrGLTexSubImage2D;
PFNGLGETERRORPROC procAddrGLGetError;
@@ -103,7 +119,8 @@ typedef struct {
int32_t bps_stream; // bits per seconds
int32_t bps_video; // bits per seconds
int32_t bps_audio; // bits per seconds
- int32_t totalFrames;
+ int32_t frames_video;
+ int32_t frames_audio;
int32_t duration; // msec
int32_t start_time; // msec