diff options
author | Matthias Schwarzott <zzam@gentoo.org> | 2007-10-18 14:37:03 +0000 |
---|---|---|
committer | Matthias Schwarzott <zzam@gentoo.org> | 2007-10-18 14:37:03 +0000 |
commit | e1b72302ad3ad8e870e1697010cc22dbb297e7c8 (patch) | |
tree | 7610efd5464d14077af2037906eca4150d7f7289 /media-video/dvbcut | |
parent | Sparc stable --- Bug #195009 --- working for me for over a month. (diff) | |
download | gentoo-2-e1b72302ad3ad8e870e1697010cc22dbb297e7c8.tar.gz gentoo-2-e1b72302ad3ad8e870e1697010cc22dbb297e7c8.tar.bz2 gentoo-2-e1b72302ad3ad8e870e1697010cc22dbb297e7c8.zip |
Fix compilation against newest ffmpeg, Bug #188184. Added desktop menu entry, Bug #188579.
(Portage version: 2.1.3.14)
Diffstat (limited to 'media-video/dvbcut')
-rw-r--r-- | media-video/dvbcut/ChangeLog | 9 | ||||
-rw-r--r-- | media-video/dvbcut/dvbcut-0.5.4-r1.ebuild | 54 | ||||
-rw-r--r-- | media-video/dvbcut/files/digest-dvbcut-0.5.4-r1 | 3 | ||||
-rw-r--r-- | media-video/dvbcut/files/dvbcut-0.5.4-ffmpeg-compat3.patch | 199 |
4 files changed, 264 insertions, 1 deletions
diff --git a/media-video/dvbcut/ChangeLog b/media-video/dvbcut/ChangeLog index 44b7bb6e6c4f..0b5c15e02fc4 100644 --- a/media-video/dvbcut/ChangeLog +++ b/media-video/dvbcut/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for media-video/dvbcut # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-video/dvbcut/ChangeLog,v 1.7 2007/06/03 10:08:24 aballier Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-video/dvbcut/ChangeLog,v 1.8 2007/10/18 14:37:02 zzam Exp $ + +*dvbcut-0.5.4-r1 (18 Oct 2007) + + 18 Oct 2007; Matthias Schwarzott <zzam@gentoo.org> + +files/dvbcut-0.5.4-ffmpeg-compat3.patch, +dvbcut-0.5.4-r1.ebuild: + Fix compilation against newest ffmpeg, Bug #188184. Added desktop menu + entry, Bug #188579. 03 Jun 2007; Alexis Ballier <aballier@gentoo.org> -files/dvbcut-0.5.3-ac3-buffer.patch, diff --git a/media-video/dvbcut/dvbcut-0.5.4-r1.ebuild b/media-video/dvbcut/dvbcut-0.5.4-r1.ebuild new file mode 100644 index 000000000000..68bdc8a5699b --- /dev/null +++ b/media-video/dvbcut/dvbcut-0.5.4-r1.ebuild @@ -0,0 +1,54 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/media-video/dvbcut/dvbcut-0.5.4-r1.ebuild,v 1.1 2007/10/18 14:37:02 zzam Exp $ + +inherit qt3 eutils + +IUSE="" + +MY_P="${P/-/_}" + +DESCRIPTION="frame-accurate editing of MPEG-2 video with MPEG and AC3 audio" +HOMEPAGE="http://dvbcut.sourceforge.net" +SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2" + +LICENSE="GPL-2" + +SLOT="0" +KEYWORDS="~amd64 ~x86" + +RDEPEND="$(qt_min_version 3) + media-libs/libao + >=media-video/ffmpeg-0.4.9_p20070330" + +DEPEND="${RDEPEND} + dev-util/scons" + +pkg_setup() { + if ! built_with_use media-video/ffmpeg a52; then + eerror "This package requires media-video/ffmpeg compiled with A/52 (a.k.a. AC-3) support." + eerror "Please reemerge media-video/ffmpeg with USE=\"a52\"." + die "Please reemerge media-video/ffmpeg with USE=\"a52\"." + fi +} + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}/${PN}-0.5.3-ffmpeg-compat.patch" + epatch "${FILESDIR}/${P}-gcc42.patch" + epatch "${FILESDIR}/${P}-ffmpeg-compat2.patch" + epatch "${FILESDIR}/${P}-ffmpeg-compat3.patch" +} + +src_compile() { + emake FFMPEG=/usr || die "build failed" +} + +src_install() { + emake FFMPEG=/usr DESTDIR="${D}" PREFIX="/usr" MANPATH="/usr/share/man" install \ + || die "install failed" + make_desktop_entry dvbcut DVBcut \ + || die "Couldn't make dvbcut desktop entry" + dodoc CREDITS ChangeLog README README.ffmpeg README.icons +} diff --git a/media-video/dvbcut/files/digest-dvbcut-0.5.4-r1 b/media-video/dvbcut/files/digest-dvbcut-0.5.4-r1 new file mode 100644 index 000000000000..e23a50a9a373 --- /dev/null +++ b/media-video/dvbcut/files/digest-dvbcut-0.5.4-r1 @@ -0,0 +1,3 @@ +MD5 02803e28a6bf6850f129ca6aa0a9c96e dvbcut_0.5.4.tar.bz2 795991 +RMD160 fc36b9d3abd818495498c1d8181e1250f43e0057 dvbcut_0.5.4.tar.bz2 795991 +SHA256 db6500fc327585be6ee5a36135c9940828d22bde936daa17b6a5cce852ad9f70 dvbcut_0.5.4.tar.bz2 795991 diff --git a/media-video/dvbcut/files/dvbcut-0.5.4-ffmpeg-compat3.patch b/media-video/dvbcut/files/dvbcut-0.5.4-ffmpeg-compat3.patch new file mode 100644 index 000000000000..53e762a1b741 --- /dev/null +++ b/media-video/dvbcut/files/dvbcut-0.5.4-ffmpeg-compat3.patch @@ -0,0 +1,199 @@ +Index: dvbcut-svn/src/psfile.cpp +=================================================================== +--- dvbcut-svn.orig/src/psfile.cpp ++++ dvbcut-svn/src/psfile.cpp +@@ -90,7 +90,7 @@ psfile::psfile(const std::string &filena + streamnumber[sid]=audiostream(audiostreams); + stream *S=&s[audiostream(audiostreams++)]; + S->id=sid; +- S->dec=&mp2_decoder; ++ S->dec=avcodec_find_decoder(CODEC_ID_MP2); + S->type=streamtype::mpegaudio; + if (audiostreams>=MAXAUDIOSTREAMS) + break; +@@ -100,7 +100,7 @@ psfile::psfile(const std::string &filena + streamnumber[sid]=audiostream(audiostreams); + stream *S=&s[audiostream(audiostreams++)]; + S->id=sid; +- S->dec=&liba52_decoder; ++ S->dec=avcodec_find_decoder(CODEC_ID_AC3); + S->type=streamtype::ac3audio; + if (audiostreams>=MAXAUDIOSTREAMS) + break; +@@ -114,8 +114,8 @@ psfile::psfile(const std::string &filena + S->allocavcc(); + S->avcc->codec_type=CODEC_TYPE_VIDEO; + S->avcc->codec_id=CODEC_ID_MPEG2VIDEO; +- S->dec=&mpeg2video_decoder; +- S->enc=&mpeg2video_encoder; ++ S->dec=avcodec_find_decoder(CODEC_ID_MPEG2VIDEO); ++ S->enc=avcodec_find_encoder(CODEC_ID_MPEG2VIDEO); + S->type=streamtype::mpeg2video; + } + +Index: dvbcut-svn/src/tsfile.cpp +=================================================================== +--- dvbcut-svn.orig/src/tsfile.cpp ++++ dvbcut-svn/src/tsfile.cpp +@@ -78,12 +78,12 @@ tsfile::tsfile(const std::string &filena + stream *S=&s[audiostream(audiostreams++)]; + S->id=it->second; + if (it->first==0xbd) { +- S->dec=&liba52_decoder; +- S->enc=&ac3_encoder; ++ S->dec=avcodec_find_decoder(CODEC_ID_AC3); ++ S->enc=avcodec_find_encoder(CODEC_ID_AC3); + S->type=streamtype::ac3audio; + } else { +- S->dec=&mp2_decoder; +- S->enc=&mp2_encoder; ++ S->dec=avcodec_find_decoder(CODEC_ID_MP2); ++ S->enc=avcodec_find_decoder(CODEC_ID_MP2); + S->type=streamtype::mpegaudio; + } + if (audiostreams>=MAXAUDIOSTREAMS) +@@ -98,8 +98,8 @@ tsfile::tsfile(const std::string &filena + S->allocavcc(); + S->avcc->codec_type=CODEC_TYPE_VIDEO; + S->avcc->codec_id=CODEC_ID_MPEG2VIDEO; +- S->dec=&mpeg2video_decoder; +- S->enc=&mpeg2video_encoder; ++ S->dec=avcodec_find_decoder(CODEC_ID_MPEG2VIDEO); ++ S->enc=avcodec_find_encoder(CODEC_ID_MPEG2VIDEO); + S->type=streamtype::mpeg2video; + } + +Index: dvbcut-svn/src/avframe.cpp +=================================================================== +--- dvbcut-svn.orig/src/avframe.cpp ++++ dvbcut-svn/src/avframe.cpp +@@ -23,7 +23,11 @@ + #include <stdio.h> + #include "avframe.h" + ++#ifdef HAVE_LIB_SWSCALE ++avframe::avframe() : tobefreed(0),w(0),h(0),dw(0),pix_fmt(),img_convert_ctx(0) ++#else + avframe::avframe() : tobefreed(0),w(0),h(0),dw(0),pix_fmt() ++#endif + { + f=avcodec_alloc_frame(); + } +@@ -54,7 +58,11 @@ avframe::avframe(AVFrame *src, AVCodecCo + h=ctx->height; + pix_fmt=ctx->pix_fmt; + dw=w*ctx->sample_aspect_ratio.num/ctx->sample_aspect_ratio.den; +- ++#ifdef HAVE_LIB_SWSCALE ++ img_convert_ctx=sws_getContext(w, h, pix_fmt, ++ w, h, PIX_FMT_BGR24, SWS_BICUBIC, ++ NULL, NULL, NULL); ++#endif + } + + avframe::~avframe() +@@ -63,11 +71,19 @@ avframe::~avframe() + free(tobefreed); + if (f) + av_free(f); ++#ifdef HAVE_LIB_SWSCALE ++ if (img_convert_ctx) ++ sws_freeContext(img_convert_ctx); ++#endif + } + + QImage avframe::getqimage(bool scaled, int viewscalefactor) + { ++#ifdef HAVE_LIB_SWSCALE ++ if (w<=0 || h<=0 || img_convert_ctx==NULL) ++#else + if (w<=0 || h<=0) ++#endif + return QImage(); + + uint8_t *rgbbuffer=(uint8_t*)malloc(avpicture_get_size(PIX_FMT_RGB24, w, h)+64); +@@ -79,11 +95,20 @@ QImage avframe::getqimage(bool scaled, i + rgbbuffer+headerlen, + PIX_FMT_RGB24,w,h); + ++#ifdef HAVE_LIB_SWSCALE ++ sws_scale(img_convert_ctx, f->data, f->linesize, 0, h, ++ avframergb->data, avframergb->linesize); ++#else + img_convert((AVPicture *)avframergb, PIX_FMT_RGB24, (AVPicture*)f, pix_fmt, w, h); ++#endif + + QImage im; + im.loadFromData(rgbbuffer, headerlen+w*h*3, "PPM"); + ++#ifdef HAVE_LIB_SWSCALE ++ im = im.swapRGB(); ++#endif ++ + if ((scaled && w!=dw)||(viewscalefactor!=1)) { + #ifdef SMOOTHSCALE + im = im.smoothScale((scaled?dw:w)/viewscalefactor, h/viewscalefactor); +Index: dvbcut-svn/src/avframe.h +=================================================================== +--- dvbcut-svn.orig/src/avframe.h ++++ dvbcut-svn/src/avframe.h +@@ -23,6 +23,9 @@ + + extern "C" { + #include <ffmpeg/avcodec.h> ++#ifdef HAVE_LIB_SWSCALE ++#include <ffmpeg/swscale.h> ++#endif + } + + class QImage; +@@ -37,6 +40,9 @@ protected: + void *tobefreed; + int w,h,dw; + enum PixelFormat pix_fmt; ++#ifdef HAVE_LIB_SWSCALE ++ struct SwsContext *img_convert_ctx; ++#endif + + public: + avframe(); +Index: dvbcut-svn/SConstruct +=================================================================== +--- dvbcut-svn.orig/SConstruct ++++ dvbcut-svn/SConstruct +@@ -88,10 +88,6 @@ if (not env.GetOption('clean')): + print "Checking for libao... found" + else: + print "Checking for libao... not found" +- +-### FINISH +- +-env=conf.Finish() + + ###### BUILD ENVIRONMENT (pt2) + +@@ -117,8 +113,23 @@ if (ffmpegpath!='/usr'): + env.Append(CPPPATH=os.path.join(str(ffmpegpath),'include')) + env.Append(LIBPATH=os.path.join(str(ffmpegpath),'lib')) + env.Append(LIBS=['avformat','avcodec','avutil']) ++if (localffmpeg==False): ++ env.Append(CPPDEFINES=["__STDC_CONSTANT_MACROS", "__STDC_LIMIT_MACROS"]) ++ ++ ++### LIBSWSCALE ++if (not env.GetOption('clean') and not localffmpeg): ++ if (conf.TryAction('pkg-config --exists libswscale')[0]): ++ conf.env.Append(CPPDEFINES="HAVE_LIB_SWSCALE") ++ conf.env.ParseConfig('pkg-config --cflags --libs libswscale') ++ print "Checking for C library swscale... yes" ++ elif (conf.CheckLibWithHeader('swscale', 'ffmpeg/swscale.h', 'C')): ++ conf.env.Append(CPPDEFINES="HAVE_LIB_SWSCALE") ++ ++### FINISH ++ ++env=conf.Finish() + +-env.Append(CPPDEFINES="__STDC_CONSTANT_MACROS") + ###### WORK + + env.bin_targets=[] |