diff options
author | Thomas Zander <riggs@FreeBSD.org> | 2015-12-06 07:19:40 +0000 |
---|---|---|
committer | Thomas Zander <riggs@FreeBSD.org> | 2015-12-06 07:19:40 +0000 |
commit | c542dfb08c52d337a7bdd3ce155ada5d34fb094a (patch) | |
tree | c67143cc7391f4ea6855ecba19c45ff672eb04ac /multimedia/omxplayer | |
parent | 0a3561889b309396ca70970f61fe3058584f2727 (diff) | |
download | ports-c542dfb08c52d337a7bdd3ce155ada5d34fb094a.tar.gz ports-c542dfb08c52d337a7bdd3ce155ada5d34fb094a.zip |
Notes
Diffstat (limited to 'multimedia/omxplayer')
-rw-r--r-- | multimedia/omxplayer/Makefile | 54 | ||||
-rw-r--r-- | multimedia/omxplayer/distinfo | 2 | ||||
-rw-r--r-- | multimedia/omxplayer/files/patch-Keyboard.cpp | 64 | ||||
-rw-r--r-- | multimedia/omxplayer/files/patch-Keyboard.h | 11 | ||||
-rw-r--r-- | multimedia/omxplayer/files/patch-Makefile | 28 | ||||
-rw-r--r-- | multimedia/omxplayer/files/patch-Makefile.include | 47 | ||||
-rw-r--r-- | multimedia/omxplayer/files/patch-linux_PlatformDefs.h | 29 | ||||
-rw-r--r-- | multimedia/omxplayer/files/patch-omxplayer.cpp | 13 | ||||
-rw-r--r-- | multimedia/omxplayer/pkg-descr | 5 |
9 files changed, 253 insertions, 0 deletions
diff --git a/multimedia/omxplayer/Makefile b/multimedia/omxplayer/Makefile new file mode 100644 index 000000000000..694a4e0a59c0 --- /dev/null +++ b/multimedia/omxplayer/Makefile @@ -0,0 +1,54 @@ +# Created by: mikael.urankar@gmail.com +# $FreeBSD$ + +PORTNAME= omxplayer +PORTVERSION= 20151109 +CATEGORIES= multimedia + +MAINTAINER= mikael.urankar@gmail.com +COMMENT= Raspberry Pi video player + +LICENSE= GPLv2 + +LIB_DEPENDS= libboost_thread.so:${PORTSDIR}/devel/boost-libs \ + libdbus-1.so:${PORTSDIR}/devel/dbus \ + libpcre.so:${PORTSDIR}/devel/pcre \ + libEGL.so:${PORTSDIR}/misc/raspberrypi-userland \ + libavcodec.so:${PORTSDIR}/multimedia/ffmpeg \ + libfreetype.so:${PORTSDIR}/print/freetype2 +RUN_DEPENDS= bash:${PORTSDIR}/shells/bash \ + ${LOCALBASE}/share/fonts/freefont-ttf/FreeSans.ttf:${PORTSDIR}/x11-fonts/freefont-ttf + +ONLY_FOR_ARCHS= armv6 + +CFLAGS+= -Dfopen64=fopen -Dfseeko64=fseeko -Dftello64=ftello +ALL_TARGET= omxplayer.bin + +USE_GITHUB= yes +GH_ACCOUNT= popcornmix +GH_TAGNAME= 6f073c9 + +USES= gmake shebangfix +USE_GCC= yes +SHEBANG_FILES= omxplayer + +PLIST_FILES= bin/omxplayer bin/omxplayer.bin +PORTDOCS= README.md + +OPTIONS_DEFINE= DOCS + +post-patch: + @${REINPLACE_CMD} -e \ + 's|LOCALBASE|${LOCALBASE}|g' ${WRKSRC}/omxplayer.cpp + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/omxplayer.bin ${STAGEDIR}${PREFIX}/bin + ${INSTALL_SCRIPT} ${WRKSRC}/omxplayer ${STAGEDIR}${PREFIX}/bin + +do-install-DOCS-on: + @${MKDIR} ${STAGEDIR}${DOCSDIR} +.for i in ${PORTDOCS} + ${INSTALL_DATA} -p ${WRKSRC}/${i} ${STAGEDIR}${DOCSDIR} +.endfor + +.include <bsd.port.mk> diff --git a/multimedia/omxplayer/distinfo b/multimedia/omxplayer/distinfo new file mode 100644 index 000000000000..5ad130f387f9 --- /dev/null +++ b/multimedia/omxplayer/distinfo @@ -0,0 +1,2 @@ +SHA256 (popcornmix-omxplayer-20151109-6f073c9_GH0.tar.gz) = a88723f7f854386b53fb601b4f57cbad33a702556de83122661cc6cd5d877ff2 +SIZE (popcornmix-omxplayer-20151109-6f073c9_GH0.tar.gz) = 1203829 diff --git a/multimedia/omxplayer/files/patch-Keyboard.cpp b/multimedia/omxplayer/files/patch-Keyboard.cpp new file mode 100644 index 000000000000..c5d3de9204a3 --- /dev/null +++ b/multimedia/omxplayer/files/patch-Keyboard.cpp @@ -0,0 +1,64 @@ +--- Keyboard.cpp.orig 2015-10-24 12:09:14 UTC ++++ Keyboard.cpp +@@ -23,7 +23,6 @@ Keyboard::Keyboard() + new_termios = orig_termios; + new_termios.c_lflag &= ~(ICANON | ECHO | ECHOCTL | ECHONL); + new_termios.c_cflag |= HUPCL; +- new_termios.c_cc[VMIN] = 0; + + tcsetattr(STDIN_FILENO, TCSANOW, &new_termios); + } +@@ -74,13 +73,20 @@ void Keyboard::restore_term() + } + } + +-void Keyboard::Sleep(unsigned int dwMilliSeconds) ++int Keyboard::Hit() + { +- struct timespec req; +- req.tv_sec = dwMilliSeconds / 1000; +- req.tv_nsec = (dwMilliSeconds % 1000) * 1000000; ++ struct timeval timeo; ++ fd_set fds; + +- while ( nanosleep(&req, &req) == -1 && errno == EINTR && (req.tv_nsec > 0 || req.tv_sec > 0)); ++ timeo.tv_sec = 0; ++ timeo.tv_usec = 200000; ++ ++ FD_ZERO(&fds); ++ FD_SET(STDIN_FILENO, &fds); ++ ++ select(FD_SETSIZE, &fds, NULL, NULL, &timeo); ++ ++ return FD_ISSET(STDIN_FILENO, &fds); + } + + void Keyboard::Process() +@@ -90,9 +96,16 @@ void Keyboard::Process() + if (conn) + dbus_connection_read_write_dispatch(conn, 0); + int ch[8]; +- int chnum = 0; ++ int chnum, nb; + +- while ((ch[chnum] = getchar()) != EOF) chnum++; ++ if (Hit() == 0) ++ continue; ++ ++ ioctl(STDIN_FILENO, FIONREAD, &nb); ++ ++ for (chnum = 0; chnum < nb && chnum < 8; chnum++) { ++ ch[chnum] = getchar(); ++ } + + if (chnum > 1) ch[0] = ch[chnum - 1] | (ch[chnum - 2] << 8); + +@@ -101,8 +114,6 @@ void Keyboard::Process() + + if (m_keymap[ch[0]] != 0) + send_action(m_keymap[ch[0]]); +- else +- Sleep(20); + } + } + diff --git a/multimedia/omxplayer/files/patch-Keyboard.h b/multimedia/omxplayer/files/patch-Keyboard.h new file mode 100644 index 000000000000..f1e97c42328c --- /dev/null +++ b/multimedia/omxplayer/files/patch-Keyboard.h @@ -0,0 +1,11 @@ +--- Keyboard.h.orig 2015-10-24 12:09:14 UTC ++++ Keyboard.h +@@ -21,7 +21,7 @@ + void Process(); + void setKeymap(std::map<int,int> keymap); + void setDbusName(std::string dbus_name); +- void Sleep(unsigned int dwMilliSeconds); ++ int Hit(); + int getEvent(); + private: + void restore_term(); diff --git a/multimedia/omxplayer/files/patch-Makefile b/multimedia/omxplayer/files/patch-Makefile new file mode 100644 index 000000000000..193a6d108ed6 --- /dev/null +++ b/multimedia/omxplayer/files/patch-Makefile @@ -0,0 +1,28 @@ +--- Makefile.orig 2015-10-24 12:09:14 UTC ++++ Makefile +@@ -2,9 +2,9 @@ include Makefile.include + + CFLAGS+=-std=c++0x -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -DTARGET_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CMAKE_CONFIG -D__VIDEOCORE4__ -U_FORTIFY_SOURCE -Wall -DHAVE_OMXLIB -DUSE_EXTERNAL_FFMPEG -DHAVE_LIBAVCODEC_AVCODEC_H -DHAVE_LIBAVUTIL_OPT_H -DHAVE_LIBAVUTIL_MEM_H -DHAVE_LIBAVUTIL_AVUTIL_H -DHAVE_LIBAVFORMAT_AVFORMAT_H -DHAVE_LIBAVFILTER_AVFILTER_H -DHAVE_LIBSWRESAMPLE_SWRESAMPLE_H -DOMX -DOMX_SKIP64BIT -ftree-vectorize -DUSE_EXTERNAL_OMX -DTARGET_RASPBERRY_PI -DUSE_EXTERNAL_LIBBCM_HOST + +-LDFLAGS+=-L./ -Lffmpeg_compiled/usr/local/lib/ -lc -lWFC -lGLESv2 -lEGL -lbcm_host -lopenmaxil -lfreetype -lz ++LDFLAGS+=-L./ -lWFC -lGLESv2 -lEGL -lbcm_host -lopenmaxil -lfreetype -lz + +-INCLUDES+=-I./ -Ilinux -Iffmpeg_compiled/usr/local/include/ -I /usr/include/dbus-1.0 -I /usr/lib/arm-linux-gnueabihf/dbus-1.0/include ++INCLUDES+=-I./ -Ilinux -I$(LOCALBASE)/include/dbus-1.0 -I$(LOCALBASE)/include/dbus-1.0/include -I$(LOCALBASE)/include/freetype2 -I$(LOCALBASE)/include/ffmpeg + + DIST ?= omxplayer-dist + +@@ -48,11 +48,10 @@ all: dist + omxplayer.o: help.h keys.h + + version: +- bash gen_version.sh > version.h ++ sh gen_version.sh > version.h + + omxplayer.bin: version $(OBJS) +- $(CXX) $(LDFLAGS) -o omxplayer.bin $(OBJS) -lvchiq_arm -lvcos -ldbus-1 -lrt -lpthread -lavutil -lavcodec -lavformat -lswscale -lswresample -lpcre +- $(STRIP) omxplayer.bin ++ $(CXX) $(CFLAGS) $(LDFLAGS) -o omxplayer.bin $(OBJS) -lvchiq_arm -lvcos -ldbus-1 -lrt -lthr -lavutil -lavcodec -lavformat -lswscale -lswresample -lpcre + + help.h: README.md Makefile + awk '/SYNOPSIS/{p=1;print;next} p&&/KEY BINDINGS/{p=0};p' $< \ diff --git a/multimedia/omxplayer/files/patch-Makefile.include b/multimedia/omxplayer/files/patch-Makefile.include new file mode 100644 index 000000000000..87b1eafd4ad6 --- /dev/null +++ b/multimedia/omxplayer/files/patch-Makefile.include @@ -0,0 +1,47 @@ +--- Makefile.include.orig 2015-10-24 12:09:14 UTC ++++ Makefile.include +@@ -1,40 +1,7 @@ +-USE_BUILDROOT=0 +-FLOAT=hard +- +-ifeq ($(USE_BUILDROOT), 1) +-BUILDROOT :=/opt/xbmc-bcm/buildroot +-SDKSTAGE :=$(BUILDROOT)/output/staging +-TARGETFS :=$(BUILDROOT)/output/target +-TOOLCHAIN :=$(BUILDROOT)/output/host/usr/ +-HOST :=arm-unknown-linux-gnueabi +-SYSROOT :=$(BUILDROOT)/output/host/usr/arm-unknown-linux-gnueabi/sysroot +-else +-BUILDROOT :=/opt/bcm-rootfs +-SDKSTAGE :=/opt/bcm-rootfs +-TARGETFS :=/opt/bcm-rootfs +-TOOLCHAIN :=/home/dc4/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/ +-HOST :=arm-linux-gnueabihf +-#SYSROOT :=$(TOOLCHAIN)/arm-bcm2708hardfp-linux-gnueabi/sysroot +-SYSROOT :=/opt/bcm-rootfs +-endif +- +-JOBS=7 +- +-CFLAGS := -isystem$(PREFIX)/include +-CXXFLAGS := $(CFLAGS) +-CPPFLAGS := $(CFLAGS) +-LDFLAGS := -L$(BUILDROOT)/lib +-LD := $(TOOLCHAIN)/bin/$(HOST)-ld --sysroot=$(SYSROOT) +-CC := $(TOOLCHAIN)/bin/$(HOST)-gcc --sysroot=$(SYSROOT) +-CXX := $(TOOLCHAIN)/bin/$(HOST)-g++ --sysroot=$(SYSROOT) +-OBJDUMP := $(TOOLCHAIN)/bin/$(HOST)-objdump +-RANLIB := $(TOOLCHAIN)/bin/$(HOST)-ranlib +-STRIP := $(TOOLCHAIN)/bin/$(HOST)-strip +-AR := $(TOOLCHAIN)/bin/$(HOST)-ar ++LDFLAGS := -L$(LOCALBASE)/lib -L$(LOCALBASE)/lib/ffmpeg + CXXCP := $(CXX) -E +-PATH := $(PREFIX)/bin:$(BUILDROOT)/output/host/usr/bin:$(PATH) ++STRIP := strip ++FLOAT := softfp + + CFLAGS += -pipe -mfloat-abi=$(FLOAT) -mcpu=arm1176jzf-s -fomit-frame-pointer -mabi=aapcs-linux -mtune=arm1176jzf-s -mfpu=vfp -Wno-psabi -mno-apcs-stack-check -g -mstructure-size-boundary=32 -mno-sched-prolog +-LDFLAGS += -L$(SDKSTAGE)/lib -L$(SDKSTAGE)/usr/lib -L$(SDKSTAGE)/opt/vc/lib/ -Lpcre/build +-#INCLUDES += -isystem$(SDKSTAGE)/usr/include -isystem$(SDKSTAGE)/opt/vc/include -isystem$(SYSROOT)/usr/include -isystem$(SDKSTAGE)/opt/vc/include/interface/vcos/pthreads -isystem$(SDKSTAGE)/usr/include/freetype2 +-INCLUDES += -isystem$(SDKSTAGE)/opt/vc/include -isystem$(SYSROOT)/usr/include -isystem$(SDKSTAGE)/opt/vc/include/interface/vcos/pthreads -Ipcre/build -Iboost-trunk -Ifreetype2/include ++INCLUDES += -I$(LOCALBASE)/include -I$(LOCALBASE)/include/interface/vcos/pthreads -I$(LOCALBASE)/include/interface/vmcs_host/linux -I$(LOCALBASE)/lib/dbus-1.0/include diff --git a/multimedia/omxplayer/files/patch-linux_PlatformDefs.h b/multimedia/omxplayer/files/patch-linux_PlatformDefs.h new file mode 100644 index 000000000000..90d1aceeb448 --- /dev/null +++ b/multimedia/omxplayer/files/patch-linux_PlatformDefs.h @@ -0,0 +1,29 @@ +--- linux/PlatformDefs.h.orig 2015-10-24 12:09:14 UTC ++++ linux/PlatformDefs.h +@@ -39,11 +39,11 @@ + #include <unistd.h> + #include <pthread.h> + #include <string.h> +-#ifdef __APPLE__ ++#if defined(__APPLE__) + #include <stdio.h> + #include <sys/sysctl.h> + #include <mach/mach.h> +-#else ++#elif defined(__linux__) + #include <sys/sysinfo.h> + #endif + #include <sys/time.h> +@@ -416,8 +416,12 @@ typedef struct _SECURITY_ATTRIBUTES { + #define FILE_CURRENT 1 + #define FILE_END 2 + ++#ifndef _S_IFREG + #define _S_IFREG S_IFREG ++#endif ++#ifndef _S_IFDIR + #define _S_IFDIR S_IFDIR ++#endif + #define MAX_PATH PATH_MAX + + #define _stat stat diff --git a/multimedia/omxplayer/files/patch-omxplayer.cpp b/multimedia/omxplayer/files/patch-omxplayer.cpp new file mode 100644 index 000000000000..59f9d245f506 --- /dev/null +++ b/multimedia/omxplayer/files/patch-omxplayer.cpp @@ -0,0 +1,13 @@ +--- omxplayer.cpp.orig 2015-10-24 12:09:14 UTC ++++ omxplayer.cpp +@@ -84,8 +86,8 @@ bool m_osd + bool m_no_keys = false; + std::string m_external_subtitles_path; + bool m_has_external_subtitles = false; +-std::string m_font_path = "/usr/share/fonts/truetype/freefont/FreeSans.ttf"; +-std::string m_italic_font_path = "/usr/share/fonts/truetype/freefont/FreeSansOblique.ttf"; ++std::string m_font_path = "/usr/local/share/fonts/freefont-ttf/FreeSans.ttf"; ++std::string m_italic_font_path = "/usr/local/share/fonts/freefont-ttf/FreeSansOblique.ttf"; + std::string m_dbus_name = "org.mpris.MediaPlayer2.omxplayer"; + bool m_asked_for_font = false; + bool m_asked_for_italic_font = false; diff --git a/multimedia/omxplayer/pkg-descr b/multimedia/omxplayer/pkg-descr new file mode 100644 index 000000000000..8e11a51a73c5 --- /dev/null +++ b/multimedia/omxplayer/pkg-descr @@ -0,0 +1,5 @@ +OMXPlayer is a commandline OMX player for the Raspberry Pi. It was developed +as a testbed for the XBMC Raspberry PI implementation and is quite handy to +use standalone. + +WWW: https://github.com/popcornmix/omxplayer |