diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-02-16 18:29:47 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-02-16 18:30:14 +0300 |
commit | b82538d3b77e4b9fe3791059fef2e604d56f747f (patch) | |
tree | 4e1836e8ccb3e94f07b474fd7795fc7fe68e5214 | |
parent | 4f8e05188321e73457cfaa6fde04b1d1e1fa270f (diff) |
Make game engine ready for FFmpeg-3.0 as well
-rw-r--r-- | source/gameengine/VideoTexture/VideoFFmpeg.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
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); } |