From 6d42cecaac8407d3ae6b733e28683ff0d0ca62d8 Mon Sep 17 00:00:00 2001 From: smarttowel Date: Tue, 11 Jan 2022 19:27:23 +0300 Subject: [PATCH] Add option for select gst plugins for deploy --- linuxdeploy-plugin-gstreamer.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/linuxdeploy-plugin-gstreamer.sh b/linuxdeploy-plugin-gstreamer.sh index 64ef699..045b702 100755 --- a/linuxdeploy-plugin-gstreamer.sh +++ b/linuxdeploy-plugin-gstreamer.sh @@ -18,6 +18,7 @@ show_usage() { echo " LINUXDEPLOY=\".../linuxdeploy\" path to linuxdeploy (e.g., AppImage); set automatically when plugin is run directly by linuxdeploy" echo echo "Optional variables:" + echo " GSTREAMER_ALLOWED_PLUGINS=\"libgstx265.so,libgstx264.so\" (comma-separated list of plugins to deploy. Deploy all plugins, if empty; default: empty)" echo " GSTREAMER_INCLUDE_BAD_PLUGINS=\"1\" (default: disabled; set to empty string or unset to disable)" echo " GSTREAMER_PLUGINS_DIR=\"...\" (directory containing GStreamer plugins; default: guessed based on main distro architecture)" echo " GSTREAMER_HELPERS_DIR=\"...\" (directory containing GStreamer helper tools like gst-plugin-scanner; default: guessed based on main distro architecture)" @@ -95,11 +96,13 @@ mkdir -p "$plugins_target_dir" echo "Copying plugins into $plugins_target_dir" for i in "$plugins_dir"/*; do - [ -d "$i" ] && continue - [ ! -f "$i" ] && echo "File does not exist: $i" && continue + if [[ -z $GSTREAMER_ALLOWED_PLUGINS ]] || [[ ",$GSTREAMER_ALLOWED_PLUGINS," = *",$(basename $i),"* ]]; then + [ -d "$i" ] && continue + [ ! -f "$i" ] && echo "File does not exist: $i" && continue - echo "Copying plugin: $i" - cp "$i" "$plugins_target_dir" + echo "Copying plugin: $i" + cp "$i" "$plugins_target_dir" + fi done "$LINUXDEPLOY" --appdir "$APPDIR"