hook-ffpyplayer.py 925 B

12345678910111213141516171819202122232425262728
  1. # ------------------------------------------------------------------
  2. # Copyright (c) 2021 PyInstaller Development Team.
  3. #
  4. # This file is distributed under the terms of the GNU General Public
  5. # License (version 2.0 or later).
  6. #
  7. # The full license is available in LICENSE, distributed with
  8. # this software.
  9. #
  10. # SPDX-License-Identifier: GPL-2.0-or-later
  11. # ------------------------------------------------------------------
  12. from PyInstaller import isolated
  13. from PyInstaller.utils.hooks import collect_submodules
  14. hiddenimports = collect_submodules("ffpyplayer")
  15. binaries = []
  16. # ffpyplayer has an internal variable that list locations of libraries it is using.
  17. @isolated.decorate
  18. def _get_ffpyplayer_binary_dirs():
  19. import ffpyplayer
  20. return ffpyplayer.dep_bins
  21. for binary_dir in _get_ffpyplayer_binary_dirs():
  22. binaries += [(binary_dir, '.')] # Copy DLLs from these locations into top-level application directory.