chore: cherry pick features#330
Merged
TzuHuanTai merged 7 commits intomainfrom May 3, 2026
Merged
Conversation
… output stream creation
- trigger WebRTC renegotiation when new video tracks are added - route MQTT offer/answer/ice messages per client for existing peers - announce additional camera tracks to the SFU during websocket join
There was a problem hiding this comment.
Pull request overview
This PR cherry-picks a mix of infrastructure and signaling changes across the app: it adds YAML-based runtime configuration, reworks MQTT/WebSocket signaling to support newer SDP topic flows and renegotiation, and hardens Libargus startup when running headless over SSH. In the broader codebase, these updates touch startup/configuration, peer negotiation, and platform-specific capture initialization.
Changes:
- Add
--configsupport with YAML loading and a sampleconfig/config.yml. - Rework signaling paths: MQTT topics are split by offer/answer/ice, WebSocket handlers accept repeated SDP messages, and
RtcPeeradds renegotiation-related state/callback handling. - Improve Jetson/Libargus startup diagnostics by clearing forwarded
DISPLAYin headless SSH sessions and surfacing a clearer output-stream creation error.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/signaling/websocket_service.cpp |
Relaxes SDP message gating to allow repeated offer/answer handling. |
src/signaling/mqtt_service.h |
Refactors MQTT topic handling API around topic types. |
src/signaling/mqtt_service.cpp |
Implements new MQTT topic scheme, client/topic parsing, and renegotiation routing. |
src/rtc/rtc_peer.h |
Adds renegotiation callback/state and replaces thread members with task-safety members. |
src/rtc/rtc_peer.cpp |
Reworks SDP/ICE handling, timeout scheduling, and renegotiation flow inside peers. |
src/parser.cpp |
Adds YAML config-file parsing and removes the old AI stream option. |
src/capturer/libargus_egl_capturer.cpp |
Handles SSH-forwarded DISPLAY and improves Argus output-stream error reporting. |
src/args.h |
Removes the unused ai_stream_idx argument field. |
src/CMakeLists.txt |
Adds the yaml-cpp dependency for the src library. |
config/config.yml |
Adds a sample YAML configuration file for runtime options. |
.gitignore |
Ignores local YAML config overrides under config/*.local.yml. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- rtc_peer: remove premature callback nulling in OnConnectionChange(kConnected) that broke renegotiation; reset sdp_emit_safety_ in Terminate() to cancel pending delayed SDP emit and prevent use-after-free - parser: require --uid unconditionally; validate --mqtt-host, --ws-host, --ws-room at startup to catch misconfiguration early - alsa_capturer, pa_capturer: CreateFloat32Source() now returns bool; Create() returns nullptr on hardware init failure instead of a broken object that crashes on first read - alsa_capturer: replace reinterpret_cast aliasing with memcpy for float/S32/S16 conversion to fix strict-aliasing UB at -O2 - openh264_encoder: Init() returns bool; Create() returns nullptr if encoder allocation or initialization fails to prevent null dereference in Encode() - audio_capturer: add sample_rate() pure virtual accessor - recorder_manager: pass AudioCapturer to CreateAudioRecorder() and use audio_src->sample_rate() instead of config.sample_rate so the recorder uses the actual negotiated rate, not the requested one
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.