public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Tomas Chvatal" <scarabeus@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/kde:master commit in: media-libs/opencv/files/, media-libs/opencv/
Date: Sat, 30 Apr 2011 10:28:37 +0000 (UTC)	[thread overview]
Message-ID: <acff45fa76fe64db12cd15ab502080cb5c54b954.scarabeus@gentoo> (raw)

commit:     acff45fa76fe64db12cd15ab502080cb5c54b954
Author:     Tomas Chvatal <scarabeus <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 30 10:28:07 2011 +0000
Commit:     Tomas Chvatal <scarabeus <AT> gentoo <DOT> org>
CommitDate: Sat Apr 30 10:28:07 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/kde.git;a=commit;h=acff45fa

[media-libs/opencv] Fix building with latest ffmpegs and make tests do something.

---
 media-libs/opencv/files/2.2.0-ffmpeg01.patch |  104 ++++++++++++++++++++++++++
 media-libs/opencv/files/2.2.0-ffmpeg02.patch |   57 ++++++++++++++
 media-libs/opencv/opencv-2.2.0.ebuild        |   13 +++-
 3 files changed, 171 insertions(+), 3 deletions(-)

diff --git a/media-libs/opencv/files/2.2.0-ffmpeg01.patch b/media-libs/opencv/files/2.2.0-ffmpeg01.patch
new file mode 100644
index 0000000..4a5392f
--- /dev/null
+++ b/media-libs/opencv/files/2.2.0-ffmpeg01.patch
@@ -0,0 +1,104 @@
+Index: D:/WaterWATCH/dev/opencv/modules/highgui/src/cap_ffmpeg.cpp
+===================================================================
+--- D:/WaterWATCH/dev/opencv/modules/highgui/src/cap_ffmpeg.cpp	(revision 2112)
++++ D:/WaterWATCH/dev/opencv/modules/highgui/src/cap_ffmpeg.cpp	(revision 2113)
+@@ -466,7 +466,7 @@
+         AVCodecContext *enc = &ic->streams[i]->codec;
+ #endif
+ 
+-        if( CODEC_TYPE_VIDEO == enc->codec_type && video_stream < 0) {
++        if( AVMEDIA_TYPE_VIDEO == enc->codec_type && video_stream < 0) {
+             AVCodec *codec = avcodec_find_decoder(enc->codec_id);
+             if (!codec ||
+             avcodec_open(enc, codec) < 0)
+@@ -550,15 +550,27 @@
+ 		        continue;
+     		}
+ 
+-#if LIBAVFORMAT_BUILD > 4628
+-        avcodec_decode_video(video_st->codec,
+-                             picture, &got_picture,
+-                             packet.data, packet.size);
+-#else
+-        avcodec_decode_video(&video_st->codec,
+-                             picture, &got_picture,
+-                             packet.data, packet.size);
+-#endif
++
++		AVPacket avpkt;
++		av_init_packet(&avpkt);
++		avpkt.data = packet.data;
++		avpkt.size = packet.size;
++		//
++		// HACK for CorePNG to decode as normal PNG by default
++		// same method used by ffmpeg
++		avpkt.flags = AV_PKT_FLAG_KEY;
++		avcodec_decode_video2(video_st->codec,
++                              picture, &got_picture, &avpkt);
++//Functions Removed from ffmpeg on 4/19/11
++//#if LIBAVFORMAT_BUILD > 4628
++//        avcodec_decode_video(video_st->codec,
++//                             picture, &got_picture,
++//                             packet.data, packet.size);
++//#else
++//        avcodec_decode_video(&video_st->codec,
++//                             picture, &got_picture,
++//                             packet.data, packet.size);
++//#endif
+ 
+         if (got_picture) {
+             // we have a new picture, so memorize it
+@@ -899,7 +911,7 @@
+ #endif
+ 
+ #if LIBAVFORMAT_BUILD > 4621
+-	c->codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, CODEC_TYPE_VIDEO);
++	c->codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, AVMEDIA_TYPE_VIDEO);
+ #else
+ 	c->codec_id = oc->oformat->video_codec;
+ #endif
+@@ -911,7 +923,7 @@
+     //if(codec_tag) c->codec_tag=codec_tag;
+ 	codec = avcodec_find_encoder(c->codec_id);
+ 
+-	c->codec_type = CODEC_TYPE_VIDEO;
++	c->codec_type = AVMEDIA_TYPE_VIDEO;
+ 
+ 	/* put sample parameters */
+ 	c->bit_rate = bitrate;
+@@ -998,7 +1010,7 @@
+         AVPacket pkt;
+         av_init_packet(&pkt);
+ 
+-        pkt.flags |= PKT_FLAG_KEY;
++        pkt.flags |= AV_PKT_FLAG_KEY;
+         pkt.stream_index= video_st->index;
+         pkt.data= (uint8_t *)picture;
+         pkt.size= sizeof(AVPicture);
+@@ -1018,7 +1030,7 @@
+ 			pkt.pts = c->coded_frame->pts;
+ #endif
+             if(c->coded_frame->key_frame)
+-                pkt.flags |= PKT_FLAG_KEY;
++                pkt.flags |= AV_PKT_FLAG_KEY;
+             pkt.stream_index= video_st->index;
+             pkt.data= outbuf;
+             pkt.size= out_size;
+@@ -1215,7 +1227,7 @@
+ 	av_register_all ();
+ 
+ 	/* auto detect the output format from the name and fourcc code. */
+-	fmt = guess_format(NULL, filename, NULL);
++	fmt = av_guess_format(NULL, filename, NULL);
+ 	if (!fmt)
+         return false;
+ 
+@@ -1238,7 +1250,7 @@
+ #endif
+ 
+     // alloc memory for context
+-	oc = av_alloc_format_context();
++	oc = avformat_alloc_context();
+ 	assert (oc);
+ 
+ 	/* set file name */

