All of lore.kernel.org
 help / color / mirror / Atom feed
* [matrix-gui-v2-apps][PATCH] arm_multimedia: add kmssink support
@ 2019-02-20 15:41 Eric Ruei
  2019-02-25 15:13 ` [EXTERNAL] " Gou, Hongmei
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Ruei @ 2019-02-20 15:41 UTC (permalink / raw)
  To: meta-arago

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

Signed-off-by: Eric Ruei <e-ruei1@ti.com>
---
 .../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(-)

diff --git a/multimedia_apps/arm_multimedia_h264dec/runH264Dec.sh b/multimedia_apps/arm_multimedia_h264dec/runH264Dec.sh
index f1ea7dd..9a3b47b 100644
--- a/multimedia_apps/arm_multimedia_h264dec/runH264Dec.sh
+++ b/multimedia_apps/arm_multimedia_h264dec/runH264Dec.sh
@@ -1,7 +1,9 @@
 #!/bin/sh
 
 machine_type="`cat /etc/hostname`"
+VIDEO_SINK="kmssink"
 if [ "$machine_type" = "am335x-evm" ] || [ "$machine_type" = "am335x-hs-evm" ]; then
+        VIDEO_SINK="fbdevsink"
 	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"
+     VIDEO_SINK="kmssink_am6"
+     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 [ "$VIDEO_SINK" = "fbdevsink" ]
+then
+	gst-launch-1.0 filesrc location=$filename ! queue ! h264parse ! avdec_h264 ! videoconvert ! fbdevsink device=/dev/fb0
+elif [ "$VIDEO_SINK" = "kmssink_am6" ]
+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
diff --git a/multimedia_apps/arm_multimedia_mpeg4aacdec/runMpeg4AacDec.sh b/multimedia_apps/arm_multimedia_mpeg4aacdec/runMpeg4AacDec.sh
index 18ee0ea..d968435 100644
--- a/multimedia_apps/arm_multimedia_mpeg4aacdec/runMpeg4AacDec.sh
+++ b/multimedia_apps/arm_multimedia_mpeg4aacdec/runMpeg4AacDec.sh
@@ -8,28 +8,34 @@ elif grep -q "no soundcards" /proc/asound/cards; then
         echo "No sound devices found!"
 else
 	machine_type="`cat /etc/hostname`"
+	VIDEO_SINK="kmssink"
 	if [ "$machine_type" = "am335x-evm" ] || [ "$machine_type" = "am335x-hs-evm" ]; then
+		VIDEO_SINK="fbdevsink"
 		resolution="`fbset | awk '/geometry/ {print $2"x"$3}'`"
-		 if [ "$resolution" = "480x272" ]; then
+		if [ "$resolution" = "480x272" ]; then
 			filename="/usr/share/ti/video/TearOfSteel-AV-Short-400x240.mp4"
 		else
 			# Use WVGA for all other resolutions
 			filename="/usr/share/ti/video/TearOfSteel-AV-Short-720x420.mp4"
-	fi
-    elif [ "$machine_type" = "dra7xx-evm" ]
-    then
-	    filename="/usr/share/ti/video/TearOfSteel-AV-Short-720x420.mp4"
-    elif [ "$machine_type" = "omap5-evm" ]
-    then
-        filename="/usr/share/ti/video/TearOfSteel-AV-Short-720x406.mp4"
-    elif [ "$machine_type" = "am437x-evm" ] || [ "$machine_type" = "am437x-hs-evm" ] || [ "$machine_type" = "am438x-epos-evm" ]|| [ "$machine_type" = "am65xx-evm" ]
-    then
-            resolution="`fbset | awk '/geometry/ {print $2"x"$3}'`"
-            if [ "$resolution" = "480x272" ]; then
-                filename="/usr/share/ti/video/TearOfSteel-AV-Short-400x240.mp4"
-            else
-                filename="/usr/share/ti/video/TearOfSteel-AV-Short-720x406.mp4"
-            fi
+		fi
+	elif [ "$machine_type" = "dra7xx-evm" ]
+	then
+		filename="/usr/share/ti/video/TearOfSteel-AV-Short-720x420.mp4"
+	elif [ "$machine_type" = "omap5-evm" ]
+	then
+		filename="/usr/share/ti/video/TearOfSteel-AV-Short-720x406.mp4"
+	elif [ "$machine_type" = "am65xx-evm" ]
+	then
+		VIDEO_SINK="kmssink_am6"
+		filename="/usr/share/ti/video/TearOfSteel-AV-Short-720x406.mp4"
+	elif [ "$machine_type" = "am437x-evm" ] || [ "$machine_type" = "am437x-hs-evm" ] || [ "$machine_type" = "am438x-epos-evm" ]
+	then
+		resolution="`fbset | awk '/geometry/ {print $2"x"$3}'`"
+		if [ "$resolution" = "480x272" ]; then
+			filename="/usr/share/ti/video/TearOfSteel-AV-Short-400x240.mp4"
+		else
+			filename="/usr/share/ti/video/TearOfSteel-AV-Short-720x406.mp4"
+		fi
 	else
 		default_display="`cat /sys/devices/platform/omapdss/manager0/display`"
 		if [ "$default_display" = "dvi" ]; then
@@ -52,14 +58,12 @@ else
 		amixer -c 0 set Headset 1+ unmute
 	elif [ "$machine_type" = "am335x-evm" ] || [ "$machine_type" = "am335x-hs-evm" ]; then
 		amixer cset name='PCM Playback Volume' 127
-    elif [ "$machine_type" = "omap5-evm" ]; then
+	elif [ "$machine_type" = "omap5-evm" ]; then
 		amixer cset name='PCM Playback Volume' 127
-    elif [ "$machine_type" = "am437x-evm" ] || [ "$machine_type" = "am437x-hs-evm" ] || [ "$machine_type" = "am438x-epos-evm" ]; then
-
+	elif [ "$machine_type" = "am437x-evm" ] || [ "$machine_type" = "am437x-hs-evm" ] || [ "$machine_type" = "am438x-epos-evm" ]; then
 		# EPOS uses a different configuration so check if
 		# we are running on that board
 		model_name=`cat /proc/device-tree/model | grep -i epos`
-
 		if [ "$?" = '0' ]; then
 			amixer cset name='DAC Playback Volume' 127
 			amixer cset name='HP Analog Playback Volume' 66
@@ -72,5 +76,11 @@ else
 			amixer cset name='PCM Playback Volume' 127
 		fi
 	fi
-	gst-launch-1.0 filesrc location=$filename ! queue ! qtdemux name=demux demux.audio_0 ! queue ! faad ! alsasink demux.video_0 ! queue ! avdec_mpeg4 ! videoconvert ! fbdevsink device=/dev/fb0
+	if [ "$VIDEO_SINK" = "fbdevsink" ]; then
+		gst-launch-1.0 filesrc location=$filename ! queue ! qtdemux name=demux demux.audio_0 ! queue ! faad ! alsasink demux.video_0 ! queue ! avdec_mpeg4 ! videoconvert ! fbdevsink device=/dev/fb0
+	elif [ "$VIDEO_SINK" = "kmssink_am6" ]; then
+		gst-launch-1.0 filesrc location=$filename ! queue ! qtdemux name=demux demux.audio_0 ! queue ! faad ! alsasink 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.audio_0 ! queue ! faad ! alsasink demux.video_0 ! queue ! avdec_mpeg4 ! videoconvert ! kmssink
+	fi
 fi
diff --git a/multimedia_apps/arm_multimedia_mpeg4dec/runMpeg4Dec.sh b/multimedia_apps/arm_multimedia_mpeg4dec/runMpeg4Dec.sh
index 82fcb2c..bb565c2 100644
--- a/multimedia_apps/arm_multimedia_mpeg4dec/runMpeg4Dec.sh
+++ b/multimedia_apps/arm_multimedia_mpeg4dec/runMpeg4Dec.sh
@@ -1,7 +1,9 @@
 #!/bin/sh
 
 machine_type="`cat /etc/hostname`"
+VIDEO_SINK="kmssink"
 if [ "$machine_type" = "am335x-evm" ] || [ "$machine_type" = "am335x-hs-evm" ]; then
+        VIDEO_SINK="fbdevsink"
 	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"
+     VIDEO_SINK="kmssink_am6"
+     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 [ "$VIDEO_SINK" = "fbdevsink" ]; then
+	gst-launch-1.0 playbin uri=file://$filename video-sink=fbdevsink audio-sink=fakesink
+elif [ "$VIDEO_SINK" = "kmssink_am6" ]; 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
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [EXTERNAL] [matrix-gui-v2-apps][PATCH] arm_multimedia: add kmssink support
  2019-02-20 15:41 [matrix-gui-v2-apps][PATCH] arm_multimedia: add kmssink support Eric Ruei
@ 2019-02-25 15:13 ` Gou, Hongmei
  2019-02-25 15:17   ` Ruei, Eric
  0 siblings, 1 reply; 3+ messages in thread
From: Gou, Hongmei @ 2019-02-25 15:13 UTC (permalink / raw)
  To: Ruei, Eric, meta-arago

> -----Original Message-----
> From: meta-arago-bounces@arago-project.org [mailto:meta-arago-
> bounces@arago-project.org] On Behalf Of Ruei, Eric
> Sent: Wednesday, February 20, 2019 10:41 AM
> To: meta-arago@arago-project.org
> Subject: [EXTERNAL] [meta-arago] [matrix-gui-v2-apps][PATCH]
> arm_multimedia: add kmssink support
> 
> - use kmssink as video sink for AM4 and AM6 SoCs
> - cleanup indentations
> 
> Signed-off-by: Eric Ruei <e-ruei1@ti.com>
> ---
>  .../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(-)
> 
> diff --git a/multimedia_apps/arm_multimedia_h264dec/runH264Dec.sh
> b/multimedia_apps/arm_multimedia_h264dec/runH264Dec.sh
> index f1ea7dd..9a3b47b 100644
> --- a/multimedia_apps/arm_multimedia_h264dec/runH264Dec.sh
> +++ b/multimedia_apps/arm_multimedia_h264dec/runH264Dec.sh
> @@ -1,7 +1,9 @@
>  #!/bin/sh
> 
>  machine_type="`cat /etc/hostname`"
> +VIDEO_SINK="kmssink"
>  if [ "$machine_type" = "am335x-evm" ] || [ "$machine_type" = "am335x-hs-
> evm" ]; then
> +        VIDEO_SINK="fbdevsink"
>  	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"
> +     VIDEO_SINK="kmssink_am6"

Setting VIDEO_SINK  as kmssink_am6 may cause confusion. According to the pipelines used below,
am6 is using kmssink also, but requires a different video format for the display.

> +     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 [ "$VIDEO_SINK" = "fbdevsink" ]
> +then
> +	gst-launch-1.0 filesrc location=$filename ! queue ! h264parse !
> avdec_h264 ! videoconvert ! fbdevsink device=/dev/fb0
> +elif [ "$VIDEO_SINK" = "kmssink_am6" ]
> +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
> diff --git
> a/multimedia_apps/arm_multimedia_mpeg4aacdec/runMpeg4AacDec.sh
> b/multimedia_apps/arm_multimedia_mpeg4aacdec/runMpeg4AacDec.sh
> index 18ee0ea..d968435 100644
> --- a/multimedia_apps/arm_multimedia_mpeg4aacdec/runMpeg4AacDec.sh
> +++
> b/multimedia_apps/arm_multimedia_mpeg4aacdec/runMpeg4AacDec.sh
> @@ -8,28 +8,34 @@ elif grep -q "no soundcards" /proc/asound/cards; then
>          echo "No sound devices found!"
>  else
>  	machine_type="`cat /etc/hostname`"
> +	VIDEO_SINK="kmssink"
>  	if [ "$machine_type" = "am335x-evm" ] || [ "$machine_type" =
> "am335x-hs-evm" ]; then
> +		VIDEO_SINK="fbdevsink"
>  		resolution="`fbset | awk '/geometry/ {print $2"x"$3}'`"
> -		 if [ "$resolution" = "480x272" ]; then
> +		if [ "$resolution" = "480x272" ]; then
>  			filename="/usr/share/ti/video/TearOfSteel-AV-
> Short-400x240.mp4"
>  		else
>  			# Use WVGA for all other resolutions
>  			filename="/usr/share/ti/video/TearOfSteel-AV-
> Short-720x420.mp4"
> -	fi
> -    elif [ "$machine_type" = "dra7xx-evm" ]
> -    then
> -	    filename="/usr/share/ti/video/TearOfSteel-AV-Short-
> 720x420.mp4"
> -    elif [ "$machine_type" = "omap5-evm" ]
> -    then
> -        filename="/usr/share/ti/video/TearOfSteel-AV-Short-720x406.mp4"
> -    elif [ "$machine_type" = "am437x-evm" ] || [ "$machine_type" =
> "am437x-hs-evm" ] || [ "$machine_type" = "am438x-epos-evm" ]|| [
> "$machine_type" = "am65xx-evm" ]
> -    then
> -            resolution="`fbset | awk '/geometry/ {print $2"x"$3}'`"
> -            if [ "$resolution" = "480x272" ]; then
> -                filename="/usr/share/ti/video/TearOfSteel-AV-Short-
> 400x240.mp4"
> -            else
> -                filename="/usr/share/ti/video/TearOfSteel-AV-Short-
> 720x406.mp4"
> -            fi
> +		fi
> +	elif [ "$machine_type" = "dra7xx-evm" ]
> +	then
> +		filename="/usr/share/ti/video/TearOfSteel-AV-Short-
> 720x420.mp4"
> +	elif [ "$machine_type" = "omap5-evm" ]
> +	then
> +		filename="/usr/share/ti/video/TearOfSteel-AV-Short-
> 720x406.mp4"
> +	elif [ "$machine_type" = "am65xx-evm" ]
> +	then
> +		VIDEO_SINK="kmssink_am6"
> +		filename="/usr/share/ti/video/TearOfSteel-AV-Short-
> 720x406.mp4"
> +	elif [ "$machine_type" = "am437x-evm" ] || [ "$machine_type" =
> "am437x-hs-evm" ] || [ "$machine_type" = "am438x-epos-evm" ]
> +	then
> +		resolution="`fbset | awk '/geometry/ {print $2"x"$3}'`"
> +		if [ "$resolution" = "480x272" ]; then
> +			filename="/usr/share/ti/video/TearOfSteel-AV-
> Short-400x240.mp4"
> +		else
> +			filename="/usr/share/ti/video/TearOfSteel-AV-
> Short-720x406.mp4"
> +		fi
>  	else
>  		default_display="`cat
> /sys/devices/platform/omapdss/manager0/display`"
>  		if [ "$default_display" = "dvi" ]; then
> @@ -52,14 +58,12 @@ else
>  		amixer -c 0 set Headset 1+ unmute
>  	elif [ "$machine_type" = "am335x-evm" ] || [ "$machine_type" =
> "am335x-hs-evm" ]; then
>  		amixer cset name='PCM Playback Volume' 127
> -    elif [ "$machine_type" = "omap5-evm" ]; then
> +	elif [ "$machine_type" = "omap5-evm" ]; then
>  		amixer cset name='PCM Playback Volume' 127
> -    elif [ "$machine_type" = "am437x-evm" ] || [ "$machine_type" =
> "am437x-hs-evm" ] || [ "$machine_type" = "am438x-epos-evm" ]; then
> -
> +	elif [ "$machine_type" = "am437x-evm" ] || [ "$machine_type" =
> "am437x-hs-evm" ] || [ "$machine_type" = "am438x-epos-evm" ]; then
>  		# EPOS uses a different configuration so check if
>  		# we are running on that board
>  		model_name=`cat /proc/device-tree/model | grep -i epos`
> -
>  		if [ "$?" = '0' ]; then
>  			amixer cset name='DAC Playback Volume' 127
>  			amixer cset name='HP Analog Playback Volume' 66
> @@ -72,5 +76,11 @@ else
>  			amixer cset name='PCM Playback Volume' 127
>  		fi
>  	fi
> -	gst-launch-1.0 filesrc location=$filename ! queue ! qtdemux
> name=demux demux.audio_0 ! queue ! faad ! alsasink demux.video_0 !
> queue ! avdec_mpeg4 ! videoconvert ! fbdevsink device=/dev/fb0
> +	if [ "$VIDEO_SINK" = "fbdevsink" ]; then
> +		gst-launch-1.0 filesrc location=$filename ! queue ! qtdemux
> name=demux demux.audio_0 ! queue ! faad ! alsasink demux.video_0 !
> queue ! avdec_mpeg4 ! videoconvert ! fbdevsink device=/dev/fb0
> +	elif [ "$VIDEO_SINK" = "kmssink_am6" ]; then
> +		gst-launch-1.0 filesrc location=$filename ! queue ! qtdemux
> name=demux demux.audio_0 ! queue ! faad ! alsasink 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.audio_0 ! queue ! faad ! alsasink demux.video_0 !
> queue ! avdec_mpeg4 ! videoconvert ! kmssink
> +	fi
>  fi
> diff --git a/multimedia_apps/arm_multimedia_mpeg4dec/runMpeg4Dec.sh
> b/multimedia_apps/arm_multimedia_mpeg4dec/runMpeg4Dec.sh
> index 82fcb2c..bb565c2 100644
> --- a/multimedia_apps/arm_multimedia_mpeg4dec/runMpeg4Dec.sh
> +++ b/multimedia_apps/arm_multimedia_mpeg4dec/runMpeg4Dec.sh
> @@ -1,7 +1,9 @@
>  #!/bin/sh
> 
>  machine_type="`cat /etc/hostname`"
> +VIDEO_SINK="kmssink"
>  if [ "$machine_type" = "am335x-evm" ] || [ "$machine_type" = "am335x-hs-
> evm" ]; then
> +        VIDEO_SINK="fbdevsink"
>  	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"
> +     VIDEO_SINK="kmssink_am6"
> +     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 [ "$VIDEO_SINK" = "fbdevsink" ]; then
> +	gst-launch-1.0 playbin uri=file://$filename video-sink=fbdevsink
> audio-sink=fakesink
> +elif [ "$VIDEO_SINK" = "kmssink_am6" ]; 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
> --
> 1.9.1
> 
> _______________________________________________
> meta-arago mailing list
> meta-arago@arago-project.org
> http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [EXTERNAL] [matrix-gui-v2-apps][PATCH] arm_multimedia: add kmssink support
  2019-02-25 15:13 ` [EXTERNAL] " Gou, Hongmei
