diff options
Diffstat (limited to 'multimedia/ffmpeg-devel/files')
11 files changed, 110 insertions, 199 deletions
diff --git a/multimedia/ffmpeg-devel/files/extra-bktr-patch-libavformat::Makefile b/multimedia/ffmpeg-devel/files/extra-bktr-patch-libavformat::Makefile deleted file mode 100644 index 25f7c23de3a0..000000000000 --- a/multimedia/ffmpeg-devel/files/extra-bktr-patch-libavformat::Makefile +++ /dev/null @@ -1,11 +0,0 @@ ---- libavformat/Makefile.orig Wed Jan 1 21:00:22 2003 -+++ libavformat/Makefile Wed Jan 1 21:01:27 2003 -@@ -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-devel/files/grab_bsdbktr.c b/multimedia/ffmpeg-devel/files/grab_bsdbktr.c index 853cf55221f4..afb4b79574bb 100644 --- a/multimedia/ffmpeg-devel/files/grab_bsdbktr.c +++ b/multimedia/ffmpeg-devel/files/grab_bsdbktr.c @@ -80,7 +80,7 @@ static void catchsignal(int signal) } 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 format, u_int8_t **video_buf_local, int *video_fd, int *tuner_fd, int idev, double frequency) { struct meteor_geomet geo; @@ -127,10 +127,11 @@ static int bktr_init (const char *video_device, int width, int height, perror("Warning: Tuner not opened continuing"); } - *video_fd = open (video_device, O_RDONLY); +// *video_fd = open (video_device, O_RDONLY); + *video_fd = open (video_device, O_RDWR); if (*video_fd < 0) { perror (video_device); - return -1; + return AVERROR_IO; } geo.rows = height; @@ -167,9 +168,9 @@ static int bktr_init (const char *video_device, int width, int height, perror ("METEORSINPUT"); return -1; } - *video_buf = (u_int8_t *) mmap((caddr_t)0, width*height*2, + *video_buf_local = (u_int8_t *) mmap((void *)0, width*height*2, PROT_READ, MAP_SHARED, *video_fd, (off_t) 0); - if (*video_buf == MAP_FAILED) { + if (*video_buf_local == MAP_FAILED) { perror ("mmap"); return -1; } @@ -185,23 +186,29 @@ static int bktr_init (const char *video_device, int width, int height, return 0; } -static void bktr_getframe(u_int64_t per_frame) +static void bktr_getframe(VideoData *s) { - u_int64_t curtime; - static u_int64_t last_frame_time = 0; - - curtime = av_gettime(); - if (!last_frame_time - || ((last_frame_time + per_frame) > curtime)) { - if (!usleep (last_frame_time + per_frame + per_frame/8 - curtime)) { - if (!nsignals) - printf ("\nSLEPT NO signals - %d microseconds late\n", - (int) (av_gettime() - last_frame_time - per_frame)); + int64_t curtime, delay; + struct timespec ts; + + /* Calculate the time of the next frame */ + s->per_frame += int64_t_C(1000000); + + /* wait based on the frame rate */ + for(;;) { + curtime = av_gettime(); + delay = s->per_frame * s->frame_rate_base / s->frame_rate - curtime; + if (delay <= 0) { + if (delay < int64_t_C(-1000000) * s->frame_rate_base / s->frame_rate) { + /* printf("grabbing is %d frames late (dropping)\n", (int) -(delay / 16666)); */ + s->per_frame += int64_t_C(1000000); + } + break; } + ts.tv_sec = delay / 1000000; + ts.tv_nsec = (delay % 1000000) * 1000; + nanosleep(&ts, NULL); } - nsignals = 0; - - last_frame_time = curtime; } void bf_memcpy (char *dest, char *src, int size) @@ -226,10 +233,12 @@ static int grab_read_packet(AVFormatContext *s1, AVPacket *pkt) // if (av_new_packet(pkt, size + halfsize) < 0) if (av_new_packet(pkt, size + size) < 0) - return -EIO; + return AVERROR_IO; + + bktr_getframe (s); +// pkt->pts = av_gettime() & ((1LL << 48) - 1); + pkt->pts = av_gettime() * s->frame_rate / s->frame_rate_base; - bktr_getframe (s->per_frame); - pkt->pts = av_gettime() & ((1LL << 48) - 1); bf_memcpy (pkt->data, video_buf, size + size); // bf_memcpy (pkt->data, video_buf, size + halfsize); @@ -246,18 +255,23 @@ static int grab_read_header (AVFormatContext *s1, AVFormatParameters *ap) int frame_rate_base; int format = -1; - if (!ap || ap->width <= 0 || ap->height <= 0 || ap->frame_rate <= 0) + if (!ap || ap->width <= 0 || ap->height <= 0 || ap->time_base.den <= 0) return -1; width = ap->width; height = ap->height; - frame_rate = ap->frame_rate; - frame_rate_base = ap->frame_rate_base; + frame_rate = ap->time_base.den; + frame_rate_base = ap->time_base.num; + + if((unsigned)width > 32767 || (unsigned)height > 32767) + return -1; st = av_new_stream(s1, 0); if (!st) return -ENOMEM; + av_set_pts_info(st, 48, 1, 1000000); /* 48 bits pts in us */ + s->width = width; s->height = height; s->frame_rate = frame_rate; @@ -270,10 +284,8 @@ static int grab_read_header (AVFormatContext *s1, AVFormatParameters *ap) st->codec.codec_id = CODEC_ID_RAWVIDEO; st->codec.width = width; st->codec.height = height; - st->codec.frame_rate = frame_rate; - st->codec.frame_rate_base = frame_rate_base; - - av_set_pts_info(s1, 48, 1, 1000000); /* 48 bits pts in use */ + st->codec.time_base.den = frame_rate; + st->codec.time_base.num = frame_rate_base; if (ap->standard) { if (!strcasecmp(ap->standard, "pal")) @@ -286,7 +298,7 @@ static int grab_read_header (AVFormatContext *s1, AVFormatParameters *ap) if (bktr_init (video_device, width, height, format, &video_buf, &(s->fd), &(s->tuner_fd), -1, 0.0) < 0) - return -EIO; + return AVERROR_IO; return 0; } @@ -298,7 +310,7 @@ static int grab_read_close (AVFormatContext *s1) ioctl(s->fd, METEORCAPTUR, &c); close(s->fd); close(s->tuner_fd); - av_free(s); + munmap((void *)video_buf, sizeof(video_buf)); return 0; } diff --git a/multimedia/ffmpeg-devel/files/patch-Makefile b/multimedia/ffmpeg-devel/files/patch-Makefile deleted file mode 100644 index a04053123a5f..000000000000 --- a/multimedia/ffmpeg-devel/files/patch-Makefile +++ /dev/null @@ -1,14 +0,0 @@ ---- Makefile.orig Sat Jul 17 11:05:15 2004 -+++ Makefile Sat Jul 17 11:04:42 2004 -@@ -81,8 +81,9 @@ - all: lib $(PROG) $(PROGTEST) $(VHOOK) $(QTFASTSTART) $(DOC) - - lib: -- $(MAKE) -C libavcodec all -- $(MAKE) -C libavformat all -+ $(MAKE) LDFLAGS="$(LDFLAGS)" -C libavcodec all -+ $(MAKE) LDFLAGS="$(LDFLAGS)" -C libavformat all -+ - - ffmpeg_g$(EXESUF): ffmpeg.o cmdutils.o .libs - $(CC) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(FFLIBS) $(EXTRALIBS) diff --git a/multimedia/ffmpeg-devel/files/patch-configure b/multimedia/ffmpeg-devel/files/patch-configure deleted file mode 100644 index 8aa0caaa7940..000000000000 --- a/multimedia/ffmpeg-devel/files/patch-configure +++ /dev/null @@ -1,29 +0,0 @@ ---- configure.orig Mon Jul 5 15:05:54 2004 -+++ configure Sun Dec 5 15:49:57 2004 -@@ -88,7 +88,7 @@ - mandir="" - bindir="" - cross_prefix="" --cc="gcc" -+cc="$CC" - ar="ar" - ranlib="ranlib" - make="make" -@@ -187,7 +187,7 @@ - BeOS) - prefix="/boot/home/config" - # helps building libavcodec --CFLAGS="-DPIC -fomit-frame-pointer" -+CFLAGS="$CFLAGS -DPIC -fomit-frame-pointer" - # 3 gcc releases known for BeOS, each with ugly bugs - gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`" - case "$gcc_version" in -@@ -857,7 +857,7 @@ - EOF - - imlib2=no --if $cc -o $TMPE $TMPC -lImlib2 -lm > /dev/null 2>&1 ; then -+if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lImlib2 -lm > /dev/null 2>&1 ; then - imlib2=yes - fi - diff --git a/multimedia/ffmpeg-devel/files/patch-libavcodec::Makefile b/multimedia/ffmpeg-devel/files/patch-libavcodec::Makefile index 4ed42ea46e9d..96f23b48f7da 100644 --- a/multimedia/ffmpeg-devel/files/patch-libavcodec::Makefile +++ b/multimedia/ffmpeg-devel/files/patch-libavcodec::Makefile @@ -1,22 +1,13 @@ ---- libavcodec/Makefile.orig Sat Jul 17 11:07:57 2004 -+++ libavcodec/Makefile Sat Jul 17 11:09:21 2004 -@@ -197,7 +197,7 @@ - $(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS) - -lib /machine:i386 /def:$(@:.dll=.def) +--- libavcodec/Makefile.orig Sun May 1 17:07:56 2005 ++++ libavcodec/Makefile Sun May 1 17:08:29 2005 +@@ -303,8 +303,8 @@ + install $(INSTALLSTRIP) -m 755 $(SLIB) "$(prefix)" else -- $(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS) $(LDFLAGS) -+ $(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS) - endif - - dsputil.o: dsputil.c dsputil.h -@@ -269,8 +269,8 @@ - install -s -m 755 $(SLIB) "$(prefix)" - else - install -d $(prefix)/lib -- install -s -m 755 $(SLIB) $(prefix)/lib/libavcodec-$(VERSION).so -- ln -sf libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so -+ install -s -m 755 $(SLIB) $(prefix)/lib/libavcodec.so.1 -+ cd $(prefix)/lib && ln -s libavcodec.so.1 libavcodec.so + install -d $(libdir) +- install $(INSTALLSTRIP) -m 755 $(SLIB) $(libdir)/libavcodec-$(VERSION).so +- ln -sf libavcodec-$(VERSION).so $(libdir)/libavcodec.so ++ ${BSD_INSTALL_DATA} $(SLIB) $(prefix)/lib/libavcodec.so.1 ++ cd $(prefix)/lib && ln -sf libavcodec.so.1 libavcodec.so ldconfig || true endif - else + ifeq ($(CONFIG_PP),yes) diff --git a/multimedia/ffmpeg-devel/files/patch-libavcodec::alpha::simple_idct_alpha.c b/multimedia/ffmpeg-devel/files/patch-libavcodec::alpha::simple_idct_alpha.c deleted file mode 100644 index 9595454fd081..000000000000 --- a/multimedia/ffmpeg-devel/files/patch-libavcodec::alpha::simple_idct_alpha.c +++ /dev/null @@ -1,19 +0,0 @@ ---- libavcodec/alpha/simple_idct_alpha.c.bak Fri Dec 27 12:35:23 2002 -+++ libavcodec/alpha/simple_idct_alpha.c Tue May 13 21:21:42 2003 -@@ -24,8 +24,16 @@ - * and Falk Hueffner <falk@debian.org> - */ - -+#if (defined(__unix__) || defined(unix)) && !defined(USG) -+#include <sys/param.h> -+#endif -+ - #include "asm.h" - #include "../dsputil.h" -+ -+#if defined(__FreeBSD__) && __FreeBSD_version < 500000 -+typedef __int32_t int_fast32_t; -+#endif - - extern void (*put_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels, - int line_size); diff --git a/multimedia/ffmpeg-devel/files/patch-libavcodec::bswap.h b/multimedia/ffmpeg-devel/files/patch-libavcodec::bswap.h index 8bef16c36abc..bc314bd7bfa9 100644 --- a/multimedia/ffmpeg-devel/files/patch-libavcodec::bswap.h +++ b/multimedia/ffmpeg-devel/files/patch-libavcodec::bswap.h @@ -1,53 +1,21 @@ ---- libavcodec/bswap.h.orig Sun Dec 5 16:03:35 2004 -+++ libavcodec/bswap.h Sun Dec 5 16:06:48 2004 -@@ -10,6 +10,14 @@ - #include <byteswap.h> - #else +--- libavcodec/bswap.h.orig Sun May 8 20:40:17 2005 ++++ libavcodec/bswap.h Sun May 8 20:45:51 2005 +@@ -6,8 +6,18 @@ + #ifndef __BSWAP_H__ + #define __BSWAP_H__ ++/* to detect __FreeBSD_version */ +#if (defined(__unix__) || defined(unix)) && !defined(USG) +#include <sys/param.h> +#endif + -+#if defined(__FreeBSD__) && __FreeBSD_version >= 470000 + #ifdef HAVE_BYTESWAP_H + #include <byteswap.h> ++#elif (defined(__FreeBSD__) && __FreeBSD_version >= 470000) +#include <sys/endian.h> -+#endif -+ - #ifdef ARCH_X86 - static inline unsigned short ByteSwap16(unsigned short x) - { -@@ -18,7 +26,11 @@ - "0" (x)); - return x; - } -+#if defined(__FreeBSD__) && __FreeBSD_version >= 470000 -+#define bswap_16(x) (be16toh(x)) -+#else - #define bswap_16(x) ByteSwap16(x) -+#endif - - static inline unsigned int ByteSwap32(unsigned int x) - { -@@ -34,7 +46,11 @@ - "0" (x)); - return x; - } -+#if defined(__FreeBSD__) && __FreeBSD_version >= 470000 -+#define bswap_32(x) (be32toh(x)) -+#else - #define bswap_32(x) ByteSwap32(x) -+#endif - - static inline unsigned long long int ByteSwap64(unsigned long long int x) - { -@@ -45,7 +61,11 @@ - "0"(bswap_32((unsigned long)x)),"1"(bswap_32((unsigned long)(x>>32)))); - return __x.__ll; - } -+#if defined(__FreeBSD__) && __FreeBSD_version >= 510000 -+#define bswap_64(x) (be64toh(x)) -+#else - #define bswap_64(x) ByteSwap64(x) -+#endif - - #elif defined(ARCH_SH4) ++#define bswap_16(x) bswap16(x) ++#define bswap_32(x) bswap32(x) ++#define bswap_64(x) bswap64(x) + #else + #ifdef ARCH_X86_64 diff --git a/multimedia/ffmpeg-devel/files/patch-libavcodec::x264.c b/multimedia/ffmpeg-devel/files/patch-libavcodec::x264.c new file mode 100644 index 000000000000..5c4d4cc6085a --- /dev/null +++ b/multimedia/ffmpeg-devel/files/patch-libavcodec::x264.c @@ -0,0 +1,10 @@ +--- libavcodec/x264.c.orig Sun May 1 16:15:23 2005 ++++ libavcodec/x264.c Sun May 1 16:14:58 2005 +@@ -19,6 +19,7 @@ + + #include "avcodec.h" + #include <x264.h> ++#include <math.h> + + typedef struct X264Context { + x264_param_t params; diff --git a/multimedia/ffmpeg-devel/files/patch-libavformat::Makefile b/multimedia/ffmpeg-devel/files/patch-libavformat::Makefile index 36a7674c28e5..5cb229d585e7 100644 --- a/multimedia/ffmpeg-devel/files/patch-libavformat::Makefile +++ b/multimedia/ffmpeg-devel/files/patch-libavformat::Makefile @@ -1,13 +1,22 @@ ---- libavformat/Makefile.orig Thu Sep 11 22:55:10 2003 -+++ libavformat/Makefile Thu Sep 11 23:12:50 2003 -@@ -88,8 +88,8 @@ - install: all - ifeq ($(BUILD_SHARED),yes) - install -d $(prefix)/lib -- install -s -m 755 $(SLIB) $(prefix)/lib/libavformat-$(VERSION).so -- ln -sf libavformat-$(VERSION).so $(prefix)/lib/libavformat.so -+ install -s -m 755 $(SLIB) $(prefix)/lib/libavformat.so.1 +--- libavformat/Makefile.orig Tue Apr 26 07:17:51 2005 ++++ libavformat/Makefile Sun May 1 17:15:15 2005 +@@ -37,7 +37,7 @@ + OBJS+= framehook.o + + ifeq ($(CONFIG_VIDEO4LINUX),yes) +-OBJS+= grab.o ++OBJS+= grab_bsdbktr.o + endif + + ifeq ($(CONFIG_DV1394),yes) +@@ -109,8 +109,8 @@ + install $(INSTALLSTRIP) -m 755 $(SLIB) "$(prefix)" + else + install -d $(libdir) +- install $(INSTALLSTRIP) -m 755 $(SLIB) $(libdir)/libavformat-$(VERSION).so +- ln -sf libavformat-$(VERSION).so $(libdir)/libavformat.so ++ ${BSD_INSTALL_DATA} $(SLIB) $(prefix)/lib/libavformat.so.1 + ln -sf libavformat.so.1 $(prefix)/lib/libavformat.so ldconfig || true - mkdir -p $(prefix)/include/ffmpeg - install -m 644 $(VPATH)/avformat.h $(prefix)/include/ffmpeg/avformat.h + endif + else diff --git a/multimedia/ffmpeg-devel/files/patch-libavformat::udp.c b/multimedia/ffmpeg-devel/files/patch-libavformat::udp.c new file mode 100644 index 000000000000..11bd9641d541 --- /dev/null +++ b/multimedia/ffmpeg-devel/files/patch-libavformat::udp.c @@ -0,0 +1,13 @@ +--- libavformat/udp.c.orig Tue May 10 01:08:33 2005 ++++ libavformat/udp.c Tue May 10 01:09:27 2005 +@@ -27,6 +27,10 @@ + # include "barpainet.h" + #endif + #include <netdb.h> ++#ifndef IPV6_ADD_MEMBERSHIP ++#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP ++#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP ++#endif + + typedef struct { + int udp_fd; diff --git a/multimedia/ffmpeg-devel/files/patch-vhook::Makefile b/multimedia/ffmpeg-devel/files/patch-vhook::Makefile deleted file mode 100644 index cea89f3f74e5..000000000000 --- a/multimedia/ffmpeg-devel/files/patch-vhook::Makefile +++ /dev/null @@ -1,19 +0,0 @@ ---- vhook/Makefile.orig Fri Dec 5 20:07:04 2003 -+++ vhook/Makefile Fri Dec 5 20:07:55 2003 -@@ -29,13 +29,13 @@ - install -s -m 755 $(HOOKS) $(INSTDIR) - - imlib2.so: imlib2.o -- $(CC) -g -o $@ $(SHFLAGS) $< -lImlib2 -+ $(CC) -o $@ $(LDFLAGS) $(SHFLAGS) $< -lImlib2 - - drawtext.so: drawtext.o -- $(CC) -g -o $@ $(SHFLAGS) $< `freetype-config --libs` -+ $(CC) -o $@ $(LDFLAGS) $(SHFLAGS) $< `freetype-config --libs` - - %.so: %.o -- $(CC) -g -o $@ $(SHFLAGS) $< -+ $(CC) -o $@ $(LDFLAGS) $(SHFLAGS) $< - - clean: - rm -f *.o *.d .depend *.so *~ |