deps: Merge the servo/media repository (#42369)

This change merges http://github.com/servo/media into this repository.
It is only used by Servo and version upgrades are complicated by having
two repositories. In addition, this avoids the need to refer to
individual commit hashes in the Servo `Cargo.toml`. The hope is that
merging these two repositories will lead to better code organization /
simplification like we have seen with the WebXR support. Initiailly, the
idea was that this media support could be shared with the wider Rust
ecosystem, but I think that hasn't worked out as planned due to the fact
that it is difficult to use the various media packaes outside of the
Servo project and the fact that no one seems to be doing this.

Some changes were made when importing the code:
- The second commit in this PR addresses new clippy warnings from the
imported code.
 - GStreamer Packages are no longer renamed in the media code, so that
   they are named the same as they are currently in Servo.
 - Some examples are not ported as they require being run interactively
   and depend on older version of important libraries like winit.
   Having these dependencies in the core part of Servo isn't very
   convenient. Removed examples:
   - `audio_decoder.rs`: This is meant to be run interactively with a
     file so isn't very useful for testing.
   - Depended on winit GUI (`player` subdirectory):
     - `media_element_source_node.rs`
     - `play_media_stream.rs`
     - `simple_player.rs`
     - `muted_player.rs`
   - `siple_webrtc.rs`: Depended on `webrtc` library:

Testing: This is covered by existing tests. In addition, the job which
runs
the media examples is added to the unit test workflow.

---------

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Martin Robinson
2026-02-06 18:00:03 +01:00
committed by GitHub
parent 8d54bf0a4b
commit eeb31a3cec
130 changed files with 16094 additions and 75 deletions

View File

@@ -101,6 +101,9 @@ jobs:
sudo apt install -qy --no-install-recommends mesa-vulkan-drivers fonts-noto-cjk fonts-dejavu-extra
# FIXME #35029
sudo apt purge -y fonts-droid-fallback
sudo apt install -y jackd2 libjack-jackd2-0
- name: Start Dummy Audio Device
run: jackd -d dummy &
- name: Sync from upstream WPT
if: ${{ inputs.wpt-sync-from-upstream }}
run: |

View File

@@ -191,7 +191,7 @@ jobs:
flags: unittests,unittests-linux,unittests-linux-${{ inputs.profile }}
token: ${{ secrets.CODECOV_TOKEN }}
- name: Devtools tests
if: ${{ false && inputs.unit-tests }} # FIXME #39273
if: ${{ false && inputs.unit-tests }} # FIXME #39273
run: ./mach test-devtools --profile ${{ inputs.profile }}
- name: Archive build timing
uses: actions/upload-artifact@v6
@@ -231,7 +231,7 @@ jobs:
if: ${{ inputs.bencher && inputs.profile != 'debug' && github.event_name != 'workflow_dispatch' && github.event_name != 'merge_group' }}
uses: ./.github/workflows/bencher.yml
with:
target: 'linux'
target: "linux"
profile: ${{ inputs.profile }}
compressed-file-path: ${{ inputs.profile }}-binary-linux/servo-tech-demo.tar.gz
binary-path: servo/servo
@@ -368,3 +368,65 @@ jobs:
files: codecov.json,support/crown/codecov.json
fail_ci_if_error: true
flags: unittests
media-examples:
name: Media Examples
if: ${{ inputs.unit-tests }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5
if: github.event_name != 'pull_request_target'
with:
fetch-depth: 1
- name: Install Dependencies
run: |
sudo bash -c 'apt-add-repository -y https://mirrors.kernel.org/ubuntu'
sudo apt update
sudo apt install -y \
gstreamer1.0-libav \
gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-ugly \
gstreamer1.0-tools \
libasound2-plugins \
libfaad2 \
libffi7 \
libfftw3-single3 \
libges-1.0-dev \
libgstreamer-plugins-bad1.0-dev\
libgstreamer-plugins-base1.0-dev \
libgstreamer1.0-dev \
libgstrtspserver-1.0-dev \
libjack-jackd2-0 \
libmms0 \
libmpg123-0 \
libopus0 \
liborc-0.4-0 \
liborc-0.4-dev \
libpulsedsp \
libsamplerate0 \
libspeexdsp1 \
libtdb1 \
libtheora0 \
libtwolame0 \
libwayland-egl1-mesa \
libwebrtc-audio-processing1 \
pulseaudio \
pulseaudio-utils \
webp
- name: Determine MSRV
id: msrv
uses: ./.github/actions/parse_msrv
- name: Install MSRV
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.msrv.outputs.rust_version }}
- name: Virtual Audio Devices
run: |
jackd -d dummy &
pulseaudio --start
gst-inspect-1.0 | grep Total
- name: Run Examples
run: |
ls components/media/examples/examples/*.rs | xargs -I{} basename {} .rs | grep -v params_connect | RUST_BACKTRACE=1 GST_DEBUG=3 xargs -I{} cargo run -p media-examples --example {}