summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-06-05 01:21:35 +0000
committerLuca Barbato <lu_zero@gentoo.org>2013-06-05 01:21:35 +0000
commitdf4fb9d8d35505c37769d5f325f8d8ca96edea61 (patch)
treed9a68fac0683aff894f82c84f4c9b51101b2270a /sci-libs/vtk
parentversion bump wrt #472146 (diff)
downloadgentoo-2-df4fb9d8d35505c37769d5f325f8d8ca96edea61.tar.gz
gentoo-2-df4fb9d8d35505c37769d5f325f8d8ca96edea61.tar.bz2
gentoo-2-df4fb9d8d35505c37769d5f325f8d8ca96edea61.zip
libav 9 (and upcoming 10) support
(Portage version: 2.1.11.63/cvs/Linux x86_64, unsigned Manifest commit)
Diffstat (limited to 'sci-libs/vtk')
-rw-r--r--sci-libs/vtk/ChangeLog6
-rw-r--r--sci-libs/vtk/files/vtk-5.10.1-libav-9.patch117
-rw-r--r--sci-libs/vtk/vtk-5.10.1.ebuild3
3 files changed, 124 insertions, 2 deletions
diff --git a/sci-libs/vtk/ChangeLog b/sci-libs/vtk/ChangeLog
index 852afdc84a92..aeff9f1a92fa 100644
--- a/sci-libs/vtk/ChangeLog
+++ b/sci-libs/vtk/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for sci-libs/vtk
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sci-libs/vtk/ChangeLog,v 1.107 2013/03/02 23:24:14 hwoarang Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-libs/vtk/ChangeLog,v 1.108 2013/06/05 01:21:35 lu_zero Exp $
+
+ 05 Jun 2013; Luca Barbato <lu_zero@gentoo.org> vtk-5.10.1.ebuild,
+ +files/vtk-5.10.1-libav-9.patch:
+ libav 9 (and upcoming 10) support.
02 Mar 2013; Markos Chandras <hwoarang@gentoo.org> vtk-5.10.0.ebuild,
vtk-5.10.1.ebuild:
diff --git a/sci-libs/vtk/files/vtk-5.10.1-libav-9.patch b/sci-libs/vtk/files/vtk-5.10.1-libav-9.patch
new file mode 100644
index 000000000000..eb7b71c5ec9e
--- /dev/null
+++ b/sci-libs/vtk/files/vtk-5.10.1-libav-9.patch
@@ -0,0 +1,117 @@
+diff -burN VTK5.10.1.old/IO/vtkFFMPEGWriter.cxx VTK5.10.1/IO/vtkFFMPEGWriter.cxx
+--- VTK5.10.1.old/IO/vtkFFMPEGWriter.cxx 2013-05-25 01:26:52.768954436 +0200
++++ VTK5.10.1/IO/vtkFFMPEGWriter.cxx 2013-05-25 11:13:53.112672449 +0200
+@@ -60,9 +60,6 @@
+
+ AVStream *avStream;
+
+- unsigned char *codecBuf;
+- int codecBufSize;
+-
+ AVFrame *rgbInput;
+ AVFrame *yuvOutput;
+
+@@ -83,7 +80,6 @@
+
+ this->avStream = NULL;
+
+- this->codecBuf = NULL;
+ this->rgbInput = NULL;
+ this->yuvOutput = NULL;
+
+@@ -140,7 +136,7 @@
+ strcpy(this->avFormatContext->filename, this->Writer->GetFileName());
+
+ //create a stream for that file
+- this->avStream = av_new_stream(this->avFormatContext, 0);
++ this->avStream = avformat_new_stream(this->avFormatContext, NULL);
+ if (!this->avStream)
+ {
+ vtkGenericWarningMacro (<< "Could not create video stream.");
+@@ -199,7 +195,7 @@
+ vtkGenericWarningMacro (<< "Codec not found." );
+ return 0;
+ }
+- if (avcodec_open(c, codec) < 0)
++ if (avcodec_open2(c, codec, NULL) < 0)
+ {
+ vtkGenericWarningMacro (<< "Could not open codec.");
+ return 0;
+@@ -207,15 +203,6 @@
+
+ //create buffers for the codec to work with.
+
+- //working compression space
+- this->codecBufSize = 2*c->width*c->height*4; //hopefully this is enough
+- this->codecBuf = new unsigned char[this->codecBufSize];
+- if (!this->codecBuf)
+- {
+- vtkGenericWarningMacro (<< "Could not make codec working space." );
+- return 0;
+- }
+-
+ //for the output of the writer's input...
+ this->rgbInput = avcodec_alloc_frame();
+ if (!this->rgbInput)
+@@ -316,38 +303,24 @@
+ return 0;
+ }
+ #endif
+-
++ AVPacket pkt = { 0 };
++ int got_frame;
+
+ //run the encoder
+- int toAdd = avcodec_encode_video(cc,
+- this->codecBuf,
+- this->codecBufSize,
+- this->yuvOutput);
++ int ret = avcodec_encode_video2(cc,
++ &pkt,
++ this->yuvOutput,
++ &got_frame);
+
+ //dump the compressed result to file
+- if (toAdd)
++ if (got_frame)
+ {
+- //create an avpacket to output the compressed result
+- AVPacket pkt;
+- av_init_packet(&pkt);
+-
+- //to do playback at actual recorded rate, this will need more work
+- pkt.pts = cc->coded_frame->pts;
+- //pkt.dts = ?; not dure what decompression time stamp should be
+- pkt.data = this->codecBuf;
+- pkt.size = toAdd;
+ pkt.stream_index = this->avStream->index;
+- if (cc->coded_frame->key_frame) //treat keyframes well
+- {
+- pkt.flags |= AV_PKT_FLAG_KEY;
+- }
+- pkt.duration = 0; //presentation duration in time_base units or 0 if NA
+- pkt.pos = -1; //byte position in stream or -1 if NA
+
+- toAdd = av_write_frame(this->avFormatContext, &pkt);
++ ret = av_write_frame(this->avFormatContext, &pkt);
+ }
+
+- if (toAdd) //should not have anything left over
++ if (ret < 0) //should not have anything left over
+ {
+ vtkGenericWarningMacro (<< "Problem encoding frame." );
+ return 0;
+@@ -373,12 +346,6 @@
+ this->rgbInput = NULL;
+ }
+
+- if (this->codecBuf)
+- {
+- av_free(this->codecBuf);
+- this->codecBuf = NULL;
+- }
+-
+ if (this->avFormatContext)
+ {
+ if (this->openedFile)
+Binary files VTK5.10.1.old/IO/.vtkFFMPEGWriter.cxx.swp and VTK5.10.1/IO/.vtkFFMPEGWriter.cxx.swp differ
diff --git a/sci-libs/vtk/vtk-5.10.1.ebuild b/sci-libs/vtk/vtk-5.10.1.ebuild
index 8577593e41bc..ee94421a37ea 100644
--- a/sci-libs/vtk/vtk-5.10.1.ebuild
+++ b/sci-libs/vtk/vtk-5.10.1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sci-libs/vtk/vtk-5.10.1.ebuild,v 1.6 2013/03/02 23:24:14 hwoarang Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-libs/vtk/vtk-5.10.1.ebuild,v 1.7 2013/06/05 01:21:35 lu_zero Exp $
EAPI=3
@@ -78,6 +78,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-5.6.1-libav-0.8.patch
"${FILESDIR}"/${P}-tcl8.6.patch
"${FILESDIR}"/${P}-ffmpeg-1.patch
+ "${FILESDIR}"/${P}-libav-9.patch
)
pkg_setup() {