-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathbt.sh
More file actions
executable file
·164 lines (140 loc) · 3.35 KB
/
bt.sh
File metadata and controls
executable file
·164 lines (140 loc) · 3.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
check_inline_res()
{
#check for *-inline used in linking and mediacontrol - the dependent file is $basename-inline.bt
if [ $inline_resource = 1 ] ; then
libfile="${btfile%.*}-inline.bt"
if [ -f $libfile ] ; then
$MP4BOX -mp4 $libfile 2> /dev/null
libfile="${btfile%.*}-inline.mp4"
else
libfile=""
fi
fi
}
compositor_test()
{
compopt=""
if [ $# -gt 2 ] ; then
compopt=":$3"
fi
if [ $strict_mode = 1 ] ; then
if [ -f $TEST_ERR_FILE ] ; then
return
fi
fi
if [ $test_skip = 1 ] ; then
return
fi
RGB_DUMP="$TEMP_DIR/$2-dump.rgb"
PCM_DUMP="$TEMP_DIR/$2-dump.pcm"
#for the time being we don't check hashes nor use same size/dur for our tests. We will redo the UI tests once finalizing filters branch
dump_dur=5
dump_size=192x192
args="$GPAC -blacklist=vtbdec,nvdec -i $1 compositor:osize=$dump_size:vfr:dur=$dump_dur:asr=44100:ach=2$compopt @ -o $RGB_DUMP @1 -o $PCM_DUMP"
ui_rec=$RULES_DIR/$2-play-ui.xml
if [ -f $ui_rec ] ; then
args="$args -cfg=Validator:Mode=Play -cfg=Validator:Trace=$ui_rec"
fi
do_test "$args" $2
v_args=""
if [ -f $RGB_DUMP ] ; then
# do_hash_test_bin "$RGB_DUMP" "$2-rgb"
v_args="$RGB_DUMP:size=$dump_size"
elif [ $empty_dump = 0 ] ; then
result="no output"
fi
a_args=""
if [ -f $PCM_DUMP ] ; then
# do_hash_test_bin "$PCM_DUMP" "$2-pcm"
a_args="$PCM_DUMP:sr=44100:ch=2"
fi
do_play_test "$2-play" "$v_args" "$a_args"
}
#@bt_test execute tests on BT file: bt -> rgb only
#encoding and decoding tests for bifs are done in bifs/sh
bt_test ()
{
btfile=$1
libfile=""
name=$(basename $1)
name=${name%.*}
extern_proto=0
inline_resource=0
skip_hash=0
empty_dump=0
#file used by other test
case $btfile in
*-inline.bt )
return ;;
*-lib.bt )
return ;;
#already done in bifs tests
*all*.bt )
return ;;
#already done in bifs+tx3g tests
*bifs_subs.bt )
return ;;
*animationstream.bt )
return ;;
*animated-osmo4logo* )
;;
#already done in bifs tests, except above animated logo
*command*.bt )
return ;;
*externproto* )
extern_proto=1 ;;
*inline-http* )
;;
*inline* )
inline_resource=1
;;
#the following bifs tests use rand() or date and won't produce consistent outputs across runs
*htk* )
return;;
*counter-auto* )
skip_hash=1;;
bifs-game* )
skip_hash=1;;
*-date* )
skip_hash=1;;
*remoteiod* )
empty_dump=1;;
esac
name=${name/bifs/bt}
#start our test, specifying all hash names we will check
test_begin "$name"
#UI test mode, check for sensor in source
if [ $test_ui != 0 ] ; then
has_sensor=`grep Sensor $1 | grep -v TimeSensor | grep -v MediaSensor`
if [ "$has_sensor" != "" ]; then
check_inline_res
#directly use the bt file for playback test
do_ui_test $btfile "play"
#$MP4BOX -mp4 $btfile 2> /dev/null
#do_ui_test $mp4file "play"
rm $libfile 2> /dev/null
fi
fi
if [ $test_skip = 1 ] ; then
return
fi
#check for extern proto, and make MP4 out of lib
if [ $extern_proto = 1 ] ; then
libfile="${btfile%.*}-lib.bt"
do_test "$MP4BOX -mp4 $libfile" "Proto-lib-BT->MP4"
libfile="${btfile%.*}-lib.mp4"
fi
#make mp4 for inline resource
check_inline_res
compositor_test "$btfile" "$name"
#this will sync everything, we can delete after
test_end
#remove proto lib or inline resource file
if [ "$libfile" != "" ] ; then
rm $libfile 2> /dev/null
fi
}
#test all bifs
for i in $MEDIA_DIR/bifs/*.bt ; do
bt_test $i
done