OSDN Git Service

FFmpegExtractor: Don't use our extractor when we agree with StageFright
[android-x86/external-stagefright-plugins.git] / tools / sfplayer
1 #!/system/xbin/bash
2
3 # ref :http://www.ibm.com/developerworks/cn/linux/l-bash-parameters.html
4
5 #dir="/data/test"
6 #file="pdahd.720X480.mp4"
7
8 showopts () {
9   while getopts ":d:" optname
10     do
11       case "$optname" in
12         "d")
13           echo "Option $optname has value $OPTARG"
14           dir=$OPTARG
15           ;;
16         "?")
17           echo "Unknown option $OPTARG"
18           ;;
19         ":")
20           echo "No argument value for option $OPTARG"
21           ;;
22         *)
23         # Should not occur
24           echo "Unknown error while processing options"
25           ;;
26       esac
27     done
28   return $OPTIND
29 }
30
31 showargs () {
32   for p in "$@"
33     do
34       echo "$p"
35     done
36 }
37
38 optinfo=$(showopts "$@")
39 argstart=$?
40 arginfo=$(showargs "${@:$argstart}")
41 echo "Arguments are:"
42 echo "$arginfo"
43 echo "Options are:"
44 echo "$optinfo"
45
46 file=$arginfo
47
48 #am start -a android.intent.action.VIEW -d file://$dir/$file -t video/*
49 am start -a android.intent.action.VIEW -d file://$file -t video/*