diff --git a/media-libs/opencv/files/2.2.0-ffmpeg02.patch b/media-libs/opencv/files/2.2.0-ffmpeg02.patch
new file mode 100644
index 0000000..a0c5787
--- /dev/null
+++ b/media-libs/opencv/files/2.2.0-ffmpeg02.patch
@@ -0,0 +1,57 @@
+Index: D:/WaterWATCH/dev/opencv/modules/highgui/src/cap_ffmpeg.cpp
+===================================================================
+--- D:/WaterWATCH/dev/opencv/modules/highgui/src/cap_ffmpeg.cpp	(revision 2121)
++++ D:/WaterWATCH/dev/opencv/modules/highgui/src/cap_ffmpeg.cpp	(revision 2122)
+@@ -815,24 +815,25 @@
+ #endif
+ };
+ 
+-static const char * icvFFMPEGErrStr(int err)
+-{
+-    switch(err) {
+-    case AVERROR_NUMEXPECTED:
+-		return "Incorrect filename syntax";
+-    case AVERROR_INVALIDDATA:
+-		return "Invalid data in header";
+-    case AVERROR_NOFMT:
+-		return "Unknown format";
+-    case AVERROR_IO:
+-		return "I/O error occurred";
+-    case AVERROR_NOMEM:
+-		return "Memory allocation error";
+-    default:
+-		break;
+-    }
+-  	return "Unspecified error";
+-}
++//Deprecated Errors, should be using AVERROR(EINVAL) to return error strings
++//static const char * icvFFMPEGErrStr(int err)
++//{
++//    switch(err) {
++//    case AVERROR_NUMEXPECTED:
++//		return "Incorrect filename syntax";
++//    case AVERROR_INVALIDDATA:
++//		return "Invalid data in header";
++//    case AVERROR_NOFMT:
++//		return "Unknown format";
++//    case AVERROR_IO:
++//		return "I/O error occurred";
++//    case AVERROR_NOMEM:
++//		return "Memory allocation error";
++//    default:
++//		break;
++//    }
++//  	return "Unspecified error";
++//}
+ 
+ /* function internal to FFMPEG (libavformat/riff.c) to lookup codec id by fourcc tag*/
+ extern "C" {
+@@ -1322,7 +1323,7 @@
+     /* open the codec */
+     if ( (err=avcodec_open(c, codec)) < 0) {
+ 		char errtext[256];
+-		sprintf(errtext, "Could not open codec '%s': %s", codec->name, icvFFMPEGErrStr(err));
++		sprintf(errtext, "Could not open codec '%s': %s", codec->name, AVERROR(EINVAL));
+ 		CV_Error(CV_StsBadArg, errtext);
+     }
+ 

diff --git a/media-libs/opencv/opencv-2.2.0.ebuild b/media-libs/opencv/opencv-2.2.0.ebuild
index 0b4465f..f2890d4 100644
--- a/media-libs/opencv/opencv-2.2.0.ebuild
+++ b/media-libs/opencv/opencv-2.2.0.ebuild
@@ -61,12 +61,14 @@ DEPEND="${RDEPEND}
 
 PATCHES=(
 	"${FILESDIR}/${PV}-convert_sets_to_options.patch"
+	"${FILESDIR}/${PV}-ffmpeg01.patch"
+	"${FILESDIR}/${PV}-ffmpeg02.patch"
 	"${FILESDIR}/${PV}-gcc46.patch"
-	"${FILESDIR}/${PV}-ptrcvcapture.patch"
-	"${FILESDIR}/${PV}-v4l_2.6.38.patch"
-	"${FILESDIR}/${PV}-use_system_libs.patch"
 	"${FILESDIR}/${PV}-libpng1.5.patch"
 	"${FILESDIR}/${PV}-numpy.patch"
+	"${FILESDIR}/${PV}-ptrcvcapture.patch"
+	"${FILESDIR}/${PV}-use_system_libs.patch"
+	"${FILESDIR}/${PV}-v4l_2.6.38.patch"
 )
 
 S=${WORKDIR}/${MY_P}
@@ -151,3 +153,8 @@ src_configure() {
 
 	cmake-utils_src_configure
 }
+
+src_test() {
+	export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${CMAKE_BUILD_DIR}/lib"
+	cmake-utils_src_test
+}



             reply	other threads:[~2011-04-30 10:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-30 10:28 Tomas Chvatal [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-04-30 19:57 [gentoo-commits] proj/kde:master commit in: media-libs/opencv/files/, media-libs/opencv/ Andreas K. Huettel
2011-04-30  9:59 Tomas Chvatal
2011-04-30  9:20 Tomas Chvatal
2011-04-29 22:09 Tomas Chvatal
2011-04-29 21:43 Tomas Chvatal
2011-04-29 20:00 Tomas Chvatal
2011-04-29 19:39 Tomas Chvatal
2011-04-29 19:25 Tomas Chvatal
2011-04-29 19:08 Tomas Chvatal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=acff45fa76fe64db12cd15ab502080cb5c54b954.scarabeus@gentoo \
    --to=scarabeus@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox