Upgrade media / GStreamer / GLib (#30750)

- Upgrade the version of GStreamer for Windows

This upgrades the Windows build to use the most recent version of
GStreamer. This is necessary to upgrade our GStreamer dependency.

- Stop shipping GStreamer binaries on Linux

The binary bundle of GStreamer that we package is not used to compile --
only to run layout tests. It's too old for the APIs that we are using
(as evidenced by needed 1.18 for WebRTC) and nowadays Linux
distributions carry a new version so it's unecessary for our build
machines. No longer using this binary bundle will allow us to upgrade
our GStreamer dependency -- which now has stricter checks that we
are using at least version 1.18.

- Upgrade media to use newer versions of GStreamer / GLib dependencies
This commit is contained in:
Martin Robinson 2024-01-05 09:01:58 +01:00 committed by GitHub
parent c219204084
commit 7fa4ea9740
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
36 changed files with 517 additions and 338 deletions

View file

@ -430,10 +430,10 @@ def package_gstreamer_dlls(env, servo_exe_dir, target):
# All the shared libraries required for starting up and loading plugins.
gst_dlls = [
"avcodec-58.dll",
"avfilter-7.dll",
"avformat-58.dll",
"avutil-56.dll",
"avcodec-59.dll",
"avfilter-8.dll",
"avformat-59.dll",
"avutil-57.dll",
"bz2.dll",
"ffi-7.dll",
"gio-2.0-0.dll",
@ -443,26 +443,21 @@ def package_gstreamer_dlls(env, servo_exe_dir, target):
"graphene-1.0-0.dll",
"intl-8.dll",
"libcrypto-1_1-x64.dll",
"libgmp-10.dll",
"libgnutls-30.dll",
"libhogweed-4.dll",
"libjpeg-8.dll",
"libnettle-6.dll.",
"libogg-0.dll",
"libopus-0.dll",
"libpng16-16.dll",
"libssl-1_1-x64.dll",
"libtasn1-6.dll",
"libtheora-0.dll",
"libtheoradec-1.dll",
"libtheoraenc-1.dll",
"libusrsctp-1.dll",
"libvorbis-0.dll",
"libvorbisenc-2.dll",
"libwinpthread-1.dll",
"nice-10.dll",
"opus-0.dll",
"orc-0.4-0.dll",
"swresample-3.dll",
"pcre2-8-0.dll",
"swresample-4.dll",
"theora-0.dll",
"theoradec-1.dll",
"theoraenc-1.dll",
"z-1.dll",
] + windows_dlls()

View file

@ -22,6 +22,7 @@ GSTREAMER_DYLIBS = [
"gstfft",
"gstgl",
"gstpbutils",
"gstplay",
"gstriff",
"gstrtp",
"gstrtsp",
@ -33,6 +34,7 @@ GSTREAMER_DYLIBS = [
"gstcodecparsers",
"gstplayer",
"gstwebrtc",
"gstwebrtcnice",
]
@ -84,12 +86,9 @@ def windows_dlls():
def windows_plugins():
# FIXME: We should support newer gstreamer versions here that replace
# gstvideoconvert and gstvideoscale with gstvideoconvertscale.
libs = [
*GSTREAMER_PLUGINS,
"gstvideoconvert",
"gstvideoscale",
"gstvideoconvertscale",
"gstwasapi"
]
return [f"{lib}.dll" for lib in libs]

View file

@ -56,7 +56,7 @@ class Base:
# the cross-compilation case, we might be picking it up from another directory.
if check_installation and not self.is_gstreamer_installed(cross_compilation_target):
raise FileNotFoundError(
"GStreamer libraries not found (>= version 1.16)."
"GStreamer libraries not found (>= version 1.18)."
"Please see installation instructions in README.md"
)
@ -83,7 +83,7 @@ class Base:
env, cross_compilation_target, check_installation=False)
return (
subprocess.call(
["pkg-config", "--atleast-version=1.16", "gstreamer-1.0"],
["pkg-config", "--atleast-version=1.18", "gstreamer-1.0"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
env=env,

View file

@ -9,7 +9,6 @@
import os
import subprocess
import tempfile
from typing import Optional, Tuple
import distro
@ -28,8 +27,16 @@ from .base import Base
APT_PKGS = [
'build-essential', 'ccache', 'clang', 'cmake', 'curl', 'g++', 'git',
'gperf', 'libdbus-1-dev', 'libfreetype6-dev', 'libgl1-mesa-dri',
'libgles2-mesa-dev', 'libglib2.0-dev', 'libgstreamer-plugins-bad1.0-dev',
'libgstreamer-plugins-base1.0-dev', 'libgstreamer1.0-dev',
'libgles2-mesa-dev', 'libglib2.0-dev',
'libgstreamer-plugins-base1.0-dev',
'gstreamer1.0-plugins-good', 'libgstreamer-plugins-good1.0-dev',
'gstreamer1.0-plugins-bad', 'libgstreamer-plugins-bad1.0-dev',
'gstreamer1.0-plugins-ugly',
"gstreamer1.0-plugins-base", 'libgstreamer-plugins-base1.0-dev',
'gstreamer1.0-libav',
'libgstrtspserver-1.0-dev',
'gstreamer1.0-tools',
'libges-1.0-dev',
'libharfbuzz-dev', 'liblzma-dev', 'libunwind-dev', 'libunwind-dev',
'libvulkan1', 'libx11-dev', 'libxcb-render0-dev', 'libxcb-shape0-dev',
'libxcb-xfixes0-dev', 'libxmu-dev', 'libxmu6', 'libegl1-mesa-dev',
@ -156,7 +163,7 @@ class Linux(Base):
if self.distro in ['Ubuntu', 'Debian GNU/Linux', 'Raspbian GNU/Linux']:
command = ['apt-get', 'install']
pkgs = APT_PKGS
if subprocess.call(['dpkg', '-s'] + pkgs,
if subprocess.call(['dpkg', '-s'] + pkgs, shell=True,
stdout=subprocess.PIPE, stderr=subprocess.PIPE) != 0:
install = True
elif self.distro in ['CentOS', 'CentOS Linux', 'Fedora', 'Fedora Linux']:
@ -204,18 +211,6 @@ class Linux(Base):
if not force and self.is_gstreamer_installed(cross_compilation_target=None):
return False
with tempfile.TemporaryDirectory() as temp_dir:
file_name = os.path.join(temp_dir, GSTREAMER_URL.rsplit('/', maxsplit=1)[-1])
util.download_file("Pre-packaged GStreamer binaries", GSTREAMER_URL, file_name)
print(f"Installing GStreamer packages to {PREPACKAGED_GSTREAMER_ROOT}...")
os.makedirs(PREPACKAGED_GSTREAMER_ROOT, exist_ok=True)
# Extract, but strip one component from the output, because the package includes
# a toplevel directory called "./gst/" and we'd like to have the same directory
# structure on all platforms.
subprocess.check_call(["tar", "xf", file_name, "-C", PREPACKAGED_GSTREAMER_ROOT,
"--strip-components=2"])
assert self.is_gstreamer_installed(cross_compilation_target=None)
return True
raise EnvironmentError(
"Bootstrapping GStreamer on Linux is not supported. "
+ "Please install it using your distribution package manager.")

View file

@ -23,8 +23,8 @@ DEPENDENCIES = {
}
URL_BASE = "https://github.com/servo/servo-build-deps/releases/download/msvc-deps/"
GSTREAMER_URL = f"{URL_BASE}/gstreamer-1.0-msvc-x86_64-1.16.0.msi"
GSTREAMER_DEVEL_URL = f"{URL_BASE}/gstreamer-1.0-devel-msvc-x86_64-1.16.0.msi"
GSTREAMER_URL = f"{URL_BASE}/gstreamer-1.0-msvc-x86_64-1.22.8.msi"
GSTREAMER_DEVEL_URL = f"{URL_BASE}/gstreamer-1.0-devel-msvc-x86_64-1.22.8.msi"
DEPENDENCIES_DIR = os.path.join(util.get_target_dir(), "dependencies")
@ -118,19 +118,19 @@ class Windows(Base):
# The bootstraped version of GStreamer always takes precedance of the installed vesion.
prepackaged_root = os.path.join(
DEPENDENCIES_DIR, "gstreamer", "1.0", gst_arch_name
DEPENDENCIES_DIR, "gstreamer", "1.0", f"msvc_{gst_arch_name}"
)
if os.path.exists(os.path.join(prepackaged_root, "bin", "ffi-7.dll")):
return prepackaged_root
# The installed version of GStreamer often sets an environment variable pointing to
# the install location.
root_from_env = os.environ.get(f"GSTREAMER_1_0_ROOT_{gst_arch_name}")
root_from_env = os.environ.get(f"GSTREAMER_1_0_ROOT_MSVC_{gst_arch_name}")
if root_from_env and os.path.exists(os.path.join(root_from_env, "bin", "ffi-7.dll")):
return root_from_env
# If all else fails, look for an installation in the default install directory.
default_root = os.path.join("C:\\gstreamer\\1.0", gst_arch_name)
default_root = os.path.join("C:\\gstreamer\\1.0", f"msvc_{gst_arch_name}")
if os.path.exists(os.path.join(default_root, "bin", "ffi-7.dll")):
return default_root