Add a gst-am7xxx-play.sh test script
authorAntonio Ospite <ospite@studenti.unina.it>
Mon, 28 Oct 2013 15:57:26 +0000 (16:57 +0100)
committerAntonio Ospite <ospite@studenti.unina.it>
Mon, 28 Oct 2013 15:57:26 +0000 (16:57 +0100)
src/gst-am7xxx-play.sh [new file with mode: 0755]

diff --git a/src/gst-am7xxx-play.sh b/src/gst-am7xxx-play.sh
new file mode 100755 (executable)
index 0000000..9e2ff95
--- /dev/null
@@ -0,0 +1,67 @@
+#!/bin/sh
+
+set -e
+
+SRC="$1"
+URI="${2:-http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_640x360.m4v}"
+
+usage() {
+  echo "usage: $(basename $0) [test|ximage|uri [URI]|v4l2|help]"
+}
+
+case "$SRC" in
+  test)
+    INPUT="videotestsrc ! video/x-raw,width=1920,height=1080"
+    ;;
+
+  ximage)
+    # without use-damage=0 ximagesrc is very slow, see:
+    # https://bugzilla.gnome.org/show_bug.cgi?id=693037
+    INPUT="ximagesrc use-damage=0 show-pointer=1 ! video/x-raw,framerate=30/1"
+    ;;
+
+  uri)
+    DECODER="dec"
+    INPUT="uridecodebin uri=$URI name=$DECODER ${DECODER}."
+    ;;
+
+  v4l2)
+    INPUT="v4l2src always-copy=FALSE ! video/x-raw,width=640,height=480"
+    ;;
+
+  help|-h|--help)
+    usage
+    exit 0
+    ;;
+
+  *)
+    usage 1>&2
+    exit 1
+    ;;
+esac
+
+JPEG_FORMAT=1
+
+if [ $JPEG_FORMAT -eq 1 ];
+then
+  # am7xxx devices doesn't like jpegs with subsampling other than 420
+  ENCODER="! video/x-raw,format=I420 ! jpegenc"
+fi
+
+VIDEOCONVERT="videorate ! videoscale add-borders=1 ! videoconvert $ENCODER"
+
+VIDEOSINK="am7xxxsink"
+#VIDEOSINK="autovideosink"
+#VIDEOSINK="fpsdisplaysink text-overlay=false video-sink=$VIDEOSINK"
+
+VIDEO_OUT="$VIDEOCONVERT ! $VIDEOSINK"
+
+if [ "x$DECODER" != "x" ];
+then
+  AUDIO_OUT="${DECODER}. ! audioconvert ! autoaudiosink"
+fi
+
+LANG=C \
+GST_DEBUG=am7xxxsink:6 \
+GST_PLUGIN_PATH=$(pwd) \
+gst-launch-1.0 $INPUT ! $VIDEO_OUT $AUDIO_OUT