mirror of
https://github.com/albfan/miraclecast.git
synced 2025-03-09 23:38:56 +00:00
sink: move GST pipeline construction to bash script
The sinkctl tool is currently a hack to make Miracast sinks work. The embedded gst-launch invocation is kinda ugly to handle. Move it into a bash-script so we can experiment a bit more with different pipelines. Ultimatively, the goal is obviously to make this work as its own gst element. Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com> Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
This commit is contained in:
parent
5fabb386b8
commit
e7aa531dca
4 changed files with 66 additions and 20 deletions
57
res/miracle-gst.sh
Executable file
57
res/miracle-gst.sh
Executable file
|
@ -0,0 +1,57 @@
|
|||
#!/bin/bash
|
||||
|
||||
DEBUG='0'
|
||||
AUDIO='0'
|
||||
SCALE='0'
|
||||
|
||||
while getopts "d:as" optname
|
||||
do
|
||||
case "$optname" in
|
||||
"d")
|
||||
DEBUG=`echo ${OPTARG} | tr -d ' '`
|
||||
;;
|
||||
"a")
|
||||
AUDIO='1'
|
||||
;;
|
||||
"s")
|
||||
SCALE='1'
|
||||
;;
|
||||
"?")
|
||||
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=1280,height=800 ! "
|
||||
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}
|
Loading…
Add table
Add a link
Reference in a new issue