mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-05 19:28:46 +02:00
Squashed buildout of the tgcalls testbench: - CLI test tool with --mode p2p/reflector/group/group-churn, cross-version interop (--version, --version2), and quiet/summary output - Linux toolchain + Docker multi-stage build, AWS Fargate mass test harness, local parallel mass test harness with signaling loss simulation - SCTP writable gate, retransmission timer tuning, role-based handshake - InstanceV2CompatImpl (PeerConnection backend with V2Impl signaling) and SignalingTranslator for v14.0.0 interop - In-process Go/Pion SFU (ICE+DTLS+SRTP+SCTP per participant) with audio RTP forwarding, ActiveAudio/VideoSsrcs data channel broadcast, RTCP feedback path, and CGo c-archive integration - GroupInstanceReferenceImpl (PeerConnection group-call) and mixed-impl group mode (--reference-participants), with SDP munging for simulcast - H264 simulcast group video (FakeVideoTrackSource pattern generator, FakeVideoSink frame counting, --video flag, two-pass channel setup, reactive video setup from ActiveVideoSsrcs) - Group churn stress mode (--mode group-churn, --churn-cycles) - SFU stream-quality adaptation: BandwidthEstimator, LayerSelector state machine, RtxRingBuffer, simulcast SSRC rewrite - Transport-cc feedback generation, NetworkSimulator (delay/jitter/loss/ token-bucket bandwidth), --network-scenario step-down-up - CLAUDE.md updates throughout Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
147 lines
3.1 KiB
Bash
Executable file
147 lines
3.1 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
# Strip version qualifiers (e.g. "dav1d >= 0.5.0" -> "dav1d")
|
|
# FFmpeg's configure passes these to pkg-config
|
|
strip_version() {
|
|
echo "$@" | sed 's/ *[><=!].*//'
|
|
}
|
|
|
|
if [ "$1" == "--version" ]; then
|
|
echo "0.29.2"
|
|
exit 0
|
|
elif [ "$1" == "--exists" ]; then
|
|
NAME="$2"
|
|
PRINT_ERRORS="0"
|
|
if [ "$NAME" == "--print-errors" ]; then
|
|
NAME=$(strip_version "$3")
|
|
PRINT_ERRORS="1"
|
|
else
|
|
NAME=$(strip_version "$2")
|
|
fi
|
|
if [ "$NAME" == "zlib" ]; then
|
|
exit 0
|
|
elif [ "$NAME" == "opus" ]; then
|
|
exit 0
|
|
elif [ "$NAME" == "vpx" ]; then
|
|
exit 0
|
|
elif [ "$NAME" == "dav1d" ]; then
|
|
exit 0
|
|
else
|
|
if [ "PRINT_ERRORS" == "1" ]; then
|
|
echo "Package $NAME was not found in the pkg-config search path."
|
|
echo "Perhaps you should add the directory containing \`$NAME.pc'"
|
|
echo "to the PKG_CONFIG_PATH environment variable"
|
|
fi
|
|
exit 1
|
|
fi
|
|
elif [ "$1" == "--cflags" ]; then
|
|
NAME="$2"
|
|
LIBOPUS_PATH=""
|
|
LIBVPX_PATH=""
|
|
LIBDAV1D_PATH=""
|
|
if [ "$2" == "--libopus_path" ]; then
|
|
LIBOPUS_PATH="$3"
|
|
NAME="$8"
|
|
else
|
|
exit 1
|
|
fi
|
|
if [ "$4" == "--libvpx_path" ]; then
|
|
LIBVPX_PATH="$5"
|
|
else
|
|
exit 1
|
|
fi
|
|
if [ "$6" == "--libdav1d_path" ]; then
|
|
LIBDAV1D_PATH="$7"
|
|
else
|
|
exit 1
|
|
fi
|
|
if [ "$NAME" == "zlib" ]; then
|
|
echo ""
|
|
exit 0
|
|
elif [ "$NAME" == "opus" ]; then
|
|
echo "-I$LIBOPUS_PATH/include/opus"
|
|
exit 0
|
|
elif [ "$NAME" == "vpx" ]; then
|
|
echo "-I$LIBVPX_PATH/include"
|
|
exit 0
|
|
elif [ "$NAME" == "dav1d" ]; then
|
|
echo "-I$LIBDAV1D_PATH/include"
|
|
exit 0
|
|
else
|
|
exit 1
|
|
fi
|
|
elif [ "$1" == "--libs" ]; then
|
|
NAME="$2"
|
|
LIBOPUS_PATH=""
|
|
LIBVPX_PATH=""
|
|
LIBDAV1D_PATH=""
|
|
if [ "$2" == "--libopus_path" ]; then
|
|
LIBOPUS_PATH="$3"
|
|
NAME="$8"
|
|
else
|
|
exit 1
|
|
fi
|
|
if [ "$4" == "--libvpx_path" ]; then
|
|
LIBVPX_PATH="$5"
|
|
else
|
|
exit 1
|
|
fi
|
|
if [ "$6" == "--libdav1d_path" ]; then
|
|
LIBDAV1D_PATH="$7"
|
|
else
|
|
exit 1
|
|
fi
|
|
if [ "$NAME" == "zlib" ]; then
|
|
echo "-lz"
|
|
exit 0
|
|
elif [ "$NAME" == "opus" ]; then
|
|
echo "-L$LIBOPUS_PATH/lib -lopus -lm"
|
|
exit 0
|
|
elif [ "$NAME" == "vpx" ]; then
|
|
echo "-L$LIBVPX_PATH/lib -lVPX -lm -lpthread"
|
|
exit 0
|
|
elif [ "$NAME" == "dav1d" ]; then
|
|
echo "-L$LIBDAV1D_PATH/lib -ldav1d -lm -lpthread -ldl"
|
|
exit 0
|
|
else
|
|
exit 1
|
|
fi
|
|
elif [[ "$1" == --variable=* ]]; then
|
|
# Handle --variable=includedir etc.
|
|
LIBOPUS_PATH=""
|
|
LIBVPX_PATH=""
|
|
LIBDAV1D_PATH=""
|
|
# Parse the library path flags to find NAME (last arg)
|
|
ARGS=("$@")
|
|
NAME="${ARGS[-1]}"
|
|
for ((i=1; i<${#ARGS[@]}-1; i++)); do
|
|
if [ "${ARGS[$i]}" == "--libopus_path" ]; then
|
|
LIBOPUS_PATH="${ARGS[$((i+1))]}"
|
|
elif [ "${ARGS[$i]}" == "--libvpx_path" ]; then
|
|
LIBVPX_PATH="${ARGS[$((i+1))]}"
|
|
elif [ "${ARGS[$i]}" == "--libdav1d_path" ]; then
|
|
LIBDAV1D_PATH="${ARGS[$((i+1))]}"
|
|
fi
|
|
done
|
|
VAR="${1#--variable=}"
|
|
if [ "$VAR" == "includedir" ]; then
|
|
if [ "$NAME" == "opus" ]; then
|
|
echo "$LIBOPUS_PATH/include"
|
|
exit 0
|
|
elif [ "$NAME" == "vpx" ]; then
|
|
echo "$LIBVPX_PATH/include"
|
|
exit 0
|
|
elif [ "$NAME" == "dav1d" ]; then
|
|
echo "$LIBDAV1D_PATH/include"
|
|
exit 0
|
|
elif [ "$NAME" == "zlib" ]; then
|
|
echo "/usr/include"
|
|
exit 0
|
|
fi
|
|
fi
|
|
# Return empty string for unhandled variables (non-fatal)
|
|
echo ""
|
|
exit 0
|
|
else
|
|
exit 1
|
|
fi
|