Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2008-12-17 23:52:39 +0300
committerBenoit Bolsee <benoit.bolsee@online.be>2008-12-17 23:52:39 +0300
commit04ef5be177b35c12378c85ef99b2e83aa7f27bd3 (patch)
treee456d24c6226ce9de1c6b4965ab2a822fc40e34b
parent3c886d7c384289206b02b1581ddc9366d607bd3f (diff)
FFmpeg upgrade to revision 12758 (avformat version 52.13): support libavdevice for video capture in VideoTexture module (BGE). Makefile, CMake, scons updated. FFmpeg binaries will have to be rebuilt for certain OS (irix), win32 binaries already up to date. You MUST do a clean rebuild after this patch. Scons users: pay attention that the config/<os>-config.py files have changed, adapt your user-config.py in consequence
-rw-r--r--CMakeLists.txt2
-rw-r--r--SConstruct9
-rw-r--r--config/darwin-config.py6
-rw-r--r--config/irix6-config.py2
-rw-r--r--config/linux2-config.py9
-rw-r--r--config/sunos5-config.py2
-rw-r--r--config/win32-mingw-config.py2
-rw-r--r--source/blender/imbuf/intern/util.c4
-rw-r--r--source/nan_definitions.mk14
9 files changed, 32 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e01a37d3b3e..4b96ca585a6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -175,7 +175,7 @@ IF(UNIX)
SET(FFMPEG /usr)
SET(FFMPEG_INC ${FFMPEG}/include)
- SET(FFMPEG_LIB avformat avcodec avutil)
+ SET(FFMPEG_LIB avformat avcodec avutil avdevice swscale)
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
SET(JPEG_LIB jpeg)
diff --git a/SConstruct b/SConstruct
index b2eb0ffe26d..809166586e6 100644
--- a/SConstruct
+++ b/SConstruct
@@ -322,10 +322,15 @@ if not quickie and do_clean:
print "remove file %s"%(B.root_build_dir+entry)
os.remove(B.root_build_dir+entry)
for confile in ['extern/ffmpeg/config.mak', 'extern/x264/config.mak',
- 'extern/xvidcore/build/generic/platform.inc']:
+ 'extern/xvidcore/build/generic/platform.inc', 'extern/ffmpeg/include']:
if os.path.exists(confile):
print "clean file %s"%confile
- os.remove(confile)
+ if os.path.isdir(confile):
+ for root, dirs, files in os.walk(confile):
+ for name in files:
+ os.remove(os.path.join(root, name))
+ else:
+ os.remove(confile)
print B.bc.OKGREEN+'...done'+B.bc.ENDC
else:
print B.bc.HEADER+'Already Clean, nothing to do.'+B.bc.ENDC
diff --git a/config/darwin-config.py b/config/darwin-config.py
index 3ef7b7132d9..cfd6a9395bb 100644
--- a/config/darwin-config.py
+++ b/config/darwin-config.py
@@ -40,7 +40,11 @@ else:
# enable ffmpeg support
WITH_BF_FFMPEG = True # -DWITH_FFMPEG
BF_FFMPEG = "#extern/ffmpeg"
-BF_FFMPEG_INC = '${BF_FFMPEG}/include'
+# trick : The version of ffmpeg in extern/ffmpeg uses explicit libav.. directory in #include statements
+# To keep Blender compatible with older versions, I add ${BF_FFMPEG} to the inc dir so that ffmpeg
+# finds the files directly in extern/ffmpeg/libav... while blender finds them in
+# extern/ffmpeg/include.
+BF_FFMPEG_INC = '${BF_FFMPEG}/include ${BF_FFMPEG}'
if USE_SDK==True:
BF_FFMPEG_EXTRA = '-isysroot '+MACOSX_SDK+' -mmacosx-version-min='+MAC_MIN_VERS
#BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
diff --git a/config/irix6-config.py b/config/irix6-config.py
index b643affb0b3..2485c02e095 100644
--- a/config/irix6-config.py
+++ b/config/irix6-config.py
@@ -146,7 +146,7 @@ WITH_BF_BINRELOC = 'false'
WITH_BF_FFMPEG = 'true' # -DWITH_FFMPEG
# Uncomment the following two lines to use system's ffmpeg
BF_FFMPEG = LCGDIR+'/ffmpeg'
-BF_FFMPEG_LIB = 'avformat avcodec swscale avutil faad faac vorbis x264 ogg mp3lame z'
+BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice faad faac vorbis x264 ogg mp3lame z'
BF_FFMPEG_INC = '${BF_FFMPEG}/include'
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
diff --git a/config/linux2-config.py b/config/linux2-config.py
index 2984c06d2df..56132aaf1de 100644
--- a/config/linux2-config.py
+++ b/config/linux2-config.py
@@ -139,8 +139,13 @@ BF_FFMPEG = '#extern/ffmpeg'
BF_FFMPEG_LIB = ''
# Uncomment the following two lines to use system's ffmpeg
# BF_FFMPEG = '/usr'
-# BF_FFMPEG_LIB = 'avformat avcodec swscale avutil'
-BF_FFMPEG_INC = '${BF_FFMPEG}/include'
+# BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice'
+# trick : The version of ffmpeg in extern/ffmpeg uses explicit libav.. directory in #include statements
+# To keep Blender compatible with older version, I add ${BF_FFMPEG} to the inc dir so that ffmpeg
+# finds the files directly in extern/ffmpeg/libav... while blender finds them in
+# extern/ffmpeg/include. When using system ffmpeg, you don't need that, assuming the system library
+# still use the flat directory model, otherwise will not compile anyway
+BF_FFMPEG_INC = '${BF_FFMPEG}/include ${BF_FFMPEG}'
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
# enable ogg, vorbis and theora in ffmpeg
diff --git a/config/sunos5-config.py b/config/sunos5-config.py
index a44a9df7c75..dda7d0ff2f3 100644
--- a/config/sunos5-config.py
+++ b/config/sunos5-config.py
@@ -131,7 +131,7 @@ WITH_BF_FFMPEG = False # -DWITH_FFMPEG
BF_FFMPEG = '/usr/local'
BF_FFMPEG_INC = '${BF_FFMPEG}/include'
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
-BF_FFMPEG_LIB = 'avformat avcodec avutil'
+BF_FFMPEG_LIB = 'avformat avcodec avutil avdevice'
# Mesa Libs should go here if your using them as well....
WITH_BF_STATICOPENGL = False
diff --git a/config/win32-mingw-config.py b/config/win32-mingw-config.py
index 6278672ca3d..963f62a5f40 100644
--- a/config/win32-mingw-config.py
+++ b/config/win32-mingw-config.py
@@ -21,7 +21,7 @@ BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
WITH_BF_FFMPEG = False
-BF_FFMPEG_LIB = 'avformat swscale avcodec avutil xvidcore x264'
+BF_FFMPEG_LIB = 'avformat swscale avcodec avutil avdevice xvidcore x264'
BF_FFMPEG_LIBPATH = LIBDIR + '/gcc/ffmpeg/lib'
BF_FFMPEG_INC = LIBDIR + '/gcc/ffmpeg/include'
diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c
index c86f9b017bf..cf8c0978c66 100644
--- a/source/blender/imbuf/intern/util.c
+++ b/source/blender/imbuf/intern/util.c
@@ -71,7 +71,7 @@
#ifdef WITH_FFMPEG
#include <ffmpeg/avcodec.h>
#include <ffmpeg/avformat.h>
-//#include <ffmpeg/avdevice.h>
+#include <ffmpeg/avdevice.h>
#include <ffmpeg/log.h>
#if LIBAVFORMAT_VERSION_INT < (49 << 16)
@@ -258,7 +258,7 @@ void do_init_ffmpeg()
if (!ffmpeg_init) {
ffmpeg_init = 1;
av_register_all();
- //avdevice_register_all();
+ avdevice_register_all();
if ((G.f & G_DEBUG) == 0)
{
diff --git a/source/nan_definitions.mk b/source/nan_definitions.mk
index 04a1d107931..3961e153cea 100644
--- a/source/nan_definitions.mk
+++ b/source/nan_definitions.mk
@@ -100,13 +100,13 @@ endif
ifeq ($(FREE_WINDOWS), true)
export NAN_FTGL ?= $(LCGDIR)/gcc/ftgl
export NAN_FFMPEG ?= $(LCGDIR)/gcc/ffmpeg
- export NAN_FFMPEGLIBS ?= $(NAN_FFMPEG)/lib/libavformat.a $(NAN_FFMPEG)/lib/libavutil.a $(NAN_FFMPEG)/lib/libavcodec.a
- export NAN_FFMPEGCFLAGS ?= -I$(NAN_FFMPEG)/include
+ export NAN_FFMPEGLIBS ?= $(NAN_FFMPEG)/lib/libavformat.a $(NAN_FFMPEG)/lib/libavutil.a $(NAN_FFMPEG)/lib/libavcodec.a $(NAN_FFMPEG)/lib/libavdevice.a
+ export NAN_FFMPEGCFLAGS ?= -I$(NAN_FFMPEG)/include -I$(NANBLENDERHOME)/extern/ffmpeg
else
export NAN_FTGL ?= $(LCGDIR)/ftgl
export NAN_FFMPEG ?= $(LCGDIR)/ffmpeg
- export NAN_FFMPEGLIBS ?= $(NAN_FFMPEG)/lib/libavformat.a $(NAN_FFMPEG)/lib/libavcodec.a $(NAN_FFMPEG)/lib/libswscale.a $(NAN_FFMPEG)/lib/libavutil.a
- export NAN_FFMPEGCFLAGS ?= -I$(NAN_FFMPEG)/include
+ export NAN_FFMPEGLIBS ?= $(NAN_FFMPEG)/lib/libavformat.a $(NAN_FFMPEG)/lib/libavcodec.a $(NAN_FFMPEG)/lib/libswscale.a $(NAN_FFMPEG)/lib/libavutil.a $(NAN_FFMPEG)/lib/libavdevice.a
+ export NAN_FFMPEGCFLAGS ?= -I$(NAN_FFMPEG)/include -I$(NANBLENDERHOME)/extern/ffmpeg
endif
ifeq ($(WITH_VERSE), true)
@@ -357,8 +357,8 @@ endif
export NAN_SDLLIBS ?= $(NAN_SDL)/lib/libSDL.a
export NAN_SDLCFLAGS ?= -I$(NAN_SDL)/include/SDL
export NAN_FFMPEG ?= $(LCGDIR)/ffmpeg
- export NAN_FFMPEGLIBS = $(NAN_FFMPEG)/lib/libavformat.a $(NAN_FFMPEG)/lib/libavcodec.a $(NAN_FFMPEG)/lib/libswscale.a $(NAN_FFMPEG)/lib/libavutil.a $(NAN_FFMPEG)/lib/libogg.a $(NAN_FFMPEG)/lib/libfaad.a $(NAN_FFMPEG)/lib/libmp3lame.a $(NAN_FFMPEG)/lib/libvorbis.a $(NAN_FFMPEG)/lib/libx264.a $(NAN_FFMPEG)/lib/libfaac.a $(NAN_ZLIB)/lib/libz.a
- export NAN_FFMPEGCFLAGS ?= -I$(NAN_FFMPEG)/include
+ export NAN_FFMPEGLIBS = $(NAN_FFMPEG)/lib/libavformat.a $(NAN_FFMPEG)/lib/libavcodec.a $(NAN_FFMPEG)/lib/libswscale.a $(NAN_FFMPEG)/lib/libavutil.a $(NAN_FFMPEG)/lib/libavdevice.a $(NAN_FFMPEG)/lib/libogg.a $(NAN_FFMPEG)/lib/libfaad.a $(NAN_FFMPEG)/lib/libmp3lame.a $(NAN_FFMPEG)/lib/libvorbis.a $(NAN_FFMPEG)/lib/libx264.a $(NAN_FFMPEG)/lib/libfaac.a $(NAN_ZLIB)/lib/libz.a
+ export NAN_FFMPEGCFLAGS ?= -I$(NAN_FFMPEG)/include -I$(NANBLENDERHOME)/extern/ffmpeg
# Uncomment the following line to use Mozilla inplace of netscape
# CPPFLAGS +=-DMOZ_NOT_NET
@@ -407,7 +407,7 @@ endif
ifneq ($(NAN_USE_FFMPEG_CONFIG), true)
export NAN_FFMPEG ?= /usr
- export NAN_FFMPEGLIBS ?= -L$(NAN_FFMPEG)/lib -lavformat -lavcodec -lavutil -lswscale -ldts -lz
+ export NAN_FFMPEGLIBS ?= -L$(NAN_FFMPEG)/lib -lavformat -lavcodec -lavutil -lswscale -lavdevice -ldts -lz
export NAN_FFMPEGCFLAGS ?= -I$(NAN_FFMPEG)/include
endif