diff --git a/.github/workflows/runner.yml b/.github/workflows/runner.yml index 47717f69..9edd5033 100644 --- a/.github/workflows/runner.yml +++ b/.github/workflows/runner.yml @@ -27,6 +27,7 @@ env: REGISTRY: ghcr.io IMAGE_NAME: nestrilabs/nestri BASE_TAG_PREFIX: runner + BASE_IMAGE: docker.io/cachyos/cachyos:latest # This makes our release ci quit prematurely # concurrency: @@ -55,7 +56,7 @@ jobs: swap-size-gb: 20 - name: Build Docker image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: file: containers/runner.Containerfile context: ./ @@ -107,7 +108,7 @@ jobs: swap-size-gb: 20 - name: Build Docker image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: file: containers/runner.Containerfile context: ./ @@ -116,3 +117,4 @@ jobs: labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha,mode=max cache-to: type=gha,mode=max + pull: ${{ github.event_name == 'schedule' }} # Pull base image for scheduled builds diff --git a/containers/runner.Containerfile b/containers/runner.Containerfile index 4b69f567..3310a696 100644 --- a/containers/runner.Containerfile +++ b/containers/runner.Containerfile @@ -85,8 +85,8 @@ RUN --mount=type=cache,target=/var/cache/pacman/pkg \ pacman -Sy --noconfirm meson pkgconf cmake git gcc make \ libxkbcommon wayland gstreamer gst-plugins-base gst-plugins-good libinput -# Clone repository with proper directory structure -RUN git clone -b dev-dmabuf https://github.com/games-on-whales/gst-wayland-display.git +# Clone repository +RUN git clone -b dev-dmabuf https://github.com/DatCaptainHorse/gst-wayland-display.git #-------------------------------------------------------------------- FROM gst-wayland-deps AS gst-wayland-planner @@ -133,8 +133,8 @@ RUN sed -i \ RUN --mount=type=cache,target=/var/cache/pacman/pkg \ pacman -Sy --needed --noconfirm \ vulkan-intel lib32-vulkan-intel vpl-gpu-rt mesa \ - steam steam-native-runtime \ - sudo xorg-xwayland seatd libinput labwc wlr-randr mangohud \ + steam steam-native-runtime gtk3 lib32-gtk3 \ + sudo xorg-xwayland seatd libinput labwc wlr-randr gamescope mangohud \ libssh2 curl wget \ pipewire pipewire-pulse pipewire-alsa wireplumber \ noto-fonts-cjk supervisor jq chwd lshw pacman-contrib && \ @@ -144,6 +144,9 @@ RUN --mount=type=cache,target=/var/cache/pacman/pkg \ gst-plugins-bad gst-plugin-pipewire \ gst-plugin-webrtchttp gst-plugin-rswebrtc gst-plugin-rsrtp \ gst-plugin-va gst-plugin-qsv && \ + # lib32 GStreamer stack to fix some games with videos + pacman -Sy --needed --noconfirm \ + lib32-gstreamer lib32-gst-plugins-base lib32-gst-plugins-good && \ # Cleanup paccache -rk1 && \ rm -rf /usr/share/{info,man,doc}/* @@ -185,6 +188,30 @@ RUN mkdir -p /run/dbus && \ -e '/wants = \[/{s/hooks\.node\.suspend\s*//; s/,\s*\]/]/}' \ /usr/share/wireplumber/wireplumber.conf +### PipeWire Latency Optimizations (1-5ms instead of 20ms) ### +RUN mkdir -p /etc/pipewire/pipewire.conf.d && \ + echo "[audio]\ + \n default.clock.rate = 48000\ + \n default.clock.quantum = 128\ + \n default.clock.min-quantum = 128\ + \n default.clock.max-quantum = 256" > /etc/pipewire/pipewire.conf.d/low-latency.conf && \ + mkdir -p /etc/wireplumber/main.lua.d && \ + echo 'table.insert(default_nodes.rules, {\ + \n matches = { { { "node.name", "matches", ".*" } } },\ + \n apply_properties = {\ + \n ["audio.format"] = "S16LE",\ + \n ["audio.rate"] = 48000,\ + \n ["audio.channels"] = 2,\ + \n ["api.alsa.period-size"] = 128,\ + \n ["api.alsa.headroom"] = 0,\ + \n ["session.suspend-timeout-seconds"] = 0\ + \n }\ + \n})' > /etc/wireplumber/main.lua.d/50-low-latency.lua && \ + echo "default-fragments = 2\ + \ndefault-fragment-size-msec = 2" >> /etc/pulse/daemon.conf && \ + echo "load-module module-loopback latency_msec=1" >> /etc/pipewire/pipewire.conf.d/loopback.conf + + ### Artifacts and Verification ### COPY --from=nestri-server-cached-builder /artifacts/nestri-server /usr/bin/ COPY --from=gst-wayland-cached-builder /artifacts/lib/ /usr/lib/ diff --git a/packages/scripts/entrypoint.sh b/packages/scripts/entrypoint.sh index 0128acb9..0e9606c8 100644 --- a/packages/scripts/entrypoint.sh +++ b/packages/scripts/entrypoint.sh @@ -1,72 +1,176 @@ #!/bin/bash set -euo pipefail -# Wait for dbus socket to be ready -echo "Waiting for DBus system bus socket..." -DBUS_SOCKET="/run/dbus/system_bus_socket" -for _ in {1..10}; do # Wait up to 10 seconds - if [ -e "$DBUS_SOCKET" ]; then - echo "DBus system bus socket is ready." - break - fi - sleep 1 -done -if [ ! -e "$DBUS_SOCKET" ]; then - echo "Error: DBus system bus socket did not appear. Exiting." - exit 1 -fi +# Configuration +CACHE_DIR="/home/nestri/.cache/nvidia" +NVIDIA_INSTALLER_DIR="/tmp" +TIMEOUT_SECONDS=10 -# Wait for PipeWire to be ready -echo "Waiting for PipeWire socket..." -PIPEWIRE_SOCKET="/run/user/${UID}/pipewire-0" -for _ in {1..10}; do # Wait up to 10 seconds - if [ -e "$PIPEWIRE_SOCKET" ]; then - echo "PipeWire socket is ready." - break - fi - sleep 1 -done -if [ ! -e "$PIPEWIRE_SOCKET" ]; then - echo "Error: PipeWire socket did not appear. Exiting." - exit 1 -fi +log() { + echo "[$(date +'%Y-%m-%d %H:%M:%S')] $1" +} -echo "Detecting GPU vendor..." -source /etc/nestri/gpu_helpers.sh +# Waits for a given socket to be ready +wait_for_socket() { + local socket_path="$1" + local name="$2" + log "Waiting for $name socket at $socket_path..." + for ((i=1; i<=TIMEOUT_SECONDS; i++)); do + if [[ -e "$socket_path" ]]; then + log "$name socket is ready." + return 0 + fi + sleep 1 + done + log "Error: $name socket did not appear after ${TIMEOUT_SECONDS}s." + return 1 +} -get_gpu_info +# Ensures cache directory exists +setup_cache() { + log "Setting up NVIDIA driver cache directory at $CACHE_DIR..." + mkdir -p "$CACHE_DIR" || { + log "Warning: Failed to create cache directory, continuing without cache." + return 1 + } + chown nestri:nestri "$CACHE_DIR" 2>/dev/null || { + log "Warning: Failed to set cache directory ownership, continuing..." + } +} -# Check for NVIDIA so we can apply a workaround -if [[ -n "${vendor_devices[nvidia]:-}" ]]; then - echo "NVIDIA GPU detected, applying driver fix..." - # Determine NVIDIA driver version from host - if [ -f "/proc/driver/nvidia/version" ]; then - NVIDIA_DRIVER_VERSION=$(head -n1 /proc/driver/nvidia/version | awk '{for(i=1;i<=NF;i++) if ($i ~ /^[0-9]+\.[0-9\.]+/) {print $i; exit}}') - elif command -v nvidia-smi &> /dev/null; then - NVIDIA_DRIVER_VERSION=$(nvidia-smi --version | grep -i 'driver version' | cut -d: -f2 | tr -d ' ') - else - echo "Failed to determine NVIDIA driver version. Exiting." - exit 1 +# Grabs NVIDIA driver installer +get_nvidia_installer() { + local driver_version="$1" + local arch="$2" + local filename="NVIDIA-Linux-${arch}-${driver_version}.run" + local cached_file="${CACHE_DIR}/${filename}" + local tmp_file="${NVIDIA_INSTALLER_DIR}/${filename}" + + # Check cache + if [[ -f "$cached_file" ]]; then + log "Found cached NVIDIA installer at $cached_file." + cp "$cached_file" "$tmp_file" || { + log "Warning: Failed to copy cached installer, proceeding with download." + rm -f "$cached_file" 2>/dev/null + } fi - NVIDIA_DRIVER_ARCH=$(uname -m) - filename="NVIDIA-Linux-${NVIDIA_DRIVER_ARCH}-${NVIDIA_DRIVER_VERSION}.run" - - cd /tmp/ - if [ ! -f "${filename}" ]; then - # Attempt multiple download sources - if ! wget "https://international.download.nvidia.com/XFree86/Linux-${NVIDIA_DRIVER_ARCH}/${NVIDIA_DRIVER_VERSION}/${filename}"; then - if ! wget "https://international.download.nvidia.com/tesla/${NVIDIA_DRIVER_VERSION}/${filename}"; then - echo "Failed to download NVIDIA driver from both XFree86 and Tesla repositories" - exit 1 + # Download if not in tmp + if [[ ! -f "$tmp_file" ]]; then + log "Downloading NVIDIA driver installer ($filename)..." + local urls=( + "https://international.download.nvidia.com/XFree86/Linux-${arch}/${driver_version}/${filename}" + "https://international.download.nvidia.com/tesla/${driver_version}/${filename}" + ) + local success=0 + for url in "${urls[@]}"; do + if wget -q --show-progress "$url" -O "$tmp_file"; then + success=1 + break fi + log "Failed to download from $url, trying next source..." + done + + if [[ "$success" -eq 0 ]]; then + log "Error: Failed to download NVIDIA driver from all sources." + return 1 fi - chmod +x "${filename}" - # Install driver components without kernel modules - sudo ./"${filename}" --silent --no-kernel-module --install-compat32-libs --no-nouveau-check --no-nvidia-modprobe --no-systemd --no-rpms --no-backup --no-check-for-alternate-installs + # Cache the downloaded file + cp "$tmp_file" "$cached_file" 2>/dev/null && \ + chown nestri:nestri "$cached_file" 2>/dev/null || \ + log "Warning: Failed to cache NVIDIA driver, continuing..." fi -fi -echo "Switching to nestri user for application startup..." -exec sudo -E -u nestri /etc/nestri/entrypoint_nestri.sh + chmod +x "$tmp_file" || { + log "Error: Failed to make NVIDIA installer executable." + return 1 + } + return 0 +} + +# Installs the NVIDIA driver +install_nvidia_driver() { + local filename="$1" + log "Installing NVIDIA driver components from $filename..." + sudo ./"$filename" \ + --silent \ + --no-kernel-module \ + --install-compat32-libs \ + --no-nouveau-check \ + --no-nvidia-modprobe \ + --no-systemd \ + --no-rpms \ + --no-backup \ + --no-check-for-alternate-installs || { + log "Error: NVIDIA driver installation failed." + return 1 + } + log "NVIDIA driver installation completed." + return 0 +} + +main() { + # Wait for required sockets + wait_for_socket "/run/dbus/system_bus_socket" "DBus" || exit 1 + wait_for_socket "/run/user/${UID}/pipewire-0" "PipeWire" || exit 1 + + # Load GPU helpers and detect GPU + log "Detecting GPU vendor..." + if [[ ! -f /etc/nestri/gpu_helpers.sh ]]; then + log "Error: GPU helpers script not found at /etc/nestri/gpu_helpers.sh." + exit 1 + fi + source /etc/nestri/gpu_helpers.sh + get_gpu_info || { + log "Error: Failed to detect GPU information." + exit 1 + } + + # Handle NVIDIA GPU + if [[ -n "${vendor_devices[nvidia]:-}" ]]; then + log "NVIDIA GPU detected, applying driver fix..." + + # Determine NVIDIA driver version + local nvidia_driver_version="" + if [[ -f "/proc/driver/nvidia/version" ]]; then + nvidia_driver_version=$(awk '/NVIDIA/ {for(i=1;i<=NF;i++) if ($i ~ /^[0-9]+\.[0-9\.]+/) {print $i; exit}}' /proc/driver/nvidia/version | head -n1) + elif command -v nvidia-smi >/dev/null 2>&1; then + nvidia_driver_version=$(nvidia-smi --version | grep -i 'driver version' | cut -d: -f2 | tr -d ' ') + fi + + if [[ -z "$nvidia_driver_version" ]]; then + log "Error: Failed to determine NVIDIA driver version." + exit 1 + fi + log "Detected NVIDIA driver version: $nvidia_driver_version" + + # Set up cache and get installer + setup_cache + local arch=$(uname -m) + local filename="NVIDIA-Linux-${arch}-${nvidia_driver_version}.run" + cd "$NVIDIA_INSTALLER_DIR" || { + log "Error: Failed to change to $NVIDIA_INSTALLER_DIR." + exit 1 + } + get_nvidia_installer "$nvidia_driver_version" "$arch" || exit 1 + + # Install driver + install_nvidia_driver "$filename" || exit 1 + else + log "No NVIDIA GPU detected, skipping driver fix." + fi + + # Switch to nestri user + log "Switching to nestri user for application startup..." + if [[ ! -x /etc/nestri/entrypoint_nestri.sh ]]; then + log "Error: Entry point script /etc/nestri/entrypoint_nestri.sh not found or not executable." + exit 1 + fi + exec sudo -E -u nestri /etc/nestri/entrypoint_nestri.sh +} + +# Trap signals for clean exit +trap 'log "Received termination signal, exiting..."; exit 1' SIGINT SIGTERM + +main \ No newline at end of file diff --git a/packages/scripts/entrypoint_nestri.sh b/packages/scripts/entrypoint_nestri.sh index 08f848ee..4d3aa516 100644 --- a/packages/scripts/entrypoint_nestri.sh +++ b/packages/scripts/entrypoint_nestri.sh @@ -1,222 +1,233 @@ #!/bin/bash set -euo pipefail -# Make user directory owned by the default user -chown -f "$(id -nu):$(id -ng)" ~ || \ - sudo chown -f "$(id -nu):$(id -ng)" ~ || \ - chown -R -f -h --no-preserve-root "$(id -nu):$(id -ng)" ~ || \ - sudo chown -R -f -h --no-preserve-root "$(id -nu):$(id -ng)" ~ || \ - echo 'Failed to change user directory permissions, there may be permission issues' +log() { + echo "[$(date +'%Y-%m-%d %H:%M:%S')] $1" +} -# Source environment variables from envs.sh -if [ -f /etc/nestri/envs.sh ]; then - echo "Sourcing environment variables from envs.sh..." - source /etc/nestri/envs.sh -else - echo "envs.sh not found! Ensure it exists at /etc/nestri/envs.sh." - exit 1 -fi +# Ensures user directory ownership +chown_user_directory() { + local user_group="$(id -nu):$(id -ng)" + chown -f "$user_group" ~ 2>/dev/null || + sudo chown -f "$user_group" ~ 2>/dev/null || + chown -R -f -h --no-preserve-root "$user_group" ~ 2>/dev/null || + sudo chown -R -f -h --no-preserve-root "$user_group" ~ 2>/dev/null || + log "Warning: Failed to change user directory permissions, there may be permission issues, continuing..." +} + +# Parses resolution string +parse_resolution() { + local resolution="$1" + if [[ -z "$resolution" ]]; then + log "Error: No resolution provided" + return 1 + fi + + IFS='x' read -r width height <<< "$resolution" + if ! [[ "$width" =~ ^[0-9]+$ ]] || ! [[ "$height" =~ ^[0-9]+$ ]]; then + log "Error: Invalid resolution format. Expected: WIDTHxHEIGHT (e.g., 1920x1080), got: $resolution" + return 1 + fi + + export WIDTH="$width" + export HEIGHT="$height" + return 0 +} + +# Loads environment variables +load_envs() { + if [[ -f /etc/nestri/envs.sh ]]; then + log "Sourcing environment variables from envs.sh..." + source /etc/nestri/envs.sh + else + log "Error: envs.sh not found at /etc/nestri/envs.sh" + exit 1 + fi +} # Configuration MAX_RETRIES=3 +RETRY_COUNT=0 -# Helper function to restart the chain -restart_chain() { - echo "Restarting nestri-server, compositor..." - - # Start nestri-server - start_nestri_server - RETRY_COUNT=0 +# Kills process if running +kill_if_running() { + local pid="$1" + local name="$2" + if [[ -n "$pid" ]] && kill -0 "$pid" 2>/dev/null; then + log "Killing existing $name process (PID: $pid)..." + kill "$pid" + wait "$pid" 2>/dev/null || true + fi } -# Function to start nestri-server +# Starts nestri-server start_nestri_server() { - if [[ -n "${NESTRI_PID:-}" ]] && kill -0 "${NESTRI_PID}" 2 >/dev/null; then - echo "Killing existing nestri-server process..." - kill "${NESTRI_PID}" - fi + kill_if_running "${NESTRI_PID:-}" "nestri-server" - echo "Starting nestri-server..." - nestri-server $(echo $NESTRI_PARAMS) & + log "Starting nestri-server..." + nestri-server $NESTRI_PARAMS & NESTRI_PID=$! - # Wait for Wayland display (wayland-1) to be ready - echo "Waiting for Wayland display 'wayland-1' to be ready..." + log "Waiting for Wayland display 'wayland-1'..." WAYLAND_SOCKET="${XDG_RUNTIME_DIR}/wayland-1" - for _ in {1..15}; do # Wait up to 15 seconds - if [ -e "$WAYLAND_SOCKET" ]; then - echo "Wayland display 'wayland-1' is ready." - sleep 5 # necessary sleep - reduces chance that non-ready socket is used + for ((i=1; i<=15; i++)); do + if [[ -e "$WAYLAND_SOCKET" ]]; then + log "Wayland display 'wayland-1' ready." + sleep 3 start_compositor return fi sleep 1 done - echo "Error: Wayland display 'wayland-1' did not appear. Incrementing retry count..." - ((RETRY_COUNT++)) - if [ "$RETRY_COUNT" -ge "$MAX_RETRIES" ]; then - echo "Max retries reached for nestri-server. Exiting." - exit 1 - fi + log "Error: Wayland display 'wayland-1' not available." + increment_retry "nestri-server" restart_chain } -# Function to start compositor (labwc) +# Starts compositor (labwc) start_compositor() { - if [[ -n "${COMPOSITOR_PID:-}" ]] && kill -0 "${COMPOSITOR_PID}" 2 >/dev/null; then - echo "Killing existing compositor process..." - kill "${COMPOSITOR_PID}" - fi + kill_if_running "${COMPOSITOR_PID:-}" "compositor" - echo "Pre-configuring compositor..." + log "Pre-configuring compositor..." mkdir -p "${HOME}/.config/labwc/" - echo '' > ~/.config/labwc/rc.xml + cat > ~/.config/labwc/rc.xml << 'EOF' + + + + + + + + + + + +EOF echo '' > ~/.config/labwc/menu.xml - echo "Starting compositor..." + log "Starting compositor..." rm -rf /tmp/.X11-unix && mkdir -p /tmp/.X11-unix && chown nestri:nestri /tmp/.X11-unix WAYLAND_DISPLAY=wayland-1 WLR_BACKENDS=wayland labwc & COMPOSITOR_PID=$! - # Wait for compositor to initialize - echo "Waiting for compositor to initialize..." + log "Waiting for compositor to initialize..." COMPOSITOR_SOCKET="${XDG_RUNTIME_DIR}/wayland-0" - for _ in {1..15}; do - if [ -e "$COMPOSITOR_SOCKET" ]; then - echo "compositor is initialized, wayland-0 output ready." - sleep 3 # necessary sleep - reduces chance that non-ready socket is used + for ((i=1; i<=15; i++)); do + if [[ -e "$COMPOSITOR_SOCKET" ]]; then + log "Compositor initialized, wayland-0 ready." + sleep 2 start_wlr_randr return fi sleep 1 done - echo "Error: compositor did not initialize correctly. Incrementing retry count..." - ((RETRY_COUNT++)) - if [ "$RETRY_COUNT" -ge "$MAX_RETRIES" ]; then - echo "Max retries reached for compositor. Exiting." - exit 1 - fi + log "Error: Compositor did not initialize." + increment_retry "compositor" start_compositor } -# Function to run wlr-randr +# Configures resolution with wlr-randr start_wlr_randr() { - echo "Configuring resolution with wlr-randr..." + log "Configuring resolution with wlr-randr..." OUTPUT_NAME=$(WAYLAND_DISPLAY=wayland-0 wlr-randr --json | jq -r '.[] | select(.enabled == true) | .name' | head -n 1) - if [ -z "$OUTPUT_NAME" ]; then - echo "Error: No enabled outputs detected, exiting." + if [[ -z "$OUTPUT_NAME" ]]; then + log "Error: No enabled outputs detected." exit 1 fi - # Retry logic for wlr-randr local WLR_RETRIES=0 while ! WAYLAND_DISPLAY=wayland-0 wlr-randr --output "$OUTPUT_NAME" --custom-mode "$RESOLUTION"; do - echo "Error: Failed to configure wlr-randr. Retrying..." + log "Error: Failed to configure wlr-randr. Retrying..." ((WLR_RETRIES++)) - if [ "$WLR_RETRIES" -ge "$MAX_RETRIES" ]; then - echo "Max retries reached for wlr-randr, exiting." + if [[ "$WLR_RETRIES" -ge "$MAX_RETRIES" ]]; then + log "Error: Max retries reached for wlr-randr." exit 1 fi sleep 2 done - echo "wlr-randr configuration successful." - sleep 2 # necessary sleep - makes sure resolution is changed before next step(s) + log "wlr-randr configuration successful." + sleep 2 } -# Function to start Steam +# Starts Steam start_steam() { - if [[ -n "${STEAM_PID:-}" ]] && kill -0 "${STEAM_PID}" 2 >/dev/null; then - echo "Killing existing Steam process..." - kill "${STEAM_PID}" - fi + kill_if_running "${STEAM_PID:-}" "Steam" - echo "Starting Steam with -tenfoot..." - WAYLAND_DISPLAY=wayland-0 steam-native -tenfoot & + log "Starting Steam with -tenfoot..." + steam-native -tenfoot & STEAM_PID=$! - # Verify Steam started successfully sleep 2 if ! kill -0 "$STEAM_PID" 2>/dev/null; then - echo "Error: Steam failed to start." + log "Error: Steam failed to start." return 1 fi - echo "Steam started successfully." + log "Steam started successfully." return 0 } -# Main loop to monitor processes +# Increments retry counter +increment_retry() { + local component="$1" + ((RETRY_COUNT++)) + if [[ "$RETRY_COUNT" -ge "$MAX_RETRIES" ]]; then + log "Error: Max retries reached for $component." + exit 1 + fi +} + +# Restarts the chain +restart_chain() { + log "Restarting nestri-server and compositor..." + RETRY_COUNT=0 + start_nestri_server +} + +# Cleans up processes +cleanup() { + log "Terminating processes..." + kill_if_running "${NESTRI_PID:-}" "nestri-server" + kill_if_running "${COMPOSITOR_PID:-}" "compositor" + kill_if_running "${STEAM_PID:-}" "Steam" + exit 0 +} + +# Monitor processes for unexpected exits main_loop() { - trap 'echo "Terminating..."; -if [[ -n "${NESTRI_PID:-}" ]] && kill -0 "${NESTRI_PID}" 2>/dev/null; then -kill "${NESTRI_PID}" -fi -if [[ -n "${COMPOSITOR_PID:-}" ]] && kill -0 "${COMPOSITOR_PID}" 2>/dev/null; then -kill "${COMPOSITOR_PID}" -fi -if [[ -n "${STEAM_PID:-}" ]] && kill -0 "${STEAM_PID}" 2>/dev/null; then -kill "${STEAM_PID}" -fi - exit 0' SIGINT SIGTERM + trap cleanup SIGINT SIGTERM while true; do - # Wait for any child process to exit - wait -n - - # Check which process exited - if ! kill -0 ${NESTRI_PID:-} 2 >/dev/null; then - echo "nestri-server crashed. Restarting chain..." - ((RETRY_COUNT++)) - if [ "$RETRY_COUNT" -ge "$MAX_RETRIES" ]; then - echo "Max retries reached for nestri-server. Exiting." - exit 1 - fi + sleep 1 + # Check nestri-server + if [[ -n "${NESTRI_PID:-}" ]] && ! kill -0 "${NESTRI_PID}" 2>/dev/null; then + log "nestri-server died." + increment_retry "nestri-server" restart_chain - start_steam || { - echo "Failed to restart Steam after chain restart." - ((RETRY_COUNT++)) - if [ "$RETRY_COUNT" -ge "$MAX_RETRIES" ]; then - echo "Max retries reached. Exiting." - exit 1 - fi - } - elif ! kill -0 ${COMPOSITOR_PID:-} 2 >/dev/null; then - echo "compositor crashed. Restarting compositor..." - ((RETRY_COUNT++)) - if [ "$RETRY_COUNT" -ge "$MAX_RETRIES" ]; then - echo "Max retries reached for compositor. Exiting." - exit 1 - fi + start_steam || increment_retry "Steam" + # Check compositor + elif [[ -n "${COMPOSITOR_PID:-}" ]] && ! kill -0 "${COMPOSITOR_PID}" 2>/dev/null; then + log "compositor died." + increment_retry "compositor" start_compositor - start_steam || { - echo "Failed to restart Steam after compositor restart." - ((RETRY_COUNT++)) - if [ "$RETRY_COUNT" -ge "$MAX_RETRIES" ]; then - echo "Max retries reached. Exiting." - exit 1 - fi - } - elif ! kill -0 ${STEAM_PID:-} 2 >/dev/null; then - echo "Steam crashed. Restarting Steam..." - ((RETRY_COUNT++)) - if [ "$RETRY_COUNT" -ge "$MAX_RETRIES" ]; then - echo "Max retries reached for Steam. Exiting." - exit 1 - fi - start_steam + start_steam || increment_retry "Steam" + # Check Steam + elif [[ -n "${STEAM_PID:-}" ]] && ! kill -0 "${STEAM_PID}" 2>/dev/null; then + log "Steam died." + increment_retry "Steam" + start_steam || increment_retry "Steam" fi done } -# Initialize retry counter -RETRY_COUNT=0 +main() { + chown_user_directory + load_envs + #parse_resolution "${RESOLUTION:-1920x1080}" || exit 1 # Not used currently + restart_chain + start_steam || increment_retry "Steam" + main_loop +} -# Start the initial chain -restart_chain - -# Start Steam after initial setup -start_steam - -# Enter monitoring loop -main_loop +main \ No newline at end of file diff --git a/packages/scripts/envs.sh b/packages/scripts/envs.sh index a177c83f..b6f7b1a4 100644 --- a/packages/scripts/envs.sh +++ b/packages/scripts/envs.sh @@ -7,5 +7,8 @@ export XDG_SESSION_TYPE=wayland export DISPLAY=:0 export $(dbus-launch) +# Causes some setups to break +export PROTON_NO_FSYNC=1 + # Our preferred prefix export WINEPREFIX=/home/${USER}/.nestripfx/ diff --git a/packages/scripts/supervisord.conf b/packages/scripts/supervisord.conf index 35dcd6da..ea1604a3 100644 --- a/packages/scripts/supervisord.conf +++ b/packages/scripts/supervisord.conf @@ -27,6 +27,7 @@ autorestart=true autostart=true startretries=3 priority=3 +nice=-10 [program:pipewire-pulse] user=nestri @@ -35,6 +36,7 @@ autorestart=true autostart=true startretries=3 priority=4 +nice=-10 [program:wireplumber] user=nestri @@ -43,6 +45,7 @@ autorestart=true autostart=true startretries=3 priority=5 +nice=-10 [program:entrypoint] user=root diff --git a/packages/server/Cargo.lock b/packages/server/Cargo.lock index 579948cc..5d4f8b54 100644 --- a/packages/server/Cargo.lock +++ b/packages/server/Cargo.lock @@ -128,9 +128,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.96" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b964d184e89d9b6b67dd2715bc8e74cf3107fb2b529990c90cf517326150bf4" +checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" [[package]] name = "arc-swap" @@ -190,9 +190,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.86" +version = "0.1.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "644dd749086bf3771a2fbc5f256fdb982d53f011c7d5d560304eafeecebce79d" +checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" dependencies = [ "proc-macro2", "quote", @@ -238,27 +238,25 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "aws-lc-rs" -version = "1.12.4" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd755adf9707cf671e31d944a189be3deaaeee11c8bc1d669bb8022ac90fbd0" +checksum = "19b756939cb2f8dc900aa6dcd505e6e2428e9cae7ff7b028c49e3946efa70878" dependencies = [ "aws-lc-sys", - "paste", "zeroize", ] [[package]] name = "aws-lc-sys" -version = "0.26.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f9dd2e03ee80ca2822dd6ea431163d2ef259f2066a4d6ccaca6d9dcb386aa43" +checksum = "b9f7720b74ed28ca77f90769a71fd8c637a0137f6fae4ae947e1050229cff57f" dependencies = [ "bindgen", "cc", "cmake", "dunce", "fs_extra", - "paste", ] [[package]] @@ -296,9 +294,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" -version = "1.6.0" +version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +checksum = "89e25b6adfb930f02d1981565a6e5d9c547ac15a96606256d3b59040e5cd4ca3" [[package]] name = "bincode" @@ -315,7 +313,7 @@ version = "0.69.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "cexpr", "clang-sys", "itertools 0.12.1", @@ -340,9 +338,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" [[package]] name = "block-buffer" @@ -376,9 +374,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cbc" @@ -391,9 +389,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.15" +version = "1.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c736e259eea577f443d5c86c304f9f4ae0295c43f3ba05c21f1d66b5f06001af" +checksum = "525046617d8376e3db1deffb079e91cef90a89fc3ca5c185bbf8c9ecdd15cd5c" dependencies = [ "jobserver", "libc", @@ -445,16 +443,16 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chrono" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" +checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "wasm-bindgen", - "windows-targets 0.52.6", + "windows-link", ] [[package]] @@ -480,9 +478,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.30" +version = "4.5.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92b7b18d71fad5313a1e320fa9897994228ce274b60faa4d694fe0ea89cd9e6d" +checksum = "d8aa86934b44c19c50f87cc2790e19f54f7a67aedb64101c2e1a2e5ecfb73944" dependencies = [ "clap_builder", "clap_derive", @@ -490,9 +488,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.30" +version = "4.5.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35db2071778a7344791a4fb4f95308b5673d219dee3ae348b86642574ecc90c" +checksum = "2414dbb2dd0695280da6ea9261e327479e9d37b0630f6b53ba2a11c60c679fd9" dependencies = [ "anstream", "anstyle", @@ -502,9 +500,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.28" +version = "4.5.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed" +checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7" dependencies = [ "heck", "proc-macro2", @@ -613,9 +611,9 @@ dependencies = [ [[package]] name = "ctrlc" -version = "3.4.5" +version = "3.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90eeab0aa92f3f9b4e87f258c72b139c207d251f9cbc1080a0086b86a8870dd3" +checksum = "697b5419f348fd5ae2478e8018cb016c00a5881c7f46c717de98ffd135a5651c" dependencies = [ "nix 0.29.0", "windows-sys 0.59.0", @@ -680,9 +678,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.11" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" dependencies = [ "powerfmt", ] @@ -732,9 +730,9 @@ dependencies = [ [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "elliptic-curve" @@ -774,9 +772,9 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" dependencies = [ "libc", "windows-sys 0.59.0", @@ -790,9 +788,9 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "ff" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" dependencies = [ "rand_core 0.6.4", "subtle", @@ -953,14 +951,14 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" dependencies = [ "cfg-if", "libc", - "wasi 0.13.3+wasi-0.2.2", - "windows-targets 0.52.6", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", ] [[package]] @@ -982,7 +980,7 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "gio" version = "0.21.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#c87867050de49f540b08bd26ae559983fc701a5b" +source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#2af41a12deb9a8ad532bc4f3b5e3d0499463dce4" dependencies = [ "futures-channel", "futures-core", @@ -998,7 +996,7 @@ dependencies = [ [[package]] name = "gio-sys" version = "0.21.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#c87867050de49f540b08bd26ae559983fc701a5b" +source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#2af41a12deb9a8ad532bc4f3b5e3d0499463dce4" dependencies = [ "glib-sys", "gobject-sys", @@ -1010,9 +1008,9 @@ dependencies = [ [[package]] name = "glib" version = "0.21.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#c87867050de49f540b08bd26ae559983fc701a5b" +source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#2af41a12deb9a8ad532bc4f3b5e3d0499463dce4" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "futures-channel", "futures-core", "futures-executor", @@ -1030,7 +1028,7 @@ dependencies = [ [[package]] name = "glib-macros" version = "0.21.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#c87867050de49f540b08bd26ae559983fc701a5b" +source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#2af41a12deb9a8ad532bc4f3b5e3d0499463dce4" dependencies = [ "heck", "proc-macro-crate", @@ -1042,7 +1040,7 @@ dependencies = [ [[package]] name = "glib-sys" version = "0.21.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#c87867050de49f540b08bd26ae559983fc701a5b" +source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#2af41a12deb9a8ad532bc4f3b5e3d0499463dce4" dependencies = [ "libc", "system-deps", @@ -1057,7 +1055,7 @@ checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "gobject-sys" version = "0.21.0" -source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#c87867050de49f540b08bd26ae559983fc701a5b" +source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#2af41a12deb9a8ad532bc4f3b5e3d0499463dce4" dependencies = [ "glib-sys", "libc", @@ -1078,7 +1076,7 @@ dependencies = [ [[package]] name = "gst-plugin-version-helper" version = "0.8.1" -source = "git+https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs?branch=main#3d384bff62ab22f71272b8ae7cea565b160e443c" +source = "git+https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs?branch=main#916e946bf1446316c4aa7d29c35fc7f732f1f1b5" dependencies = [ "chrono", "toml_edit", @@ -1087,7 +1085,7 @@ dependencies = [ [[package]] name = "gst-plugin-webrtc" version = "0.14.0-alpha.1" -source = "git+https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs?branch=main#3d384bff62ab22f71272b8ae7cea565b160e443c" +source = "git+https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs?branch=main#916e946bf1446316c4aa7d29c35fc7f732f1f1b5" dependencies = [ "anyhow", "async-recursion", @@ -1109,7 +1107,7 @@ dependencies = [ "gstreamer-utils", "gstreamer-video", "gstreamer-webrtc", - "http 1.2.0", + "http 1.3.1", "human_bytes", "itertools 0.14.0", "parse_link_header", @@ -1117,7 +1115,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tokio-native-tls", "tokio-stream", @@ -1132,7 +1130,7 @@ dependencies = [ [[package]] name = "gst-plugin-webrtc-signalling" version = "0.14.0-alpha.1" -source = "git+https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs?branch=main#3d384bff62ab22f71272b8ae7cea565b160e443c" +source = "git+https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs?branch=main#916e946bf1446316c4aa7d29c35fc7f732f1f1b5" dependencies = [ "anyhow", "async-tungstenite", @@ -1143,7 +1141,7 @@ dependencies = [ "serde", "serde_json", "test-log", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tokio-native-tls", "tracing", @@ -1155,7 +1153,7 @@ dependencies = [ [[package]] name = "gst-plugin-webrtc-signalling-protocol" version = "0.14.0-alpha.1" -source = "git+https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs?branch=main#3d384bff62ab22f71272b8ae7cea565b160e443c" +source = "git+https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs?branch=main#916e946bf1446316c4aa7d29c35fc7f732f1f1b5" dependencies = [ "serde", "serde_json", @@ -1164,7 +1162,7 @@ dependencies = [ [[package]] name = "gstreamer" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#b6e4e615d22f2a0a81130d69535baa0d2faf440a" dependencies = [ "cfg-if", "futures-channel", @@ -1184,13 +1182,13 @@ dependencies = [ "serde", "serde_bytes", "smallvec", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] name = "gstreamer-app" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#b6e4e615d22f2a0a81130d69535baa0d2faf440a" dependencies = [ "futures-core", "futures-sink", @@ -1204,7 +1202,7 @@ dependencies = [ [[package]] name = "gstreamer-app-sys" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#b6e4e615d22f2a0a81130d69535baa0d2faf440a" dependencies = [ "glib-sys", "gstreamer-base-sys", @@ -1216,7 +1214,7 @@ dependencies = [ [[package]] name = "gstreamer-audio" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#b6e4e615d22f2a0a81130d69535baa0d2faf440a" dependencies = [ "cfg-if", "glib", @@ -1231,7 +1229,7 @@ dependencies = [ [[package]] name = "gstreamer-audio-sys" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#b6e4e615d22f2a0a81130d69535baa0d2faf440a" dependencies = [ "glib-sys", "gobject-sys", @@ -1244,7 +1242,7 @@ dependencies = [ [[package]] name = "gstreamer-base" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#b6e4e615d22f2a0a81130d69535baa0d2faf440a" dependencies = [ "atomic_refcell", "cfg-if", @@ -1257,7 +1255,7 @@ dependencies = [ [[package]] name = "gstreamer-base-sys" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#b6e4e615d22f2a0a81130d69535baa0d2faf440a" dependencies = [ "glib-sys", "gobject-sys", @@ -1269,7 +1267,7 @@ dependencies = [ [[package]] name = "gstreamer-net" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#b6e4e615d22f2a0a81130d69535baa0d2faf440a" dependencies = [ "gio", "glib", @@ -1280,7 +1278,7 @@ dependencies = [ [[package]] name = "gstreamer-net-sys" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#b6e4e615d22f2a0a81130d69535baa0d2faf440a" dependencies = [ "gio-sys", "glib-sys", @@ -1292,7 +1290,7 @@ dependencies = [ [[package]] name = "gstreamer-rtp" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#b6e4e615d22f2a0a81130d69535baa0d2faf440a" dependencies = [ "glib", "gstreamer", @@ -1303,7 +1301,7 @@ dependencies = [ [[package]] name = "gstreamer-rtp-sys" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#b6e4e615d22f2a0a81130d69535baa0d2faf440a" dependencies = [ "glib-sys", "gstreamer-base-sys", @@ -1315,7 +1313,7 @@ dependencies = [ [[package]] name = "gstreamer-sdp" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#b6e4e615d22f2a0a81130d69535baa0d2faf440a" dependencies = [ "glib", "gstreamer", @@ -1325,7 +1323,7 @@ dependencies = [ [[package]] name = "gstreamer-sdp-sys" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#b6e4e615d22f2a0a81130d69535baa0d2faf440a" dependencies = [ "glib-sys", "gstreamer-sys", @@ -1336,7 +1334,7 @@ dependencies = [ [[package]] name = "gstreamer-sys" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#b6e4e615d22f2a0a81130d69535baa0d2faf440a" dependencies = [ "cfg-if", "glib-sys", @@ -1348,18 +1346,18 @@ dependencies = [ [[package]] name = "gstreamer-utils" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#b6e4e615d22f2a0a81130d69535baa0d2faf440a" dependencies = [ "gstreamer", "gstreamer-app", "gstreamer-video", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] name = "gstreamer-video" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#b6e4e615d22f2a0a81130d69535baa0d2faf440a" dependencies = [ "cfg-if", "futures-channel", @@ -1369,13 +1367,13 @@ dependencies = [ "gstreamer-video-sys", "libc", "serde", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] name = "gstreamer-video-sys" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#b6e4e615d22f2a0a81130d69535baa0d2faf440a" dependencies = [ "glib-sys", "gobject-sys", @@ -1388,7 +1386,7 @@ dependencies = [ [[package]] name = "gstreamer-webrtc" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#b6e4e615d22f2a0a81130d69535baa0d2faf440a" dependencies = [ "glib", "gstreamer", @@ -1400,7 +1398,7 @@ dependencies = [ [[package]] name = "gstreamer-webrtc-sys" version = "0.24.0" -source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#7851b9ced9542506968d62b33a54b027cf93ce8b" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs?branch=main#b6e4e615d22f2a0a81130d69535baa0d2faf440a" dependencies = [ "glib-sys", "gstreamer-sdp-sys", @@ -1428,6 +1426,25 @@ dependencies = [ "tracing", ] +[[package]] +name = "h2" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5017294ff4bb30944501348f6f8e42e6ad28f42c8bbef7a74029aff064a4e3c2" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.3.1", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "hashbrown" version = "0.15.2" @@ -1510,9 +1527,9 @@ dependencies = [ [[package]] name = "http" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" dependencies = [ "bytes", "fnv", @@ -1531,10 +1548,33 @@ dependencies = [ ] [[package]] -name = "httparse" -version = "1.10.0" +name = "http-body" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http 1.3.1", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http 1.3.1", + "http-body 1.0.1", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "httpdate" @@ -1558,9 +1598,9 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2", + "h2 0.3.26", "http 0.2.12", - "http-body", + "http-body 0.4.6", "httparse", "httpdate", "itoa", @@ -1573,28 +1613,89 @@ dependencies = [ ] [[package]] -name = "hyper-tls" -version = "0.5.0" +name = "hyper" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" dependencies = [ "bytes", - "hyper", + "futures-channel", + "futures-util", + "h2 0.4.8", + "http 1.3.1", + "http-body 1.0.1", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" +dependencies = [ + "futures-util", + "http 1.3.1", + "hyper 1.6.0", + "hyper-util", + "rustls 0.23.25", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.26.2", + "tower-service", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper 1.6.0", + "hyper-util", "native-tls", "tokio", "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497bbc33a26fdd4af9ed9c70d63f61cf56a938375fbb32df34db9b1cd6d643f2" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.3.1", + "http-body 1.0.1", + "hyper 1.6.0", + "libc", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", ] [[package]] name = "iana-time-zone" -version = "0.1.61" +version = "0.1.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", + "log", "wasm-bindgen", "windows-core", ] @@ -1649,9 +1750,9 @@ dependencies = [ [[package]] name = "icu_locid_transform_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" +checksum = "7515e6d781098bf9f7205ab3fc7e9709d34554ae0b21ddbcb5febfa4bc7df11d" [[package]] name = "icu_normalizer" @@ -1673,9 +1774,9 @@ dependencies = [ [[package]] name = "icu_normalizer_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" +checksum = "c5e8338228bdc8ab83303f16b797e177953730f601a96c25d10cb3ab0daa0cb7" [[package]] name = "icu_properties" @@ -1694,9 +1795,9 @@ dependencies = [ [[package]] name = "icu_properties_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" +checksum = "85fb8799753b75aee8d2a21d7c14d9f38921b54b3dbda10f5a3c7a7b82dba5e2" [[package]] name = "icu_provider" @@ -1749,9 +1850,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.7.1" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", "hashbrown", @@ -1819,16 +1920,17 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jobserver" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a" dependencies = [ + "getrandom 0.3.2", "libc", ] @@ -1865,9 +1967,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.169" +version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" [[package]] name = "libloading" @@ -1876,7 +1978,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -1886,10 +1988,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] -name = "litemap" -version = "0.7.4" +name = "linux-raw-sys" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" + +[[package]] +name = "litemap" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" [[package]] name = "lock_api" @@ -1903,9 +2011,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.26" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "matchers" @@ -1965,9 +2073,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.5" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" +checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" dependencies = [ "adler2", ] @@ -2028,6 +2136,7 @@ dependencies = [ name = "nestri-server" version = "0.1.0-alpha.2" dependencies = [ + "atomic_refcell", "chrono", "clap", "futures-util", @@ -2037,11 +2146,12 @@ dependencies = [ "log", "num-derive", "num-traits", + "parking_lot", "prost", "prost-types", "rand 0.9.0", "regex", - "rustls 0.23.23", + "rustls 0.23.25", "serde", "serde_json", "tokio", @@ -2068,7 +2178,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "cfg-if", "cfg_aliases", "libc", @@ -2170,9 +2280,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.3" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "opaque-debug" @@ -2182,11 +2292,11 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "openssl" -version = "0.10.71" +version = "0.10.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e14130c6a98cd258fdcb0fb6d744152343ff729cbfcb28c656a9d12b999fbcd" +checksum = "fedfea7d58a1f73118430a55da6a286e7b044961736ce96a16a17068ea25e5da" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "cfg-if", "foreign-types", "libc", @@ -2214,9 +2324,9 @@ checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-sys" -version = "0.9.106" +version = "0.9.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd" +checksum = "8288979acd84749c744a9014b4382d42b8f7b2592847b5afb2ed29e5d16ede07" dependencies = [ "cc", "libc", @@ -2288,11 +2398,11 @@ dependencies = [ [[package]] name = "parse_link_header" -version = "0.3.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3687fe9debbbf2a019f381a8bc6b42049b22647449b39af54b3013985c0cf6de" +checksum = "fbc23fdb8bbf668d582b0c17120bf6b7f91d85ccad3a5b39706f019a4efda005" dependencies = [ - "http 0.2.12", + "http 1.3.1", "lazy_static", "regex", "url", @@ -2331,18 +2441,18 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfe2e71e1471fe07709406bf725f710b02927c9c54b2b5b2ec0e8087d97c327d" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6e859e6e5bd50440ab63c47e3ebabc90f26251f7c73c3d3e837b74a1cc3fa67" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", @@ -2373,9 +2483,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "polyval" @@ -2391,9 +2501,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" [[package]] name = "powerfmt" @@ -2403,18 +2513,18 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.20" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ - "zerocopy 0.7.35", + "zerocopy", ] [[package]] name = "prettyplease" -version = "0.2.29" +version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac" +checksum = "664ec5419c51e34154eec046ebcba56312d5a2fc3b09a06da188e1ad21afadf6" dependencies = [ "proc-macro2", "syn", @@ -2431,18 +2541,18 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" dependencies = [ "toml_edit", ] [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" dependencies = [ "unicode-ident", ] @@ -2481,13 +2591,19 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + [[package]] name = "rand" version = "0.8.5" @@ -2506,8 +2622,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" dependencies = [ "rand_chacha 0.9.0", - "rand_core 0.9.2", - "zerocopy 0.8.20", + "rand_core 0.9.3", + "zerocopy", ] [[package]] @@ -2527,7 +2643,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core 0.9.2", + "rand_core 0.9.3", ] [[package]] @@ -2541,12 +2657,11 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a509b1a2ffbe92afab0e55c8fd99dea1c280e8171bd2d88682bb20bc41cbc2c" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" dependencies = [ - "getrandom 0.3.1", - "zerocopy 0.8.20", + "getrandom 0.3.2", ] [[package]] @@ -2565,11 +2680,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.9" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82b568323e98e49e2a0899dcee453dd679fae22d69adf9b11dd508d1549b7e2f" +checksum = "d2f103c6d277498fbceb16e84d317e2a400f160f46904d5f5410848c829511a3" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", ] [[package]] @@ -2618,20 +2733,23 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.11.27" +version = "0.12.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +checksum = "d19c46a6fdd48bc4dab94b6103fccc55d34c67cc0ad04653aad4ea2a07cd7bbb" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "bytes", "encoding_rs", "futures-core", "futures-util", - "h2", - "http 0.2.12", - "http-body", - "hyper", + "h2 0.4.8", + "http 1.3.1", + "http-body 1.0.1", + "http-body-util", + "hyper 1.6.0", + "hyper-rustls", "hyper-tls", + "hyper-util", "ipnet", "js-sys", "log", @@ -2640,7 +2758,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls-pemfile 1.0.4", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", @@ -2648,12 +2766,13 @@ dependencies = [ "system-configuration", "tokio", "tokio-native-tls", + "tower", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "winreg", + "windows-registry", ] [[package]] @@ -2668,9 +2787,9 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.13" +version = "0.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ac5d832aa16abd7d1def883a8545280c20a60f523a370aa3a9617c2b8550ee" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", @@ -2742,10 +2861,23 @@ version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "errno", "libc", - "linux-raw-sys", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d97817398dd4bb2e6da002002db259209759911da105da92bec29ccb12cf58bf" +dependencies = [ + "bitflags 2.9.0", + "errno", + "libc", + "linux-raw-sys 0.9.3", "windows-sys 0.59.0", ] @@ -2758,36 +2890,27 @@ dependencies = [ "log", "ring", "rustls-pki-types", - "rustls-webpki", + "rustls-webpki 0.102.8", "subtle", "zeroize", ] [[package]] name = "rustls" -version = "0.23.23" +version = "0.23.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47796c98c480fce5406ef69d1c76378375492c3b0a0de587be0c1d9feb12f395" +checksum = "822ee9188ac4ec04a2f0531e55d035fb2de73f18b41a63c70c2712503b6fb13c" dependencies = [ "aws-lc-rs", "log", "once_cell", "ring", "rustls-pki-types", - "rustls-webpki", + "rustls-webpki 0.103.1", "subtle", "zeroize", ] -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64 0.21.7", -] - [[package]] name = "rustls-pemfile" version = "2.2.0" @@ -2808,6 +2931,17 @@ name = "rustls-webpki" version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fef8b8769aaccf73098557a87cd1816b4f9c7c16811c9c77142aa695c16f2c03" dependencies = [ "aws-lc-rs", "ring", @@ -2817,15 +2951,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" [[package]] name = "ryu" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "schannel" @@ -2880,7 +3014,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "core-foundation", "core-foundation-sys", "libc", @@ -2899,33 +3033,33 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" [[package]] name = "serde" -version = "1.0.218" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.15" +version = "0.11.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" +checksum = "8437fd221bde2d4ca316d61b90e337e9e702b3820b87d63caa9ba6c02bd06d96" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.218" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", @@ -2934,9 +3068,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.139" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44f86c3acccc9c65b153fe1b85a3be07fe5515274ec9f0653b4a0875731c72a6" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", "memchr", @@ -3032,9 +3166,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" +checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" [[package]] name = "smol_str" @@ -3047,9 +3181,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" +checksum = "4f5fd57c80058a56cf5c777ab8a126398ece8e442983605d280a44ce79d0edef" dependencies = [ "libc", "windows-sys 0.52.0", @@ -3125,9 +3259,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.98" +version = "2.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" dependencies = [ "proc-macro2", "quote", @@ -3136,9 +3270,12 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "0.1.2" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] [[package]] name = "synstructure" @@ -3153,20 +3290,20 @@ dependencies = [ [[package]] name = "system-configuration" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.9.0", "core-foundation", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" dependencies = [ "core-foundation-sys", "libc", @@ -3193,15 +3330,14 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.17.1" +version = "3.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e5a0acb1f3f55f65cc4a866c361b2fb2a0ff6366785ae6fbb5f85df07ba230" +checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf" dependencies = [ - "cfg-if", "fastrand", - "getrandom 0.3.1", + "getrandom 0.3.2", "once_cell", - "rustix", + "rustix 1.0.5", "windows-sys 0.59.0", ] @@ -3237,11 +3373,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.11" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" dependencies = [ - "thiserror-impl 2.0.11", + "thiserror-impl 2.0.12", ] [[package]] @@ -3257,9 +3393,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.11" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", @@ -3278,9 +3414,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.37" +version = "0.3.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" dependencies = [ "deranged", "itoa", @@ -3293,15 +3429,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" [[package]] name = "time-macros" -version = "0.2.19" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" dependencies = [ "num-conv", "time-core", @@ -3319,9 +3455,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.43.0" +version = "1.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" +checksum = "e6b88822cbe49de4185e3a4cbf8321dd487cf5fe0c5c65695fef6346371e9c48" dependencies = [ "backtrace", "bytes", @@ -3367,6 +3503,16 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" +dependencies = [ + "rustls 0.23.25", + "tokio", +] + [[package]] name = "tokio-stream" version = "0.1.17" @@ -3406,9 +3552,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.13" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" +checksum = "6b9590b93e6fcc1739458317cccd391ad3955e2bde8913edf6f95f9e65a8f034" dependencies = [ "bytes", "futures-core", @@ -3451,6 +3597,27 @@ dependencies = [ "winnow", ] +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + [[package]] name = "tower-service" version = "0.3.3" @@ -3534,7 +3701,7 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http 1.2.0", + "http 1.3.1", "httparse", "log", "rand 0.8.5", @@ -3552,13 +3719,13 @@ checksum = "4793cb5e56680ecbb1d843515b23b6de9a75eb04b66643e256a396d43be33c13" dependencies = [ "bytes", "data-encoding", - "http 1.2.0", + "http 1.3.1", "httparse", "log", "native-tls", "rand 0.9.0", "sha1", - "thiserror 2.0.11", + "thiserror 2.0.12", "url", "utf-8", ] @@ -3598,9 +3765,9 @@ checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" [[package]] name = "unicode-ident" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "universal-hash" @@ -3655,11 +3822,11 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.14.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d59ca99a559661b96bf898d8fce28ed87935fd2bea9f05983c1464dd6c71b1" +checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" dependencies = [ - "getrandom 0.3.1", + "getrandom 0.3.2", ] [[package]] @@ -3715,20 +3882,20 @@ dependencies = [ "futures-util", "headers", "http 0.2.12", - "hyper", + "hyper 0.14.32", "log", "mime", "mime_guess", "multer", "percent-encoding", "pin-project", - "rustls-pemfile 2.2.0", + "rustls-pemfile", "scoped-tls", "serde", "serde_json", "serde_urlencoded", "tokio", - "tokio-rustls", + "tokio-rustls 0.25.0", "tokio-tungstenite 0.21.0", "tokio-util", "tower-service", @@ -3743,9 +3910,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasi" -version = "0.13.3+wasi-0.2.2" +version = "0.14.2+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" dependencies = [ "wit-bindgen-rt", ] @@ -3852,7 +4019,7 @@ dependencies = [ "ring", "rtcp", "rtp", - "rustls 0.23.23", + "rustls 0.23.25", "sdp", "serde", "serde_json", @@ -3914,7 +4081,7 @@ dependencies = [ "rand_core 0.6.4", "rcgen", "ring", - "rustls 0.23.23", + "rustls 0.23.25", "sec1", "serde", "sha1", @@ -4049,7 +4216,7 @@ dependencies = [ "either", "home", "once_cell", - "rustix", + "rustix 0.38.44", ] [[package]] @@ -4076,20 +4243,81 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-core" -version = "0.52.0" +version = "0.61.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980" dependencies = [ - "windows-targets 0.52.6", + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings 0.4.0", ] [[package]] -name = "windows-sys" -version = "0.48.0" +name = "windows-implement" +version = "0.60.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" dependencies = [ - "windows-targets 0.48.5", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" + +[[package]] +name = "windows-registry" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3" +dependencies = [ + "windows-result", + "windows-strings 0.3.1", + "windows-targets 0.53.0", +] + +[[package]] +name = "windows-result" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97" +dependencies = [ + "windows-link", ] [[package]] @@ -4110,21 +4338,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - [[package]] name = "windows-targets" version = "0.52.6" @@ -4134,7 +4347,7 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", + "windows_i686_gnullvm 0.52.6", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", @@ -4142,10 +4355,20 @@ dependencies = [ ] [[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" +name = "windows-targets" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] [[package]] name = "windows_aarch64_gnullvm" @@ -4154,10 +4377,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" +name = "windows_aarch64_gnullvm" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" [[package]] name = "windows_aarch64_msvc" @@ -4166,10 +4389,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] -name = "windows_i686_gnu" -version = "0.48.5" +name = "windows_aarch64_msvc" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" [[package]] name = "windows_i686_gnu" @@ -4177,6 +4400,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" @@ -4184,10 +4413,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] -name = "windows_i686_msvc" -version = "0.48.5" +name = "windows_i686_gnullvm" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" [[package]] name = "windows_i686_msvc" @@ -4196,10 +4425,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" +name = "windows_i686_msvc" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" [[package]] name = "windows_x86_64_gnu" @@ -4208,10 +4437,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" +name = "windows_x86_64_gnu" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" [[package]] name = "windows_x86_64_gnullvm" @@ -4220,10 +4449,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" +name = "windows_x86_64_gnullvm" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" [[package]] name = "windows_x86_64_msvc" @@ -4232,31 +4461,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] -name = "winnow" -version = "0.7.3" +name = "windows_x86_64_msvc" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7f4ea97f6f78012141bcdb6a216b2609f0979ada50b20ca5b52dde2eac2bb1" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "winnow" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63d3fcd9bba44b03821e7d699eeee959f3126dcc4aa8e4ae18ec617c2a5cea10" dependencies = [ "memchr", ] -[[package]] -name = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - [[package]] name = "wit-bindgen-rt" -version = "0.33.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", ] [[package]] @@ -4336,39 +4561,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.35" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" dependencies = [ - "byteorder", - "zerocopy-derive 0.7.35", -] - -[[package]] -name = "zerocopy" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dde3bb8c68a8f3f1ed4ac9221aad6b10cece3e60a8e2ea54a6a2dec806d0084c" -dependencies = [ - "zerocopy-derive 0.8.20", + "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.35" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "zerocopy-derive" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eea57037071898bf96a6da35fd626f4f27e9cee3ead2a6c703cf09d472b2e700" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" dependencies = [ "proc-macro2", "quote", @@ -4377,18 +4581,18 @@ dependencies = [ [[package]] name = "zerofrom" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", diff --git a/packages/server/Cargo.toml b/packages/server/Cargo.toml index 1931a183..eb8b2c64 100644 --- a/packages/server/Cargo.toml +++ b/packages/server/Cargo.toml @@ -8,22 +8,24 @@ name = "nestri-server" path = "src/main.rs" [dependencies] -gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "main", features = ["v1_24"] } -gst-webrtc = { package = "gstreamer-webrtc", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "main", features = ["v1_24"] } +gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "main", features = ["v1_26"] } +gst-webrtc = { package = "gstreamer-webrtc", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "main", features = ["v1_26"] } gstrswebrtc = { package = "gst-plugin-webrtc", git = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs", branch = "main", features = ["v1_22"] } -serde = {version = "1.0.214", features = ["derive"] } -tokio = { version = "1.41.0", features = ["full"] } -clap = { version = "4.5.20", features = ["env"] } -serde_json = "1.0.132" -webrtc = "0.12.0" -regex = "1.11.1" -rand = "0.9.0" -rustls = { version = "0.23.17", features = ["ring"] } -tokio-tungstenite = { version = "0.26.1", features = ["native-tls"] } -log = { version = "0.4.22", features = ["std"] } -chrono = "0.4.38" -futures-util = "0.3.31" -num-derive = "0.4.2" -num-traits = "0.2.19" -prost = "0.13.4" -prost-types = "0.13.4" +serde = {version = "1.0", features = ["derive"] } +tokio = { version = "1.44", features = ["full"] } +clap = { version = "4.5", features = ["env"] } +serde_json = "1.0" +webrtc = "0.12" +regex = "1.11" +rand = "0.9" +rustls = { version = "0.23", features = ["ring"] } +tokio-tungstenite = { version = "0.26", features = ["native-tls"] } +log = { version = "0.4", features = ["std"] } +chrono = "0.4" +futures-util = "0.3" +num-derive = "0.4" +num-traits = "0.2" +prost = "0.13" +prost-types = "0.13" +parking_lot = "0.12" +atomic_refcell = "0.1" diff --git a/packages/server/src/args.rs b/packages/server/src/args.rs index 71ed1819..9c3907b7 100644 --- a/packages/server/src/args.rs +++ b/packages/server/src/args.rs @@ -22,19 +22,11 @@ impl Args { .default_value("false"), ) .arg( - Arg::new("debug-feed") + Arg::new("debug") .short('d') - .long("debug-feed") - .env("DEBUG_FEED") - .help("Debug by showing a window on host") - .default_value("false"), - ) - .arg( - Arg::new("debug-latency") - .short('l') - .long("debug-latency") - .env("DEBUG_LATENCY") - .help("Debug latency by showing time on feed") + .long("debug") + .env("DEBUG") + .help("Enable additional debugging information and features") .default_value("false"), ) .arg( diff --git a/packages/server/src/args/app_args.rs b/packages/server/src/args/app_args.rs index 3d94c7e8..5fc4525f 100644 --- a/packages/server/src/args/app_args.rs +++ b/packages/server/src/args/app_args.rs @@ -1,10 +1,8 @@ pub struct AppArgs { /// Verbose output mode pub verbose: bool, - /// Debug the pipeline by showing a window on host - pub debug_feed: bool, - /// Debug the latency by showing time in stream - pub debug_latency: bool, + /// Enable additional debug information and features, may affect performance + pub debug: bool, /// Virtual display resolution pub resolution: (u32, u32), @@ -24,10 +22,8 @@ impl AppArgs { Self { verbose: matches.get_one::("verbose").unwrap() == "true" || matches.get_one::("verbose").unwrap() == "1", - debug_feed: matches.get_one::("debug-feed").unwrap() == "true" - || matches.get_one::("debug-feed").unwrap() == "1", - debug_latency: matches.get_one::("debug-latency").unwrap() == "true" - || matches.get_one::("debug-latency").unwrap() == "1", + debug: matches.get_one::("debug").unwrap() == "true" + || matches.get_one::("debug").unwrap() == "1", resolution: { let res = matches .get_one::("resolution") @@ -65,8 +61,7 @@ impl AppArgs { pub fn debug_print(&self) { println!("AppArgs:"); println!("> verbose: {}", self.verbose); - println!("> debug_feed: {}", self.debug_feed); - println!("> debug_latency: {}", self.debug_latency); + println!("> debug: {}", self.debug); println!("> resolution: {}x{}", self.resolution.0, self.resolution.1); println!("> framerate: {}", self.framerate); println!("> relay_url: {}", self.relay_url); diff --git a/packages/server/src/enc_helper.rs b/packages/server/src/enc_helper.rs index 98bb307d..83683605 100644 --- a/packages/server/src/enc_helper.rs +++ b/packages/server/src/enc_helper.rs @@ -249,8 +249,10 @@ pub fn encoder_gop_params(encoder: &VideoEncoderInfo, gop_size: u32) -> VideoEnc pub fn encoder_low_latency_params( encoder: &VideoEncoderInfo, rate_control: &RateControl, + framerate: u32, ) -> VideoEncoderInfo { - let mut encoder_optz = encoder_gop_params(encoder, 30); + // 2 second GOP size, maybe lower to 1 second for fast recovery, if needed? + let mut encoder_optz = encoder_gop_params(encoder, framerate * 2); match encoder_optz.encoder_api { EncoderAPI::QSV => { diff --git a/packages/server/src/main.rs b/packages/server/src/main.rs index 4519ccaa..b1e1edf1 100644 --- a/packages/server/src/main.rs +++ b/packages/server/src/main.rs @@ -128,8 +128,11 @@ fn handle_encoder_video_settings( args: &args::Args, video_encoder: &enc_helper::VideoEncoderInfo, ) -> enc_helper::VideoEncoderInfo { - let mut optimized_encoder = - enc_helper::encoder_low_latency_params(&video_encoder, &args.encoding.video.rate_control); + let mut optimized_encoder = enc_helper::encoder_low_latency_params( + &video_encoder, + &args.encoding.video.rate_control, + args.app.framerate, + ); // Handle rate-control method match &args.encoding.video.rate_control { encoding_args::RateControl::CQP(cqp) => { @@ -235,7 +238,7 @@ async fn main() -> Result<(), Box> { encoding_args::AudioCaptureMethod::PipeWire => { gst::ElementFactory::make("pipewiresrc").build()? } - _ => gst::ElementFactory::make("alsasrc").build()?, + encoding_args::AudioCaptureMethod::ALSA => gst::ElementFactory::make("alsasrc").build()?, }; // Audio Converter Element @@ -259,6 +262,10 @@ async fn main() -> Result<(), Box> { _ => 128000i32, }, ); + // If has "frame-size" (opus), set to 10 for lower latency (below 10 seems to be too low?) + if audio_encoder.has_property("frame-size") { + audio_encoder.set_property_from_str("frame-size", "10"); + } /* Video */ // Video Source Element @@ -299,6 +306,18 @@ async fn main() -> Result<(), Box> { let video_encoder = gst::ElementFactory::make(video_encoder_info.name.as_str()).build()?; video_encoder_info.apply_parameters(&video_encoder, args.app.verbose); + // Video parser Element, required for GStreamer 1.26 as it broke some things.. + let video_parser; + if video_encoder_info.codec == enc_helper::VideoCodec::H264 { + video_parser = Some( + gst::ElementFactory::make("h264parse") + .property("config-interval", -1i32) + .build()?, + ); + } else { + video_parser = None; + } + /* Output */ // WebRTC sink Element let signaller = NestriSignaller::new(nestri_ws.clone(), pipeline.clone()); @@ -307,20 +326,50 @@ async fn main() -> Result<(), Box> { webrtcsink.set_property_from_str("congestion-control", "disabled"); webrtcsink.set_property("do-retransmission", false); + /* Queues */ + let video_queue = gst::ElementFactory::make("queue2") + .property("max-size-buffers", 3u32) + .property("max-size-time", 0u64) + .property("max-size-bytes", 0u32) + .build()?; + + let audio_queue = gst::ElementFactory::make("queue2") + .property("max-size-buffers", 3u32) + .property("max-size-time", 0u64) + .property("max-size-bytes", 0u32) + .build()?; + + /* Clock Sync */ + let video_clocksync = gst::ElementFactory::make("clocksync") + .property("sync-to-first", true) + .build()?; + + let audio_clocksync = gst::ElementFactory::make("clocksync") + .property("sync-to-first", true) + .build()?; + // Add elements to the pipeline pipeline.add_many(&[ webrtcsink.upcast_ref(), &video_encoder, &video_converter, &caps_filter, + &video_queue, + &video_clocksync, &video_source, &audio_encoder, &audio_capsfilter, + &audio_queue, + &audio_clocksync, &audio_rate, &audio_converter, &audio_source, ])?; + if let Some(parser) = &video_parser { + pipeline.add(parser)?; + } + // If DMA-BUF is enabled, add glupload, color conversion and caps filter if args.app.dma_buf { pipeline.add_many(&[&glupload, &glcolorconvert, &gl_caps_filter])?; @@ -332,6 +381,8 @@ async fn main() -> Result<(), Box> { &audio_converter, &audio_rate, &audio_capsfilter, + &audio_queue, + &audio_clocksync, &audio_encoder, webrtcsink.upcast_ref(), ])?; @@ -342,30 +393,45 @@ async fn main() -> Result<(), Box> { gst::Element::link_many(&[ &video_source, &caps_filter, + &video_queue, + &video_clocksync, &glupload, &glcolorconvert, &gl_caps_filter, &video_encoder, - webrtcsink.upcast_ref(), ])?; } else { // Link video source to caps_filter, video_converter, video_encoder, webrtcsink gst::Element::link_many(&[ &video_source, &caps_filter, + &video_queue, + &video_clocksync, &video_converter, &video_encoder, - webrtcsink.upcast_ref(), ])?; } + // Link video parser if present with webrtcsink, otherwise just link webrtc sink + if let Some(parser) = &video_parser { + gst::Element::link_many(&[&video_encoder, parser, webrtcsink.upcast_ref()])?; + } else { + gst::Element::link_many(&[&video_encoder, webrtcsink.upcast_ref()])?; + } + + // Set QOS + video_encoder.set_property("qos", true); + // Optimize latency of pipeline video_source .sync_state_with_parent() .expect("failed to sync with parent"); video_source.set_property("do-timestamp", &true); audio_source.set_property("do-timestamp", &true); + pipeline.set_property("latency", &0u64); + pipeline.set_property("async-handling", true); + pipeline.set_property("message-forward", true); // Run both pipeline and websocket tasks concurrently let result = run_pipeline(pipeline.clone()).await; diff --git a/packages/server/src/nestrisink/imp.rs b/packages/server/src/nestrisink/imp.rs index 1510d64b..17ac24f8 100644 --- a/packages/server/src/nestrisink/imp.rs +++ b/packages/server/src/nestrisink/imp.rs @@ -7,47 +7,53 @@ use crate::proto::proto::proto_input::InputType::{ }; use crate::proto::proto::{ProtoInput, ProtoMessageInput}; use crate::websocket::NestriWebSocket; +use atomic_refcell::AtomicRefCell; use glib::subclass::prelude::*; use gst::glib; use gst::prelude::*; use gst_webrtc::{WebRTCSDPType, WebRTCSessionDescription, gst_sdp}; use gstrswebrtc::signaller::{Signallable, SignallableImpl}; +use parking_lot::RwLock as PLRwLock; use prost::Message; -use std::collections::HashSet; use std::sync::{Arc, LazyLock}; -use std::sync::{Mutex, RwLock}; use webrtc::ice_transport::ice_candidate::RTCIceCandidateInit; use webrtc::peer_connection::sdp::session_description::RTCSessionDescription; pub struct Signaller { - nestri_ws: RwLock>>, - pipeline: RwLock>>, - data_channel: RwLock>, + nestri_ws: PLRwLock>>, + pipeline: PLRwLock>>, + data_channel: AtomicRefCell>, } impl Default for Signaller { fn default() -> Self { Self { - nestri_ws: RwLock::new(None), - pipeline: RwLock::new(None), - data_channel: RwLock::new(None), + nestri_ws: PLRwLock::new(None), + pipeline: PLRwLock::new(None), + data_channel: AtomicRefCell::new(None), } } } impl Signaller { pub fn set_nestri_ws(&self, nestri_ws: Arc) { - *self.nestri_ws.write().unwrap() = Some(nestri_ws); + *self.nestri_ws.write() = Some(nestri_ws); } pub fn set_pipeline(&self, pipeline: Arc) { - *self.pipeline.write().unwrap() = Some(pipeline); + *self.pipeline.write() = Some(pipeline); } pub fn get_pipeline(&self) -> Option> { - self.pipeline.read().unwrap().clone() + self.pipeline.read().clone() } pub fn set_data_channel(&self, data_channel: gst_webrtc::WebRTCDataChannel) { - *self.data_channel.write().unwrap() = Some(data_channel); + match self.data_channel.try_borrow_mut() { + Ok(mut dc) => *dc = Some(data_channel), + Err(_) => gst::warning!( + gst::CAT_DEFAULT, + "Failed to set data channel - already borrowed" + ), + } } /// Helper method to clean things up @@ -55,7 +61,6 @@ impl Signaller { let nestri_ws = { self.nestri_ws .read() - .unwrap() .clone() .expect("NestriWebSocket not set") }; @@ -145,8 +150,9 @@ impl Signaller { &"nestri-data-channel", &gst::Structure::builder("config") .field("ordered", &true) - .field("max-retransmits", &0u32) + .field("max-retransmits", &2u32) .field("priority", "high") + .field("protocol", "raw") .build(), ], ), @@ -175,7 +181,6 @@ impl SignallableImpl for Signaller { let nestri_ws = { self.nestri_ws .read() - .unwrap() .clone() .expect("NestriWebSocket not set") }; @@ -266,7 +271,6 @@ impl SignallableImpl for Signaller { let nestri_ws = { self.nestri_ws .read() - .unwrap() .clone() .expect("NestriWebSocket not set") }; @@ -297,7 +301,6 @@ impl SignallableImpl for Signaller { let nestri_ws = { self.nestri_ws .read() - .unwrap() .clone() .expect("NestriWebSocket not set") }; @@ -360,9 +363,6 @@ impl ObjectImpl for Signaller { fn setup_data_channel(data_channel: &gst_webrtc::WebRTCDataChannel, pipeline: &gst::Pipeline) { let pipeline = pipeline.clone(); - // A shared state to track currently pressed keys - let pressed_keys = Arc::new(Mutex::new(HashSet::new())); - let pressed_buttons = Arc::new(Mutex::new(HashSet::new())); data_channel.connect_on_message_data(move |_data_channel, data| { if let Some(data) = data { @@ -370,9 +370,7 @@ fn setup_data_channel(data_channel: &gst_webrtc::WebRTCDataChannel, pipeline: &g Ok(message_input) => { if let Some(input_msg) = message_input.data { // Process the input message and create an event - if let Some(event) = - handle_input_message(input_msg, &pressed_keys, &pressed_buttons) - { + if let Some(event) = handle_input_message(input_msg) { // Send the event to pipeline, result bool is ignored let _ = pipeline.send_event(event); } @@ -388,11 +386,7 @@ fn setup_data_channel(data_channel: &gst_webrtc::WebRTCDataChannel, pipeline: &g }); } -fn handle_input_message( - input_msg: ProtoInput, - pressed_keys: &Arc>>, - pressed_buttons: &Arc>>, -) -> Option { +fn handle_input_message(input_msg: ProtoInput) -> Option { if let Some(input_type) = input_msg.input_type { match input_type { MouseMove(data) => { @@ -412,13 +406,6 @@ fn handle_input_message( Some(gst::event::CustomUpstream::new(structure)) } KeyDown(data) => { - let mut keys = pressed_keys.lock().unwrap(); - // If the key is already pressed, return to prevent key lockup - if keys.contains(&data.key) { - return None; - } - keys.insert(data.key); - let structure = gst::Structure::builder("KeyboardKey") .field("key", data.key as u32) .field("pressed", true) @@ -427,10 +414,6 @@ fn handle_input_message( Some(gst::event::CustomUpstream::new(structure)) } KeyUp(data) => { - let mut keys = pressed_keys.lock().unwrap(); - // Remove the key from the pressed state when released - keys.remove(&data.key); - let structure = gst::Structure::builder("KeyboardKey") .field("key", data.key as u32) .field("pressed", false) @@ -447,13 +430,6 @@ fn handle_input_message( Some(gst::event::CustomUpstream::new(structure)) } MouseKeyDown(data) => { - let mut buttons = pressed_buttons.lock().unwrap(); - // If the button is already pressed, return to prevent button lockup - if buttons.contains(&data.key) { - return None; - } - buttons.insert(data.key); - let structure = gst::Structure::builder("MouseButton") .field("button", data.key as u32) .field("pressed", true) @@ -462,10 +438,6 @@ fn handle_input_message( Some(gst::event::CustomUpstream::new(structure)) } MouseKeyUp(data) => { - let mut buttons = pressed_buttons.lock().unwrap(); - // Remove the button from the pressed state when released - buttons.remove(&data.key); - let structure = gst::Structure::builder("MouseButton") .field("button", data.key as u32) .field("pressed", false) diff --git a/packages/server/src/proto/gen.rs b/packages/server/src/proto/gen.rs new file mode 100644 index 00000000..04a9ab9d --- /dev/null +++ b/packages/server/src/proto/gen.rs @@ -0,0 +1,202 @@ +// @generated +// This file is @generated by prost-build. +/// EntityState represents the state of an entity in the mesh (e.g., a room). +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EntityState { + /// Type of entity (e.g., "room") + #[prost(string, tag="1")] + pub entity_type: ::prost::alloc::string::String, + /// Unique identifier (e.g., room name) + #[prost(string, tag="2")] + pub entity_id: ::prost::alloc::string::String, + /// Whether the entity is active + #[prost(bool, tag="3")] + pub active: bool, + /// Relay ID that owns this entity + #[prost(string, tag="4")] + pub owner_relay_id: ::prost::alloc::string::String, +} +/// MeshMessage is the top-level message for all relay-to-relay communication. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MeshMessage { + #[prost(oneof="mesh_message::Type", tags="1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13")] + pub r#type: ::core::option::Option, +} +/// Nested message and enum types in `MeshMessage`. +pub mod mesh_message { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Type { + /// Level 0 + #[prost(message, tag="1")] + StateUpdate(super::StateUpdate), + #[prost(message, tag="2")] + Ack(super::Ack), + #[prost(message, tag="3")] + RetransmissionRequest(super::RetransmissionRequest), + #[prost(message, tag="4")] + Retransmission(super::Retransmission), + #[prost(message, tag="5")] + Heartbeat(super::Heartbeat), + #[prost(message, tag="6")] + SuspectRelay(super::SuspectRelay), + #[prost(message, tag="7")] + Disconnect(super::Disconnect), + /// Level 1 + #[prost(message, tag="8")] + ForwardSdp(super::ForwardSdp), + #[prost(message, tag="9")] + ForwardIce(super::ForwardIce), + #[prost(message, tag="10")] + ForwardIngest(super::ForwardIngest), + #[prost(message, tag="11")] + StreamRequest(super::StreamRequest), + /// Level 2 + #[prost(message, tag="12")] + Handshake(super::Handshake), + #[prost(message, tag="13")] + HandshakeResponse(super::HandshakeResponse), + } +} +/// Handshake to inititiate new connection to mesh. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Handshake { + /// UUID of the relay + #[prost(string, tag="1")] + pub relay_id: ::prost::alloc::string::String, + /// base64 encoded Diffie-Hellman public key + #[prost(string, tag="2")] + pub dh_public_key: ::prost::alloc::string::String, +} +/// HandshakeResponse to respond to a mesh joiner. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct HandshakeResponse { + #[prost(string, tag="1")] + pub relay_id: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub dh_public_key: ::prost::alloc::string::String, + /// relay id to signature + #[prost(map="string, string", tag="3")] + pub approvals: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, +} +/// Forwarded SDP from another relay. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ForwardSdp { + #[prost(string, tag="1")] + pub room_name: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub participant_id: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub sdp: ::prost::alloc::string::String, + /// "offer" or "answer" + #[prost(string, tag="4")] + pub r#type: ::prost::alloc::string::String, +} +/// Forwarded ICE candidate from another relay. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ForwardIce { + #[prost(string, tag="1")] + pub room_name: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub participant_id: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub candidate: ::prost::alloc::string::String, +} +/// Forwarded ingest room from another relay. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ForwardIngest { + #[prost(string, tag="1")] + pub room_name: ::prost::alloc::string::String, +} +/// Stream request from mesh. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StreamRequest { + #[prost(string, tag="1")] + pub room_name: ::prost::alloc::string::String, +} +/// StateUpdate propagates entity state changes across the mesh. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StateUpdate { + /// Unique sequence number for this update + #[prost(uint64, tag="1")] + pub sequence_number: u64, + /// Key: entity_id (e.g., room name), Value: EntityState + #[prost(map="string, message", tag="2")] + pub entities: ::std::collections::HashMap<::prost::alloc::string::String, EntityState>, +} +/// Ack acknowledges receipt of a StateUpdate. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Ack { + /// UUID of the acknowledging relay + #[prost(string, tag="1")] + pub relay_id: ::prost::alloc::string::String, + /// Sequence number being acknowledged + #[prost(uint64, tag="2")] + pub sequence_number: u64, +} +/// RetransmissionRequest requests a missed StateUpdate. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RetransmissionRequest { + /// UUID of the requesting relay + #[prost(string, tag="1")] + pub relay_id: ::prost::alloc::string::String, + /// Sequence number of the missed update + #[prost(uint64, tag="2")] + pub sequence_number: u64, +} +/// Retransmission resends a StateUpdate. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Retransmission { + /// UUID of the sending relay + #[prost(string, tag="1")] + pub relay_id: ::prost::alloc::string::String, + /// The retransmitted update + #[prost(message, optional, tag="2")] + pub state_update: ::core::option::Option, +} +/// Heartbeat signals relay liveness. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Heartbeat { + /// UUID of the sending relay + #[prost(string, tag="1")] + pub relay_id: ::prost::alloc::string::String, + /// Time of the heartbeat + #[prost(message, optional, tag="2")] + pub timestamp: ::core::option::Option<::prost_types::Timestamp>, +} +/// SuspectRelay marks a relay as potentially unresponsive. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SuspectRelay { + /// UUID of the suspected relay + #[prost(string, tag="1")] + pub relay_id: ::prost::alloc::string::String, + /// Reason for suspicion (e.g., "no heartbeat") + #[prost(string, tag="2")] + pub reason: ::prost::alloc::string::String, +} +/// Disconnect signals to remove a relay from the mesh. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Disconnect { + /// UUID of the relay to disconnect + #[prost(string, tag="1")] + pub relay_id: ::prost::alloc::string::String, + /// Reason for disconnection (e.g., "unresponsive") + #[prost(string, tag="2")] + pub reason: ::prost::alloc::string::String, +} +// @@protoc_insertion_point(module) diff --git a/packages/server/src/proto/proto.rs b/packages/server/src/proto/proto.rs index 5c070b86..3c1e3d56 100644 --- a/packages/server/src/proto/proto.rs +++ b/packages/server/src/proto/proto.rs @@ -3,17 +3,17 @@ #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProtoTimestampEntry { - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub stage: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] + #[prost(message, optional, tag="2")] pub time: ::core::option::Option<::prost_types::Timestamp>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProtoLatencyTracker { - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub sequence_id: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] + #[prost(message, repeated, tag="2")] pub timestamps: ::prost::alloc::vec::Vec, } /// MouseMove message @@ -21,11 +21,11 @@ pub struct ProtoLatencyTracker { #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProtoMouseMove { /// Fixed value "MouseMove" - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub r#type: ::prost::alloc::string::String, - #[prost(int32, tag = "2")] + #[prost(int32, tag="2")] pub x: i32, - #[prost(int32, tag = "3")] + #[prost(int32, tag="3")] pub y: i32, } /// MouseMoveAbs message @@ -33,11 +33,11 @@ pub struct ProtoMouseMove { #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProtoMouseMoveAbs { /// Fixed value "MouseMoveAbs" - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub r#type: ::prost::alloc::string::String, - #[prost(int32, tag = "2")] + #[prost(int32, tag="2")] pub x: i32, - #[prost(int32, tag = "3")] + #[prost(int32, tag="3")] pub y: i32, } /// MouseWheel message @@ -45,11 +45,11 @@ pub struct ProtoMouseMoveAbs { #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProtoMouseWheel { /// Fixed value "MouseWheel" - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub r#type: ::prost::alloc::string::String, - #[prost(int32, tag = "2")] + #[prost(int32, tag="2")] pub x: i32, - #[prost(int32, tag = "3")] + #[prost(int32, tag="3")] pub y: i32, } /// MouseKeyDown message @@ -57,9 +57,9 @@ pub struct ProtoMouseWheel { #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProtoMouseKeyDown { /// Fixed value "MouseKeyDown" - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub r#type: ::prost::alloc::string::String, - #[prost(int32, tag = "2")] + #[prost(int32, tag="2")] pub key: i32, } /// MouseKeyUp message @@ -67,9 +67,9 @@ pub struct ProtoMouseKeyDown { #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProtoMouseKeyUp { /// Fixed value "MouseKeyUp" - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub r#type: ::prost::alloc::string::String, - #[prost(int32, tag = "2")] + #[prost(int32, tag="2")] pub key: i32, } /// KeyDown message @@ -77,9 +77,9 @@ pub struct ProtoMouseKeyUp { #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProtoKeyDown { /// Fixed value "KeyDown" - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub r#type: ::prost::alloc::string::String, - #[prost(int32, tag = "2")] + #[prost(int32, tag="2")] pub key: i32, } /// KeyUp message @@ -87,53 +87,53 @@ pub struct ProtoKeyDown { #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProtoKeyUp { /// Fixed value "KeyUp" - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub r#type: ::prost::alloc::string::String, - #[prost(int32, tag = "2")] + #[prost(int32, tag="2")] pub key: i32, } /// Union of all Input types #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProtoInput { - #[prost(oneof = "proto_input::InputType", tags = "1, 2, 3, 4, 5, 6, 7")] + #[prost(oneof="proto_input::InputType", tags="1, 2, 3, 4, 5, 6, 7")] pub input_type: ::core::option::Option, } /// Nested message and enum types in `ProtoInput`. pub mod proto_input { #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] +#[derive(Clone, PartialEq, ::prost::Oneof)] pub enum InputType { - #[prost(message, tag = "1")] + #[prost(message, tag="1")] MouseMove(super::ProtoMouseMove), - #[prost(message, tag = "2")] + #[prost(message, tag="2")] MouseMoveAbs(super::ProtoMouseMoveAbs), - #[prost(message, tag = "3")] + #[prost(message, tag="3")] MouseWheel(super::ProtoMouseWheel), - #[prost(message, tag = "4")] + #[prost(message, tag="4")] MouseKeyDown(super::ProtoMouseKeyDown), - #[prost(message, tag = "5")] + #[prost(message, tag="5")] MouseKeyUp(super::ProtoMouseKeyUp), - #[prost(message, tag = "6")] + #[prost(message, tag="6")] KeyDown(super::ProtoKeyDown), - #[prost(message, tag = "7")] + #[prost(message, tag="7")] KeyUp(super::ProtoKeyUp), } } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProtoMessageBase { - #[prost(string, tag = "1")] + #[prost(string, tag="1")] pub payload_type: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] + #[prost(message, optional, tag="2")] pub latency: ::core::option::Option, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProtoMessageInput { - #[prost(message, optional, tag = "1")] + #[prost(message, optional, tag="1")] pub message_base: ::core::option::Option, - #[prost(message, optional, tag = "2")] + #[prost(message, optional, tag="2")] pub data: ::core::option::Option, } // @@protoc_insertion_point(module)