import rtmpdump, based on a ports@ post from David Cathcart, with BE fixes
and tweaks by myself. A small dumper for media content streamed over the RTMP protocol. Supplying an rtmp url will result in a dumped flv file, which can be played/transcoded using ffmpeg/mplayer, etc.
This commit is contained in:
parent
a887af279c
commit
e628dbbb60
30
net/rtmpdump/Makefile
Normal file
30
net/rtmpdump/Makefile
Normal file
@ -0,0 +1,30 @@
|
||||
# $OpenBSD: Makefile,v 1.1.1.1 2009/04/17 17:56:50 sthen Exp $
|
||||
|
||||
COMMENT = dump RTMP media streams
|
||||
|
||||
DISTNAME = rtmpdump-v1.4
|
||||
PKGNAME = ${DISTNAME:S/-v/-/}
|
||||
|
||||
CATEGORIES = net
|
||||
|
||||
HOMEPAGE = http://sourceforge.net/projects/rtmpdump/
|
||||
|
||||
# GPLv2+
|
||||
PERMIT_PACKAGE_CDROM = Yes
|
||||
PERMIT_PACKAGE_FTP = Yes
|
||||
PERMIT_DISTFILES_CDROM =Yes
|
||||
PERMIT_DISTFILES_FTP = Yes
|
||||
|
||||
WANTLIB = c m stdc++
|
||||
|
||||
MASTER_SITES = ${MASTER_SITE_SOURCEFORGE:=rtmpdump/}
|
||||
WRKDIST = ${WRKDIR}/rtmpdump
|
||||
|
||||
MAKE_FLAGS += CXX="${CXX}" CXXFLAGS="${CXXFLAGS}"
|
||||
|
||||
NO_REGRESS = Yes
|
||||
|
||||
do-install:
|
||||
${INSTALL_PROGRAM} ${WRKBUILD}/rtmpdump ${PREFIX}/bin
|
||||
|
||||
.include <bsd.port.mk>
|
5
net/rtmpdump/distinfo
Normal file
5
net/rtmpdump/distinfo
Normal file
@ -0,0 +1,5 @@
|
||||
MD5 (rtmpdump-v1.4.tar.gz) = Cf7y5nT3V5CI2WaqxdCHNg==
|
||||
RMD160 (rtmpdump-v1.4.tar.gz) = DFnmALXKWGV3dR4Dyq30DuN+AQU=
|
||||
SHA1 (rtmpdump-v1.4.tar.gz) = SwXK2bFK/VX47oCGb+4BemX3noQ=
|
||||
SHA256 (rtmpdump-v1.4.tar.gz) = VFumlU4I4UH5yl3t1Lgiss14HDyk7CSQhMhrz85KImM=
|
||||
SIZE (rtmpdump-v1.4.tar.gz) = 177619
|
25
net/rtmpdump/patches/patch-Makefile
Normal file
25
net/rtmpdump/patches/patch-Makefile
Normal file
@ -0,0 +1,25 @@
|
||||
$OpenBSD: patch-Makefile,v 1.1.1.1 2009/04/17 17:56:50 sthen Exp $
|
||||
|
||||
avoid gmake-isms
|
||||
|
||||
--- Makefile.orig Fri Apr 17 12:26:58 2009
|
||||
+++ Makefile Fri Apr 17 12:27:00 2009
|
||||
@@ -10,13 +10,17 @@ CFLAGS=-Wall
|
||||
CXXFLAGS=-Wall
|
||||
LDFLAGS=-Wall
|
||||
|
||||
+.SUFFIXES: .cpp
|
||||
+.cpp.o:
|
||||
+ $(CXX) $(CXXFLAGS) -c $< -o $@
|
||||
+
|
||||
all: rtmpdump
|
||||
|
||||
clean:
|
||||
rm -f rtmpdump rtmpdump.exe *.o
|
||||
|
||||
rtmpdump: bytes.o log.o rtmp.o AMFObject.o rtmppacket.o rtmpdump.o parseurl.o
|
||||
- $(CXX) $(LDFLAGS) $^ -o $@
|
||||
+ $(CXX) $(LDFLAGS) $> -o $@
|
||||
|
||||
win32: bytes.o log.o rtmp.o AMFObject.o rtmppacket.o rtmpdump.o parseurl.o
|
||||
$(CXX) $(LDFLAGS) $^ -o rtmpdump.exe -lws2_32 -lwinmm
|
31
net/rtmpdump/patches/patch-bytes_cpp
Normal file
31
net/rtmpdump/patches/patch-bytes_cpp
Normal file
@ -0,0 +1,31 @@
|
||||
$OpenBSD: patch-bytes_cpp,v 1.1.1.1 2009/04/17 17:56:50 sthen Exp $
|
||||
|
||||
- unbreak all big-endian arch (first hunk)
|
||||
- unbreak strict alignment big-endian (second hunk)
|
||||
|
||||
--- bytes.cpp.orig Wed Mar 11 21:33:48 2009
|
||||
+++ bytes.cpp Fri Apr 17 18:43:52 2009
|
||||
@@ -30,10 +30,10 @@ void WriteNumber(char *data, double dVal)
|
||||
uint64_t res;
|
||||
|
||||
#if __FLOAT_WORD_ORDER == __BYTE_ORDER
|
||||
+ uint64_t in = *((uint64_t*)&dVal);
|
||||
#if __BYTE_ORDER == __BIG_ENDIAN
|
||||
- res = dVal;
|
||||
+ res = in;
|
||||
#elif __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
- uint64_t in = *((uint64_t*)&dVal);
|
||||
res = __bswap_64(in);
|
||||
#endif
|
||||
#else
|
||||
@@ -60,7 +60,9 @@ double ReadNumber(const char *data)
|
||||
{
|
||||
#if __FLOAT_WORD_ORDER == __BYTE_ORDER
|
||||
#if __BYTE_ORDER == __BIG_ENDIAN
|
||||
- return *((double *)data);
|
||||
+ double val;
|
||||
+ memcpy(&val, data, sizeof(double));
|
||||
+ return val;
|
||||
#elif __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
uint64_t in = *((uint64_t*)data);
|
||||
uint64_t res = __bswap_64(in);
|
23
net/rtmpdump/patches/patch-bytes_h
Normal file
23
net/rtmpdump/patches/patch-bytes_h
Normal file
@ -0,0 +1,23 @@
|
||||
$OpenBSD: patch-bytes_h,v 1.1.1.1 2009/04/17 17:56:50 sthen Exp $
|
||||
--- bytes.h.orig Wed Mar 11 21:55:44 2009
|
||||
+++ bytes.h Wed Apr 8 15:44:32 2009
|
||||
@@ -34,8 +34,17 @@ typedef unsigned long long int uint64_t;
|
||||
| (((x) & 0x00000000000000ffull) << 56))
|
||||
|
||||
#else
|
||||
-#include <endian.h>
|
||||
-#include <byteswap.h>
|
||||
+#include <machine/endian.h>
|
||||
+#define bswap_16 swap16
|
||||
+#define bswap_32 swap32
|
||||
+#define bswap_64 swap64
|
||||
+#define __bswap_16 __swap16
|
||||
+#define __bswap_32 __swap32
|
||||
+#define __bswap_64 __swap64
|
||||
+#define __BYTE_ORDER _BYTE_ORDER
|
||||
+#define __BIG_ENDIAN _BIG_ENDIAN
|
||||
+#define __LITTLE_ENDIAN _LITTLE_ENDIAN
|
||||
+#define __FLOAT_WORD_ORDER _BYTE_ORDER
|
||||
|
||||
typedef __uint64_t uint64_t;
|
||||
typedef __uint32_t uint32_t;
|
12
net/rtmpdump/patches/patch-log_h
Normal file
12
net/rtmpdump/patches/patch-log_h
Normal file
@ -0,0 +1,12 @@
|
||||
$OpenBSD: patch-log_h,v 1.1.1.1 2009/04/17 17:56:50 sthen Exp $
|
||||
--- log.h.orig Fri Apr 17 14:05:18 2009
|
||||
+++ log.h Fri Apr 17 14:05:37 2009
|
||||
@@ -21,7 +21,7 @@
|
||||
#ifndef __LOG_H__
|
||||
#define __LOG_H__
|
||||
|
||||
-#define _DEBUG
|
||||
+/* #define _DEBUG */
|
||||
|
||||
#ifdef _DEBUG
|
||||
#undef NODEBUG
|
20
net/rtmpdump/patches/patch-rtmp_h
Normal file
20
net/rtmpdump/patches/patch-rtmp_h
Normal file
@ -0,0 +1,20 @@
|
||||
$OpenBSD: patch-rtmp_h,v 1.1.1.1 2009/04/17 17:56:50 sthen Exp $
|
||||
--- rtmp.h.orig Wed Apr 8 15:50:31 2009
|
||||
+++ rtmp.h Wed Apr 8 15:50:43 2009
|
||||
@@ -27,12 +27,12 @@
|
||||
|
||||
#ifdef WIN32
|
||||
#else
|
||||
-//#include <sys/types.h>
|
||||
-//#include <sys/socket.h>
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
#include <arpa/inet.h>
|
||||
-//#include <unistd.h>
|
||||
-//#include <netinet/in.h>
|
||||
+#include <unistd.h>
|
||||
+#include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
#include "AMFObject.h"
|
3
net/rtmpdump/pkg/DESCR
Normal file
3
net/rtmpdump/pkg/DESCR
Normal file
@ -0,0 +1,3 @@
|
||||
A small dumper for media content streamed over the RTMP protocol.
|
||||
Supplying an rtmp url will result in a dumped flv file, which can be
|
||||
played/transcoded using ffmpeg/mplayer, etc.
|
2
net/rtmpdump/pkg/PLIST
Normal file
2
net/rtmpdump/pkg/PLIST
Normal file
@ -0,0 +1,2 @@
|
||||
@comment $OpenBSD: PLIST,v 1.1.1.1 2009/04/17 17:56:50 sthen Exp $
|
||||
@bin bin/rtmpdump
|
Loading…
Reference in New Issue
Block a user