diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2019-07-08 12:40:05 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-08 12:40:05 -0400 |
commit | 988e38fe0ac225a3762deb1cd5c4bbda6fe37f53 (patch) | |
tree | ac7c9bb9662b60ab61b67ee47d3ee34b784388b5 /python/servo/build_commands.py | |
parent | 3e88f63693fe3970de6074c2d79c250f24df50e0 (diff) | |
parent | 7c97d0193b12f47a8f404354b7085f3c275e2e37 (diff) | |
download | servo-988e38fe0ac225a3762deb1cd5c4bbda6fe37f53.tar.gz servo-988e38fe0ac225a3762deb1cd5c4bbda6fe37f53.zip |
Auto merge of #23712 - servo:gstreamer-windows, r=ferjm
Support WebAudio on Windows
These changes improve the GStreamer experience on Windows in several ways:
* we package the set of plugins and their dependencies that Servo requires for media support
* we explicitly load those plugins when starting the media engine rather than relying on an existing gstreamer installation
These changes do not affect the experience on non-Windows platforms, but the path is clear to do so in order to fix problems like #23519. With these changes I can successfully hear a tone when loading https://joshmatthews.net/osc.html in both a desktop build and a UWP build.
---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #23631 and fix #23698
- [x] These changes do not require tests because no tests on windows ;_;
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23712)
<!-- Reviewable:end -->
Diffstat (limited to 'python/servo/build_commands.py')
-rw-r--r-- | python/servo/build_commands.py | 142 |
1 files changed, 107 insertions, 35 deletions
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index df2dc4c9ecc..53354f3d73a 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -664,50 +664,122 @@ def package_gstreamer_dlls(servo_exe_dir, target): gst_root = "" gst_default_path = path.join("C:\\gstreamer\\1.0", gst_x64) gst_env = "GSTREAMER_1_0_ROOT_" + gst_x64 - if os.path.exists(path.join(gst_default_path, "bin", "libffi-7.dll")) or \ - os.path.exists(path.join(gst_default_path, "bin", "ffi-7.dll")): - gst_root = gst_default_path - elif os.environ.get(gst_env) is not None: + if os.environ.get(gst_env) is not None: gst_root = os.environ.get(gst_env) + elif os.path.exists(path.join(gst_default_path, "bin", "ffi-7.dll")): + gst_root = gst_default_path else: - print("Could not found GStreamer installation directory.") + print("Could not find GStreamer installation directory.") return False + # All the shared libraries required for starting up and loading plugins. gst_dlls = [ - ["libffi-7.dll", "ffi-7.dll"], - ["libgio-2.0-0.dll", "gio-2.0-0.dll"], - ["libglib-2.0-0.dll", "glib-2.0-0.dll"], - ["libgmodule-2.0-0.dll", "gmodule-2.0-0.dll"], - ["libgobject-2.0-0.dll", "gobject-2.0-0.dll"], - ["libgstapp-1.0-0.dll", "gstapp-1.0-0.dll"], - ["libgstaudio-1.0-0.dll", "gstaudio-1.0-0.dll"], - ["libgstbase-1.0-0.dll", "gstbase-1.0-0.dll"], - ["libgstgl-1.0-0.dll", "gstgl-1.0-0.dll"], - ["libgstpbutils-1.0-0.dll", "gstpbutils-1.0-0.dll"], - ["libgstplayer-1.0-0.dll", "gstplayer-1.0-0.dll"], - ["libgstreamer-1.0-0.dll", "gstreamer-1.0-0.dll"], - ["libgstrtp-1.0-0.dll", "gstrtp-1.0-0.dll"], - ["libgstsdp-1.0-0.dll", "gstsdp-1.0-0.dll"], - ["libgsttag-1.0-0.dll", "gsttag-1.0-0.dll"], - ["libgstvideo-1.0-0.dll", "gstvideo-1.0-0.dll"], - ["libgstwebrtc-1.0-0.dll", "gstwebrtc-1.0-0.dll"], - ["libintl-8.dll", "intl-8.dll"], - ["liborc-0.4-0.dll", "orc-0.4-0.dll"], - ["libwinpthread-1.dll", "winpthread-1.dll"], - ["libz.dll", "libz-1.dll", "z-1.dll"] + "avfilter-7.dll", + "avformat-58.dll", + "avcodec-58.dll", + "avutil-56.dll", + "bz2.dll", + "ffi-7.dll", + "gio-2.0-0.dll", + "glib-2.0-0.dll", + "gmodule-2.0-0.dll", + "gobject-2.0-0.dll", + "graphene-1.0-0.dll", + "gstapp-1.0-0.dll", + "gstaudio-1.0-0.dll", + "gstbase-1.0-0.dll", + "gstcodecparsers-1.0-0.dll", + "gstcontroller-1.0-0.dll", + "gstfft-1.0-0.dll", + "gstgl-1.0-0.dll", + "gstpbutils-1.0-0.dll", + "gstplayer-1.0-0.dll", + "gstreamer-1.0-0.dll", + "gstriff-1.0-0.dll", + "gstrtp-1.0-0.dll", + "gstsctp-1.0-0.dll", + "gstsdp-1.0-0.dll", + "gsttag-1.0-0.dll", + "gstvideo-1.0-0.dll", + "gstwebrtc-1.0-0.dll", + "intl-8.dll", + "libgmp-10.dll", + "libgnutls-30.dll", + "libhogweed-4.dll", + "libjpeg-8.dll", + "libnettle-6.dll.", + "libpng16-16.dll", + "libogg-0.dll", + "libopus-0.dll", + "libtasn1-6.dll", + "libtheora-0.dll", + "libtheoradec-1.dll", + "libtheoraenc-1.dll", + "libvorbis-0.dll", + "libvorbisenc-2.dll", + "libwinpthread-1.dll", + "nice-10.dll", + "orc-0.4-0.dll", + "swresample-3.dll", + "z-1.dll", ] missing = [] for gst_lib in gst_dlls: - if isinstance(gst_lib, str): - gst_lib = [gst_lib] - for lib in gst_lib: - try: - shutil.copy(path.join(gst_root, "bin", lib), servo_exe_dir) - break - except: - pass - else: + try: + shutil.copy(path.join(gst_root, "bin", gst_lib), servo_exe_dir) + except: + missing += [str(gst_lib)] + + for gst_lib in missing: + print("ERROR: could not find required GStreamer DLL: " + gst_lib) + if missing: + return False + + # Only copy a subset of the available plugins. + gst_dlls = [ + "gstapp.dll", + "gstaudioconvert.dll", + "gstaudiofx.dll", + "gstaudioparsers.dll", + "gstaudioresample.dll", + "gstautodetect.dll", + "gstcoreelements.dll", + "gstdeinterlace.dll", + "gstplayback.dll", + "gstinterleave.dll", + "gstisomp4.dll", + "gstnice.dll", + "gstogg.dll", + "gstopengl.dll", + "gstopus.dll", + "gstproxy.dll", + "gstrtp.dll", + "gsttheora.dll", + "gsttypefindfunctions.dll", + "gstvideoconvert.dll", + "gstvideofilter.dll", + "gstvideoparsersbad.dll", + "gstvideoscale.dll", + "gstvolume.dll", + "gstvorbis.dll", + "gstvpx.dll", + "gstwebrtc.dll", + "gstwasapi.dll", + "gstlibav.dll", + ] + + gst_plugin_path_root = os.environ.get("GSTREAMER_PACKAGE_PLUGIN_PATH") or gst_root + gst_plugin_path = path.join(gst_plugin_path_root, "lib", "gstreamer-1.0") + if not os.path.exists(gst_plugin_path): + print("ERROR: couldn't find gstreamer plugins at " + gst_plugin_path) + return False + + missing = [] + for gst_lib in gst_dlls: + try: + shutil.copy(path.join(gst_plugin_path, gst_lib), servo_exe_dir) + except: missing += [str(gst_lib)] for gst_lib in missing: |