diff options
author | 2006-08-20 16:40:10 +0000 | |
---|---|---|
committer | 2006-08-20 16:40:10 +0000 | |
commit | 9befbfc6a163f32bd9c9b3797a740ae9cb2d9b81 (patch) | |
tree | ffaf6f83192fd4c8ce2dcf224f9b412db7ee702c /media-libs/libquicktime | |
parent | add libquicktime with new x264-support to package.mask (diff) | |
download | gentoo-2-9befbfc6a163f32bd9c9b3797a740ae9cb2d9b81.tar.gz gentoo-2-9befbfc6a163f32bd9c9b3797a740ae9cb2d9b81.tar.bz2 gentoo-2-9befbfc6a163f32bd9c9b3797a740ae9cb2d9b81.zip |
fix for new x264
(Portage version: 2.1.1_pre5-r2)
Diffstat (limited to 'media-libs/libquicktime')
-rw-r--r-- | media-libs/libquicktime/ChangeLog | 8 | ||||
-rw-r--r-- | media-libs/libquicktime/files/digest-libquicktime-0.9.9-r1 | 3 | ||||
-rw-r--r-- | media-libs/libquicktime/files/libquicktime-new-x264.patch | 146 | ||||
-rw-r--r-- | media-libs/libquicktime/libquicktime-0.9.9-r1.ebuild | 81 |
4 files changed, 237 insertions, 1 deletions
diff --git a/media-libs/libquicktime/ChangeLog b/media-libs/libquicktime/ChangeLog index 05358b0cfa5e..99a66a428afb 100644 --- a/media-libs/libquicktime/ChangeLog +++ b/media-libs/libquicktime/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for media-libs/libquicktime # Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-libs/libquicktime/ChangeLog,v 1.61 2006/08/08 22:38:52 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-libs/libquicktime/ChangeLog,v 1.62 2006/08/20 16:40:10 hanno Exp $ + +*libquicktime-0.9.9-r1 (20 Aug 2006) + + 20 Aug 2006; Hanno Boeck <hanno@gentoo.org> + +files/libquicktime-new-x264.patch, +libquicktime-0.9.9-r1.ebuild: + Add patch to compile with latest x264 (still masked). 08 Aug 2006; Chris Gianelloni <wolf31o2@gentoo.org> libquicktime-0.9.7-r1.ebuild: diff --git a/media-libs/libquicktime/files/digest-libquicktime-0.9.9-r1 b/media-libs/libquicktime/files/digest-libquicktime-0.9.9-r1 new file mode 100644 index 000000000000..f515872f62a6 --- /dev/null +++ b/media-libs/libquicktime/files/digest-libquicktime-0.9.9-r1 @@ -0,0 +1,3 @@ +MD5 4ac23264f22a22ff013722aa9d188190 libquicktime-0.9.9.tar.gz 926280 +RMD160 c345f54d949f29a9f5be42ca5fbdc80be781a3d4 libquicktime-0.9.9.tar.gz 926280 +SHA256 b92f08e8e9a9e4be36dd5cdd4b1c5d31f0cc821569623b2f5f79b3e7ba8ed3da libquicktime-0.9.9.tar.gz 926280 diff --git a/media-libs/libquicktime/files/libquicktime-new-x264.patch b/media-libs/libquicktime/files/libquicktime-new-x264.patch new file mode 100644 index 000000000000..f87de840811e --- /dev/null +++ b/media-libs/libquicktime/files/libquicktime-new-x264.patch @@ -0,0 +1,146 @@ +--- libquicktime-0.9.9/plugins/x264/x264.c 2006/06/25 13:10:30 1.7 ++++ libquicktime-0.9.9/plugins/x264/x264.c 2006/07/25 12:17:37 1.8 +@@ -437,7 +437,7 @@ + codec->stats_filename = malloc(strlen(stats_file)+1); + strcpy(codec->stats_filename, stats_file); + +- fprintf(stderr, "set_pass_x264 %d %d %s\n", pass, total_passes, stats_file); ++ // fprintf(stderr, "set_pass_x264 %d %d %s\n", pass, total_passes, stats_file); + return 1; + } + +@@ -488,22 +488,28 @@ + codec->params.i_fps_den = lqt_frame_duration(file, track, NULL); + + /* Set multipass control */ +- +- /* Open encoder */ + +- if(codec->pass == 1) ++ if(codec->total_passes) + { +- /* Strings will be made private by x264 */ +- codec->params.rc.psz_stat_out = codec->stats_filename; +- codec->params.rc.b_stat_write = 1; +- } +- else if(codec->total_passes && (codec->pass == codec->total_passes)) +- { +- /* Strings will be made private by x264 */ +- codec->params.rc.psz_stat_in = codec->stats_filename; +- codec->params.rc.b_stat_read = 1; ++ /* Force ABR */ ++ codec->params.rc.i_rc_method = X264_RC_ABR; ++ codec->params.rc.i_rf_constant = 0; ++ if(codec->pass == 1) ++ { ++ /* Strings will be made private by x264 */ ++ codec->params.rc.psz_stat_out = codec->stats_filename; ++ codec->params.rc.b_stat_write = 1; ++ } ++ else if(codec->pass == codec->total_passes) ++ { ++ /* Strings will be made private by x264 */ ++ codec->params.rc.psz_stat_in = codec->stats_filename; ++ codec->params.rc.b_stat_read = 1; ++ } + } + ++ /* Open encoder */ ++ + codec->enc = x264_encoder_open(&codec->params); + if(!codec->enc) + { +@@ -621,6 +627,14 @@ + { "Auto", X264_DIRECT_PRED_AUTO } + }; + ++enum_t rc_methods[] = ++ { ++ { "Constant quality", X264_RC_CQP }, ++ { "Average bitrate", X264_RC_ABR }, ++ { "CRF based VBR", X264_RC_CRF } ++ }; ++ ++ + static int set_parameter(quicktime_t *file, + int track, + char *key, +@@ -637,22 +651,11 @@ + INTPARAM("x264_i_bframe_bias", codec->params.i_bframe_bias); + INTPARAM("x264_b_bframe_pyramid", codec->params.b_bframe_pyramid); + +- if(!strcasecmp(key, "x264_i_bitrate")) +- { +- if(*(int*)(value)) +- { +- codec->params.rc.b_cbr = 1; +- codec->params.rc.i_bitrate = *(int*)(value); +- } +- else +- { +- codec->params.rc.b_cbr = 0; +- codec->params.rc.i_bitrate = 0; +- } +- found = 1; +- } +- ++ ENUMPARAM("x264_i_rc_method", codec->params.rc.i_rc_method, rc_methods); ++ INTPARAM("x264_i_bitrate", codec->params.rc.i_bitrate); ++ + INTPARAM("x264_i_qp_constant", codec->params.rc.i_qp_constant); ++ INTPARAM("x264_i_rf_constant", codec->params.rc.i_rf_constant); + INTPARAM("x264_i_qp_min", codec->params.rc.i_qp_min); + INTPARAM("x264_i_qp_max", codec->params.rc.i_qp_max); + INTPARAM("x264_i_qp_step", codec->params.rc.i_qp_step); +--- libquicktime-0.9.9/plugins/x264/lqt_x264.c 2006/04/10 21:46:15 1.2 ++++ libquicktime-0.9.9/plugins/x264/lqt_x264.c 2006/07/25 12:17:37 1.3 +@@ -74,6 +74,21 @@ + type: LQT_PARAMETER_SECTION + }, + { ++ name: "x264_i_rc_method", ++ real_name: "Ratecontrol method", ++ type: LQT_PARAMETER_STRINGLIST, ++ val_default: { val_string: "Constant quality" }, ++ stringlist_options: (char*[]){ "Constant quality", ++ "Average bitrate", ++ "CRF based VBR", ++ (char*)0 }, ++ help_string: "Ratecontrol method:\n\ ++Constant quality: Specify a quantizer parameter below\n\ ++Average bitrate: Specify a bitrate below\n\ ++CRF based VBR: Specify a rate factor below\n\ ++Selecting 2-pass encoding will force Average bitrate.", ++ }, ++ { + name: "x264_i_bitrate", + real_name: "Bitrate", + type: LQT_PARAMETER_INT, +@@ -81,6 +96,16 @@ + help_string: "Bitrate in kbit/s. 0 means VBR (recommended)" + }, + { ++ name: "x264_i_rf_constant", ++ real_name: "Nominal Quantizer parameter", ++ type: LQT_PARAMETER_INT, ++ val_default: { val_int: 26 }, ++ val_min: { val_int: 0 }, ++ val_max: { val_int: 51 }, ++ help_string: "This selects the nominal quantizer to use (1 to 51). Lower values result in " \ ++ "better fidelity, but higher bitrates. 26 is a good default value. 0 means lossless." ++ }, ++ { + name: "x264_i_qp_constant", + real_name: "Quantizer parameter", + type: LQT_PARAMETER_INT, +@@ -90,7 +115,9 @@ + help_string: "This selects the quantizer to use (1 to 51). Lower values result in " \ + "better fidelity, but higher bitrates. 26 is a good default value. 0 means lossless." + }, +- { ++ ++ ++{ + name: "x264_i_qp_min", + real_name: "Minimum quantizer parameter", + type: LQT_PARAMETER_INT, diff --git a/media-libs/libquicktime/libquicktime-0.9.9-r1.ebuild b/media-libs/libquicktime/libquicktime-0.9.9-r1.ebuild new file mode 100644 index 000000000000..a910bdd293f5 --- /dev/null +++ b/media-libs/libquicktime/libquicktime-0.9.9-r1.ebuild @@ -0,0 +1,81 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/media-libs/libquicktime/libquicktime-0.9.9-r1.ebuild,v 1.1 2006/08/20 16:40:10 hanno Exp $ + +inherit libtool eutils autotools + +DESCRIPTION="A library based on quicktime4linux with extensions" +HOMEPAGE="http://libquicktime.sourceforge.net/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +LICENSE="LGPL-2.1" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86" + +IUSE="mmx X" + +DEPEND="media-libs/libdv + >=x11-libs/gtk+-2.4.0 + media-libs/libpng + media-libs/jpeg + media-libs/libvorbis + media-libs/libogg + media-libs/x264-svn + X? ( || ( ( x11-libs/libXaw + x11-libs/libXv + x11-proto/xextproto + ) + virtual/x11 + ) + ) + !virtual/quicktime" +PROVIDE="virtual/quicktime" + +pkg_setup() { + if has_version '=x11-base/xorg-x11-6*' && ! built_with_use x11-base/xorg-x11 xv; then + die "You need xv support to compile ${PN}." + fi +} + +src_unpack() { + unpack ${A} + epatch ${FILESDIR}/libquicktime-new-x264.patch +} + +src_compile() { + econf --enable-shared \ + --enable-static \ + --enable-gpl \ + $(use_enable mmx) \ + $(use_with X x) \ + --without-cpuflags || die "econf failed" + emake || die "emake failed" +} + +src_install() { + emake DESTDIR="${D}" install || die "emake install failed" + + # Compatibility with software that uses quicktime prefix, but + # don't do that when building for Darwin/MacOS + [[ ${CHOST} != *-darwin* ]] && \ + dosym /usr/include/lqt /usr/include/quicktime +} + +pkg_preinst() { + if [[ -d /usr/include/quicktime && ! -L /usr/include/quicktime ]]; then + einfo "For compatibility with other quicktime libraries, ${PN} was" + einfo "going to create a /usr/include/quicktime symlink, but for some" + einfo "reason that is a directory on your system." + + if $(has_version =media-libs/libquicktime-0.9.4); then + einfo "It seems this directory belongs to libquicktime-0.9.4." + einfo "We'll delete that directory now." + rm -rvf /usr/include/quicktime + else + einfo "Please check that is empty, and remove it, or submit a bug" + einfo "telling us which package owns the directory." + die "/usr/include/quicktime is a directory." + fi + fi +} + |