forked from bartvdbraak/blender
== 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 :)
This commit is contained in:
parent
d5d2d1fece
commit
615c5232c7
@ -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'
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user