#globals
set xrange [-8:]
set yrange [0:]
set format y "%2.0f"
set key bottom left
#set terminal postscript eps color solid
set terminal postscript color solid

set title "network bandwidth"

plot 'rtp_stat-streamout-client-0' using 1:4 title \
                                               "clnt_real_bw" with steps 2, \
 'rtp_stat-streamout-server-0' using 1:2 title "srv_net_bw" with steps lw 2 7, \
  'rtp_stat-streamout-server-0' using 1:6 title "srv_real_bw" with steps 4, \
  'rtp_stat-streamout-server-0' using 1:7 title "srv_pkt_loss" with boxes, \
  'rtp_stat-streamout-server-0' using 1:($13 * MAXREALBW) title "switch point" with impulses 9, \
  'rtp_stat-streamout-server-0' using 1:14 title "streamBW" with steps lw 4 1, \
     AVGREALBW title "avg real_bw: AVGREALBW Kbps" with steps 1
#pause -1 "please hit return"

set title "adaptation quality in PSNR"
plot 'rtp_stat-playout-client-0' using 1:8 title "clnt_psnr" with steps 3, \
     'rtp_stat-playout-server-0' using 1:($12 * 35) title "switch point" with impulses 9, \
     AVGPSNR title "avg psnr: AVGPSNR dB" with steps 1
#pause -1 "please hit return"

set key top left
set title "adaptation by frame rate"
# 'rtp_stat-playout-client-0' using 1:2 title "clnt_net_fps" with boxes 2 , 
plot 'rtp_stat-playout-client-0' using 1:3 title \
                                     "clnt_real_fps" with steps 3, \
     'rtp_stat-playout-server-0' using 1:($12 * 30) title "switch point" with impulses 9, \
     AVGFPS title "avg: AVGFPS real fps" with steps 1
#pause -1 "please hit return"


set key top left
set title "adaptation percentage"
plot 'rtp_stat-streamout-server-0' using 1:10 title "srv_adapt_percent" with steps, \
     'rtp_stat-streamout-server-0' using 1:11 title "srv_adapt_secs" with steps, \
     'rtp_stat-streamout-server-0' using 1:($13 * 150) title "switch point" with impulses 9, \
     'rtp_stat-playout-client-0' using 1:3 title "clnt_fps" with steps     
#pause -1 "please hit return"

set title "buffer fill level video_secs"
plot 'rtp_stat-streamout-server-0' using 8:9 title "srv_buf_ahead" with steps, \
     'rtp_stat-streamout-client-0' using 5:6 title "clnt_buf_ahead" with steps
#pause -1 "please hit return"

set title "buffer fill level KBits"
plot 'rtp_stat-streamout-server-0' using 1:12 title "est. srv_buf_ahead" with steps, \
     'rtp_stat-streamout-client-0' using 1:7 title "est. clnt_buf_ahead" with steps, \
     'rtp_stat-streamout-client-0' using 1:8 title "real clnt_buf preQ" with steps
#pause -1 "please hit return"


