Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 130948 Details for
Bug 185627
media-gfx/blender-2.44 doesn't compile when USE=ffmpeg
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
blender-2.44-swscale.patch - take 2
blender-2.44-swscale.patch (text/plain), 3.96 KB, created by
Martin Capitanio
on 2007-09-14 21:01:48 UTC
(
hide
)
Description:
blender-2.44-swscale.patch - take 2
Filename:
MIME Type:
Creator:
Martin Capitanio
Created:
2007-09-14 21:01:48 UTC
Size:
3.96 KB
patch
obsolete
>diff --git a/trunk/blender/config/linux2-config.py b/trunk/blender/config/linux2-config.py >index edc7f26..bd323e4 100644 >--- a/trunk/blender/config/linux2-config.py >+++ b/trunk/blender/config/linux2-config.py >@@ -119,7 +119,7 @@ WITH_BF_FFMPEG = 'false' # -DWITH_FFMPEG > BF_FFMPEG = '/usr' > BF_FFMPEG_INC = '${BF_FFMPEG}/include' > BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib' >-BF_FFMPEG_LIB = 'avformat avcodec avutil' >+BF_FFMPEG_LIB = 'avformat avcodec avutil swscale' > > # Mesa Libs should go here if your using them as well.... > WITH_BF_STATICOPENGL = 'false' >diff --git a/trunk/blender/source/blender/blenkernel/intern/writeffmpeg.c b/trunk/blender/source/blender/blenkernel/intern/writeffmpeg.c >index 703f280..8576f59 100644 >--- a/trunk/blender/source/blender/blenkernel/intern/writeffmpeg.c >+++ b/trunk/blender/source/blender/blenkernel/intern/writeffmpeg.c >@@ -32,6 +32,7 @@ > #include <ffmpeg/avformat.h> > #include <ffmpeg/avcodec.h> > #include <ffmpeg/rational.h> >+#include <ffmpeg/swscale.h> > > #if LIBAVFORMAT_VERSION_INT < (49 << 16) > #define FFMPEG_OLD_FRAME_RATE 1 >@@ -258,6 +259,7 @@ static void write_video_frame(AVFrame* frame) > static AVFrame* generate_video_frame(uint8_t* pixels) > { > uint8_t* rendered_frame; >+ static struct SwsContext *img_convert_ctx; > > AVCodecContext* c = get_codec_from_stream(video_stream); > int width = c->width; >@@ -317,8 +319,18 @@ static AVFrame* generate_video_frame(uint8_t* pixels) > } > > if (c->pix_fmt != PIX_FMT_RGBA32) { >- img_convert((AVPicture*)current_frame, c->pix_fmt, >- (AVPicture*)rgb_frame, PIX_FMT_RGBA32, width, height); >+ if (img_convert_ctx == NULL) >+ img_convert_ctx = sws_getContext(c->width, c->height, >+ PIX_FMT_RGBA32, >+ c->width, c->height, >+ c->pix_fmt, >+ SWS_BICUBIC, >+ NULL, NULL, NULL); >+ sws_scale(img_convert_ctx, rgb_frame->data, >+ rgb_frame->linesize, 0, c->height, >+ current_frame->data, current_frame->linesize); >+// img_convert((AVPicture*)current_frame, c->pix_fmt, >+// (AVPicture*)rgb_frame, PIX_FMT_RGBA32, width, height); > delete_picture(rgb_frame); > } > return current_frame; >diff --git a/trunk/blender/source/blender/imbuf/intern/anim.c b/trunk/blender/source/blender/imbuf/intern/anim.c >index 5b185a4..5cdb651 100644 >--- a/trunk/blender/source/blender/imbuf/intern/anim.c >+++ b/trunk/blender/source/blender/imbuf/intern/anim.c >@@ -89,6 +89,7 @@ > #include <ffmpeg/avformat.h> > #include <ffmpeg/avcodec.h> > #include <ffmpeg/rational.h> >+#include <ffmpeg/swscale.h> > > #if LIBAVFORMAT_VERSION_INT < (49 << 16) > #define FFMPEG_OLD_FRAME_RATE 1 >@@ -619,6 +620,7 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position) { > AVPacket packet; > int64_t pts_to_search = 0; > int pos_found = 1; >+ static struct SwsContext *img_convert_ctx; > > if (anim == 0) return (0); > >@@ -706,12 +708,32 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position) { > unsigned char * p =(unsigned char*) ibuf->rect; > unsigned char * e = p + anim->x * anim->y * 4; > >- img_convert((AVPicture *)anim->pFrameRGB, >- PIX_FMT_RGBA32, >- (AVPicture*)anim->pFrame, >- anim->pCodecCtx->pix_fmt, >- anim->pCodecCtx->width, >- anim->pCodecCtx->height); >+// img_convert((AVPicture *)anim->pFrameRGB, >+// PIX_FMT_RGBA32, >+// (AVPicture*)anim->pFrame, >+// anim->pCodecCtx->pix_fmt, >+// anim->pCodecCtx->width, >+// anim->pCodecCtx->height); >+ if (img_convert_ctx == NULL) { >+ img_convert_ctx = sws_getContext( >+ anim->pCodecCtx->width, >+ anim->pCodecCtx->height, >+ PIX_FMT_RGBA32, >+ anim->pCodecCtx->width, >+ anim->pCodecCtx->height, >+ anim->pCodecCtx->pix_fmt, >+ SWS_BICUBIC, >+ NULL, NULL, NULL); >+ } >+ sws_scale(img_convert_ctx, >+ anim->pFrame->data, >+ anim->pFrame->linesize, >+ 0, >+ anim->pCodecCtx->height, >+ anim->pFrameRGB->data, >+ anim->pFrameRGB->linesize); >+ >+ > IMB_flipy(ibuf); > if (G.order == L_ENDIAN) { > /* BGRA -> RGBA */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 185627
:
125324
|
125886
|
130942
| 130948