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:
authorPeter Schlaile <peter@schlaile.de>2009-03-22 22:19:21 +0300
committerPeter Schlaile <peter@schlaile.de>2009-03-22 22:19:21 +0300
commit615c5232c7b2e51f9722fdff58e04ae53c043797 (patch)
treeee259a124d9c94e5363db7914cb1798931794875
parentd5d2d1feceb9f261ff04682ca4f6a2658c04ab5c (diff)
== FFMPEG ==
Updated ffmpeg to release version 0.5 updated x264 to today's daily build thanks to ben2610 for first patches (but you got hddaudio.c wrong :)
-rw-r--r--config/darwin-config.py6
-rw-r--r--config/linux2-config.py7
-rw-r--r--source/blender/blenkernel/intern/writeffmpeg.c28
-rw-r--r--source/blender/imbuf/intern/IMB_anim.h6
-rw-r--r--source/blender/imbuf/intern/anim.c8
-rw-r--r--source/blender/imbuf/intern/util.c8
-rw-r--r--source/blender/src/buttons_scene.c6
-rw-r--r--source/blender/src/hddaudio.c12
-rw-r--r--source/gameengine/VideoTexture/VideoFFmpeg.h8
9 files changed, 42 insertions, 47 deletions
diff --git a/config/darwin-config.py b/config/darwin-config.py
index cfd6a9395bb..39c9b9df4ff 100644
--- a/config/darwin-config.py
+++ b/config/darwin-config.py
@@ -40,11 +40,7 @@ else:
# enable ffmpeg support
WITH_BF_FFMPEG = True # -DWITH_FFMPEG
BF_FFMPEG = "#extern/ffmpeg"
-# 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}'
+BF_FFMPEG_INC = '${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/linux2-config.py b/config/linux2-config.py
index 6ba3052048d..102bb2e5e4c 100644
--- a/config/linux2-config.py
+++ b/config/linux2-config.py
@@ -140,12 +140,7 @@ BF_FFMPEG_LIB = ''
# Uncomment the following two lines to use system's ffmpeg
# BF_FFMPEG = '/usr'
# 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_INC = '${BF_FFMPEG}'
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
# enable ogg, vorbis and theora in ffmpeg
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index cef6f802729..378e4319223 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -29,11 +29,11 @@
#include <stdlib.h>
-#include <ffmpeg/avformat.h>
-#include <ffmpeg/avcodec.h>
-#include <ffmpeg/rational.h>
-#include <ffmpeg/swscale.h>
-#include <ffmpeg/opt.h>
+#include <libavformat/avformat.h>
+#include <libavcodec/avcodec.h>
+#include <libavutil/rational.h>
+#include <libswscale/swscale.h>
+#include <libavcodec/opt.h>
#if LIBAVFORMAT_VERSION_INT < (49 << 16)
#define FFMPEG_OLD_FRAME_RATE 1
@@ -290,8 +290,8 @@ static AVFrame* generate_video_frame(uint8_t* pixels)
int height = c->height;
AVFrame* rgb_frame;
- if (c->pix_fmt != PIX_FMT_RGBA32) {
- rgb_frame = alloc_picture(PIX_FMT_RGBA32, width, height);
+ if (c->pix_fmt != PIX_FMT_BGR32) {
+ rgb_frame = alloc_picture(PIX_FMT_BGR32, width, height);
if (!rgb_frame) {
G.afbreek=1;
error("Couldn't allocate temporary frame");
@@ -342,7 +342,7 @@ static AVFrame* generate_video_frame(uint8_t* pixels)
}
}
- if (c->pix_fmt != PIX_FMT_RGBA32) {
+ if (c->pix_fmt != PIX_FMT_BGR32) {
sws_scale(img_convert_ctx, rgb_frame->data,
rgb_frame->linesize, 0, c->height,
current_frame->data, current_frame->linesize);
@@ -498,9 +498,11 @@ static AVStream* alloc_video_stream(int codec_id, AVFormatContext* of,
c->pix_fmt = PIX_FMT_YUV420P;
}
- if (!strcmp(of->oformat->name, "mp4") ||
- !strcmp(of->oformat->name, "mov") ||
- !strcmp(of->oformat->name, "3gp")) {
+ if ((of->oformat->flags & AVFMT_GLOBALHEADER)
+// || !strcmp(of->oformat->name, "mp4")
+// || !strcmp(of->oformat->name, "mov")
+// || !strcmp(of->oformat->name, "3gp")
+ ) {
fprintf(stderr, "Using global header\n");
c->flags |= CODEC_FLAG_GLOBAL_HEADER;
}
@@ -514,7 +516,7 @@ static AVStream* alloc_video_stream(int codec_id, AVFormatContext* of,
/* xasp & yasp got float lately... */
- c->sample_aspect_ratio = av_d2q(
+ st->sample_aspect_ratio = c->sample_aspect_ratio = av_d2q(
((double) G.scene->r.xasp / (double) G.scene->r.yasp), 255);
set_ffmpeg_properties(c, "video");
@@ -531,7 +533,7 @@ static AVStream* alloc_video_stream(int codec_id, AVFormatContext* of,
current_frame = alloc_picture(c->pix_fmt, c->width, c->height);
img_convert_ctx = sws_getContext(c->width, c->height,
- PIX_FMT_RGBA32,
+ PIX_FMT_BGR32,
c->width, c->height,
c->pix_fmt,
SWS_BICUBIC,
diff --git a/source/blender/imbuf/intern/IMB_anim.h b/source/blender/imbuf/intern/IMB_anim.h
index 745248d3218..7e99df8237a 100644
--- a/source/blender/imbuf/intern/IMB_anim.h
+++ b/source/blender/imbuf/intern/IMB_anim.h
@@ -76,9 +76,9 @@
#endif /* WITH_QUICKTIME */
#ifdef WITH_FFMPEG
-#include <ffmpeg/avformat.h>
-#include <ffmpeg/avcodec.h>
-#include <ffmpeg/swscale.h>
+#include <libavformat/avformat.h>
+#include <libavcodec/avcodec.h>
+#include <libswscale/swscale.h>
#endif
#ifdef WITH_REDCODE
diff --git a/source/blender/imbuf/intern/anim.c b/source/blender/imbuf/intern/anim.c
index 80bf401bec0..42fe47cc5e9 100644
--- a/source/blender/imbuf/intern/anim.c
+++ b/source/blender/imbuf/intern/anim.c
@@ -83,10 +83,10 @@
#include "IMB_anim5.h"
#ifdef WITH_FFMPEG
-#include <ffmpeg/avformat.h>
-#include <ffmpeg/avcodec.h>
-#include <ffmpeg/rational.h>
-#include <ffmpeg/swscale.h>
+#include <libavformat/avformat.h>
+#include <libavcodec/avcodec.h>
+#include <libavutil/rational.h>
+#include <libswscale/swscale.h>
#if LIBAVFORMAT_VERSION_INT < (49 << 16)
#define FFMPEG_OLD_FRAME_RATE 1
diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c
index 15d1d031dbd..ffd5d3431af 100644
--- a/source/blender/imbuf/intern/util.c
+++ b/source/blender/imbuf/intern/util.c
@@ -73,10 +73,10 @@
#endif
#ifdef WITH_FFMPEG
-#include <ffmpeg/avcodec.h>
-#include <ffmpeg/avformat.h>
-#include <ffmpeg/avdevice.h>
-#include <ffmpeg/log.h>
+#include <libavcodec/avcodec.h>
+#include <libavformat/avformat.h>
+#include <libavdevice/avdevice.h>
+#include <libavutil/log.h>
#if LIBAVFORMAT_VERSION_INT < (49 << 16)
#define FFMPEG_OLD_FRAME_RATE 1
diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c
index 376a57b11e9..be988c5a68a 100644
--- a/source/blender/src/buttons_scene.c
+++ b/source/blender/src/buttons_scene.c
@@ -109,9 +109,9 @@
#ifdef WITH_FFMPEG
-#include <ffmpeg/avcodec.h> /* for PIX_FMT_* and CODEC_ID_* */
-#include <ffmpeg/avformat.h>
-#include <ffmpeg/opt.h>
+#include <libavcodec/avcodec.h> /* for PIX_FMT_* and CODEC_ID_* */
+#include <libavformat/avformat.h>
+#include <libavcodec/opt.h>
static int ffmpeg_preset_sel = 0;
diff --git a/source/blender/src/hddaudio.c b/source/blender/src/hddaudio.c
index 7e6b314f296..7175f140b09 100644
--- a/source/blender/src/hddaudio.c
+++ b/source/blender/src/hddaudio.c
@@ -33,9 +33,9 @@
#endif
#ifdef WITH_FFMPEG
-#include <ffmpeg/avformat.h>
-#include <ffmpeg/avcodec.h>
-#include <ffmpeg/rational.h>
+#include <libavformat/avformat.h>
+#include <libavcodec/avcodec.h>
+#include <libavutil/rational.h>
#if LIBAVFORMAT_VERSION_INT < (49 << 16)
#define FFMPEG_OLD_FRAME_RATE 1
#else
@@ -311,7 +311,8 @@ static void sound_hdaudio_extract_small_block(
audio_pkt_size = packet.size;
while (audio_pkt_size > 0) {
- len = avcodec_decode_audio(
+ data_size=AVCODEC_MAX_AUDIO_FRAME_SIZE;
+ len = avcodec_decode_audio2(
hdaudio->pCodecCtx,
hdaudio->decode_cache
+ decode_pos,
@@ -478,7 +479,8 @@ static void sound_hdaudio_extract_small_block(
}
while (audio_pkt_size > 0) {
- len = avcodec_decode_audio(
+ data_size=AVCODEC_MAX_AUDIO_FRAME_SIZE;
+ len = avcodec_decode_audio2(
hdaudio->pCodecCtx,
hdaudio->decode_cache
+ decode_pos,
diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.h b/source/gameengine/VideoTexture/VideoFFmpeg.h
index 51ce2c4eebe..51f1067c466 100644
--- a/source/gameengine/VideoTexture/VideoFFmpeg.h
+++ b/source/gameengine/VideoTexture/VideoFFmpeg.h
@@ -25,10 +25,10 @@ http://www.gnu.org/copyleft/lesser.txt.
#ifdef WITH_FFMPEG
extern "C" {
#include <pthread.h>
-#include <ffmpeg/avformat.h>
-#include <ffmpeg/avcodec.h>
-#include <ffmpeg/rational.h>
-#include <ffmpeg/swscale.h>
+#include <libavformat/avformat.h>
+#include <libavcodec/avcodec.h>
+#include <libavutil/rational.h>
+#include <libswscale/swscale.h>
#include "DNA_listBase.h"
#include "BLI_threads.h"
#include "BLI_blenlib.h"