Skip to content

chore: cherry pick features#330

Merged
TzuHuanTai merged 7 commits intomainfrom
chore/cherry-pick-features
May 3, 2026
Merged

chore: cherry pick features#330
TzuHuanTai merged 7 commits intomainfrom
chore/cherry-pick-features

Conversation

@TzuHuanTai
Copy link
Copy Markdown
Owner

No description provided.

TzuHuanTai added 4 commits May 3, 2026 05:40
- 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
Copilot AI review requested due to automatic review settings May 3, 2026 13:56
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --config support with YAML loading and a sample config/config.yml.
  • Rework signaling paths: MQTT topics are split by offer/answer/ice, WebSocket handlers accept repeated SDP messages, and RtcPeer adds renegotiation-related state/callback handling.
  • Improve Jetson/Libargus startup diagnostics by clearing forwarded DISPLAY in 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.

Comment thread src/rtc/rtc_peer.cpp Outdated
Comment thread src/rtc/rtc_peer.cpp
Comment thread src/rtc/rtc_peer.cpp
Comment thread src/parser.cpp
Comment thread src/signaling/mqtt_service.cpp
TzuHuanTai and others added 3 commits May 3, 2026 08:15
- 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>
@TzuHuanTai TzuHuanTai merged commit 291292b into main May 3, 2026
7 checks passed
@TzuHuanTai TzuHuanTai deleted the chore/cherry-pick-features branch May 3, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants