Remove gstreamer limitation to Armv8 CPUs (#75)

* Remove gstreamer limitation to Armv8 CPUs

* Improve CodecPack patching

* Fix orphan processes
pull/76/head
Alex 3 years ago committed by GitHub
parent 64b96840ff
commit 649bfda035
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,3 +1,5 @@
The patcher now supports every scenarios including gstreamer (credits to @nap-liu).
A process leak was identified and fixed, performances should be better when changing video time.
As always, please let me know of any issue you could have.

@ -5,7 +5,6 @@
###############################
source "/etc/VERSION"
cpu_platform=$(</proc/syno_platform)
dsm_version="$productversion $buildnumber-$smallfixnumber"
repo_base_url="https://github.com/AlexPresso/VideoStation-FFMPEG-Patcher"
version="2.0"
@ -18,9 +17,11 @@ wrappers=(
"gst-inspect-1.0"
)
vs_path=/var/packages/VideoStation/target
vs_base_path=/var/packages/VideoStation
vs_path="$vs_base_path/target"
libsynovte_path="$vs_path/lib/libsynovte.so"
cp_path=/var/packages/CodecPack/target/pack
cp_base_path=/var/packages/CodecPack
cp_path="$cp_base_path/target/pack"
cp_bin_path="$cp_path/bin"
cp_to_patch=(
"ffmpeg41:ffmpeg"
@ -30,9 +31,6 @@ cp_to_patch=(
"gst-inspect-1.0:gst-inspect-1.0"
)
gstreamer_platforms=(
"REALTEK_RTD1296"
)
gstreamer_plugins=(
"libgstdtsdec"
"libgstlibav"
@ -119,15 +117,19 @@ function welcome_motd() {
function restart_packages() {
if [[ -d $cp_bin_path ]]; then
info "Clearing CodecPack gstreamer cache..."
rm -f "$cp_path/etc/gstreamer-1.0/registry.*.bin"
if [[ -d "$cp_base_path/etc/gstreamer-1.0" ]]; then
info "Clearing CodecPack gstreamer cache..."
rm -f "$cp_base_path/etc/gstreamer-1.0/registry.*.bin"
fi
info "Restarting CodecPack..."
synopkg restart CodecPack
fi
info "Clearing VideoStation gstreamer cache..."
rm -f "$vs_path/etc/gstreamer-1.0/registry.*.bin"
if [[ -d "$vs_base_path/etc/gstreamer-1.0" ]]; then
info "Clearing VideoStation gstreamer cache..."
rm -f "$vs_base_path/etc/gstreamer-1.0/registry.*.bin"
fi
info "Restarting VideoStation..."
synopkg restart VideoStation
@ -178,11 +180,12 @@ function patch() {
mv -n "$cp_bin_path/$filename" "$cp_bin_path/$filename.orig"
ln -s -f "$vs_path/bin/$target" "$cp_bin_path/$filename"
ln -s -f "$vs_path/bin/$target" "$cp_base_path/target/bin/$filename"
fi
done
fi
if [[ "${gstreamer_platforms[*]}" =~ $cpu_platform ]]; then
if [[ -f "$vs_path/bin/gst-launch-1.0" ]]; then
info "Downloading gstreamer plugins..."
for plugin in "${gstreamer_plugins[@]}"; do
@ -238,13 +241,16 @@ function unpatch() {
done
if [[ -d $cp_bin_path ]]; then
find $cp_bin_path -type f -name "*.orig" | while read -r filename; do
for file in "${cp_to_patch[@]}"; do
filename="${file%%:*}"
info "Restoring CodecPack's $filename"
mv -T -f "$filename" "${filename::-5}"
mv -T -f "$cp_bin_path/$filename.orig" "$cp_bin_path/$filename"
ln -s -f "../pack/bin/$filename" "$cp_base_path/target/bin/$filename"
done
fi
if [[ "${gstreamer_platforms[*]}" =~ $cpu_platform ]]; then
if [[ -f "$vs_path/bin/gst-launch-1.0" ]]; then
for plugin in "${gstreamer_plugins[@]}"; do
info "Removing gstreamer's $plugin plugin"
rm -f "$vs_path/lib/gstreamer/gstreamer-1.0/$plugin.so"

@ -5,6 +5,7 @@
#########################
pid=$$
child=""
stderrfile="/tmp/ffmpeg-$pid.stderr"
logfile="/tmp/ffmpeg.log"
errcode=0
@ -36,6 +37,11 @@ function endprocess() {
info "========================================[end ffmpeg $pid]"
newline
rm -f "$stderrfile"
if [[ "$child" != "" ]]; then
kill -9 "$child"
fi
exit $errcode
}

@ -5,8 +5,10 @@
#########################
pid=$$
child=""
stderrfile="/tmp/gstinspect-$pid.stderr"
logfile="/tmp/gstreamer.log"
errcode=0
#########################
# UTILS
@ -27,6 +29,7 @@ function handle_error() {
newline
cat "$stderrfile" >> $logfile
newline
errcode=1
endprocess
}
@ -34,7 +37,12 @@ function endprocess() {
info "========================================[end gst $pid]"
newline
rm "$stderrfile"
exit 1
if [[ "$child" != "" ]]; then
kill -9 "$child"
fi
exit $errcode
}
#########################

@ -5,8 +5,10 @@
#########################
pid=$$
child=""
stderrfile="/tmp/gstlaunch-$pid.stderr"
logfile="/tmp/gstreamer.log"
errcode=0
#########################
# UTILS
@ -27,6 +29,7 @@ function handle_error() {
newline
cat "$stderrfile" >> $logfile
newline
errcode=1
endprocess
}
@ -34,7 +37,12 @@ function endprocess() {
info "========================================[end gst $pid]"
newline
rm "$stderrfile"
exit 1
if [[ "$child" != "" ]]; then
kill -9 "$child"
fi
exit $errcode
}
#########################

Loading…
Cancel
Save