Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 1f6672ec authored by SPINDLER Fabien's avatar SPINDLER Fabien Committed by Thomas Moulard
Browse files

Add patch to fix build issues with ffmpeg libraries

parent ce5b7a13
No related branches found
No related tags found
No related merge requests found
From 3f2be63a8fc682bc41ccb36b79005d15eca842ac Mon Sep 17 00:00:00 2001
From: Fabien Spindler <Fabien.Spindler@inria.fr>
Date: Sun, 1 Jun 2014 21:57:17 +0200
Subject: [PATCH] Install vpConfig.h in include architecture triplet
Subject: [PATCH 1/2] Install vpConfig.h in include architecture triplet
---
CMakeLists.txt | 2 +-
......
From 590cba1ca215a798327f589aad02d041c6ca28b5 Mon Sep 17 00:00:00 2001
From: Fabien Spindler <Fabien.Spindler@inria.fr>
Date: Tue, 3 Jun 2014 15:45:32 +0200
Subject: [PATCH 2/2] Fix compat with ffmpeg libraries
---
src/video/vpFFMPEG.cpp | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/src/video/vpFFMPEG.cpp b/src/video/vpFFMPEG.cpp
index 744d873..83429c4 100644
--- a/src/video/vpFFMPEG.cpp
+++ b/src/video/vpFFMPEG.cpp
@@ -134,8 +134,13 @@ bool vpFFMPEG::openStream(const char *filename, vpFFMPEGColorType colortype)
{
videoStream = i;
//std::cout << "rate: " << pFormatCtx->streams[i]->r_frame_rate.num << " " << pFormatCtx->streams[i]->r_frame_rate.den << std::endl;
+#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(55,12,0)
framerate_stream = pFormatCtx->streams[i]->r_frame_rate.num;
framerate_stream /= pFormatCtx->streams[i]->r_frame_rate.den;
+#else
+ framerate_stream = pFormatCtx->streams[i]->avg_frame_rate.num;
+ framerate_stream /= pFormatCtx->streams[i]->avg_frame_rate.den;
+#endif
found_codec= true;
break;
}
@@ -162,11 +167,19 @@ bool vpFFMPEG::openStream(const char *filename, vpFFMPEGColorType colortype)
return false; // Could not open codec
}
+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55,34,0)
pFrame = avcodec_alloc_frame();
-
+#else
+ pFrame = av_frame_alloc(); // libavcodec 55.34.1
+#endif
+
if (color_type == vpFFMPEG::COLORED)
{
+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55,34,0)
pFrameRGB=avcodec_alloc_frame();
+#else
+ pFrameRGB=av_frame_alloc(); // libavcodec 55.34.1
+#endif
if (pFrameRGB == NULL)
return false;
@@ -176,7 +189,11 @@ bool vpFFMPEG::openStream(const char *filename, vpFFMPEGColorType colortype)
else if (color_type == vpFFMPEG::GRAY_SCALED)
{
+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55,34,0)
pFrameGRAY=avcodec_alloc_frame();
+#else
+ pFrameGRAY=av_frame_alloc(); // libavcodec 55.34.1
+#endif
if (pFrameGRAY == NULL)
return false;
@@ -666,8 +683,14 @@ bool vpFFMPEG::openEncoder(const char *filename, unsigned int w, unsigned int h,
#else
pCodecCtx = avcodec_alloc_context3(NULL);
#endif
+
+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55,34,0)
pFrame = avcodec_alloc_frame();
pFrameRGB = avcodec_alloc_frame();
+#else
+ pFrame = av_frame_alloc(); // libavcodec 55.34.1
+ pFrameRGB = av_frame_alloc(); // libavcodec 55.34.1
+#endif
/* put sample parameters */
pCodecCtx->bit_rate = (int)bit_rate;
--
1.9.1
0001-Install-vpConfig.h-in-include-architecture-triplet.patch
0002-Fix-compat-with-ffmpeg-libraries.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment