From ddf8a134fa4ca7e090817e1cb9c148d1f5f390a4 Mon Sep 17 00:00:00 2001 From: ajacoutot Date: Sun, 8 Apr 2007 17:33:39 +0000 Subject: [PATCH] - add support for x264 - regen patches while here "go for it" naddy@ --- x11/mplayer/Makefile | 8 +++-- x11/mplayer/patches/patch-Makefile | 10 +++--- .../patches/patch-TOOLS_subfont-c_subfont_c | 8 ++--- .../patches/patch-libavcodec_bitstream_h | 6 ++-- .../patches/patch-libmpcodecs_ve_x264_c | 34 +++++++++++++++++++ .../patches/patch-libmpdemux_realrtsp_asmrp_c | 8 ++--- .../patches/patch-libmpdemux_realrtsp_real_c | 8 ++--- .../patches/patch-libmpdemux_tvi_bsdbt848_c | 18 +++++----- x11/mplayer/patches/patch-mp3lib_layer2_c | 8 ++--- x11/mplayer/patches/patch-mplayer_c | 10 +++--- 10 files changed, 77 insertions(+), 41 deletions(-) create mode 100644 x11/mplayer/patches/patch-libmpcodecs_ve_x264_c diff --git a/x11/mplayer/Makefile b/x11/mplayer/Makefile index 2b0a9c7c682..234012177c4 100644 --- a/x11/mplayer/Makefile +++ b/x11/mplayer/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.114 2007/04/05 16:20:02 kili Exp $ +# $OpenBSD: Makefile,v 1.115 2007/04/08 17:33:39 ajacoutot Exp $ # May not be hard to add more. ONLY_FOR_ARCHS= amd64 i386 powerpc sparc64 arm @@ -7,7 +7,7 @@ COMMENT= "Movie player supporting MPEG, DivX, AVI, ASF, MOV & more" DISTNAME= MPlayer-1.0pre8 DIST_SUBDIR= mplayer -PKGNAME= ${DISTNAME:L}p9 +PKGNAME= ${DISTNAME:L}p10 CATEGORIES= x11 EXTRACT_SUFX= .tar.bz2 @@ -47,7 +47,8 @@ LIB_DEPENDS= png::graphics/png \ speex::audio/speex \ mpcdec::audio/libmpcdec \ ogg.>=5::audio/libogg \ - xvidcore::multimedia/xvidcore + xvidcore::multimedia/xvidcore \ + x264::multimedia/x264 BUILD_DEPENDS= :rtunes->=0.6:audio/rtunes @@ -75,6 +76,7 @@ CONFIGURE_ARGS+=--disable-alsa \ --enable-menu \ --enable-iconv \ --enable-cdparanoia \ + --enable-x264 \ --with-extraincdir=${LOCALBASE}/include/libpng:${LOCALBASE}/include \ --with-extralibdir=${LOCALBASE}/lib \ --confdir=${CONFDIR} \ diff --git a/x11/mplayer/patches/patch-Makefile b/x11/mplayer/patches/patch-Makefile index 00deeb5cb8f..9d28ed0314f 100644 --- a/x11/mplayer/patches/patch-Makefile +++ b/x11/mplayer/patches/patch-Makefile @@ -1,7 +1,7 @@ -$OpenBSD: patch-Makefile,v 1.12 2006/07/19 21:40:47 robert Exp $ ---- Makefile.orig Sun Jun 11 20:35:47 2006 -+++ Makefile Thu Jul 6 00:08:11 2006 -@@ -426,7 +426,7 @@ LIBS_MENCODER = libmpcodecs/libmpencoder +$OpenBSD: patch-Makefile,v 1.13 2007/04/08 17:33:39 ajacoutot Exp $ +--- Makefile.orig Sun Apr 8 10:17:01 2007 ++++ Makefile Sun Apr 8 10:17:01 2007 +@@ -429,7 +429,7 @@ LIBS_MENCODER = libmpcodecs/libmpencoders.a \ $(LIBC_LIB) \ $(PRG_MENCODER): $(MENCODER_DEP) @@ -10,7 +10,7 @@ $OpenBSD: patch-Makefile,v 1.12 2006/07/19 21:40:47 robert Exp $ endif codecs.conf.h: $(PRG_CFG) etc/codecs.conf -@@ -485,8 +485,6 @@ ifeq ($(GUI),yes) +@@ -488,8 +488,6 @@ ifeq ($(GUI),yes) @$(INSTALL) -d $(prefix)/share/applications $(INSTALL) -m 644 etc/mplayer.desktop $(prefix)/share/applications/mplayer.desktop endif diff --git a/x11/mplayer/patches/patch-TOOLS_subfont-c_subfont_c b/x11/mplayer/patches/patch-TOOLS_subfont-c_subfont_c index 14d5234d301..843cebcc0fb 100644 --- a/x11/mplayer/patches/patch-TOOLS_subfont-c_subfont_c +++ b/x11/mplayer/patches/patch-TOOLS_subfont-c_subfont_c @@ -1,7 +1,7 @@ -$OpenBSD: patch-TOOLS_subfont-c_subfont_c,v 1.4 2005/05/27 04:31:51 pvalchev Exp $ ---- TOOLS/subfont-c/subfont.c.orig Sat Aug 28 14:53:01 2004 -+++ TOOLS/subfont-c/subfont.c Sun May 8 13:15:57 2005 -@@ -831,6 +831,18 @@ unsigned gmatrix(unsigned *m, int r, int +$OpenBSD: patch-TOOLS_subfont-c_subfont_c,v 1.5 2007/04/08 17:33:39 ajacoutot Exp $ +--- TOOLS/subfont-c/subfont.c.orig Sun Jun 11 20:35:45 2006 ++++ TOOLS/subfont-c/subfont.c Sun Apr 8 10:17:01 2007 +@@ -831,6 +831,18 @@ unsigned gmatrix(unsigned *m, int r, int w, double con } diff --git a/x11/mplayer/patches/patch-libavcodec_bitstream_h b/x11/mplayer/patches/patch-libavcodec_bitstream_h index 456cc60531c..18281288762 100644 --- a/x11/mplayer/patches/patch-libavcodec_bitstream_h +++ b/x11/mplayer/patches/patch-libavcodec_bitstream_h @@ -1,7 +1,7 @@ -$OpenBSD: patch-libavcodec_bitstream_h,v 1.2 2006/07/19 21:40:47 robert Exp $ +$OpenBSD: patch-libavcodec_bitstream_h,v 1.3 2007/04/08 17:33:39 ajacoutot Exp $ --- libavcodec/bitstream.h.orig Sun Jun 11 20:35:48 2006 -+++ libavcodec/bitstream.h Thu Jul 6 00:08:11 2006 -@@ -374,7 +374,7 @@ for examples see get_bits, show_bits, sk ++++ libavcodec/bitstream.h Sun Apr 8 10:17:01 2007 +@@ -374,7 +374,7 @@ for examples see get_bits, show_bits, skip_bits, get_v static inline int unaligned32_be(const void *v) { diff --git a/x11/mplayer/patches/patch-libmpcodecs_ve_x264_c b/x11/mplayer/patches/patch-libmpcodecs_ve_x264_c new file mode 100644 index 00000000000..1bf67e836f9 --- /dev/null +++ b/x11/mplayer/patches/patch-libmpcodecs_ve_x264_c @@ -0,0 +1,34 @@ +$OpenBSD: patch-libmpcodecs_ve_x264_c,v 1.1 2007/04/08 17:33:39 ajacoutot Exp $ +--- libmpcodecs/ve_x264.c.orig Sun Apr 8 10:17:32 2007 ++++ libmpcodecs/ve_x264.c Sun Apr 8 10:13:03 2007 +@@ -208,7 +208,7 @@ m_option_t x264encopts_conf[] = { + }; + + static int parse_cqm(const char *str, uint8_t *cqm, int length, +- h264_module_t *mod, char *matrix_name) { ++ h264_module_t *mod, const char *matrix_name) { + int i; + if (!str) return 0; + for (i = 0; i < length; i++) { +@@ -247,8 +247,11 @@ static int config(struct vf_instance_s* vf, int width, + mod->param.i_deblocking_filter_beta = deblockbeta; + mod->param.b_cabac = cabac; + ++ mod->param.rc.i_rc_method = X264_RC_CQP; + mod->param.rc.i_qp_constant = qp_constant; +- mod->param.rc.i_rf_constant = rf_constant; ++ if(rf_constant > 0) ++ mod->param.rc.i_rc_method = X264_RC_CRF; ++ mod->param.rc.f_rf_constant = rf_constant; + if(qp_min > qp_constant) + qp_min = qp_constant; + if(qp_max < qp_constant) +@@ -275,7 +278,7 @@ static int config(struct vf_instance_s* vf, int width, + "VBV requires both vbv_maxrate and vbv_bufsize.\n"); + return 0; + } +- mod->param.rc.b_cbr = 1; ++ mod->param.rc.i_rc_method = X264_RC_ABR; + mod->param.rc.i_bitrate = bitrate; + mod->param.rc.f_rate_tolerance = ratetol; + mod->param.rc.i_vbv_max_bitrate = vbv_maxrate; diff --git a/x11/mplayer/patches/patch-libmpdemux_realrtsp_asmrp_c b/x11/mplayer/patches/patch-libmpdemux_realrtsp_asmrp_c index 76a29006da8..632873efc04 100644 --- a/x11/mplayer/patches/patch-libmpdemux_realrtsp_asmrp_c +++ b/x11/mplayer/patches/patch-libmpdemux_realrtsp_asmrp_c @@ -1,6 +1,6 @@ -$OpenBSD: patch-libmpdemux_realrtsp_asmrp_c,v 1.1 2007/01/02 09:01:58 robert Exp $ ---- libmpdemux/realrtsp/asmrp.c.orig Mon Jan 1 14:46:36 2007 -+++ libmpdemux/realrtsp/asmrp.c Mon Jan 1 14:47:35 2007 +$OpenBSD: patch-libmpdemux_realrtsp_asmrp_c,v 1.2 2007/04/08 17:33:39 ajacoutot Exp $ +--- libmpdemux/realrtsp/asmrp.c.orig Sun Jun 11 20:35:46 2006 ++++ libmpdemux/realrtsp/asmrp.c Sun Apr 8 10:17:01 2007 @@ -40,6 +40,7 @@ #include #include @@ -9,7 +9,7 @@ $OpenBSD: patch-libmpdemux_realrtsp_asmrp_c,v 1.1 2007/01/02 09:01:58 robert Exp /* #define LOG -@@ -645,8 +646,10 @@ static int asmrp_eval (asmrp_t *p, int * +@@ -645,8 +646,10 @@ static int asmrp_eval (asmrp_t *p, int *matches) { #ifdef LOG printf ("rule #%d is true\n", rule_num); #endif diff --git a/x11/mplayer/patches/patch-libmpdemux_realrtsp_real_c b/x11/mplayer/patches/patch-libmpdemux_realrtsp_real_c index 1390ce683c5..2f480f057fa 100644 --- a/x11/mplayer/patches/patch-libmpdemux_realrtsp_real_c +++ b/x11/mplayer/patches/patch-libmpdemux_realrtsp_real_c @@ -1,7 +1,7 @@ -$OpenBSD: patch-libmpdemux_realrtsp_real_c,v 1.2 2007/01/02 09:01:58 robert Exp $ ---- libmpdemux/realrtsp/real.c.orig Mon Jan 1 14:49:12 2007 -+++ libmpdemux/realrtsp/real.c Mon Jan 1 14:49:37 2007 -@@ -528,7 +528,7 @@ rmff_header_t *real_parse_sdp(char *data +$OpenBSD: patch-libmpdemux_realrtsp_real_c,v 1.3 2007/04/08 17:33:39 ajacoutot Exp $ +--- libmpdemux/realrtsp/real.c.orig Sun Jun 11 20:35:46 2006 ++++ libmpdemux/realrtsp/real.c Sun Apr 8 10:17:01 2007 +@@ -528,7 +528,7 @@ rmff_header_t *real_parse_sdp(char *data, char **strea int j=0; int n; char b[64]; diff --git a/x11/mplayer/patches/patch-libmpdemux_tvi_bsdbt848_c b/x11/mplayer/patches/patch-libmpdemux_tvi_bsdbt848_c index 0b2b34b0f77..4a63f27ad17 100644 --- a/x11/mplayer/patches/patch-libmpdemux_tvi_bsdbt848_c +++ b/x11/mplayer/patches/patch-libmpdemux_tvi_bsdbt848_c @@ -1,6 +1,6 @@ -$OpenBSD: patch-libmpdemux_tvi_bsdbt848_c,v 1.2 2006/07/19 21:40:47 robert Exp $ +$OpenBSD: patch-libmpdemux_tvi_bsdbt848_c,v 1.3 2007/04/08 17:33:39 ajacoutot Exp $ --- libmpdemux/tvi_bsdbt848.c.orig Sun Jun 11 20:35:46 2006 -+++ libmpdemux/tvi_bsdbt848.c Thu Jul 6 00:08:12 2006 ++++ libmpdemux/tvi_bsdbt848.c Sun Apr 8 10:17:02 2007 @@ -40,9 +40,12 @@ #include @@ -78,7 +78,7 @@ $OpenBSD: patch-libmpdemux_tvi_bsdbt848_c,v 1.2 2006/07/19 21:40:47 robert Exp $ static void processframe(int signal) { -@@ -212,6 +242,19 @@ static int control(priv_t *priv, int cmd +@@ -212,6 +242,19 @@ static int control(priv_t *priv, int cmd, void *arg) return(TVI_CONTROL_TRUE); } @@ -98,7 +98,7 @@ $OpenBSD: patch-libmpdemux_tvi_bsdbt848_c,v 1.2 2006/07/19 21:40:47 robert Exp $ case TVI_CONTROL_TUN_GET_TUNER: case TVI_CONTROL_TUN_SET_TUNER: -@@ -219,23 +262,24 @@ static int control(priv_t *priv, int cmd +@@ -219,23 +262,24 @@ static int control(priv_t *priv, int cmd, void *arg) case TVI_CONTROL_SPC_GET_INPUT: { @@ -127,7 +127,7 @@ $OpenBSD: patch-libmpdemux_tvi_bsdbt848_c,v 1.2 2006/07/19 21:40:47 robert Exp $ return(0); } -@@ -261,8 +305,15 @@ static int control(priv_t *priv, int cmd +@@ -261,8 +305,15 @@ static int control(priv_t *priv, int cmd, void *arg) case TVI_CONTROL_AUD_SET_SAMPLERATE: { int dspspeed = (int)*(void **)arg; @@ -206,7 +206,7 @@ $OpenBSD: patch-libmpdemux_tvi_bsdbt848_c,v 1.2 2006/07/19 21:40:47 robert Exp $ priv->dspbytesread = 0; priv->dsprate = priv->dspspeed * priv->dspsamplesize/8*(priv->dspstereo+1); priv->dspframesize = priv->dspspeed*priv->dspsamplesize/8/priv->fps * -@@ -597,6 +673,31 @@ if((priv->dspfd = open (priv->dspdev, O_ +@@ -597,6 +673,31 @@ if((priv->dspfd = open (priv->dspdev, O_RDONLY, 0)) < marg = (256 << 16) | 12; @@ -263,7 +263,7 @@ $OpenBSD: patch-libmpdemux_tvi_bsdbt848_c,v 1.2 2006/07/19 21:40:47 robert Exp $ if(priv->videoready == FALSE) return(0); -@@ -680,6 +785,15 @@ if(ioctl(priv->btfd, METEORCAPTUR, &marg +@@ -680,6 +785,15 @@ if(ioctl(priv->btfd, METEORCAPTUR, &marg) < 0 ) close(priv->btfd); close(priv->dspfd); @@ -279,7 +279,7 @@ $OpenBSD: patch-libmpdemux_tvi_bsdbt848_c,v 1.2 2006/07/19 21:40:47 robert Exp $ priv->dspfd = -1; priv->btfd = -1; -@@ -802,13 +916,13 @@ return(priv->dspbytesread * 1.0 / priv-> +@@ -802,13 +916,13 @@ return(priv->dspbytesread * 1.0 / priv->dsprate); static int get_audio_framesize(priv_t *priv) { int bytesavail; @@ -295,7 +295,7 @@ $OpenBSD: patch-libmpdemux_tvi_bsdbt848_c,v 1.2 2006/07/19 21:40:47 robert Exp $ if(ioctl(priv->dspfd, AUDIO_GETINFO, &auinf) < 0) { perror("AUDIO_GETINFO"); -@@ -827,24 +941,28 @@ if(ioctl(priv->dspfd, FIONREAD, &bytesav +@@ -827,24 +941,28 @@ if(ioctl(priv->dspfd, FIONREAD, &bytesavail) < 0) /* When mencoder wants audio data, it wants data.. it won't go do anything else until it gets it :( */ diff --git a/x11/mplayer/patches/patch-mp3lib_layer2_c b/x11/mplayer/patches/patch-mp3lib_layer2_c index 9b771407c76..939edbf107d 100644 --- a/x11/mplayer/patches/patch-mp3lib_layer2_c +++ b/x11/mplayer/patches/patch-mp3lib_layer2_c @@ -1,7 +1,7 @@ -$OpenBSD: patch-mp3lib_layer2_c,v 1.2 2005/05/09 12:24:38 biorn Exp $ ---- mp3lib/layer2.c.orig Sat Apr 16 00:21:34 2005 -+++ mp3lib/layer2.c Wed Apr 20 06:35:55 2005 -@@ -294,6 +294,11 @@ static int do_layer2(struct frame *fr,in +$OpenBSD: patch-mp3lib_layer2_c,v 1.3 2007/04/08 17:33:39 ajacoutot Exp $ +--- mp3lib/layer2.c.orig Sun Jun 11 20:35:43 2006 ++++ mp3lib/layer2.c Sun Apr 8 10:17:02 2007 +@@ -294,6 +294,11 @@ static int do_layer2(struct frame *fr,int outmode) fr->jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ? (fr->mode_ext<<2)+4 : fr->II_sblimit; diff --git a/x11/mplayer/patches/patch-mplayer_c b/x11/mplayer/patches/patch-mplayer_c index 40d5741fb70..4b6d6cd333a 100644 --- a/x11/mplayer/patches/patch-mplayer_c +++ b/x11/mplayer/patches/patch-mplayer_c @@ -1,6 +1,6 @@ -$OpenBSD: patch-mplayer_c,v 1.4 2006/07/19 21:40:47 robert Exp $ +$OpenBSD: patch-mplayer_c,v 1.5 2007/04/08 17:33:39 ajacoutot Exp $ --- mplayer.c.orig Sun Jun 11 20:35:47 2006 -+++ mplayer.c Thu Jul 6 00:08:12 2006 ++++ mplayer.c Sun Apr 8 10:17:02 2007 @@ -614,7 +614,7 @@ static void exit_sighandler(int x){ gdb_pid = fork(); mp_msg(MSGT_CPLAYER, MSGL_INFO, "Forked...\n"); @@ -10,7 +10,7 @@ $OpenBSD: patch-mplayer_c,v 1.4 2006/07/19 21:40:47 robert Exp $ mp_msg(MSGT_CPLAYER, MSGL_ERR, "Couldn't start gdb\n"); } else if (gdb_pid < 0) mp_msg(MSGT_CPLAYER, MSGL_ERR, "Couldn't fork\n"); -@@ -4527,7 +4527,7 @@ if (stream->type==STREAMTYPE_DVDNAV && d +@@ -4527,7 +4527,7 @@ if (stream->type==STREAMTYPE_DVDNAV && dvd_nav_still) { #ifdef USE_SUB if (sh_video) { @@ -19,7 +19,7 @@ $OpenBSD: patch-mplayer_c,v 1.4 2006/07/19 21:40:47 robert Exp $ } #endif } break; -@@ -4548,11 +4548,11 @@ if (stream->type==STREAMTYPE_DVDNAV && d +@@ -4548,11 +4548,11 @@ if (stream->type==STREAMTYPE_DVDNAV && dvd_nav_still) case MP_CMD_GET_VO_FULLSCREEN : { if(video_out && vo_config_count) @@ -33,7 +33,7 @@ $OpenBSD: patch-mplayer_c,v 1.4 2006/07/19 21:40:47 robert Exp $ } break; case MP_CMD_GET_TIME_POS : { float pos = 0; -@@ -4570,7 +4570,7 @@ if (stream->type==STREAMTYPE_DVDNAV && d +@@ -4570,7 +4570,7 @@ if (stream->type==STREAMTYPE_DVDNAV && dvd_nav_still) case MP_CMD_RUN : { #ifndef __MINGW32__ if(!fork()) {