From 1f6672ec9153cf2859b5b205aa065f269ac89904 Mon Sep 17 00:00:00 2001 From: Fabien Spindler <Fabien.Spindler@inria.fr> Date: Tue, 3 Jun 2014 16:12:09 +0200 Subject: [PATCH] Add patch to fix build issues with ffmpeg libraries --- ...ig.h-in-include-architecture-triplet.patch | 2 +- ...002-Fix-compat-with-ffmpeg-libraries.patch | 78 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 debian/patches/0002-Fix-compat-with-ffmpeg-libraries.patch diff --git a/debian/patches/0001-Install-vpConfig.h-in-include-architecture-triplet.patch b/debian/patches/0001-Install-vpConfig.h-in-include-architecture-triplet.patch index 38f0fd0a..c9cc60e8 100644 --- a/debian/patches/0001-Install-vpConfig.h-in-include-architecture-triplet.patch +++ b/debian/patches/0001-Install-vpConfig.h-in-include-architecture-triplet.patch @@ -1,7 +1,7 @@ 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 +- diff --git a/debian/patches/0002-Fix-compat-with-ffmpeg-libraries.patch b/debian/patches/0002-Fix-compat-with-ffmpeg-libraries.patch new file mode 100644 index 00000000..d395267e --- /dev/null +++ b/debian/patches/0002-Fix-compat-with-ffmpeg-libraries.patch @@ -0,0 +1,78 @@ +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 + diff --git a/debian/patches/series b/debian/patches/series index 232426fb..0eb4519c 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ 0001-Install-vpConfig.h-in-include-architecture-triplet.patch +0002-Fix-compat-with-ffmpeg-libraries.patch -- GitLab