diff options
author | lioux <lioux@FreeBSD.org> | 2003-01-11 02:21:21 +0800 |
---|---|---|
committer | lioux <lioux@FreeBSD.org> | 2003-01-11 02:21:21 +0800 |
commit | 71f42afed38c396eb89ba5148f323356783f918a (patch) | |
tree | be5d4194c32360ef54c266c4b28c65d23a314773 /multimedia/ffmpeg/files | |
parent | 680b79f6faa8ee94fbd33ee1ef40b9c4aed6b5e9 (diff) | |
download | freebsd-ports-graphics-71f42afed38c396eb89ba5148f323356783f918a.tar.gz freebsd-ports-graphics-71f42afed38c396eb89ba5148f323356783f918a.tar.zst freebsd-ports-graphics-71f42afed38c396eb89ba5148f323356783f918a.zip |
- After repo copy to ffmpeg045 port so that both older and faster
version 0.4.5 is preserved while the current version matures:
o Update to 0.4.6
o Remove ONLY_FOR_ARCHS, no longer i386 only
o Add PKGMESSAGE explaining the differences between this and ffmpeg045
port
Reviewed by: Steve O'Hara-Smith <steve@sohara.org>
Repo copied by: cvs (joe)
Approved by: portmgr (self)
Diffstat (limited to 'multimedia/ffmpeg/files')
-rw-r--r-- | multimedia/ffmpeg/files/extra-bktr-patch-ffmpeg.c | 16 | ||||
-rw-r--r-- | multimedia/ffmpeg/files/extra-bktr-patch-libavformat::Makefile (renamed from multimedia/ffmpeg/files/patch-libav::Makefile) | 14 | ||||
-rw-r--r-- | multimedia/ffmpeg/files/extra-bktr-patch-libavformat::avformat.h | 11 | ||||
-rw-r--r-- | multimedia/ffmpeg/files/grab_bsdbktr.c | 79 | ||||
-rw-r--r-- | multimedia/ffmpeg/files/patch-Makefile | 30 | ||||
-rw-r--r-- | multimedia/ffmpeg/files/patch-ffmpeg.c | 16 | ||||
-rw-r--r-- | multimedia/ffmpeg/files/patch-ffserver.c | 18 | ||||
-rw-r--r-- | multimedia/ffmpeg/files/patch-libav::avformat.h | 9 | ||||
-rw-r--r-- | multimedia/ffmpeg/files/patch-libavformat::Makefile | 20 | ||||
-rw-r--r-- | multimedia/ffmpeg/files/patch-libavformat::avformat.h | 11 |
10 files changed, 124 insertions, 100 deletions
diff --git a/multimedia/ffmpeg/files/extra-bktr-patch-ffmpeg.c b/multimedia/ffmpeg/files/extra-bktr-patch-ffmpeg.c index 2242cdb60be..0ba5924735c 100644 --- a/multimedia/ffmpeg/files/extra-bktr-patch-ffmpeg.c +++ b/multimedia/ffmpeg/files/extra-bktr-patch-ffmpeg.c @@ -1,14 +1,14 @@ ---- ffmpeg.c.orig Thu Oct 10 20:13:52 2002 -+++ ffmpeg.c Thu Oct 10 20:14:03 2002 -@@ -36,6 +36,7 @@ - #include <ctype.h> - +--- ffmpeg.c.orig Wed Jan 1 20:56:06 2003 ++++ ffmpeg.c Wed Jan 1 20:56:41 2003 +@@ -35,6 +35,7 @@ + #define INFINITY HUGE_VAL + #endif +#define INT64_C(x) x##LL #define MAXINT64 INT64_C(0x7fffffffffffffff) typedef struct { -@@ -146,7 +147,7 @@ +@@ -158,7 +159,7 @@ const char *audio_device = "none"; #endif #ifndef CONFIG_VIDEO4LINUX @@ -17,7 +17,7 @@ #endif typedef struct AVOutputStream { -@@ -1601,7 +1602,7 @@ +@@ -1842,7 +1843,7 @@ void opt_video_device(const char *arg) { @@ -26,7 +26,7 @@ } void opt_audio_device(const char *arg) -@@ -2099,7 +2100,7 @@ +@@ -2428,7 +2429,7 @@ /* by now video grab has one stream */ ic->streams[0]->r_frame_rate = ap->frame_rate; input_files[nb_input_files] = ic; diff --git a/multimedia/ffmpeg/files/patch-libav::Makefile b/multimedia/ffmpeg/files/extra-bktr-patch-libavformat::Makefile index bc4294226b2..a24d33a0ad4 100644 --- a/multimedia/ffmpeg/files/patch-libav::Makefile +++ b/multimedia/ffmpeg/files/extra-bktr-patch-libavformat::Makefile @@ -1,20 +1,20 @@ ---- libav/Makefile.orig Tue Oct 8 13:54:16 2002 -+++ libav/Makefile Tue Oct 8 13:54:30 2002 +--- libavformat/Makefile.orig Wed Jan 1 21:00:22 2003 ++++ libavformat/Makefile Wed Jan 1 21:01:27 2003 @@ -6,7 +6,7 @@ - VPATH=$(SRC_PATH)/libav + VPATH=$(SRC_PATH)/libavformat -CFLAGS= $(OPTFLAGS) -Wall -g -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE +CFLAGS= $(OPTFLAGS) -Wall -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE OBJS= utils.o cutils.o allformats.o -@@ -17,7 +17,7 @@ - OBJS+= avio.o aviobuf.o file.o - +@@ -21,7 +21,7 @@ + endif + ifeq ($(CONFIG_VIDEO4LINUX),yes) -OBJS+= grab.o +OBJS+= grab_bsdbktr.o endif - + ifeq ($(CONFIG_AUDIO_OSS),yes) diff --git a/multimedia/ffmpeg/files/extra-bktr-patch-libavformat::avformat.h b/multimedia/ffmpeg/files/extra-bktr-patch-libavformat::avformat.h new file mode 100644 index 00000000000..7c3de0a2092 --- /dev/null +++ b/multimedia/ffmpeg/files/extra-bktr-patch-libavformat::avformat.h @@ -0,0 +1,11 @@ +--- libavformat/avformat.h.orig Wed Jan 1 21:03:56 2003 ++++ libavformat/avformat.h Wed Jan 1 21:04:02 2003 +@@ -329,7 +329,7 @@ + int video_grab_init(void); + int audio_init(void); + +-extern const char *v4l_device; ++extern const char *video_device; + extern const char *audio_device; + + #ifdef HAVE_AV_CONFIG_H diff --git a/multimedia/ffmpeg/files/grab_bsdbktr.c b/multimedia/ffmpeg/files/grab_bsdbktr.c index f071b2da00f..06499141ea6 100644 --- a/multimedia/ffmpeg/files/grab_bsdbktr.c +++ b/multimedia/ffmpeg/files/grab_bsdbktr.c @@ -38,8 +38,7 @@ typedef struct { int frame_format; /* see VIDEO_PALETTE_xxx */ int width, height; int frame_rate; - INT64 per_frame; - INT64 last_frame_time; + int frame_size; } VideoData; const char *video_device = "/dev/bktr0"; @@ -60,10 +59,14 @@ const char *video_device = "/dev/bktr0"; #endif static UINT8 *video_buf; -static int nsignals = 0; + +static int signal_expected = 0; +static int unexpected_signals = 0; + static void catchsignal(int signal) { - nsignals++; + if (!signal_expected) unexpected_signals++; + signal_expected = 0; return; } @@ -85,7 +88,6 @@ static int bktr_init(AVFormatContext *s1, AVFormatParameters *ap) width = s->width; height = s->height; - s->last_frame_time = 0; s->tuner_fd = open ("/dev/tuner0", O_RDWR); if (s->tuner_fd < 0) { @@ -101,7 +103,7 @@ static int bktr_init(AVFormatContext *s1, AVFormatParameters *ap) geo.rows = height; geo.columns = width; geo.frames = 1; - geo.oformat = METEOR_GEO_YUV_422 | METEOR_GEO_YUV_12; + geo.oformat = METEOR_GEO_YUV_PACKED; if ((format == PAL) && (height <= (PAL_HEIGHT/2))) geo.oformat |= METEOR_GEO_EVEN_ONLY; @@ -129,7 +131,7 @@ static int bktr_init(AVFormatContext *s1, AVFormatParameters *ap) perror ("METEORSINPUT"); return -EIO; } - video_buf = mmap((caddr_t)0, width*height*3, PROT_READ, MAP_SHARED, + video_buf = mmap((caddr_t)0, width*height*2, PROT_READ, MAP_SHARED, video_fd, (off_t) 0); if (video_buf == MAP_FAILED) { perror ("mmap"); @@ -138,45 +140,66 @@ static int bktr_init(AVFormatContext *s1, AVFormatParameters *ap) c = METEOR_CAP_CONTINOUS; ioctl(s->fd, METEORCAPTUR, &c); c = SIGUSR1; + signal_expected = 1; ioctl (s->fd, METEORSSIGNAL, &c); return 0; } +static void bf_yuv422_to_yuv420p(UINT8 *lum, UINT8 *cb, UINT8 *cr, + UINT8 *src, int width, int height) +{ + int x, y; + UINT8 *p = src; + for(y=0;y<height;y+=2) { + for(x=0;x<width;x+=2) { + lum[0] = p[1]; + cb[0] = p[0]; + lum[1] = p[3]; + cr[0] = p[2]; + p += 4; + lum += 2; + cb++; + cr++; + } + for(x=0;x<width;x+=2) { + lum[0] = p[1]; + lum[1] = p[3]; + p += 4; + lum += 2; + } + } +} + /* note: we support only one picture read at a time */ static int grab_read_packet(AVFormatContext *s1, AVPacket *pkt) { VideoData *s = s1->priv_data; int size, halfsize; sigset_t msig; - UINT64 curtime; + UINT8 *lum, *cb, *cr; size = s->width * s->height; halfsize = size << 1; if (av_new_packet(pkt, size + halfsize) < 0) return -EIO; - curtime = av_gettime(); - if (!s->last_frame_time - || ((s->last_frame_time + s->per_frame) > curtime)) { - if (!usleep (s->last_frame_time + s->per_frame + s->per_frame/8 - curtime)) { - if (!nsignals) - printf ("\nSLEPT NO signals - %d microseconds late\n", - av_gettime() - s->last_frame_time - s->per_frame); - } - } else if ((s->last_frame_time + s->per_frame*5 < curtime)) { - bzero (pkt->data, size + halfsize); - printf ("\nBlank %d signals - %d microseconds\n", - nsignals, curtime - s->last_frame_time - s->per_frame); - s->last_frame_time += s->per_frame; - return size + halfsize; + if (unexpected_signals > 0) { + unexpected_signals--; + } else { + signal_expected = 1; + sigemptyset (&msig); + sigsuspend (&msig); } - nsignals = 0; - s->last_frame_time = s->last_frame_time - ? s->last_frame_time + s->per_frame - : av_gettime(); + if (unexpected_signals & 1) { + bzero (pkt->data, size + halfsize); + } else { + lum = pkt->data; + cb = lum + size; + cr = cb + size/4; - memcpy (pkt->data, video_buf, size + halfsize); + bf_yuv422_to_yuv420p (lum, cb, cr, video_buf, s->width, s->height); + } return size + halfsize; } @@ -203,7 +226,7 @@ static int grab_read_header (AVFormatContext *s1, AVFormatParameters *ap) s->width = width; s->height = height; s->frame_rate = frame_rate; - s->per_frame = (INT64_C(1000000) * FRAME_RATE_BASE) / s->frame_rate; + s->frame_size = width*height*2; st->codec.pix_fmt = PIX_FMT_YUV420P; st->codec.codec_id = CODEC_ID_RAWVIDEO; st->codec.width = width; diff --git a/multimedia/ffmpeg/files/patch-Makefile b/multimedia/ffmpeg/files/patch-Makefile index eebc45c2755..b3c67ee98c4 100644 --- a/multimedia/ffmpeg/files/patch-Makefile +++ b/multimedia/ffmpeg/files/patch-Makefile @@ -1,26 +1,12 @@ ---- Makefile.orig Sun Sep 1 15:07:34 2002 -+++ Makefile Tue Oct 8 13:51:49 2002 -@@ -6,12 +6,12 @@ +--- Makefile.orig Wed Jan 1 20:51:57 2003 ++++ Makefile Wed Jan 1 20:52:27 2003 +@@ -6,8 +6,7 @@ VPATH=$(SRC_PATH) --CFLAGS= $(OPTFLAGS) -Wall -g -I. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libav -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -+CFLAGS= $(OPTFLAGS) -Wall -I. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libav -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE - ifeq ($(CONFIG_DARWIN),yes) - LDFLAGS+= -g -d - FFSLDFLAGS= -Wl,-bind_at_load - else --LDFLAGS+= -g -Wl,--warn-common -+LDFLAGS+= -Wl,--warn-common - FFSLDFLAGS= -Wl,-E - endif - -@@ -60,7 +60,7 @@ - ffserver$(EXE): ffserver.o $(DEP_LIBS) - $(CC) $(LDFLAGS) $(FFSLDFLAGS) \ - -o $@ ffserver.o -L./libavcodec -L./libav \ -- -lavformat -lavcodec -ldl $(EXTRALIBS) -+ -lavformat -lavcodec $(EXTRALIBS) +-CFLAGS= $(OPTFLAGS) -Wall -g -I. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE +-LDFLAGS+= -g ++CFLAGS= $(OPTFLAGS) -Wall -I. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE - ffplay: ffmpeg$(EXE) - ln -sf $< $@ + ifeq ($(TARGET_GPROF),yes) + CFLAGS+=-p diff --git a/multimedia/ffmpeg/files/patch-ffmpeg.c b/multimedia/ffmpeg/files/patch-ffmpeg.c index 2242cdb60be..0ba5924735c 100644 --- a/multimedia/ffmpeg/files/patch-ffmpeg.c +++ b/multimedia/ffmpeg/files/patch-ffmpeg.c @@ -1,14 +1,14 @@ ---- ffmpeg.c.orig Thu Oct 10 20:13:52 2002 -+++ ffmpeg.c Thu Oct 10 20:14:03 2002 -@@ -36,6 +36,7 @@ - #include <ctype.h> - +--- ffmpeg.c.orig Wed Jan 1 20:56:06 2003 ++++ ffmpeg.c Wed Jan 1 20:56:41 2003 +@@ -35,6 +35,7 @@ + #define INFINITY HUGE_VAL + #endif +#define INT64_C(x) x##LL #define MAXINT64 INT64_C(0x7fffffffffffffff) typedef struct { -@@ -146,7 +147,7 @@ +@@ -158,7 +159,7 @@ const char *audio_device = "none"; #endif #ifndef CONFIG_VIDEO4LINUX @@ -17,7 +17,7 @@ #endif typedef struct AVOutputStream { -@@ -1601,7 +1602,7 @@ +@@ -1842,7 +1843,7 @@ void opt_video_device(const char *arg) { @@ -26,7 +26,7 @@ } void opt_audio_device(const char *arg) -@@ -2099,7 +2100,7 @@ +@@ -2428,7 +2429,7 @@ /* by now video grab has one stream */ ic->streams[0]->r_frame_rate = ap->frame_rate; input_files[nb_input_files] = ic; diff --git a/multimedia/ffmpeg/files/patch-ffserver.c b/multimedia/ffmpeg/files/patch-ffserver.c deleted file mode 100644 index 93bd700c513..00000000000 --- a/multimedia/ffmpeg/files/patch-ffserver.c +++ /dev/null @@ -1,18 +0,0 @@ ---- ffserver.c.orig Tue Oct 8 13:45:36 2002 -+++ ffserver.c Tue Oct 8 13:46:10 2002 -@@ -20,7 +20,6 @@ - #include "avformat.h" - - #include <stdarg.h> --#include <netinet/in.h> - #include <unistd.h> - #include <fcntl.h> - #include <sys/ioctl.h> -@@ -30,6 +29,7 @@ - #include <time.h> - #include <sys/types.h> - #include <sys/socket.h> -+#include <netinet/in.h> - #include <sys/wait.h> - #include <arpa/inet.h> - #include <netdb.h> diff --git a/multimedia/ffmpeg/files/patch-libav::avformat.h b/multimedia/ffmpeg/files/patch-libav::avformat.h deleted file mode 100644 index 3199bc4a0bb..00000000000 --- a/multimedia/ffmpeg/files/patch-libav::avformat.h +++ /dev/null @@ -1,9 +0,0 @@ ---- libav/avformat.h Mon Jul 8 04:38:40 2002 -+++ libav/avformat.h Sun Jul 14 15:22:58 2002 -@@ -284,5 +284,5 @@ - int video_grab_init(void); - int audio_init(void); - --extern const char *v4l_device; -+extern const char *video_device; - extern const char *audio_device; diff --git a/multimedia/ffmpeg/files/patch-libavformat::Makefile b/multimedia/ffmpeg/files/patch-libavformat::Makefile new file mode 100644 index 00000000000..a24d33a0ad4 --- /dev/null +++ b/multimedia/ffmpeg/files/patch-libavformat::Makefile @@ -0,0 +1,20 @@ +--- libavformat/Makefile.orig Wed Jan 1 21:00:22 2003 ++++ libavformat/Makefile Wed Jan 1 21:01:27 2003 +@@ -6,7 +6,7 @@ + + VPATH=$(SRC_PATH)/libavformat + +-CFLAGS= $(OPTFLAGS) -Wall -g -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE ++CFLAGS= $(OPTFLAGS) -Wall -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE + + OBJS= utils.o cutils.o allformats.o + +@@ -21,7 +21,7 @@ + endif + + ifeq ($(CONFIG_VIDEO4LINUX),yes) +-OBJS+= grab.o ++OBJS+= grab_bsdbktr.o + endif + + ifeq ($(CONFIG_AUDIO_OSS),yes) diff --git a/multimedia/ffmpeg/files/patch-libavformat::avformat.h b/multimedia/ffmpeg/files/patch-libavformat::avformat.h new file mode 100644 index 00000000000..7c3de0a2092 --- /dev/null +++ b/multimedia/ffmpeg/files/patch-libavformat::avformat.h @@ -0,0 +1,11 @@ +--- libavformat/avformat.h.orig Wed Jan 1 21:03:56 2003 ++++ libavformat/avformat.h Wed Jan 1 21:04:02 2003 +@@ -329,7 +329,7 @@ + int video_grab_init(void); + int audio_init(void); + +-extern const char *v4l_device; ++extern const char *video_device; + extern const char *audio_device; + + #ifdef HAVE_AV_CONFIG_H |