aboutsummaryrefslogtreecommitdiffstats
path: root/community/omxplayer
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2018-03-07 13:56:09 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2018-03-07 13:56:09 +0000
commit69e0f45f2280af0ef8e2f192363ebd3bfbc42eb3 (patch)
tree08dd1ffea0bdd6d5e425290ce7aee76efba37d46 /community/omxplayer
parent26aa4de397292ac7cf30da476e1909e4129f340b (diff)
downloadaports-69e0f45f2280af0ef8e2f192363ebd3bfbc42eb3.tar.gz
aports-69e0f45f2280af0ef8e2f192363ebd3bfbc42eb3.tar.bz2
aports-69e0f45f2280af0ef8e2f192363ebd3bfbc42eb3.tar.xz
{main => community}/omxplayer: move
Diffstat (limited to 'community/omxplayer')
-rw-r--r--community/omxplayer/APKBUILD58
-rw-r--r--community/omxplayer/default-font.patch26
-rw-r--r--community/omxplayer/fix-makefile.patch28
-rw-r--r--community/omxplayer/issue-260.patch16
-rw-r--r--community/omxplayer/issue-297.patch78
-rw-r--r--community/omxplayer/omxplayer.confd3
-rw-r--r--community/omxplayer/omxplayer.initd34
7 files changed, 243 insertions, 0 deletions
diff --git a/community/omxplayer/APKBUILD b/community/omxplayer/APKBUILD
new file mode 100644
index 0000000000..1b29522f42
--- /dev/null
+++ b/community/omxplayer/APKBUILD
@@ -0,0 +1,58 @@
+# Maintainer: Timo Teräs <timo.teras@iki.fi>
+pkgname=omxplayer
+pkgver=0.20161017
+_commitid=2ee17b22a6149a043a2e402580504f282c615373
+pkgrel=1
+pkgdesc="Commandline OMX player for Raspberry Pi"
+url="https://github.com/popcornmix/omxplayer"
+arch="armhf"
+license="GPL-2.0"
+depends="ttf-freefont"
+makedepends="linux-headers raspberrypi-dev ffmpeg-dev pcre-dev
+ boost-dev freetype-dev dbus-dev alsa-lib-dev"
+install=""
+subpackages="$pkgname-doc $pkgname-dbg"
+source="omxplayer-$pkgver.tar.gz::https://github.com/popcornmix/omxplayer/archive/$_commitid.tar.gz
+ issue-260.patch
+ issue-297.patch
+ fix-makefile.patch
+ default-font.patch
+
+ omxplayer.initd
+ omxplayer.confd
+ "
+
+builddir="$srcdir"/$pkgname-$_commitid
+
+build() {
+ cd "$builddir"
+ cat <<EOF > Makefile.include
+INCLUDES:=-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux
+INCLUDES+=$(pkg-config --cflags freetype2 dbus-1)
+LDFLAGS:=-L/opt/vc/lib -Wl,-rpath,/opt/vc/lib
+LIBS:=$(pkg-config --libs freetype2 dbus-1)
+STRIP:=echo
+EOF
+ make omxplayer.bin
+}
+
+package() {
+ cd "$builddir"
+ mkdir -p $pkgdir/usr/bin $pkgdir/usr/share/doc/omxplayer
+ cp omxplayer.bin $pkgdir/usr/bin/omxplayer
+ cp COPYING $pkgdir/usr/share/doc/omxplayer
+ cp README.md $pkgdir/usr/share/doc/omxplayer/README
+
+ install -m755 -D "$srcdir"/$pkgname.initd \
+ "$pkgdir"/etc/init.d/$pkgname
+ install -m644 -D "$srcdir"/$pkgname.confd \
+ "$pkgdir"/etc/conf.d/$pkgname
+}
+
+sha512sums="75a19d29e037d87b17edfe631590ba8e9035dc3ee8114e0398531f7f5fbfbc2947044ec56290dbeff90bba3e8231590b70270e39fcb2e1a91ca698c69e9aa02c omxplayer-0.20161017.tar.gz
+c349eea5f7c513a07d82a6cf6467c4d21bcb29c053bc5e39d8f675b1212db9beef0abf5248d50ac5a2f14fda73055786f94f421377ffcf5f6bcf8daa2f1b56e8 issue-260.patch
+2a8a6def1e09f726cba58c0b9109fa6c4fbd4a3b4f1d27d200488f262a0e0978579d83db7fe24f1d3e03beef318c3674ed79cbd2f1994c4551a59c9fe0f63489 issue-297.patch
+009ae8398755417d1a13ed15bcfdc6ce43fb637db153c51c15b00ef0edf82117dfb2964d5e37e0baf30e4ef1e3003546ae39e42a492e75fcdfc15d751e1ad516 fix-makefile.patch
+8aa58aaa07453186302dc68d92f28c1b50bf0f8fccd50359640a7fc8339b233b32a0c8c02284a9974599e56d69cc557acc25e76e6438c6d64d15afd9c1788a8e default-font.patch
+3ddd32235d87a46478d0237ee9b253edeb75729e377b09a33069ecdca2ee230d2851f308897ee75ff69a9f3bdd2876f490bc1667a572dce1c186f80fddcf6df3 omxplayer.initd
+4f906ada035869a0e515e7615056b18b0f6906ce4b3a2d34081c0efa79bb9455380f729e7c5270180f5ace89c53a7ac7c93f609e6761825f639f44aa22346bb2 omxplayer.confd"
diff --git a/community/omxplayer/default-font.patch b/community/omxplayer/default-font.patch
new file mode 100644
index 0000000000..b140e90b32
--- /dev/null
+++ b/community/omxplayer/default-font.patch
@@ -0,0 +1,26 @@
+--- omxplayer-7af21f596378e5efeceebedff9c4a298e2d06d98.orig/omxplayer.cpp
++++ omxplayer-7af21f596378e5efeceebedff9c4a298e2d06d98/omxplayer.cpp
+@@ -88,8 +88,8 @@
+ bool m_osd = true;
+ 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/share/fonts/TTF/FreeSans.ttf";
++std::string m_italic_font_path = "/usr/share/fonts/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;
+--- omxplayer-6ee9a0a5488119786990b6f91990d59d6e35427c/README.md.orig
++++ omxplayer-6ee9a0a5488119786990b6f91990d59d6e35427c/README.md
+@@ -80,8 +80,8 @@
+ --no-osd Do not display status information on screen
+ --no-keys Disable keyboard input (prevents hangs for certain TTYs)
+ --subtitles path External subtitles in UTF-8 srt format
+- --font path Default: /usr/share/fonts/truetype/freefont/FreeSans.ttf
+- --italic-font path Default: /usr/share/fonts/truetype/freefont/FreeSansOblique.ttf
++ --font path Default: /usr/share/fonts/TTF/FreeSans.ttf
++ --italic-font path Default: /usr/share/fonts/TTF/FreeSansOblique.ttf
+ --font-size size Font size in 1/1000 screen height (default: 55)
+ --align left/center Subtitle alignment (default: left)
+ --no-ghost-box No semitransparent boxes behind subtitles
diff --git a/community/omxplayer/fix-makefile.patch b/community/omxplayer/fix-makefile.patch
new file mode 100644
index 0000000000..88dd8d376f
--- /dev/null
+++ b/community/omxplayer/fix-makefile.patch
@@ -0,0 +1,28 @@
+--- omxplayer-2ee17b22a6149a043a2e402580504f282c615373.orig/Makefile 2017-10-17 19:51:35.000000000 +0300
++++ omxplayer-2ee17b22a6149a043a2e402580504f282c615373/Makefile 2017-11-21 15:43:30.122410419 +0200
+@@ -3,8 +3,11 @@
+
+ LDFLAGS=-L$(SDKSTAGE)/opt/vc/lib/
+ LDFLAGS+=-L./ -Lffmpeg_compiled/usr/local/lib/ -lc -lbrcmGLESv2 -lbrcmEGL -lbcm_host -lopenmaxil -lfreetype -lz -lasound
++LDFLAGS+=-L./ -Wl,-rpath,/opt/vc/lib/
++LIBS+=-lWFC -lGLESv2 -lEGL -lbcm_host -lopenmaxil -lfreetype -lz -lasound
+
+-INCLUDES+=-I./ -Ilinux -Iffmpeg_compiled/usr/local/include/ -I /usr/include/dbus-1.0 -I /usr/lib/arm-linux-gnueabihf/dbus-1.0/include -I/usr/include/freetype2 -isystem$(SDKSTAGE)/opt/vc/include -isystem$(SDKSTAGE)/opt/vc/include/interface/vcos/pthreads
++
++INCLUDES+=-I./ -Ilinux $(shell pkg-config --cflags dbus-1 freetype2) -isystem$(SDKSTAGE)/opt/vc/include -isystem$(SDKSTAGE)/opt/vc/include/interface/vcos/pthreads
+
+ DIST ?= omxplayer-dist
+ STRIP ?= strip
+@@ -50,10 +53,10 @@
+ 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 -lvchostif -lvcos -ldbus-1 -lrt -lpthread -lavutil -lavcodec -lavformat -lswscale -lswresample -lpcre
++ $(CXX) $(LDFLAGS) -o omxplayer.bin $(OBJS) $(LIBS) -lvchiq_arm -lvcos -ldbus-1 -lrt -lpthread -lavutil -lavcodec -lavformat -lswscale -lswresample -lpcre
+ $(STRIP) omxplayer.bin
+
+ help.h: README.md Makefile
diff --git a/community/omxplayer/issue-260.patch b/community/omxplayer/issue-260.patch
new file mode 100644
index 0000000000..4e8e77ad1c
--- /dev/null
+++ b/community/omxplayer/issue-260.patch
@@ -0,0 +1,16 @@
+https://github.com/popcornmix/omxplayer/issues/260
+
+Not a fix, but improves the situation a little bit.
+
+--- omxplayer-6ee9a0a5488119786990b6f91990d59d6e35427c.orig/omxplayer.cpp
++++ omxplayer-6ee9a0a5488119786990b6f91990d59d6e35427c/omxplayer.cpp
+@@ -1543,6 +1543,9 @@
+ }
+ }
+
++ if (audio_pts < stamp) audio_pts = DVD_NOPTS_VALUE;
++ if (video_pts < stamp) video_pts = DVD_NOPTS_VALUE;
++
+ float audio_fifo = audio_pts == DVD_NOPTS_VALUE ? 0.0f : audio_pts / DVD_TIME_BASE - stamp * 1e-6;
+ float video_fifo = video_pts == DVD_NOPTS_VALUE ? 0.0f : video_pts / DVD_TIME_BASE - stamp * 1e-6;
+ float threshold = std::min(0.1f, (float)m_player_audio.GetCacheTotal() * 0.1f);
diff --git a/community/omxplayer/issue-297.patch b/community/omxplayer/issue-297.patch
new file mode 100644
index 0000000000..4a2cf1d50a
--- /dev/null
+++ b/community/omxplayer/issue-297.patch
@@ -0,0 +1,78 @@
+diff --git a/OMXReader.cpp b/OMXReader.cpp
+index df15a01..97ed20f 100644
+--- a/OMXReader.cpp
++++ b/OMXReader.cpp
+@@ -261,9 +261,6 @@ bool OMXReader::Open(std::string filename, bool dump_format, bool live /* =false
+ if(/*m_bAVI || */m_bMatroska)
+ m_pFormatContext->max_analyze_duration = 0;
+
+- if (live)
+- m_pFormatContext->flags |= AVFMT_FLAG_NOBUFFER;
+-
+ result = m_dllAvFormat.avformat_find_stream_info(m_pFormatContext, NULL);
+ if(result < 0)
+ {
+diff --git a/OMXVideo.cpp b/OMXVideo.cpp
+index acd055e..b69f451 100644
+--- a/OMXVideo.cpp
++++ b/OMXVideo.cpp
+@@ -670,6 +670,8 @@ bool COMXVideo::Open(OMXClock *clock, const OMXVideoConfig &config)
+ float fAspect = m_config.hints.aspect ? (float)m_config.hints.aspect / (float)m_config.hints.width * (float)m_config.hints.height : 1.0f;
+ m_pixel_aspect = fAspect / m_config.display_aspect;
+
++ PortSettingsChanged();
++
+ return true;
+ }
+
+diff --git a/omxplayer.cpp b/omxplayer.cpp
+index c03760b..071fb60 100644
+--- a/omxplayer.cpp
++++ b/omxplayer.cpp
+@@ -1642,30 +1642,33 @@ int main(int argc, char *argv[])
+ latency = audio_fifo;
+ else if (!m_has_audio && m_has_video && video_pts != DVD_NOPTS_VALUE)
+ latency = video_fifo;
+- if (!m_Pause && latency != DVD_NOPTS_VALUE)
++ if (!m_Pause && (m_omx_reader.IsEof() || latency != DVD_NOPTS_VALUE))
+ {
+ if (m_av_clock->OMXIsPaused())
+ {
+- if (latency > m_threshold)
++ if (m_omx_reader.IsEof() || latency > m_threshold)
+ {
+ CLog::Log(LOGDEBUG, "Resume %.2f,%.2f (%d,%d,%d,%d) EOF:%d PKT:%p\n", audio_fifo, video_fifo, audio_fifo_low, video_fifo_low, audio_fifo_high, video_fifo_high, m_omx_reader.IsEof(), m_omx_pkt);
+ m_av_clock->OMXResume();
+- m_latency = latency;
++ if (latency > 0)
++ m_latency = latency;
+ }
+ }
+ else
+ {
+- m_latency = m_latency*0.99f + latency*0.01f;
+ float speed = 1.0f;
+- if (m_latency < 0.5f*m_threshold)
+- speed = 0.990f;
+- else if (m_latency < 0.9f*m_threshold)
+- speed = 0.999f;
+- else if (m_latency > 2.0f*m_threshold)
+- speed = 1.010f;
+- else if (m_latency > 1.1f*m_threshold)
+- speed = 1.001f;
+-
++ if (latency != DVD_NOPTS_VALUE)
++ {
++ m_latency = m_latency*0.99f + latency*0.01f;
++ if (m_latency < 0.5f*m_threshold)
++ speed = 0.990f;
++ else if (m_latency < 0.9f*m_threshold)
++ speed = 0.999f;
++ else if (m_latency > 2.0f*m_threshold)
++ speed = 1.010f;
++ else if (m_latency > 1.1f*m_threshold)
++ speed = 1.001f;
++ }
+ m_av_clock->OMXSetSpeed(S(speed));
+ m_av_clock->OMXSetSpeed(S(speed), true, true);
+ CLog::Log(LOGDEBUG, "Live: %.2f (%.2f) S:%.3f T:%.2f\n", m_latency, latency, speed, m_threshold);
diff --git a/community/omxplayer/omxplayer.confd b/community/omxplayer/omxplayer.confd
new file mode 100644
index 0000000000..8baf0a6e26
--- /dev/null
+++ b/community/omxplayer/omxplayer.confd
@@ -0,0 +1,3 @@
+# OMXPLAYER_OPTS="--live"
+# OMXPLAYER_URL="http://10.0.0.1/"
+# OMXPLAYER_DELAY=5
diff --git a/community/omxplayer/omxplayer.initd b/community/omxplayer/omxplayer.initd
new file mode 100644
index 0000000000..70af0e56da
--- /dev/null
+++ b/community/omxplayer/omxplayer.initd
@@ -0,0 +1,34 @@
+#!/sbin/openrc-run
+
+depend() {
+ after net firewall chrony
+}
+
+omxplayer_run_loop() {
+ while true; do
+ /usr/bin/omxplayer "$@"
+ status=$?
+ echo "exited: $status"
+ [ "$status" -eq 129 ] && exit 0
+ [ "$status" -ne 0 ] && sleep ${OMXPLAYER_DELAY:-5}
+ done
+}
+
+checkconfig() {
+ [ -z "$OMXPLAYER_URL" ] && eerror "omxplayer URL not set"
+ return 0
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting omxplayer"
+ omxplayer_run_loop ${OMXPLAYER_OPTS} "${OMXPLAYER_URL}" 2>&1 | logger -t omxplayer &
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping omxplayer"
+ killall -HUP omxplayer
+ eend $?
+}
+