mingw-gstreamer1-plugins-ba.../gst-p-bad-cleanup.sh

204 lines
2.8 KiB
Bash
Raw Normal View History

#!/bin/sh
# Process a gst-plugins-bad tarball to remove
# unwanted GStreamer plugins.
#
# See https://bugzilla.redhat.com/show_bug.cgi?id=532470
# for details
#
# Bastien Nocera <bnocera@redhat.com> - 2010
#
2023-03-19 12:03:51 +00:00
VERSION="$1"
SOURCE_URL="http://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-${VERSION}.tar.xz"
SOURCE="gst-plugins-bad-${VERSION}.tar.xz"
wget ${SOURCE_URL}
NEW_SOURCE=`echo $SOURCE | sed 's/bad-/bad-free-/'`
DIRECTORY=`echo $SOURCE | sed 's/\.tar\.xz//'`
ALLOWED="
aacparse
accurip
adpcmdec
adpcmenc
aiff
aiffparse
amrparse
asfmux
audiobuffersplit
audiofxbad
2018-07-18 09:20:29 +00:00
audiolatency
audiomixer
2017-06-20 12:19:37 +00:00
audiomixmatrix
audioparsers
audiovisualizers
autoconvert
bayer
camerabin
camerabin2
cdxaparse
2021-06-07 14:00:49 +00:00
codecalpha
2023-01-28 23:17:18 +00:00
codectimestamper
coloreffects
colorspace
compositor
dataurisrc
dccp
debugutils
dtmf
2020-11-01 23:08:38 +00:00
dvbsubenc
2024-03-07 15:07:49 +00:00
dvbsuboverlay
faceoverlay
festival
fieldanalysis
freeverb
freeze
frei0r
gaudieffects
gdp
geometrictransform
h264parse
hdvparse
hls
id3tag
2024-03-07 15:07:49 +00:00
insertbin
inter
interlace
invtelecine
ivfparse
ivtc
jpegformat
jp2kdecimator
legacyresample
librfb
liveadder
midi
2024-03-07 15:07:49 +00:00
mse
mve
mpegdemux
mpeg4videoparse
mpegpsmux
mpegtsdemux
mpegtsmux
mpegvideoparse
mxf
2016-05-12 15:41:40 +00:00
netsim
nsf
nuvdemux
2016-05-12 15:41:40 +00:00
onvif
2024-03-07 15:07:49 +00:00
openh264
patchdetect
pcapparse
pnm
2018-07-18 09:20:29 +00:00
proxy
qtmux
rawparse
removesilence
2020-11-01 23:08:38 +00:00
rist
rtmp2
2016-05-12 15:41:40 +00:00
rtp
rtpmux
rtpvp8
scaletempo
sdi
sdp
segmentclip
selector
2024-03-07 15:07:49 +00:00
siren
smooth
speed
stereo
subenc
2020-11-01 23:08:38 +00:00
switchbin
2016-11-05 14:31:58 +00:00
timecode
2020-11-01 23:08:38 +00:00
transcode
tta
2024-03-07 15:07:49 +00:00
unixfd
valve
videofilters
2016-05-12 15:41:40 +00:00
videoframe_audiolevel
videomaxrate
videomeasure
videoparsers
videosignal
vmnc
yadif
y4m
"
NOT_ALLOWED="
dvdspu
"
error()
{
MESSAGE=$1
echo $MESSAGE
exit 1
}
check_allowed()
{
MODULE=$1
for i in $ALLOWED ; do
if test x$MODULE = x$i ; then
return 0;
fi
done
# Ignore errors coming from ext/ directory
# they require external libraries so are ineffective anyway
return 1;
}
check_not_allowed()
{
MODULE=$1
for i in $NOT_ALLOWED ; do
if test x$MODULE = x$i ; then
return 0;
fi
done
return 1;
}
rm -rf $DIRECTORY
tar xJf $SOURCE || error "Cannot unpack $SOURCE"
pushd $DIRECTORY > /dev/null || error "Cannot open directory \"$DIRECTORY\""
unknown=""
for subdir in gst ext sys; do
for dir in $subdir/* ; do
# Don't touch non-directories
if ! [ -d $dir ] ; then
continue;
fi
MODULE=`basename $dir`
if ( check_not_allowed $MODULE ) ; then
echo "**** Removing $MODULE ****"
echo "Removing directory $dir"
rm -r $dir || error "Cannot remove $dir"
echo
elif test $subdir = ext || test $subdir = sys; then
# Ignore library or system non-blacklisted plugins
continue;
elif ! ( check_allowed $MODULE ) ; then
echo "Unknown module in $dir"
unknown="$unknown $dir"
fi
done
done
echo
if test "x$unknown" != "x"; then
echo -n "Aborting due to unkown modules: "
echo "$unknown" | sed "s/ /\n /g"
exit 1
fi
popd > /dev/null
tar cJf $NEW_SOURCE $DIRECTORY
echo "$NEW_SOURCE is ready to use"