@ 2019-02-25 15:17   ` Ruei, Eric
  0 siblings, 0 replies; 3+ messages in thread
From: Ruei, Eric @ 2019-02-25 15:17 UTC (permalink / raw)
  To: Gou, Hongmei, meta-arago

Any suggest of better variable name?

Best regards,

Eric


-----Original Message-----
From: Gou, Hongmei 
Sent: Monday, February 25, 2019 10:13 AM
To: Ruei, Eric; meta-arago@arago-project.org
Subject: RE: [EXTERNAL] [meta-arago] [matrix-gui-v2-apps][PATCH] arm_multimedia: add kmssink support

> -----Original Message-----
> From: meta-arago-bounces@arago-project.org [mailto:meta-arago-
> bounces@arago-project.org] On Behalf Of Ruei, Eric
> Sent: Wednesday, February 20, 2019 10:41 AM
> To: meta-arago@arago-project.org
> Subject: [EXTERNAL] [meta-arago] [matrix-gui-v2-apps][PATCH]
> arm_multimedia: add kmssink support
> 
> - use kmssink as video sink for AM4 and AM6 SoCs
> - cleanup indentations
> 
> Signed-off-by: Eric Ruei <e-ruei1@ti.com>
> ---
>  .../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(-)
> 
> diff --git a/multimedia_apps/arm_multimedia_h264dec/runH264Dec.sh
> b/multimedia_apps/arm_multimedia_h264dec/runH264Dec.sh
> index f1ea7dd..9a3b47b 100644
> --- a/multimedia_apps/arm_multimedia_h264dec/runH264Dec.sh
> +++ b/multimedia_apps/arm_multimedia_h264dec/runH264Dec.sh
> @@ -1,7 +1,9 @@
>  #!/bin/sh
> 
>  machine_type="`cat /etc/hostname`"
> +VIDEO_SINK="kmssink"
>  if [ "$machine_type" = "am335x-evm" ] || [ "$machine_type" = "am335x-hs-
> evm" ]; then
> +        VIDEO_SINK="fbdevsink"
>  	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"
> +     VIDEO_SINK="kmssink_am6"

Setting VIDEO_SINK  as kmssink_am6 may cause confusion. According to the pipelines used below,
am6 is using kmssink also, but requires a different video format for the display.

> +     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 [ "$VIDEO_SINK" = "fbdevsink" ]
> +then
> +	gst-launch-1.0 filesrc location=$filename ! queue ! h264parse !
> avdec_h264 ! videoconvert ! fbdevsink device=/dev/fb0
> +elif [ "$VIDEO_SINK" = "kmssink_am6" ]
> +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
> diff --git
> a/multimedia_apps/arm_multimedia_mpeg4aacdec/runMpeg4AacDec.sh
> b/multimedia_apps/arm_multimedia_mpeg4aacdec/runMpeg4AacDec.sh
> index 18ee0ea..d968435 100644
> --- a/multimedia_apps/arm_multimedia_mpeg4aacdec/runMpeg4AacDec.sh
> +++
> b/multimedia_apps/arm_multimedia_mpeg4aacdec/runMpeg4AacDec.sh
> @@ -8,28 +8,34 @@ elif grep -q "no soundcards" /proc/asound/cards; then
>          echo "No sound devices found!"
>  else
>  	machine_type="`cat /etc/hostname`"
> +	VIDEO_SINK="kmssink"
>  	if [ "$machine_type" = "am335x-evm" ] || [ "$machine_type" =
> "am335x-hs-evm" ]; then
> +		VIDEO_SINK="fbdevsink"
>  		resolution="`fbset | awk '/geometry/ {print $2"x"$3}'`"
> -		 if [ "$resolution" = "480x272" ]; then
> +		if [ "$resolution" = "480x272" ]; then
>  			filename="/usr/share/ti/video/TearOfSteel-AV-
> Short-400x240.mp4"
>  		else
>  			# Use WVGA for all other resolutions
>  			filename="/usr/share/ti/video/TearOfSteel-AV-
> Short-720x420.mp4"
> -	fi
> -    elif [ "$machine_type" = "dra7xx-evm" ]
> -    then
> -	    filename="/usr/share/ti/video/TearOfSteel-AV-Short-
> 720x420.mp4"
> -    elif [ "$machine_type" = "omap5-evm" ]
> -    then
> -        filename="/usr/share/ti/video/TearOfSteel-AV-Short-720x406.mp4"
> -    elif [ "$machine_type" = "am437x-evm" ] || [ "$machine_type" =
> "am437x-hs-evm" ] || [ "$machine_type" = "am438x-epos-evm" ]|| [
> "$machine_type" = "am65xx-evm" ]
> -    then
> -            resolution="`fbset | awk '/geometry/ {print $2"x"$3}'`"
> -            if [ "$resolution" = "480x272" ]; then
> -                filename="/usr/share/ti/video/TearOfSteel-AV-Short-
> 400x240.mp4"
> -            else
> -                filename="/usr/share/ti/video/TearOfSteel-AV-Short-
> 720x406.mp4"
> -            fi
> +		fi
> +	elif [ "$machine_type" = "dra7xx-evm" ]
> +	then
> +		filename="/usr/share/ti/video/TearOfSteel-AV-Short-
> 720x420.mp4"
> +	elif [ "$machine_type" = "omap5-evm" ]
> +	then
> +		filename="/usr/share/ti/video/TearOfSteel-AV-Short-
> 720x406.mp4"
> +	elif [ "$machine_type" = "am65xx-evm" ]
> +	then
> +		VIDEO_SINK="kmssink_am6"
> +		filename="/usr/share/ti/video/TearOfSteel-AV-Short-
> 720x406.mp4"
> +	elif [ "$machine_type" = "am437x-evm" ] || [ "$machine_type" =
> "am437x-hs-evm" ] || [ "$machine_type" = "am438x-epos-evm" ]
> +	then
> +		resolution="`fbset | awk '/geometry/ {print $2"x"$3}'`"
> +		if [ "$resolution" = "480x272" ]; then
> +			filename="/usr/share/ti/video/TearOfSteel-AV-
> Short-400x240.mp4"
> +		else
> +			filename="/usr/share/ti/video/TearOfSteel-AV-
> Short-720x406.mp4"
> +		fi
>  	else
>  		default_display="`cat
> /sys/devices/platform/omapdss/manager0/display`"
>  		if [ "$default_display" = "dvi" ]; then
> @@ -52,14 +58,12 @@ else
>  		amixer -c 0 set Headset 1+ unmute
>  	elif [ "$machine_type" = "am335x-evm" ] || [ "$machine_type" =
> "am335x-hs-evm" ]; then
>  		amixer cset name='PCM Playback Volume' 127
> -    elif [ "$machine_type" = "omap5-evm" ]; then
> +	elif [ "$machine_type" = "omap5-evm" ]; then
>  		amixer cset name='PCM Playback Volume' 127
> -    elif [ "$machine_type" = "am437x-evm" ] || [ "$machine_type" =
> "am437x-hs-evm" ] || [ "$machine_type" = "am438x-epos-evm" ]; then
> -
> +	elif [ "$machine_type" = "am437x-evm" ] || [ "$machine_type" =
> "am437x-hs-evm" ] || [ "$machine_type" = "am438x-epos-evm" ]; then
>  		# EPOS uses a different configuration so check if
>  		# we are running on that board
>  		model_name=`cat /proc/device-tree/model | grep -i epos`
> -
>  		if [ "$?" = '0' ]; then
>  			amixer cset name='DAC Playback Volume' 127
>  			amixer cset name='HP Analog Playback Volume' 66
> @@ -72,5 +76,11 @@ else
>  			amixer cset name='PCM Playback Volume' 127
>  		fi
>  	fi
> -	gst-launch-1.0 filesrc location=$filename ! queue ! qtdemux
> name=demux demux.audio_0 ! queue ! faad ! alsasink demux.video_0 !
> queue ! avdec_mpeg4 ! videoconvert ! fbdevsink device=/dev/fb0
> +	if [ "$VIDEO_SINK" = "fbdevsink" ]; then
> +		gst-launch-1.0 filesrc location=$filename ! queue ! qtdemux
> name=demux demux.audio_0 ! queue ! faad ! alsasink demux.video_0 !
> queue ! avdec_mpeg4 ! videoconvert ! fbdevsink device=/dev/fb0
> +	elif [ "$VIDEO_SINK" = "kmssink_am6" ]; then
> +		gst-launch-1.0 filesrc location=$filename ! queue ! qtdemux
> name=demux demux.audio_0 ! queue ! faad ! alsasink 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.audio_0 ! queue ! faad ! alsasink demux.video_0 !
> queue ! avdec_mpeg4 ! videoconvert ! kmssink
> +	fi
>  fi
> diff --git a/multimedia_apps/arm_multimedia_mpeg4dec/runMpeg4Dec.sh
> b/multimedia_apps/arm_multimedia_mpeg4dec/runMpeg4Dec.sh
> index 82fcb2c..bb565c2 100644
> --- a/multimedia_apps/arm_multimedia_mpeg4dec/runMpeg4Dec.sh
> +++ b/multimedia_apps/arm_multimedia_mpeg4dec/runMpeg4Dec.sh
> @@ -1,7 +1,9 @@
>  #!/bin/sh
> 
>  machine_type="`cat /etc/hostname`"
> +VIDEO_SINK="kmssink"
>  if [ "$machine_type" = "am335x-evm" ] || [ "$machine_type" = "am335x-hs-
> evm" ]; then
> +        VIDEO_SINK="fbdevsink"
>  	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"
> +     VIDEO_SINK="kmssink_am6"
> +     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 [ "$VIDEO_SINK" = "fbdevsink" ]; then
> +	gst-launch-1.0 playbin uri=file://$filename video-sink=fbdevsink
> audio-sink=fakesink
> +elif [ "$VIDEO_SINK" = "kmssink_am6" ]; 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
> --
> 1.9.1
> 
> _______________________________________________
> meta-arago mailing list
> meta-arago@arago-project.org
> http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-02-25 15:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-20 15:41 [matrix-gui-v2-apps][PATCH] arm_multimedia: add kmssink support Eric Ruei
2019-02-25 15:13 ` [EXTERNAL] " Gou, Hongmei
2019-02-25 15:17   ` Ruei, Eric

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.