aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Arnold <nerdboy@gentoo.org>2018-02-02 10:42:01 -0800
committerSteve Arnold <nerdboy@gentoo.org>2018-02-02 10:42:01 -0800
commit33b025397274eacc72711e8852307f2ab1b022e6 (patch)
tree4b4a09b782a1d0d519c8b31e0de21b7f6b4fbb72
parentarmv8multi-sources-4.14.3-r0: really fix stupid path typo... (diff)
downloadarm-33b025397274eacc72711e8852307f2ab1b022e6.tar.gz
arm-33b025397274eacc72711e8852307f2ab1b022e6.tar.bz2
arm-33b025397274eacc72711e8852307f2ab1b022e6.zip
media-video/mjpg-streamer: switched to RPi fork, still testing
* note we are still missing the dependencies for raspicam plugin Signed-off-by: Steve Arnold <nerdboy@gentoo.org>
-rw-r--r--media-video/mjpg-streamer/files/0_pre20120621-make-var-instead-of-cmd.patch118
-rw-r--r--media-video/mjpg-streamer/files/0_pre20120621-to-work-with-kernel-3.18.patch74
-rw-r--r--media-video/mjpg-streamer/files/mjpg-streamer.confd21
-rw-r--r--media-video/mjpg-streamer/files/mjpg-streamer.initd47
-rw-r--r--media-video/mjpg-streamer/metadata.xml49
-rw-r--r--media-video/mjpg-streamer/mjpg-streamer-9999.ebuild67
6 files changed, 376 insertions, 0 deletions
diff --git a/media-video/mjpg-streamer/files/0_pre20120621-make-var-instead-of-cmd.patch b/media-video/mjpg-streamer/files/0_pre20120621-make-var-instead-of-cmd.patch
new file mode 100644
index 0000000..98d89c5
--- /dev/null
+++ b/media-video/mjpg-streamer/files/0_pre20120621-make-var-instead-of-cmd.patch
@@ -0,0 +1,118 @@
+Index: Makefile
+===================================================================
+--- Makefile (revision 150)
++++ Makefile (working copy)
+@@ -63,64 +63,64 @@
+ chmod 755 $(APP_BINARY)
+
+ output_autofocus.so: mjpg_streamer.h utils.h
+- make -C plugins/output_autofocus all
++ $(MAKE) -C plugins/output_autofocus all
+ cp plugins/output_autofocus/output_autofocus.so .
+
+ input_testpicture.so: mjpg_streamer.h utils.h
+- make -C plugins/input_testpicture all
++ $(MAKE) -C plugins/input_testpicture all
+ cp plugins/input_testpicture/input_testpicture.so .
+
+
+ ifeq ($(USE_LIBV4L2),true)
+ input_uvc.so: mjpg_streamer.h utils.h
+- make -C plugins/input_uvc USE_LIBV4L2=true all
++ $(MAKE) -C plugins/input_uvc USE_LIBV4L2=true all
+ cp plugins/input_uvc/input_uvc.so .
+ else
+ input_uvc.so: mjpg_streamer.h utils.h
+- make -C plugins/input_uvc all
++ $(MAKE) -C plugins/input_uvc all
+ cp plugins/input_uvc/input_uvc.so .
+ endif
+
+ input_control.so: mjpg_streamer.h utils.h
+- make -C plugins/input_control all
++ $(MAKE) -C plugins/input_control all
+ cp plugins/input_control/input_control.so .
+
+ output_file.so: mjpg_streamer.h utils.h
+- make -C plugins/output_file all
++ $(MAKE) -C plugins/output_file all
+ cp plugins/output_file/output_file.so .
+
+ ifeq ($(WXP_COMPAT),true)
+ output_http.so: mjpg_streamer.h utils.h
+- make -C plugins/output_http -DWXP_COMPAT all
++ $(MAKE) -C plugins/output_http -DWXP_COMPAT all
+ cp plugins/output_http/output_http.so .
+ else
+ output_http.so: mjpg_streamer.h utils.h
+- make -C plugins/output_http all
++ $(MAKE) -C plugins/output_http all
+ cp plugins/output_http/output_http.so .
+ endif
+
+ output_udp.so: mjpg_streamer.h utils.h
+- make -C plugins/output_udp all
++ $(MAKE) -C plugins/output_udp all
+ cp plugins/output_udp/output_udp.so .
+
+ input_gspcav1.so: mjpg_streamer.h utils.h
+- make -C plugins/input_gspcav1 all
++ $(MAKE) -C plugins/input_gspcav1 all
+ cp plugins/input_gspcav1/input_gspcav1.so .
+
+ input_file.so: mjpg_streamer.h utils.h
+- make -C plugins/input_file all
++ $(MAKE) -C plugins/input_file all
+ cp plugins/input_file/input_file.so .
+
+ output_rtsp.so: mjpg_streamer.h utils.h
+- make -C plugins/output_rtsp all
++ $(MAKE) -C plugins/output_rtsp all
+ cp plugins/output_rtsp/output_rtsp.so .
+
+ output_ptp2.so: mjpg_streamer.h utils.h
+- make -C plugins/input_ptp2 all
++ $(MAKE) -C plugins/input_ptp2 all
+ cp plugins/input_ptp2/input_ptp2.so .
+
+ #input_http.so: mjpg_streamer.h utils.h
+-# make -C plugins/input_http all
++# $(MAKE) -C plugins/input_http all
+ # cp plugins/input_http/input_http.so .
+
+ # The viewer plugin requires the SDL library for compilation
+@@ -129,22 +129,22 @@
+ # execute the following command:
+ # make output_viewer.so
+ output_viewer.so: mjpg_streamer.h utils.h
+- make -C plugins/output_viewer all
++ $(MAKE) -C plugins/output_viewer all
+ cp plugins/output_viewer/output_viewer.so .
+
+ # cleanup
+ clean:
+- make -C plugins/input_uvc $@
+- make -C plugins/input_testpicture $@
+- make -C plugins/output_file $@
+- make -C plugins/output_http $@
+- make -C plugins/output_udp $@
+- make -C plugins/output_autofocus $@
+- make -C plugins/input_gspcav1 $@
+- make -C plugins/output_viewer $@
+- make -C plugins/input_control $@
+- make -C plugins/output_rtsp $@
+-# make -C plugins/input_http $@
++ $(MAKE) -C plugins/input_uvc $@
++ $(MAKE) -C plugins/input_testpicture $@
++ $(MAKE) -C plugins/output_file $@
++ $(MAKE) -C plugins/output_http $@
++ $(MAKE) -C plugins/output_udp $@
++ $(MAKE) -C plugins/output_autofocus $@
++ $(MAKE) -C plugins/input_gspcav1 $@
++ $(MAKE) -C plugins/output_viewer $@
++ $(MAKE) -C plugins/input_control $@
++ $(MAKE) -C plugins/output_rtsp $@
++# $(MAKE) -C plugins/input_http $@
+ rm -f *.a *.o $(APP_BINARY) core *~ *.so *.lo
+
+ # useful to make a backup "make tgz"
diff --git a/media-video/mjpg-streamer/files/0_pre20120621-to-work-with-kernel-3.18.patch b/media-video/mjpg-streamer/files/0_pre20120621-to-work-with-kernel-3.18.patch
new file mode 100644
index 0000000..5f16f4a
--- /dev/null
+++ b/media-video/mjpg-streamer/files/0_pre20120621-to-work-with-kernel-3.18.patch
@@ -0,0 +1,74 @@
+From 03796a1d930212aea460405b86cd41bea8fa5150 Mon Sep 17 00:00:00 2001
+From: Eric Lee <saintgimp@hotmail.com>
+Date: Thu, 26 Feb 2015 19:31:41 -0800
+Subject: [PATCH] Fix mjpg-streamer to work with kernel 3.18
+
+I didn't create this fix, it was originally posted to http://www.raspberrypi.org/forums/viewtopic.php?f=28&t=97983&p=681259. @koosvriezen tried to create a pull request #3 but made kind of a hash of it, so this is the same fix only a proper pull request.
+---
+ mjpg-streamer/plugins/input_uvc/input_uvc.c | 8 +++++---
+ mjpg-streamer/plugins/input_uvc/v4l2uvc.c | 2 ++
+ mjpg-streamer/plugins/input_uvc/v4l2uvc.h | 3 +++
+ 3 files changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/mjpg-streamer/plugins/input_uvc/input_uvc.c b/mjpg-streamer/plugins/input_uvc/input_uvc.c
+index c0b2d10..ef264e9 100644
+--- a/mjpg-streamer/plugins/input_uvc/input_uvc.c
++++ b/mjpg-streamer/plugins/input_uvc/input_uvc.c
+@@ -405,9 +405,13 @@ void *cam_thread(void *arg)
+ if(pcontext->videoIn->formatIn == V4L2_PIX_FMT_YUYV) {
+ DBG("compressing frame from input: %d\n", (int)pcontext->id);
+ pglobal->in[pcontext->id].size = compress_yuyv_to_jpeg(pcontext->videoIn, pglobal->in[pcontext->id].buf, pcontext->videoIn->framesizeIn, gquality);
++ /* copy this frame's timestamp to user space */
++ pglobal->in[pcontext->id].timestamp = pcontext->videoIn->buf.timestamp;
+ } else {
+ DBG("copying frame from input: %d\n", (int)pcontext->id);
+- pglobal->in[pcontext->id].size = memcpy_picture(pglobal->in[pcontext->id].buf, pcontext->videoIn->tmpbuffer, pcontext->videoIn->buf.bytesused);
++ pglobal->in[pcontext->id].size = memcpy_picture(pglobal->in[pcontext->id].buf, pcontext->videoIn->tmpbuffer, pcontext->videoIn->tmpbytesused);
++ /* copy this frame's timestamp to user space */
++ pglobal->in[pcontext->id].timestamp = pcontext->videoIn->tmptimestamp;
+ }
+
+ #if 0
+@@ -418,8 +422,6 @@ void *cam_thread(void *arg)
+ prev_size = global->size;
+ #endif
+
+- /* copy this frame's timestamp to user space */
+- pglobal->in[pcontext->id].timestamp = pcontext->videoIn->buf.timestamp;
+
+ /* signal fresh_frame */
+ pthread_cond_broadcast(&pglobal->in[pcontext->id].db_update);
+diff --git a/mjpg-streamer/plugins/input_uvc/v4l2uvc.c b/mjpg-streamer/plugins/input_uvc/v4l2uvc.c
+index 48fd189..329233b 100644
+--- a/mjpg-streamer/plugins/input_uvc/v4l2uvc.c
++++ b/mjpg-streamer/plugins/input_uvc/v4l2uvc.c
+@@ -450,6 +450,8 @@ int uvcGrab(struct vdIn *vd)
+ */
+
+ memcpy(vd->tmpbuffer, vd->mem[vd->buf.index], vd->buf.bytesused);
++ vd->tmpbytesused = vd->buf.bytesused;
++ vd->tmptimestamp = vd->buf.timestamp;
+
+ if(debug)
+ fprintf(stderr, "bytes in used %d \n", vd->buf.bytesused);
+diff --git a/mjpg-streamer/plugins/input_uvc/v4l2uvc.h b/mjpg-streamer/plugins/input_uvc/v4l2uvc.h
+index d5296fc..0e3f99f 100644
+--- a/mjpg-streamer/plugins/input_uvc/v4l2uvc.h
++++ b/mjpg-streamer/plugins/input_uvc/v4l2uvc.h
+@@ -28,6 +28,7 @@
+
+
+ #include <stdio.h>
++#include <stdint.h>
+ #include <string.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+@@ -105,6 +106,8 @@ struct vdIn {
+ int framecount;
+ int recordstart;
+ int recordtime;
++ uint32_t tmpbytesused;
++ struct timeval tmptimestamp;
+ };
+
+ /* context of each camera thread */
diff --git a/media-video/mjpg-streamer/files/mjpg-streamer.confd b/media-video/mjpg-streamer/files/mjpg-streamer.confd
new file mode 100644
index 0000000..07a81b0
--- /dev/null
+++ b/media-video/mjpg-streamer/files/mjpg-streamer.confd
@@ -0,0 +1,21 @@
+# The input plugins and options:
+# uvc
+# testpicture
+# file
+#ex. INPUT_PLUGIN="uvc"
+INPUT_PLUGIN=""
+INPUT_PLUGIN_OPTS=""
+
+# The output plugins and options:
+# autofocus
+# file
+# http
+# udp
+# rtsp
+#ex. OUTPUT_PLUGIN="http"
+OUTPUT_PLUGIN=""
+OUTPUT_PLUGIN_OPTS=""
+
+# Deamon runing as user/group
+MJPG_STREAMER_USER="nobody"
+MJPG_STREAMER_GROUP="video"
diff --git a/media-video/mjpg-streamer/files/mjpg-streamer.initd b/media-video/mjpg-streamer/files/mjpg-streamer.initd
new file mode 100644
index 0000000..60665e5
--- /dev/null
+++ b/media-video/mjpg-streamer/files/mjpg-streamer.initd
@@ -0,0 +1,47 @@
+#!/sbin/openrc-run
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+MJPG_STREAMER_PIDFILE="${MJPG_STREAMER_PIDFILE:-/var/run/${SVCNAME}.pid}"
+MY_NAME=${SVCNAME//-/_}
+
+depend() {
+ use logger
+}
+
+checkconfig() {
+ local vars
+
+ [[ ${INPUT_PLUGIN} ]] || vars+=\ INPUT_PLUGIN
+ [[ ${OUTPUT_PLUGIN} ]] || vars+=\ OUTPUT_PLUGIN
+ [[ ${MJPG_STREAMER_USER} ]] || vars+=\ MJPG_STREAMER_USER
+ [[ ${MJPG_STREAMER_GROUP} ]] || vars+=\ MJPG_STREAMER_GROUP
+ vars="${vars# }"
+
+ if [[ ${vars} ]]; then
+ eerror "Required variables in /etc/conf.d/${SVCNAME} are not set:"
+ eerror " ${vars// /, }"
+ return 1
+ fi
+
+ return 0
+}
+
+start() {
+ checkconfig || return $?
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --exec /usr/bin/${MY_NAME} \
+ --user "${MJPG_STREAMER_USER}" \
+ --group "${MJPG_STREAMER_GROUP}" -w 100 -b -m \
+ --pidfile "${MJPG_STREAMER_PIDFILE}" \
+ -- -i "/usr/$(get_libdir)/input_${INPUT_PLUGIN}.so ${INPUT_PLUGIN_OPTS}" \
+ -o "/usr/$(get_libdir)/output_${OUTPUT_PLUGIN}.so ${OUTPUT_PLUGIN_OPTS}"
+ eend $? "Check syslog to see why startup failed."
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --exec /usr/bin/${MY_NAME} \
+ --pidfile "${MJPG_STREAMER_PIDFILE}"
+ eend $?
+}
diff --git a/media-video/mjpg-streamer/metadata.xml b/media-video/mjpg-streamer/metadata.xml
new file mode 100644
index 0000000..289845e
--- /dev/null
+++ b/media-video/mjpg-streamer/metadata.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>andrzej.pauli@gmail.com</email>
+ <name>Andrzej Pauli</name>
+ <description>Maintainer. Assign bugs to him.</description>
+ </maintainer>
+ <maintainer type="person">
+ <email>aidecoe@gentoo.org</email>
+ <name>Amadeusz Żołnowski</name>
+ <description>Proxy maintainer. CC him on bugs.</description>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription lang="en">
+ MJPG-streamer takes JPGs from Linux-UVC compatible webcams, filesystem or
+ other input plugins and streams them as M-JPEG via HTTP to webbrowsers,
+ VLC and other software. It is the successor of uvc-streamer, a Linux-UVC
+ streaming application with Pan/Tilt
+ </longdescription>
+ <use>
+ <flag name="input_testpicture">Plugin for sending compiled in, test
+ pictures</flag>
+ <flag name="input_control">Plugin giving ability to control camera
+ movement (only specific cameras)</flag>
+ <flag name="input_file">Plugin that watches given directory and send
+ it's content</flag>
+ <flag name="input_uvc">Plugin that sends video stream from UVC
+ compatible camera</flag>
+ <flag name="output_file">Plugin that saves received content under given
+ location</flag>
+ <flag name="output_udp">Plugin receiving content over UDP and storing to
+ a directory</flag>
+ <flag name="output_http">Small HTTP server plugin which sends WWW
+ directory content and streams image content</flag>
+ <flag name="output_autofocus">Auto focusing plugin</flag>
+ <flag name="output_rtsp">Plugin which provides a mechanism to take
+ snapshots with a trigger from a UDP packet</flag>
+ <flag name="www">Installs WWW content</flag>
+ <flag name="v4l">Uses <pkg>media-libs/libv4l</pkg> function mapping for
+ input_uvc plugin</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">mjpg-streamer</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/media-video/mjpg-streamer/mjpg-streamer-9999.ebuild b/media-video/mjpg-streamer/mjpg-streamer-9999.ebuild
new file mode 100644
index 0000000..0270582
--- /dev/null
+++ b/media-video/mjpg-streamer/mjpg-streamer-9999.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python3_{4,5,6} )
+
+inherit cmake-utils eutils flag-o-matic python-any-r1
+
+DESCRIPTION="MJPG-streamer, MJPGs from Linux-UVC compatible webcams and RPi"
+HOMEPAGE="https://github.com/sarnold/mjpg-streamer"
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="https://github.com/sarnold/mjpg-streamer.git"
+ EGIT_BRANCH="master"
+ inherit git-r3
+ KEYWORDS=""
+else
+ EGIT_REPO_URI="https://github.com/sarnold/mjpg-streamer.git"
+ EGIT_COMMIT="8cc9d22c1e79905d529a248ccf05bbf0625e0bf3"
+ inherit git-r3
+ KEYWORDS="~x86 ~amd64 ~arm ~arm64"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+
+INPUT_PLUGINS="input_testpicture input_control input_file input_uvc"
+OUTPUT_PLUGINS="output_file output_udp output_http output_autofocus output_rtsp"
+IUSE_PLUGINS="${INPUT_PLUGINS} ${OUTPUT_PLUGINS}"
+IUSE="input_testpicture input_control +input_file input_uvc output_file
+ output_udp +output_http output_autofocus output_rtsp v4l"
+
+REQUIRED_USE="|| ( ${INPUT_PLUGINS} )
+ || ( ${OUTPUT_PLUGINS} )
+ v4l? ( input_uvc )"
+
+RDEPEND="virtual/jpeg
+ v4l? ( input_uvc? ( media-libs/libv4l ) )"
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}
+ input_testpicture? ( media-gfx/imagemagick )"
+
+S="${WORKDIR}/${P}/mjpg-streamer-experimental"
+
+src_configure() {
+ append-cxxflags -std=gnu++11
+ cmake-utils_src_configure
+
+ sed -i -e 's|usr/lib|usr/$(get_libdir)|' \
+ "${FILESDIR}"/mjpg-streamer.initd || die
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
+}
+
+pkg_postinst() {
+ elog "Remember to set an input and output plugin for mjpg-streamer."
+
+ echo
+ elog "An example webinterface has been installed into"
+ elog "/usr/share/mjpg-streamer/www for your usage."
+}