-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgstreamer_build.sh
executable file
·152 lines (139 loc) · 6.17 KB
/
gstreamer_build.sh
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
#!/bin/bash
#http://wiki.oz9aec.net/index.php/Building_Gstreamer_1.2_from_source
NO_ERROR=0
BASE_PATH=/home/pi/gst
if [ ! -f dependency_install ]; then
apt-get install libx264-dev libgudev-1.0-dev yasm bison flex
touch dependency_install
fi
source ./set_env.sh
ORC_DOWNLOAD=http://gstreamer.freedesktop.org/src/orc/orc-0.4.21.tar.xz
FILES=( http://gstreamer.freedesktop.org/src/gstreamer/gstreamer-1.4.0.tar.xz \
http://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-1.4.0.tar.xz \
http://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-1.4.0.tar.xz \
http://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-1.4.0.tar.xz \
http://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-1.4.0.tar.xz \
http://gstreamer.freedesktop.org/src/gst-libav/gst-libav-1.4.0.tar.xz )
if [ ! -f downloaded ]; then
[ $NO_ERROR -eq 0 ] && wget -c $ORC_DOWNLOAD || NO_ERROR=1
for file in ${FILES[@]}; do
[ $NO_ERROR -eq 0 ] && wget -c $file || NO_ERROR=1
[ $NO_ERROR -eq 0 ] && wget -c $file.sha256sum || NO_ERROR=1
done
[ $NO_ERROR -eq 0 ] && sha256sum -c *.sha256sum || NO_ERROR=1
[ $NO_ERROR -eq 0 ] && touch downloaded
fi
for file in $(ls -1 | grep -E -e "gz$|xz$"); do
#echo "$(echo "$file" | sed 's/\.tar\.[gx]z$//')"
if [ ! -d $(echo "$file" | sed 's/\.tar\.[gx]z$//') ]; then
echo "Extracting $file"
[ $NO_ERROR -eq 0 ] && tar xf $file || NO_ERROR=1
fi
done
PREFIX="--prefix=/home/pi/gst/runtime"
ORC="--enable-orc"
pushd $BASE_PATH/orc-*
CURRENT=$BASE_PATH/orc_status
if [ ! -f $CURRENT ] || [ $(cat $CURRENT | grep -c "configured") -eq 0 ]; then
[ $NO_ERROR -eq 0 ] && ./configure $PREFIX || NO_ERROR=1
[ $NO_ERROR -eq 0 ] && echo "configured" > $CURRENT
fi
if [ ! -f $CURRENT ] || [ $(cat $CURRENT | grep -c "built") -eq 0 ]; then
[ $NO_ERROR -eq 0 ] && make || NO_ERROR=1
[ $NO_ERROR -eq 0 ] && echo "built" >> $CURRENT
fi
if [ ! -f $CURRENT ] || [ $(cat $CURRENT | grep -c "installed") -eq 0 ]; then
[ $NO_ERROR -eq 0 ] && make install || NO_ERROR=1
[ $NO_ERROR -eq 0 ] && echo "installed" >> $CURRENT
fi
popd
pushd $BASE_PATH/gstreamer-*
CURRENT=$BASE_PATH/gstreamer_status
if [ ! -f $CURRENT ] || [ $(cat $CURRENT | grep -c "configured") -eq 0 ]; then
[ $NO_ERROR -eq 0 ] && ./configure $ORC $PREFIX || NO_ERROR=1
[ $NO_ERROR -eq 0 ] && echo "configured" > $CURRENT
fi
if [ ! -f $CURRENT ] || [ $(cat $CURRENT | grep -c "built") -eq 0 ]; then
[ $NO_ERROR -eq 0 ] && make || NO_ERROR=1
[ $NO_ERROR -eq 0 ] && echo "built" >> $CURRENT
fi
if [ ! -f $CURRENT ] || [ $(cat $CURRENT | grep -c "installed") -eq 0 ]; then
[ $NO_ERROR -eq 0 ] && make install || NO_ERROR=1
[ $NO_ERROR -eq 0 ] && echo "installed" >> $CURRENT
fi
popd
pushd $BASE_PATH/gst-plugins-base-*
CURRENT=$BASE_PATH/gst-plugins-base_status
if [ ! -f $CURRENT ] || [ $(cat $CURRENT | grep -c "configured") -eq 0 ]; then
[ $NO_ERROR -eq 0 ] && ./configure $ORC $PREFIX || NO_ERROR=1
[ $NO_ERROR -eq 0 ] && echo "configured" > $CURRENT
fi
if [ ! -f $CURRENT ] || [ $(cat $CURRENT | grep -c "built") -eq 0 ]; then
[ $NO_ERROR -eq 0 ] && make || NO_ERROR=1
[ $NO_ERROR -eq 0 ] && echo "built" >> $CURRENT
fi
if [ ! -f $CURRENT ] || [ $(cat $CURRENT | grep -c "installed") -eq 0 ]; then
[ $NO_ERROR -eq 0 ] && make install || NO_ERROR=1
[ $NO_ERROR -eq 0 ] && echo "installed" >> $CURRENT
fi
popd
pushd $BASE_PATH/gst-plugins-good-*
CURRENT=$BASE_PATH/gst-plugins-good_status
if [ ! -f $CURRENT ] || [ $(cat $CURRENT | grep -c "configured") -eq 0 ]; then
[ $NO_ERROR -eq 0 ] && ./configure $ORC $PREFIX || NO_ERROR=1
[ $NO_ERROR -eq 0 ] && echo "configured" > $CURRENT
fi
if [ ! -f $CURRENT ] || [ $(cat $CURRENT | grep -c "built") -eq 0 ]; then
[ $NO_ERROR -eq 0 ] && make || NO_ERROR=1
[ $NO_ERROR -eq 0 ] && echo "built" >> $CURRENT
fi
if [ ! -f $CURRENT ] || [ $(cat $CURRENT | grep -c "installed") -eq 0 ]; then
[ $NO_ERROR -eq 0 ] && make install || NO_ERROR=1
[ $NO_ERROR -eq 0 ] && echo "installed" >> $CURRENT
fi
popd
pushd $BASE_PATH/gst-plugins-bad-*
CURRENT=$BASE_PATH/gst-plugins-bad_status
if [ ! -f $CURRENT ] || [ $(cat $CURRENT | grep -c "configured") -eq 0 ]; then
[ $NO_ERROR -eq 0 ] && ./configure $ORC $PREFIX || NO_ERROR=1
[ $NO_ERROR -eq 0 ] && echo "configured" > $CURRENT
fi
if [ ! -f $CURRENT ] || [ $(cat $CURRENT | grep -c "built") -eq 0 ]; then
[ $NO_ERROR -eq 0 ] && make || NO_ERROR=1
[ $NO_ERROR -eq 0 ] && echo "built" >> $CURRENT
fi
if [ ! -f $CURRENT ] || [ $(cat $CURRENT | grep -c "installed") -eq 0 ]; then
[ $NO_ERROR -eq 0 ] && make install || NO_ERROR=1
[ $NO_ERROR -eq 0 ] && echo "installed" >> $CURRENT
fi
popd
pushd $BASE_PATH/gst-plugins-ugly-*
CURRENT=$BASE_PATH/gst-plugins-ugly_status
if [ ! -f $CURRENT ] || [ $(cat $CURRENT | grep -c "configured") -eq 0 ]; then
[ $NO_ERROR -eq 0 ] && ./configure $ORC $PREFIX || NO_ERROR=1
[ $NO_ERROR -eq 0 ] && echo "configured" > $CURRENT
fi
if [ ! -f $CURRENT ] || [ $(cat $CURRENT | grep -c "built") -eq 0 ]; then
[ $NO_ERROR -eq 0 ] && make || NO_ERROR=1
[ $NO_ERROR -eq 0 ] && echo "built" >> $CURRENT
fi
if [ ! -f $CURRENT ] || [ $(cat $CURRENT | grep -c "installed") -eq 0 ]; then
[ $NO_ERROR -eq 0 ] && make install || NO_ERROR=1
[ $NO_ERROR -eq 0 ] && echo "installed" >> $CURRENT
fi
popd
pushd $BASE_PATH/gst-libav-*
CURRENT=$BASE_PATH/gst-libav_status
if [ ! -f $CURRENT ] || [ $(cat $CURRENT | grep -c "configured") -eq 0 ]; then
[ $NO_ERROR -eq 0 ] && ./configure $ORC $PREFIX || NO_ERROR=1
[ $NO_ERROR -eq 0 ] && echo "configured" > $CURRENT
fi
if [ ! -f $CURRENT ] || [ $(cat $CURRENT | grep -c "built") -eq 0 ]; then
[ $NO_ERROR -eq 0 ] && make || NO_ERROR=1
[ $NO_ERROR -eq 0 ] && echo "built" >> $CURRENT
fi
if [ ! -f $CURRENT ] || [ $(cat $CURRENT | grep -c "installed") -eq 0 ]; then
[ $NO_ERROR -eq 0 ] && make install || NO_ERROR=1
[ $NO_ERROR -eq 0 ] && echo "installed" >> $CURRENT
fi
popd