summaryrefslogtreecommitdiffstats
path: root/src/jogl/native
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-08-28 02:44:29 +0200
committerSven Gothel <[email protected]>2013-08-28 02:44:29 +0200
commit15ec34db947f89b1d20043b729a09413a425de5d (patch)
treed5545d00009717cdabbb6e52963dbcdea7cc48b9 /src/jogl/native
parent5031a42647442b71ef32041d332ed5f22d3e6ecf (diff)
Fix libav/ffmpeg compilation: Use 'dot less' dir/file names; Compile ffmpeg version dependent c-files individually and inject object files. ; ffmpeg *register_all() at setStream0(..)
- Use 'dot less' dir/file names - Compile ffmpeg version dependent c-files individually and inject object files. - ffmpeg *register_all() at setStream0(..) - Only register devices if available _and_ camera is requested.
Diffstat (limited to 'src/jogl/native')
-rw-r--r--src/jogl/native/libav/ffmpeg_impl_template.c (renamed from src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGvXXNatives.c)26
-rw-r--r--src/jogl/native/libav/ffmpeg_lavc53_lavf53_lavu51.c33
-rw-r--r--src/jogl/native/libav/ffmpeg_lavc54_lavf54_lavu52_lavr01.c33
-rw-r--r--src/jogl/native/libav/ffmpeg_static.c (renamed from src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGStaticNatives.c)2
-rw-r--r--src/jogl/native/libav/ffmpeg_tool.h3
-rw-r--r--src/jogl/native/libav/lavc53.lavf53.lavu51/jogamp_opengl_util_av_impl_FFMPEGv08Natives.c31
-rw-r--r--src/jogl/native/libav/lavc54.lavf54.lavu52.lavr01/jogamp_opengl_util_av_impl_FFMPEGv09Natives.c31
7 files changed, 80 insertions, 79 deletions
diff --git a/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGvXXNatives.c b/src/jogl/native/libav/ffmpeg_impl_template.c
index aaa26cfb1..60cddef45 100644
--- a/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGvXXNatives.c
+++ b/src/jogl/native/libav/ffmpeg_impl_template.c
@@ -30,14 +30,14 @@
#include "JoglCommon.h"
#include "ffmpeg_tool.h"
-/**
+
#include "libavutil/pixdesc.h"
#include "libavutil/samplefmt.h"
#if LIBAVUTIL_VERSION_MAJOR < 53
#include "libavutil/audioconvert.h"
// 52: #include "libavutil/channel_layout.h"
#endif
-*/
+
#include <GL/gl.h>
static const char * const ClazzNameFFMPEGMediaPlayer = "jogamp/opengl/util/av/impl/FFMPEGMediaPlayer";
@@ -501,17 +501,6 @@ JNIEXPORT jlong JNICALL FF_FUNC(createInstance0)
pAV->useRefCountedFrames = 0;
#endif
- // Register all formats and codecs
- sp_avcodec_register_all();
- if(HAS_FUNC(sp_avdevice_register_all)) {
- sp_avdevice_register_all();
- }
- sp_av_register_all();
- // Network too ..
- if(HAS_FUNC(sp_avformat_network_init)) {
- sp_avformat_network_init();
- }
-
pAV->ffmpegMediaPlayer = (*env)->NewGlobalRef(env, ffmpegMediaPlayer);
pAV->verbose = verbose;
pAV->vid=AV_STREAM_ID_AUTO;
@@ -599,6 +588,17 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
return;
}
+ // Register all formats and codecs
+ sp_avcodec_register_all();
+ if( jIsCameraInput && HAS_FUNC(sp_avdevice_register_all) ) {
+ sp_avdevice_register_all();
+ }
+ sp_av_register_all();
+ // Network too ..
+ if(HAS_FUNC(sp_avformat_network_init)) {
+ sp_avformat_network_init();
+ }
+
pAV->pFormatCtx = sp_avformat_alloc_context();
// Open video file
diff --git a/src/jogl/native/libav/ffmpeg_lavc53_lavf53_lavu51.c b/src/jogl/native/libav/ffmpeg_lavc53_lavf53_lavu51.c
new file mode 100644
index 000000000..edce2ba1d
--- /dev/null
+++ b/src/jogl/native/libav/ffmpeg_lavc53_lavf53_lavu51.c
@@ -0,0 +1,33 @@
+/**
+ * Copyright 2013 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+#include "jogamp_opengl_util_av_impl_FFMPEGv08Natives.h"
+
+#define FF_FUNC(METHOD) Java_jogamp_opengl_util_av_impl_FFMPEGv08Natives_ ## METHOD
+
+#include "ffmpeg_impl_template.c"
diff --git a/src/jogl/native/libav/ffmpeg_lavc54_lavf54_lavu52_lavr01.c b/src/jogl/native/libav/ffmpeg_lavc54_lavf54_lavu52_lavr01.c
new file mode 100644
index 000000000..651a64976
--- /dev/null
+++ b/src/jogl/native/libav/ffmpeg_lavc54_lavf54_lavu52_lavr01.c
@@ -0,0 +1,33 @@
+/**
+ * Copyright 2013 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+#include "jogamp_opengl_util_av_impl_FFMPEGv09Natives.h"
+
+#define FF_FUNC(METHOD) Java_jogamp_opengl_util_av_impl_FFMPEGv09Natives_ ## METHOD
+
+#include "ffmpeg_impl_template.c"
diff --git a/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGStaticNatives.c b/src/jogl/native/libav/ffmpeg_static.c
index ee7f3f47d..171dda6a7 100644
--- a/src/jogl/native/libav/jogamp_opengl_util_av_impl_FFMPEGStaticNatives.c
+++ b/src/jogl/native/libav/ffmpeg_static.c
@@ -42,7 +42,7 @@
#include "JoglCommon.h"
-#include <GL/gl.h>
+#include <GL/gl-platform.h>
typedef unsigned (APIENTRYP AV_GET_VERSION)(void);
diff --git a/src/jogl/native/libav/ffmpeg_tool.h b/src/jogl/native/libav/ffmpeg_tool.h
index 90d795b91..ea9625da6 100644
--- a/src/jogl/native/libav/ffmpeg_tool.h
+++ b/src/jogl/native/libav/ffmpeg_tool.h
@@ -29,7 +29,6 @@
#ifndef _FFMPEG_TOOL_H
#define _FFMPEG_TOOL_H
-/***
#ifdef _WIN32
#include <windows.h>
// __declspec(dllimport) void __stdcall Sleep(unsigned long dwMilliseconds);
@@ -49,8 +48,6 @@
#include "libavresample/avresample.h"
#endif
-*/
-
#ifndef LIBAVRESAMPLE_VERSION_MAJOR
#define LIBAVRESAMPLE_VERSION_MAJOR 0
typedef void* AVAudioResampleContext;
diff --git a/src/jogl/native/libav/lavc53.lavf53.lavu51/jogamp_opengl_util_av_impl_FFMPEGv08Natives.c b/src/jogl/native/libav/lavc53.lavf53.lavu51/jogamp_opengl_util_av_impl_FFMPEGv08Natives.c
deleted file mode 100644
index 217ca8cc4..000000000
--- a/src/jogl/native/libav/lavc53.lavf53.lavu51/jogamp_opengl_util_av_impl_FFMPEGv08Natives.c
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifdef _WIN32
- #include <windows.h>
- // __declspec(dllimport) void __stdcall Sleep(unsigned long dwMilliseconds);
-
- #define usleep(t) Sleep((t) / 1000)
-#endif
-
-#include <gluegen_stdint.h>
-#include <gluegen_inttypes.h>
-#include <gluegen_stddef.h>
-#include <gluegen_stdint.h>
-
-#include "libavcodec/avcodec.h"
-#include "libavformat/avformat.h"
-#include "libavutil/avutil.h"
-#if LIBAVCODEC_VERSION_MAJOR >= 54
-#include "libavresample/avresample.h"
-#endif
-
-#include "libavutil/pixdesc.h"
-#include "libavutil/samplefmt.h"
-#if LIBAVUTIL_VERSION_MAJOR < 53
- #include "libavutil/audioconvert.h"
- // 52: #include "libavutil/channel_layout.h"
-#endif
-
-#include "jogamp_opengl_util_av_impl_FFMPEGv08Natives.h"
-
-#define FF_FUNC(METHOD) Java_jogamp_opengl_util_av_impl_FFMPEGv08Natives_ ## METHOD
-
-#include "../jogamp_opengl_util_av_impl_FFMPEGvXXNatives.c"
diff --git a/src/jogl/native/libav/lavc54.lavf54.lavu52.lavr01/jogamp_opengl_util_av_impl_FFMPEGv09Natives.c b/src/jogl/native/libav/lavc54.lavf54.lavu52.lavr01/jogamp_opengl_util_av_impl_FFMPEGv09Natives.c
deleted file mode 100644
index 53f72754f..000000000
--- a/src/jogl/native/libav/lavc54.lavf54.lavu52.lavr01/jogamp_opengl_util_av_impl_FFMPEGv09Natives.c
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifdef _WIN32
- #include <windows.h>
- // __declspec(dllimport) void __stdcall Sleep(unsigned long dwMilliseconds);
-
- #define usleep(t) Sleep((t) / 1000)
-#endif
-
-#include <gluegen_stdint.h>
-#include <gluegen_inttypes.h>
-#include <gluegen_stddef.h>
-#include <gluegen_stdint.h>
-
-#include "libavcodec/avcodec.h"
-#include "libavformat/avformat.h"
-#include "libavutil/avutil.h"
-#if LIBAVCODEC_VERSION_MAJOR >= 54
-#include "libavresample/avresample.h"
-#endif
-
-#include "libavutil/pixdesc.h"
-#include "libavutil/samplefmt.h"
-#if LIBAVUTIL_VERSION_MAJOR < 53
- #include "libavutil/audioconvert.h"
- // 52: #include "libavutil/channel_layout.h"
-#endif
-
-#include "jogamp_opengl_util_av_impl_FFMPEGv09Natives.h"
-
-#define FF_FUNC(METHOD) Java_jogamp_opengl_util_av_impl_FFMPEGv09Natives_ ## METHOD
-
-#include "../jogamp_opengl_util_av_impl_FFMPEGvXXNatives.c"