[Bf-blender-cvs] [b82538d] master: Make game engine ready for FFmpeg-3.0 as well

Sergey Sharybin noreply at git.blender.org
Tue Feb 16 16:52:18 CET 2016


Commit: b82538d3b77e4b9fe3791059fef2e604d56f747f
Author: Sergey Sharybin
Date:   Tue Feb 16 16:29:47 2016 +0100
Branches: master
https://developer.blender.org/rBb82538d3b77e4b9fe3791059fef2e604d56f747f

Make game engine ready for FFmpeg-3.0 as well

===================================================================

M	source/gameengine/VideoTexture/VideoFFmpeg.cpp

===================================================================

diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.cpp b/source/gameengine/VideoTexture/VideoFFmpeg.cpp
index 41ace25..5fed121 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);
 	}




More information about the Bf-blender-cvs mailing list