Skip to contentSkip to conversation

arm_multimedia: add kmssink support

PATCH New Eric Ruei 1 participant 1 message Feb 25, 2019

lore
Share & tools
lore

Eric Ruei

author
#0 lore raw

PATCH v2 1/1 arm_multimedia: add kmssink support

- use kmssink as video sink for AM4 and AM6 SoCs
- cleanup indentations

---
 .../arm_multimedia_h264dec/runH264Dec.sh           | 15 ++++++-
 .../arm_multimedia_mpeg4aacdec/runMpeg4AacDec.sh   | 52 +++++++++++++---------
 .../arm_multimedia_mpeg4dec/runMpeg4Dec.sh         | 13 +++++-
 3 files changed, 55 insertions(+), 25 deletions(-)
multimedia_apps/arm_multimedia_h264dec/runH264Dec.sh +13 -2
index f1ea7dd..00fd92a 100644
@@ -1,7 +1,9 @@
 #!/bin/sh
 
 machine_type="`cat /etc/hostname`"
+platform="default"
 if [ "$machine_type" = "am335x-evm" ] || [ "$machine_type" = "am335x-hs-evm" ]; then
+	platform="am35xx"
 	resolution="`fbset | awk '/geometry/ {print $2"x"$3}'`"
 	if [ "$resolution" = "480x272" ]; then
 		filename="/usr/share/ti/video/TearOfSteel-Short-400x240.264"
@@ -25,7 +27,8 @@ then
         fi
 elif [ "$machine_type" = "am65xx-evm" ]
 then
-     filename="/usr/share/ti/video/TearOfSteel-Short-1280x540.h264"
+     platform="am65xx"
+     filename="/usr/share/ti/video/TearOfSteel-Short-720x406.264"
 else
 	default_display="`cat /sys/devices/platform/omapdss/manager0/display`"
 	if [ "$default_display" = "dvi" ]; then
@@ -50,4 +53,12 @@ echo ""
 echo "Launch GStreamer pipeline"
 echo ""
 echo "Length of video clip: 21 seconds"
-gst-launch-1.0 filesrc location=$filename ! queue ! h264parse ! avdec_h264 ! videoconvert ! fbdevsink device=/dev/fb0
+if [ "$platform" = "am35xx" ]
+then
+	gst-launch-1.0 filesrc location=$filename ! queue ! h264parse ! avdec_h264 ! videoconvert ! fbdevsink device=/dev/fb0
+elif [ "$platform" = "am65xx" ]
+then
+	gst-launch-1.0 filesrc location=$filename ! queue ! h264parse ! avdec_h264 ! videoconvert ! 'video/x-raw, format=(string)BGRA' ! kmssink
+else
+	gst-launch-1.0 filesrc location=$filename ! queue ! h264parse ! avdec_h264 ! videoconvert ! kmssink
+fi
\ No newline at end of file
multimedia_apps/arm_multimedia_mpeg4aacdec/runMpeg4AacDec.sh +31 -21

78 lines not on this page · raw message

multimedia_apps/arm_multimedia_mpeg4dec/runMpeg4Dec.sh +11 -2
index 82fcb2c..cef2e47 100644
@@ -1,7 +1,9 @@
 #!/bin/sh
 
 machine_type="`cat /etc/hostname`"
+platform="default"
 if [ "$machine_type" = "am335x-evm" ] || [ "$machine_type" = "am335x-hs-evm" ]; then
+        platform="am35xx"
 	resolution="`fbset | awk '/geometry/ {print $2"x"$3}'`"
 	if [ "$resolution" = "480x272" ]; then
 		filename="/usr/share/ti/video/TearOfSteel-Short-400x240.m4v"
@@ -25,7 +27,8 @@ then
     fi
 elif [ "$machine_type" = "am65xx-evm" ]
 then
-     filename="/usr/share/ti/video/TearOfSteel-Short-1280x540.m4v"
+     platform="am65xx"
+     filename="/usr/share/ti/video/TearOfSteel-Short-720x406.m4v"
 else
 	default_display="`cat /sys/devices/platform/omapdss/manager0/display`"
 	if [ "$default_display" = "dvi" ]; then
@@ -46,4 +49,10 @@ if [ ! -f $filename ]; then
         echo "Video clip not found"
         exit 1
 fi
-gst-launch-1.0 playbin uri=file://$filename video-sink=fbdevsink audio-sink=fakesink
+if [ "$platform" = "am35xx" ]; then
+	gst-launch-1.0 playbin uri=file://$filename video-sink=fbdevsink audio-sink=fakesink
+elif [ "$platform" = "am65xx" ]; then
+	gst-launch-1.0 filesrc location=$filename ! queue ! qtdemux name=demux demux.video_0 ! queue ! avdec_mpeg4 ! videoconvert ! 'video/x-raw, format=(string)BGRA' ! kmssink
+else
+	gst-launch-1.0 filesrc location=$filename ! queue ! qtdemux name=demux demux.video_0 ! queue ! avdec_mpeg4 ! videoconvert ! kmssink
+fi
Signature · 1 line
1.9.1