forked from bartvdbraak/blender
Make game engine ready for FFmpeg-3.0 as well
This commit is contained in:
parent
4f8e051883
commit
b82538d3b7
@ -141,23 +141,23 @@ bool VideoFFmpeg::release()
|
||||
AVFrame *VideoFFmpeg::allocFrameRGB()
|
||||
{
|
||||
AVFrame *frame;
|
||||
frame = avcodec_alloc_frame();
|
||||
frame = av_frame_alloc();
|
||||
if (m_format == RGBA32)
|
||||
{
|
||||
avpicture_fill((AVPicture*)frame,
|
||||
(uint8_t*)MEM_callocN(avpicture_get_size(
|
||||
PIX_FMT_RGBA,
|
||||
AV_PIX_FMT_RGBA,
|
||||
m_codecCtx->width, m_codecCtx->height),
|
||||
"ffmpeg rgba"),
|
||||
PIX_FMT_RGBA, m_codecCtx->width, m_codecCtx->height);
|
||||
AV_PIX_FMT_RGBA, m_codecCtx->width, m_codecCtx->height);
|
||||
} else
|
||||
{
|
||||
avpicture_fill((AVPicture*)frame,
|
||||
(uint8_t*)MEM_callocN(avpicture_get_size(
|
||||
PIX_FMT_RGB24,
|
||||
AV_PIX_FMT_RGB24,
|
||||
m_codecCtx->width, m_codecCtx->height),
|
||||
"ffmpeg rgb"),
|
||||
PIX_FMT_RGB24, m_codecCtx->width, m_codecCtx->height);
|
||||
AV_PIX_FMT_RGB24, m_codecCtx->width, m_codecCtx->height);
|
||||
}
|
||||
return frame;
|
||||
}
|
||||
@ -237,8 +237,8 @@ int VideoFFmpeg::openStream(const char *filename, AVInputFormat *inputFormat, AV
|
||||
m_codecCtx = codecCtx;
|
||||
m_formatCtx = formatCtx;
|
||||
m_videoStream = videoStream;
|
||||
m_frame = avcodec_alloc_frame();
|
||||
m_frameDeinterlaced = avcodec_alloc_frame();
|
||||
m_frame = av_frame_alloc();
|
||||
m_frameDeinterlaced = av_frame_alloc();
|
||||
|
||||
// allocate buffer if deinterlacing is required
|
||||
avpicture_fill((AVPicture*)m_frameDeinterlaced,
|
||||
@ -249,10 +249,10 @@ int VideoFFmpeg::openStream(const char *filename, AVInputFormat *inputFormat, AV
|
||||
m_codecCtx->pix_fmt, m_codecCtx->width, m_codecCtx->height);
|
||||
|
||||
// check if the pixel format supports Alpha
|
||||
if (m_codecCtx->pix_fmt == PIX_FMT_RGB32 ||
|
||||
m_codecCtx->pix_fmt == PIX_FMT_BGR32 ||
|
||||
m_codecCtx->pix_fmt == PIX_FMT_RGB32_1 ||
|
||||
m_codecCtx->pix_fmt == PIX_FMT_BGR32_1)
|
||||
if (m_codecCtx->pix_fmt == AV_PIX_FMT_RGB32 ||
|
||||
m_codecCtx->pix_fmt == AV_PIX_FMT_BGR32 ||
|
||||
m_codecCtx->pix_fmt == AV_PIX_FMT_RGB32_1 ||
|
||||
m_codecCtx->pix_fmt == AV_PIX_FMT_BGR32_1)
|
||||
{
|
||||
// allocate buffer to store final decoded frame
|
||||
m_format = RGBA32;
|
||||
@ -263,7 +263,7 @@ int VideoFFmpeg::openStream(const char *filename, AVInputFormat *inputFormat, AV
|
||||
m_codecCtx->pix_fmt,
|
||||
m_codecCtx->width,
|
||||
m_codecCtx->height,
|
||||
PIX_FMT_RGBA,
|
||||
AV_PIX_FMT_RGBA,
|
||||
SWS_FAST_BILINEAR,
|
||||
NULL, NULL, NULL);
|
||||
} else
|
||||
@ -277,7 +277,7 @@ int VideoFFmpeg::openStream(const char *filename, AVInputFormat *inputFormat, AV
|
||||
m_codecCtx->pix_fmt,
|
||||
m_codecCtx->width,
|
||||
m_codecCtx->height,
|
||||
PIX_FMT_RGB24,
|
||||
AV_PIX_FMT_RGB24,
|
||||
SWS_FAST_BILINEAR,
|
||||
NULL, NULL, NULL);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user