pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/multimedia/ffmpeg Convert to bsd.options.mk, and add t...
details: https://anonhg.NetBSD.org/pkgsrc/rev/09288044c527
branches: trunk
changeset: 480083:09288044c527
user: wiz <wiz%pkgsrc.org@localhost>
date: Sun Aug 29 22:43:50 2004 +0000
description:
Convert to bsd.options.mk, and add three new options: bktr lame vorbis.
The latter two add support for reading/writing mp3 and ogg files,
while the first adds support for grabbing from bktr(4), based on a file
from FreeBSD ports with some additional changes by me.
Additionally, document how to use it in the man page.
Also, add a patch (by me) to use the NetBSD native audio interface instead
of libossaudio (on NetBSD).
Based on PR 24691 and additional mails by Ove Soerensen (thanks!).
Also addresses PR 20281.
Bump PKGREVISION for the audio interface change.
diffstat:
multimedia/ffmpeg/Makefile | 47 ++++-
multimedia/ffmpeg/distinfo | 5 +-
multimedia/ffmpeg/files/bktr.diff | 22 ++
multimedia/ffmpeg/files/ffmpeg.1.diff | 61 ++++++
multimedia/ffmpeg/files/grab_bsdbktr.c | 325 +++++++++++++++++++++++++++++++++
multimedia/ffmpeg/patches/patch-ad | 24 +-
multimedia/ffmpeg/patches/patch-ag | 194 +++++++++++++++++++
7 files changed, 663 insertions(+), 15 deletions(-)
diffs (truncated from 765 to 300 lines):
diff -r ec367220d1a8 -r 09288044c527 multimedia/ffmpeg/Makefile
--- a/multimedia/ffmpeg/Makefile Sun Aug 29 21:56:19 2004 +0000
+++ b/multimedia/ffmpeg/Makefile Sun Aug 29 22:43:50 2004 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.8 2004/07/26 23:53:49 xtraeme Exp $
+# $NetBSD: Makefile,v 1.9 2004/08/29 22:43:50 wiz Exp $
DISTNAME= ffmpeg-0.4.8
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= multimedia net
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=ffmpeg/}
@@ -22,15 +22,25 @@
FFSERVER_CONF=${PKG_SYSCONFDIR}/ffserver.conf \
LOCALBASE="${LOCALBASE}"
-CONFIGURE_ARGS= --cc=${CC} --disable-grab --prefix=${PREFIX}
+CONFIGURE_ARGS= --cc=${CC} --prefix=${PREFIX}
CONFIGURE_ARGS+= --enable-pp --disable-vhook --disable-debug
+PKG_OPTIONS_VAR= PKG_OPTIONS.ffmpeg
+PKG_SUPPORTED_OPTIONS= bktr lame mmx vorbis
+
+.include "../../mk/bsd.options.mk"
+
+.include "../../mk/bsd.prefs.mk"
+
+.if !empty(USE_MMX:M[Yy][Ee][Ss])
+PKG_DEFAULT_OPTIONS+= mmx
+.endif
+
.include "../../mk/compiler.mk"
.if !empty(MACHINE_ARCH:Mi386)
-BUILD_DEFS+= USE_MMX
-. if !empty(USE_MMX:M[Yy][Ee][Ss]) && !empty(CC_VERSION:Mgcc*)
-CFLAGS+= -fomit-frame-pointer
+. if !empty(PKG_OPTIONS:Mmmx) && !empty(CC_VERSION:Mgcc*)
+CFLAGS+= -fomit-frame-pointer
. else
CONFIGURE_ARGS+= --disable-mmx
. endif
@@ -38,6 +48,15 @@
CONFIGURE_ARGS+= --disable-mmx
.endif
+.if !empty(PKG_OPTIONS:Mbktr)
+post-extract:
+ ${CP} ${FILESDIR}/grab_bsdbktr.c ${WRKSRC}/libavformat
+
+post-patch:
+ ${PATCH} --quiet -d ${WRKSRC} < ${FILESDIR}/bktr.diff
+ ${PATCH} --quiet -d ${WRKSRC} < ${FILESDIR}/ffmpeg.1.diff
+.endif
+
post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/ffmpeg \
${PREFIX}/share/doc/ffmpeg \
@@ -56,5 +75,19 @@
${PREFIX}/include/ffmpeg/libpostproc
.include "../../devel/libgetopt/buildlink3.mk"
-.include "../../mk/ossaudio.buildlink3.mk"
+
+.if !empty(PKG_OPTIONS:Mlame)
+CONFIGURE_ARGS+= --enable-mp3lame
+.include "../../audio/lame/buildlink3.mk"
+.else
+CONFIGURE_ARGS+= --disable-mp3lame
+.endif
+
+.if !empty(PKG_OPTIONS:Mvorbis)
+CONFIGURE_ARGS+= --enable-vorbis
+.include "../../audio/libvorbis/buildlink3.mk"
+.else
+CONFIGURE_ARGS+= --disable-vorbis
+.endif
+
.include "../../mk/bsd.pkg.mk"
diff -r ec367220d1a8 -r 09288044c527 multimedia/ffmpeg/distinfo
--- a/multimedia/ffmpeg/distinfo Sun Aug 29 21:56:19 2004 +0000
+++ b/multimedia/ffmpeg/distinfo Sun Aug 29 22:43:50 2004 +0000
@@ -1,10 +1,11 @@
-$NetBSD: distinfo,v 1.5 2004/08/06 11:01:53 drochner Exp $
+$NetBSD: distinfo,v 1.6 2004/08/29 22:43:50 wiz Exp $
SHA1 (ffmpeg-0.4.8.tar.gz) = 629a0f8f4daa3da1dedd8ba58bfdec4c47581bb4
Size (ffmpeg-0.4.8.tar.gz) = 1352874 bytes
SHA1 (patch-aa) = ed0dadc9112d8ae1cdcb30bc08f7e8c27195e027
SHA1 (patch-ab) = f596db3c555ab772eae2da5b8144c23fb4f2eaa0
SHA1 (patch-ac) = 6f137ca14131e00c2db89cbe44657f32f3513e98
-SHA1 (patch-ad) = 38ce2de4fd721ed0832669ffb9e30f4a909e10b2
+SHA1 (patch-ad) = e058ddcb0ad4211c16d2f4c5fe0859723316b3a8
SHA1 (patch-ae) = 7223978301c95de96d19610afb332f10764c4de0
SHA1 (patch-af) = 6e245cee0c49bc9a829bc9caf5fad5f887da8e3c
+SHA1 (patch-ag) = 975f7dac2488f367083cf4375b862fe8e3f4daf6
diff -r ec367220d1a8 -r 09288044c527 multimedia/ffmpeg/files/bktr.diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/ffmpeg/files/bktr.diff Sun Aug 29 22:43:50 2004 +0000
@@ -0,0 +1,22 @@
+--- libavformat/Makefile.orig 2004-08-14 14:51:47.000000000 +0200
++++ libavformat/Makefile 2004-08-14 14:52:43.000000000 +0200
+@@ -32,7 +32,7 @@
+ OBJS+= framehook.o
+
+ ifeq ($(CONFIG_VIDEO4LINUX),yes)
+-OBJS+= grab.o
++OBJS+= grab_bsdbktr.o
+ endif
+
+ ifeq ($(CONFIG_DV1394),yes)
+--- configure.org 2004-07-31 17:12:40.000000000 +0200
++++ configure 2004-07-31 17:12:54.000000000 +0200
+@@ -231,6 +231,8 @@
+ *) ;;
+ esac
+
++v4l="yes"
++
+ # From mplayer configure. We need TARGET_OS available
+ # to the Makefile, so it can distinguish between flavors
+ # of AltiVec on PowerPC
diff -r ec367220d1a8 -r 09288044c527 multimedia/ffmpeg/files/ffmpeg.1.diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/ffmpeg/files/ffmpeg.1.diff Sun Aug 29 22:43:50 2004 +0000
@@ -0,0 +1,61 @@
+--- doc/ffmpeg.1.orig 2004-08-29 12:38:34.000000000 +0200
++++ doc/ffmpeg.1 2004-08-29 13:03:08.000000000 +0200
+@@ -505,21 +505,49 @@
+ tell that the raw codec data must be copied as is.
+ .Sh "Audio/Video grab options"
+ .IX Subsection "Audio/Video grab options"
+-.IP "\fB\-vd device\fR" 4
+-.IX Item "-vd device"
+-set video grab device (e.g. \fI/dev/video0\fR)
+-.IP "\fB\-vc channel\fR" 4
+-.IX Item "-vc channel"
+-set video grab channel (\s-1DV1394\s0 only)
+ .IP "\fB\-tvstd standard\fR" 4
+ .IX Item "-tvstd standard"
+ set television standard (\s-1NTSC\s0, \s-1PAL\s0 (\s-1SECAM\s0))
+-.IP "\fB\-dv1394\fR" 4
+-.IX Item "-dv1394"
+-set \s-1DV1394\s0 grab
+ .IP "\fB\-ad device\fR" 4
+ .IX Item "-ad device"
+ set audio device (e.g. \fI/dev/dsp\fR)
++.PP
++This build of ffmpeg includes NetBSD-specific patches that change the
++video-grabbing semantics. Recording from bktr(4) can be controlled via the
++following environment variables:
++.PP
++.RS
++.B BKTR_DEV
++(0\-4): which of the devices on the bktr should provide the signal (tuner,
++video-in,...)
++.PP
++.B BKTR_FORMAT
++(1\-6): TV format, 1 PAL 2 NTSC 3 SECAM 4 PALN 5 PALM 6 NTSCJ
++.PP
++.B BKTR_FREQUENCY
++(float): frequency to which the tuner should be set.
++.PP
++.B BKTR_CHANNEL
++(int): channel to which the tuner should be set, overrides BKTR_FREQUENCY
++.RE
++.PP
++If you set the channel or frequency with a different program such as xawtv
++or fxtv you might not get audio; try to use the environment variables in
++that case. Do not forget to set the following mixerctl variables to useful
++values:
++.PP
++.RS
++record.source=line
++.PP
++record.volume=255,255
++.PP
++inputs.line=255,255
++.RE
++.PP
++One possible command line would then be:
++.PP
++ffmpeg -y -intra -tvstd pal -vcodec mpeg2video -s 768x576 -b 9600 -ab 128 -ad
++/dev/audio -ac 2 -ar 44100 /tmp/file.mpg
+ .Sh "Advanced options"
+ .IX Subsection "Advanced options"
+ .IP "\fB\-map file:stream\fR" 4
diff -r ec367220d1a8 -r 09288044c527 multimedia/ffmpeg/files/grab_bsdbktr.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/ffmpeg/files/grab_bsdbktr.c Sun Aug 29 22:43:50 2004 +0000
@@ -0,0 +1,325 @@
+/*
+ * FreeBSD video grab interface
+ * Copyright (c) 2002 Steve O'Hara-Smith
+ * based on
+ * Linux video grab interface
+ * Copyright (c) 2000,2001 Gerard Lantau.
+ * and
+ * simple_grab.c Copyright (c) 1999 Roger Hardiman
+ *
+ * GPL virus inherited:
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#include "avformat.h"
+#include <dev/ic/bt8xx.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <sys/time.h>
+#include <signal.h>
+
+typedef struct {
+ int fd;
+ int tuner_fd;
+ int frame_format; /* see VIDEO_PALETTE_xxx */
+ int width, height;
+ int frame_rate;
+ int frame_rate_base;
+ int64_t per_frame;
+} VideoData;
+
+const char *video_device = "/dev/bktr0";
+
+#define PAL 1
+#define PALBDGHI 1
+#define NTSC 2
+#define NTSCM 2
+#define SECAM 3
+#define PALN 4
+#define PALM 5
+#define NTSCJ 6
+
+/* PAL is 768 x 576. NTSC is 640 x 480 */
+#define PAL_HEIGHT 576
+#define SECAM_HEIGHT 576
+#define NTSC_HEIGHT 480
+
+#ifndef VIDEO_FORMAT
+#define VIDEO_FORMAT NTSC
+#endif
+
+static int bktr_dev[] = { METEOR_DEV0, METEOR_DEV1, METEOR_DEV2,
+ METEOR_DEV3, METEOR_DEV_SVIDEO };
+
+static u_int8_t *video_buf;
+static int nsignals = 0;
+static void catchsignal(int signal)
+{
+ nsignals++;
+ return;
+}
+
+static int bktr_init (const char *video_device, int width, int height,
+ int format, u_int8_t **video_buf, int *video_fd, int *tuner_fd,
+ int idev, double frequency)
+{
+ struct meteor_geomet geo;
+ int h_max;
+ long ioctl_frequency;
+ char *arg;
+ int c;
+ int channel = 0;
+ struct sigaction act,old;
+
+ if (idev < 0 || idev > 4)
+ {
+ arg = getenv ("BKTR_DEV");
+ if (arg)
+ idev = atoi (arg);
+ if (idev < 0 || idev > 4)
+ idev = 0;
+ }
+
+ if (format < 1 || format > 6)
+ {
+ arg = getenv ("BKTR_FORMAT");
+ if (arg)
+ format = atoi (arg);
+ if (format < 1 || format > 6)
+ format = VIDEO_FORMAT;
+ }
+
+ if (frequency <= 0)
+ {
+ arg = getenv ("BKTR_FREQUENCY");
Home |
Main Index |
Thread Index |
Old Index