[vtk6] 02/03: Add support for FFmpeg 2.9. (Closes: #803869)

Anton Gladky gladk at moszumanska.debian.org
Sun Dec 20 17:47:31 UTC 2015


This is an automated email from the git hooks/post-receive script.

gladk pushed a commit to branch master
in repository vtk6.

commit 8c4dcf0bf912202989f16e60d8e1ef90ade0d084
Author: Andreas Cadhalpun <andreas.cadhalpun at googlemail.com>
Date:   Sun Dec 20 17:53:43 2015 +0100

    Add support for FFmpeg 2.9. (Closes: #803869)
---
 debian/patches/95_ffmpeg_2.9.patch | 94 ++++++++++++++++++++++++++++++++++++++
 debian/patches/series              |  1 +
 2 files changed, 95 insertions(+)

diff --git a/debian/patches/95_ffmpeg_2.9.patch b/debian/patches/95_ffmpeg_2.9.patch
new file mode 100644
index 0000000..e2394ba
--- /dev/null
+++ b/debian/patches/95_ffmpeg_2.9.patch
@@ -0,0 +1,94 @@
+Description: Replace deprecated FFmpeg API
+Author: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
+Last-Update: <2015-11-02>
+
+--- vtk6-6.2.0+dfsg1.orig/CMake/vtkTestFFMPEG.cmake
++++ vtk6-6.2.0+dfsg1/CMake/vtkTestFFMPEG.cmake
+@@ -32,8 +32,8 @@ if(FFMPEG_INCLUDE_DIR)
+ #include <${FFMEG_CODEC_HEADER_PATH}/avcodec.h>
+ int main()
+ {
+-  img_convert(0, PIX_FMT_RGB24,
+-              0, PIX_FMT_RGB24,
++  img_convert(0, AV_PIX_FMT_RGB24,
++              0, AV_PIX_FMT_RGB24,
+               0, 0);
+   return 0;
+ }\n")
+--- vtk6-6.2.0+dfsg1.orig/IO/FFMPEG/vtkFFMPEGWriter.cxx
++++ vtk6-6.2.0+dfsg1/IO/FFMPEG/vtkFFMPEGWriter.cxx
+@@ -189,11 +189,11 @@ int vtkFFMPEGWriterInternal::Start()
+   c->height = this->Dim[1];
+   if (this->Writer->GetCompression())
+     {
+-    c->pix_fmt = PIX_FMT_YUVJ422P;
++    c->pix_fmt = AV_PIX_FMT_YUVJ422P;
+     }
+   else
+     {
+-    c->pix_fmt = PIX_FMT_BGR24;
++    c->pix_fmt = AV_PIX_FMT_BGR24;
+     }
+ 
+   //to do playback at actual recorded rate, this will need more work see also below
+@@ -272,13 +272,13 @@ int vtkFFMPEGWriterInternal::Start()
+ #endif
+ 
+   //for the output of the writer's input...
+-  this->rgbInput = avcodec_alloc_frame();
++  this->rgbInput = av_frame_alloc();
+   if (!this->rgbInput)
+     {
+     vtkGenericWarningMacro (<< "Could not make rgbInput avframe." );
+     return 0;
+     }
+-  int RGBsize = avpicture_get_size(PIX_FMT_RGB24, c->width, c->height);
++  int RGBsize = avpicture_get_size(AV_PIX_FMT_RGB24, c->width, c->height);
+   unsigned char *rgb = (unsigned char *)av_malloc(sizeof(unsigned char) * RGBsize);
+   if (!rgb)
+     {
+@@ -286,10 +286,10 @@ int vtkFFMPEGWriterInternal::Start()
+     return 0;
+     }
+   //The rgb buffer should get deleted when this->rgbInput is.
+-  avpicture_fill((AVPicture *)this->rgbInput, rgb, PIX_FMT_RGB24, c->width, c->height);
++  avpicture_fill((AVPicture *)this->rgbInput, rgb, AV_PIX_FMT_RGB24, c->width, c->height);
+ 
+   //and for the output to the codec's input.
+-  this->yuvOutput = avcodec_alloc_frame();
++  this->yuvOutput = av_frame_alloc();
+   if (!this->yuvOutput)
+     {
+     vtkGenericWarningMacro (<< "Could not make yuvOutput avframe." );
+@@ -347,12 +347,12 @@ int vtkFFMPEGWriterInternal::Write(vtkIm
+   //convert that to YUV for input to the codec
+ #ifdef VTK_FFMPEG_HAS_IMG_CONVERT
+   img_convert((AVPicture *)this->yuvOutput, cc->pix_fmt,
+-              (AVPicture *)this->rgbInput, PIX_FMT_RGB24,
++              (AVPicture *)this->rgbInput, AV_PIX_FMT_RGB24,
+               cc->width, cc->height);
+ #else
+   //convert that to YUV for input to the codec
+   SwsContext* convert_ctx = sws_getContext(
+-    cc->width, cc->height, PIX_FMT_RGB24,
++    cc->width, cc->height, AV_PIX_FMT_RGB24,
+     cc->width, cc->height, cc->pix_fmt,
+     SWS_BICUBIC, NULL, NULL, NULL);
+ 
+@@ -445,14 +445,14 @@ void vtkFFMPEGWriterInternal::End()
+   if (this->yuvOutput)
+     {
+     av_free(this->yuvOutput->data[0]);
+-    av_free(this->yuvOutput);
++    av_frame_free(&this->yuvOutput);
+     this->yuvOutput = NULL;
+     }
+ 
+   if (this->rgbInput)
+     {
+     av_free(this->rgbInput->data[0]);
+-    av_free(this->rgbInput);
++    av_frame_free(&this->rgbInput);
+     this->rgbInput = NULL;
+     }
+ 
diff --git a/debian/patches/series b/debian/patches/series
index b9f2a86..23a2c92 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,4 @@
 70_fix_ftbfs_gcc49.patch
 80_fix_arm_compilation.patch
 90_gdal-2.0.patch
+95_ffmpeg_2.9.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/vtk6.git



More information about the debian-science-commits mailing list