mirror of
https://github.com/albfan/miraclecast.git
synced 2025-03-09 23:38:56 +00:00
Add external player config
Allow to run custom player. It will be run within a wrapper that respect -p/--port, option at least fixes #87
This commit is contained in:
parent
016159bb1e
commit
3628f789b4
3 changed files with 90 additions and 12 deletions
|
@ -1,4 +1,4 @@
|
|||
bin_SCRIPTS = miracle-gst gstplayer uibc-viewer
|
||||
bin_SCRIPTS = miracle-gst gstplayer uibc-viewer miracle-omxplayer
|
||||
EXTRA_DIST = wpa.conf
|
||||
|
||||
dbuspolicydir=$(sysconfdir)/dbus-1/system.d
|
||||
|
|
69
res/miracle-omxplayer
Executable file
69
res/miracle-omxplayer
Executable file
|
@ -0,0 +1,69 @@
|
|||
#!/bin/bash
|
||||
|
||||
function help {
|
||||
local scriptname="$(basename $0)"
|
||||
cat >&2 <<EOF
|
||||
|
||||
$scriptname [options]
|
||||
|
||||
play rtp stream with omxplayer
|
||||
|
||||
Options:
|
||||
-r Resolution
|
||||
-s <Width>x<height> Scale
|
||||
-d <level> Log level for gst
|
||||
-p <port> Port for stream
|
||||
-a Enables audio
|
||||
-h Show this help
|
||||
|
||||
Examples:
|
||||
|
||||
# play stream on port 7236
|
||||
$ $scriptname -p 7236
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
DEBUG='0'
|
||||
AUDIO='0'
|
||||
SCALE='0'
|
||||
|
||||
while getopts "r:d:as:p:h" optname
|
||||
do
|
||||
case "$optname" in
|
||||
"h")
|
||||
help
|
||||
exit 0
|
||||
;;
|
||||
"d")
|
||||
DEBUG=`echo ${OPTARG} | tr -d ' '`
|
||||
;;
|
||||
"r")
|
||||
RESOLUTION=`echo ${OPTARG} | tr -d ' '`
|
||||
;;
|
||||
"a")
|
||||
AUDIO='1'
|
||||
;;
|
||||
"p")
|
||||
PORT=`echo ${OPTARG} | tr -d ' '`
|
||||
;;
|
||||
"s")
|
||||
SCALE='1'
|
||||
WIDTH=`echo ${OPTARG} | tr -d ' ' | cut -dx -f 1`
|
||||
HEIGHT=`echo ${OPTARG} | tr -d ' ' | cut -dx -f 2`
|
||||
;;
|
||||
"?")
|
||||
echo "Unknown option $OPTARG"
|
||||
;;
|
||||
*)
|
||||
echo "Unknown parameter $OPTARG"
|
||||
help
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
RUN="omxplayer -live -b - o hdmi rtp://localhost:$PORT"
|
||||
|
||||
echo "running: $RUN"
|
||||
exec ${RUN}
|
Loading…
Add table
Add a link
Reference in a new issue