Skip to content

Add UDP video protocol + client/server screen sharing support#7162

Draft
maxer137 wants to merge 9 commits intomumble-voip:masterfrom
maxer137:screenshare
Draft

Add UDP video protocol + client/server screen sharing support#7162
maxer137 wants to merge 9 commits intomumble-voip:masterfrom
maxer137:screenshare

Conversation

@maxer137
Copy link
Copy Markdown
Contributor

This change introduces initial support for screen sharing in Mumble by extending the protocol, server, and client to handle a new UDP video message type.
The current implementation focuses on wiring and basic functionality.

I intend to keep this PR more as a tracker. Per component, I hope to make PRs and track them in this list.

Protocol

To ensure video streaming works, a video message type for the Mumble protocol is added.
This video message type contains codec, resolution, fragmentation metadata, the video payload, and a keyframe flag.
This probably should get expanded further to enable Scalable Video Coding (SVC) in the future.

  • Add UDP video message type
  • Define basic video packet structure (codec, resolution, fragmentation metadata, payload, keyframe flag)
  • Extend protocol for additional codecs
  • Investigate support for scalable video coding (SVC)
  • Review and stabilize fragmentation design

Server

Add a simple relay that doesn't decode the video packets but simply passes on the video content to the other users in the channel. Decoding and encoding of video packets is done on client devices to reduce computational load on the server.
Ideally, the only computational load that gets added to the server is for deciding which packet needs to get sent to what user.

  • Implement basic UDP video packet relay
  • Integrate screen-sharing state handling
  • Validate and harden packet handling (bounds, malformed data, etc.)
  • Improve packet routing efficiency
  • Evaluate whether partial decoding or inspection is needed

Client

Added a screen capture implementation. This screen capture implementation uses FFmpeg libraries to encode captured frames. As it stands, QT does not implement neat window picker implementations for video capture, especially for macOS and Wayland.

  • Implement screen capture
  • Integrate FFmpeg-based encoding
  • Add basic streaming pipeline
  • Add receiving and viewing components
  • Improve capture performance and stability
  • Add proper window/screen selection UX
  • Improve decoding/rendering performance
  • Support additional codecs

Build

FFmpeg libraries would become a new dependency for Mumble on the client.

  • Add FFmpeg as a client dependency
  • Review cross-platform build integration
  • Ensure CI coverage for FFmpeg builds
  • Evaluate optional vs required dependency

Notes

This PR is kept as a draft and is an initial implementation and not considered complete.
UDP video handling is minimal and currently only supports the H.264 codec.
I intend this PR to keep track of progress on this larger feature and hope to stabilize parts of the PR step by step.


Fixes / relates to: #4150

Introduces the MumbleUDP::Video protobuf message for carrying encoded
video frame fragments over UDP. Adds the Video entry to the
MUMBLE_ALL_UDP_MESSAGES macro and a corresponding VideoData struct in
MumbleProtocol.h with fields for sender session, codec, resolution,
fragmentation info, payload, and keyframe flag.

Also adds the screen_sharing boolean field to MumbleProto::UserState
(Mumble.proto) and the matching bScreenSharing member to the shared
User data model, providing the state foundation needed by both server
and client for screen sharing sessions.

Stub switch cases for UDPMessageType::Video are added in ServerHandler
and Server to keep the compiler happy; full decoding and relay follow
in subsequent commits.
Introduce full support for decoding, handling, and relaying UDP video
packets within the Mumble protocol stack.

This change adds a VideoData structure and corresponding decoding path
in UDPDecoder, including a new decodeVideo_protobuf implementation.
Video packets are now parsed into a strongly typed structure with
validation for resolution, fragment bounds, and payload presence.

Protocol-related adjustments include:
- Addition of UDPDecoder::getVideoData accessor
- Introduction of decodeVideo_protobuf path
- Strongly typed VideoData payload handling
- Replacement of video codec field with enum type

Also handles the screen_sharing UserState field server-side: when a
client toggles screen_sharing, the server broadcasts a TextMessage to
the channel announcing that the user started or stopped sharing, and
updates bScreenSharing on the ServerUser.
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.

1 participant