summaryrefslogtreecommitdiff
path: root/scripts/client/sydra-receiver.sh
blob: f1fa81dcd141baf7a175c4bfce36a2867d6c8cc6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
############################

ROOT_D="$1"

SYDRA_RTP="sydra-rtp"
SYDRA_LAUNCH="sydra-launch"

############################

printUsage() {
  echo "Usage: $0 <basedir>"
}

if [ -z "$ROOT_D" ]; then
  printUsage
  exit 1
fi
if [ ! -d "$ROOT_D" ]; then
  echo "ERROR: can't change to non-existent directory: $ROOT_D"
  exit 2
fi

. ./include.sh

start_rtp() {
  exec $SYDRA_RTP -n "receiver" -D --log stdout:3 --mode receiver -k 3 -a $RTP_HOST -o $SEND_PORT_BASE -O 5000 \
    --sink "videoconvert name=videosink ! textoverlay text=\"remote\" shaded-background=true font-desc=\"Sans 18\" ! videoscale add-borders=true ! xvimagesink    audioconvert name=\"audiosink\" ! autoaudiosink"
}

start_test() {
  exec $SYDRA_LAUNCH -n "receiver" -D --log stdout:3 -p "videotestsrc ! video/x-raw,width=864,height=480,framerate=25/1 ! textoverlay text=\"remote\" shaded-background=true font-desc=\"Sans 18\" ! videoscale add-borders=true ! xvimagesink"
}

cd $ROOT_D
[ -n "$SYDRA_TEST" ] || start_rtp
[ -n "$SYDRA_TEST" ] && start_test