Control: tags -1 + pending pending

The commit mentioned by Reinhard is not enough for 5.8.0. Fortunately,
all changes for vtk to build against libav 9 can be found in upstream's
repository. I've backported the commits
bc976d74591a6f2c8a1e62f1c54691c281d21e00,
52a07b454b93c14b7b0f51e9e71ae7b2b2d525fe,
1967fef7709dccb5adaa6ac7f780a2e95f327c78,
d48033e127b208228b46f820d454c5eca1c719e1 and prepared an NMU since vtk
vtk is involved in three ongoing transitions.

Here comes the usual nmudiff text:


Dear maintainer,

I've prepared an NMU for vtk (versioned as 5.8.0-14.1) and
uploaded it to DELAYED/2. Please feel free to tell me if I
should delay it longer.

Regards
-- 
Sebastian Ramacher
diff -Nru vtk-5.8.0/debian/changelog vtk-5.8.0/debian/changelog
--- vtk-5.8.0/debian/changelog	2013-07-09 08:42:22.000000000 +0200
+++ vtk-5.8.0/debian/changelog	2013-08-23 15:28:19.000000000 +0200
@@ -1,3 +1,11 @@
+vtk (5.8.0-14.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * debian/patches/libav9.patch: Backport patches from upstream to fix
+    compilation with libav 9. (Closes: #693639)
+
+ -- Sebastian Ramacher <sramac...@debian.org>  Fri, 23 Aug 2013 15:28:14 +0200
+
 vtk (5.8.0-14) unstable; urgency=low
 
   [ Mathieu Malaterre ]
diff -Nru vtk-5.8.0/debian/patches/libav9.patch vtk-5.8.0/debian/patches/libav9.patch
--- vtk-5.8.0/debian/patches/libav9.patch	1970-01-01 01:00:00.000000000 +0100
+++ vtk-5.8.0/debian/patches/libav9.patch	2013-08-23 15:18:07.000000000 +0200
@@ -0,0 +1,190 @@
+Description: Fix compilation with libav 9
+Origin: upstream,
+ http://vtk.org/gitweb?p=VTK.git;a=commitdiff;h=bc976d74591a6f2c8a1e62f1c54691c281d21e00,
+ http://vtk.org/gitweb?p=VTK.git;a=commitdiff;h=52a07b454b93c14b7b0f51e9e71ae7b2b2d525fe,
+ http://vtk.org/gitweb?p=VTK.git;a=commitdiff;h=1967fef7709dccb5adaa6ac7f780a2e95f327c78,
+ http://vtk.org/gitweb?p=VTK.git;a=commitdiff;h=d48033e127b208228b46f820d454c5eca1c719e1
+Bug-Debian: http://bugs.debian.org/693639
+Last-Update: 2013-08-23
+
+--- a/IO/vtkFFMPEGWriter.cxx
++++ b/IO/vtkFFMPEGWriter.cxx
+@@ -60,8 +60,10 @@
+ 
+   AVStream *avStream;
+ 
++#if LIBAVFORMAT_VERSION_MAJOR < 54
+   unsigned char *codecBuf;
+   int codecBufSize;
++#endif
+ 
+   AVFrame *rgbInput;
+   AVFrame *yuvOutput;
+@@ -83,7 +85,9 @@
+ 
+   this->avStream = NULL;
+ 
++#if LIBAVFORMAT_VERSION_MAJOR < 54
+   this->codecBuf = NULL;
++#endif
+   this->rgbInput = NULL;
+   this->yuvOutput = NULL;
+ 
+@@ -111,7 +115,7 @@
+   av_register_all();
+ 
+   //create the format context that wraps all of the media output structures
+-#ifdef VTK_FFMPEG_NEW_ALLOC
++#if LIBAVFORMAT_VERSION_MAJOR >= 52
+   this->avFormatContext = avformat_alloc_context();
+ #else
+   this->avFormatContext = av_alloc_format_context();
+@@ -140,7 +144,11 @@
+   strcpy(this->avFormatContext->filename, this->Writer->GetFileName());
+ 
+   //create a stream for that file
++#if LIBAVFORMAT_VERSION_MAJOR < 54
+   this->avStream = av_new_stream(this->avFormatContext, 0);
++#else
++  this->avStream = avformat_new_stream(this->avFormatContext, 0);
++#endif
+   if (!this->avStream) 
+     {
+     vtkGenericWarningMacro (<< "Could not create video stream.");
+@@ -191,13 +199,14 @@
+     {
+     c->bit_rate_tolerance = this->Writer->GetBitRateTolerance();
+     }
+-
++#if LIBAVFORMAT_VERSION_MAJOR < 54
+   //apply the chosen parameters
+   if (av_set_parameters(this->avFormatContext, NULL) < 0)
+     {
+     vtkGenericWarningMacro (<< "Invalid output format parameters." );
+     return 0;
+     }
++#endif
+ 
+   //manufacture a codec with the chosen parameters
+   AVCodec *codec = avcodec_find_encoder(c->codec_id);
+@@ -206,7 +215,11 @@
+     vtkGenericWarningMacro (<< "Codec not found." );
+     return 0;
+     }
++#if LIBAVFORMAT_VERSION_MAJOR < 54
+   if (avcodec_open(c, codec) < 0) 
++#else
++  if (avcodec_open2(c, codec, NULL) < 0)
++#endif
+     {
+     vtkGenericWarningMacro (<< "Could not open codec.");
+     return 0;
+@@ -214,6 +227,7 @@
+ 
+   //create buffers for the codec to work with.
+ 
++#if LIBAVFORMAT_VERSION_MAJOR < 54
+   //working compression space
+   this->codecBufSize = 2*c->width*c->height*4; //hopefully this is enough
+   this->codecBuf = new unsigned char[this->codecBufSize];
+@@ -222,6 +236,7 @@
+     vtkGenericWarningMacro (<< "Could not make codec working space." );
+     return 0;
+     }
++#endif
+ 
+   //for the output of the writer's input...
+   this->rgbInput = avcodec_alloc_frame();
+@@ -259,14 +274,22 @@
+ 
+ 
+   //Finally, open the file and start it off.
+-  if (url_fopen(&this->avFormatContext->pb, this->avFormatContext->filename, URL_WRONLY) < 0) 
++#if LIBAVFORMAT_VERSION_MAJOR < 54
++   if (url_fopen(&this->avFormatContext->pb, this->avFormatContext->filename, URL_WRONLY) < 0)
++#else
++  if (avio_open(&this->avFormatContext->pb, this->avFormatContext->filename, AVIO_FLAG_WRITE) < 0)
++#endif
+     {
+     vtkGenericWarningMacro (<< "Could not open " << this->Writer->GetFileName() << "." );
+     return 0;
+     }
+   this->openedFile = 1;
+ 
++#if LIBAVFORMAT_VERSION_MAJOR < 54
+   av_write_header(this->avFormatContext);
++#else
++  avformat_write_header(this->avFormatContext, NULL);
++#endif
+   return 1;
+ }
+ 
+@@ -321,8 +344,13 @@
+     }
+ #endif
+ 
++#if LIBAVFORMAT_VERSION_MAJOR >= 54
++  AVPacket pkt = { 0 };
++  int got_frame;
++#endif
+ 
+   //run the encoder
++#if LIBAVFORMAT_VERSION_MAJOR < 54
+   int toAdd = avcodec_encode_video(cc, 
+                                    this->codecBuf, 
+                                    this->codecBufSize, 
+@@ -357,6 +385,26 @@
+     return 0;
+     }
+ 
++#else
++  int ret = avcodec_encode_video2(cc,
++                                  &pkt,
++                                  this->yuvOutput,
++                                  &got_frame);
++
++  //dump the compressed result to file
++  if (got_frame)
++    {
++    pkt.stream_index = this->avStream->index;
++    ret = av_write_frame(this->avFormatContext, &pkt);
++    }
++
++  if (ret<0)
++    {
++    vtkGenericWarningMacro (<< "Problem encoding frame." );
++    return 0;
++    }
++#endif
++
+   return 1;
+ }
+ 
+@@ -377,21 +425,25 @@
+     this->rgbInput = NULL;
+     }
+   
++#if LIBAVFORMAT_VERSION_MAJOR < 54
+   if (this->codecBuf)
+     {
+     av_free(this->codecBuf);
+     this->codecBuf = NULL;
+     }
++#endif
+ 
+   if (this->avFormatContext)
+     {          
+     if (this->openedFile)
+       {
+       av_write_trailer(this->avFormatContext);
+-#ifdef VTK_FFMPEG_OLD_URL_FCLOSE
++#if VTK_FFMPEG_OLD_URL_FCLOSE
+       url_fclose(&this->avFormatContext->pb);
+-#else
++#elif LIBAVFORMAT_VERSION_MAJOR < 54
+       url_fclose(this->avFormatContext->pb);
++#else
++      avio_close(this->avFormatContext->pb);
+ #endif
+       this->openedFile = 0;
+       }
diff -Nru vtk-5.8.0/debian/patches/series vtk-5.8.0/debian/patches/series
--- vtk-5.8.0/debian/patches/series	2013-07-09 08:36:58.000000000 +0200
+++ vtk-5.8.0/debian/patches/series	2013-08-23 14:38:05.000000000 +0200
@@ -1 +1,2 @@
 allpatches.patch
+libav9.patch

Attachment: signature.asc
Description: Digital signature

Reply via email to