From b82538d3b77e4b9fe3791059fef2e604d56f747f Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 16 Feb 2016 16:29:47 +0100 Subject: Make game engine ready for FFmpeg-3.0 as well --- source/gameengine/VideoTexture/VideoFFmpeg.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'source/gameengine') diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.cpp b/source/gameengine/VideoTexture/VideoFFmpeg.cpp index 41ace25b19e..5fed1211d6c 100644 --- a/source/gameengine/VideoTexture/VideoFFmpeg.cpp +++ b/source/gameengine/VideoTexture/VideoFFmpeg.cpp @@ -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); } -- cgit v1.2.3