mirror of
https://github.com/albfan/miraclecast.git
synced 2025-03-09 23:38:56 +00:00
help functions for arch linux
This commit is contained in:
parent
0ac755a765
commit
349db0f04a
2 changed files with 28 additions and 62 deletions
|
@ -1,62 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
DEBUG='0'
|
|
||||||
AUDIO='0'
|
|
||||||
SCALE='0'
|
|
||||||
|
|
||||||
while getopts "r:d:as:" optname
|
|
||||||
do
|
|
||||||
case "$optname" in
|
|
||||||
"d")
|
|
||||||
DEBUG=`echo ${OPTARG} | tr -d ' '`
|
|
||||||
;;
|
|
||||||
"r")
|
|
||||||
RESOLUTION=`echo ${OPTARG} | tr -d ' '`
|
|
||||||
;;
|
|
||||||
"a")
|
|
||||||
AUDIO='1'
|
|
||||||
;;
|
|
||||||
"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"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
# Should not occur
|
|
||||||
echo "Unknown error while processing options"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
RUN="/usr/bin/gst-launch-1.0 -v "
|
|
||||||
if [ $DEBUG != '0' ]
|
|
||||||
then
|
|
||||||
RUN+="--gst-debug=${DEBUG} "
|
|
||||||
fi
|
|
||||||
|
|
||||||
RUN+="udpsrc port=1991 caps=\"application/x-rtp, media=video\" ! rtpjitterbuffer latency=100 ! rtpmp2tdepay ! tsdemux "
|
|
||||||
|
|
||||||
if [ $AUDIO == '1' ]
|
|
||||||
then
|
|
||||||
RUN+="name=demuxer demuxer. "
|
|
||||||
fi
|
|
||||||
|
|
||||||
RUN+="! queue max-size-buffers=0 max-size-time=0 ! h264parse ! avdec_h264 ! videoconvert ! "
|
|
||||||
|
|
||||||
if [ $SCALE == '1' ]
|
|
||||||
then
|
|
||||||
RUN+="videoscale method=1 ! video/x-raw,width=${WIDTH},height=${HEIGHT} ! "
|
|
||||||
fi
|
|
||||||
|
|
||||||
RUN+="autovideosink "
|
|
||||||
|
|
||||||
if [ $AUDIO == '1' ]
|
|
||||||
then
|
|
||||||
RUN+="demuxer. ! queue max-size-buffers=0 max-size-time=0 ! aacparse ! avdec_aac ! audioconvert ! audioresample ! autoaudiosink "
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "running: $RUN"
|
|
||||||
exec ${RUN}
|
|
|
@ -101,6 +101,12 @@ function find_wpa_supplicant_pid {
|
||||||
show_wpa_supplicant_process | awk '{print $2}'
|
show_wpa_supplicant_process | awk '{print $2}'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# checking if distro is archlinux
|
||||||
|
#
|
||||||
|
function check_archlinux_distro {
|
||||||
|
test -f "/etc/arch-release"
|
||||||
|
}
|
||||||
#
|
#
|
||||||
# checking if distro is ubuntu
|
# checking if distro is ubuntu
|
||||||
#
|
#
|
||||||
|
@ -119,6 +125,17 @@ function kill_ubuntu_network_manager {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# arch linux manager restarts automatically wpa_supplicant
|
||||||
|
#
|
||||||
|
function kill_archlinux_network_manager {
|
||||||
|
if check_ubuntu_distro
|
||||||
|
then
|
||||||
|
echo stopping NetworkManager
|
||||||
|
sudo systemctl stop Network.service
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# start ubuntu manager
|
# start ubuntu manager
|
||||||
#
|
#
|
||||||
|
@ -129,3 +146,14 @@ function start_ubuntu_network_manager {
|
||||||
sudo service NetworkManager start
|
sudo service NetworkManager start
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# start arch linux manager
|
||||||
|
#
|
||||||
|
function start_archlinux_network_manager {
|
||||||
|
if check_archlinux_distro
|
||||||
|
then
|
||||||
|
echo starting NetworkManager
|
||||||
|
sudo systemctl start Network.service
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue