[PR #235] [CLOSED] Implement WHIP server ingest #236

Closed
opened 2026-03-02 04:00:52 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/eerimoq/moblin/pull/235
Author: @Copilot
Created: 2/13/2026
Status: Closed

Base: mainHead: copilot/implement-whip-server-ingest


📝 Commits (5)

  • 1978f3b Initial plan
  • 4c0f78b Add WHIP server ingest implementation with WebRTC peer connection, H.264/Opus depacketization, HTTP server body parsing, and model integration
  • d3ee0c1 Fix import and add periphery:ignore annotations for protocol-required parameters
  • 06d1618 Use safer nested withUnsafeBytes pattern for H.264 format description creation
  • 42b5fc4 Change WHIP HTTP endpoint path from /whip to /whip/

📊 Changes

8 files changed (+962 additions, -7 deletions)

View changed files

📝 Common/Various/CommonUtils.swift (+9 -0)
Moblin/Media/HaishinKit/Whip/WhipServer.swift (+150 -0)
Moblin/Media/HaishinKit/Whip/WhipServerClient.swift (+531 -0)
📝 Moblin/Various/Model/Model.swift (+3 -0)
Moblin/Various/Model/ModelWhipServer.swift (+135 -0)
📝 Moblin/Various/Network/HttpServer.swift (+46 -7)
📝 Moblin/Various/Settings/Settings.swift (+4 -0)
📝 Moblin/Various/Settings/SettingsIngests.swift (+84 -0)

📄 Description

  • Explore repository and understand architecture
  • Modify HttpServer.swift to support parsing HTTP request bodies (Content-Length), custom response headers/content-types, and prefix-based route matching
  • Create WhipServerClient.swift - WebRTC peer connection that receives media (H.264 video + Opus audio) using libdatachannel, depacketizes RTP into CMSampleBuffers
  • Create WhipServer.swift - WHIP server using HttpServer, handling POST /whip/ (SDP offer→answer) and DELETE /whip/{id} endpoints
  • Add SettingsWhipServer and SettingsWhipServerStream classes in SettingsIngests.swift
  • Add whipServer property to Database class in Settings.swift with encode/decode
  • Add whip property to Ingests class in Model.swift
  • Create ModelWhipServer.swift - Model extension with reload/stop/delegate methods
  • Add whipCamera() and isWhipCameraOrMic() helpers in CommonUtils.swift
  • Call reloadWhipServer() in Model.swift initialization and settings reload
  • Code review and security checks complete

Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/eerimoq/moblin/pull/235 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 2/13/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `copilot/implement-whip-server-ingest` --- ### 📝 Commits (5) - [`1978f3b`](https://github.com/eerimoq/moblin/commit/1978f3b87b11223dddacd25d262de2eaccfd535f) Initial plan - [`4c0f78b`](https://github.com/eerimoq/moblin/commit/4c0f78bf85b0a3fb402ac26927d8e9146cb71afa) Add WHIP server ingest implementation with WebRTC peer connection, H.264/Opus depacketization, HTTP server body parsing, and model integration - [`d3ee0c1`](https://github.com/eerimoq/moblin/commit/d3ee0c1a927a685fa72d628c4f3d418585ac8de0) Fix import and add periphery:ignore annotations for protocol-required parameters - [`06d1618`](https://github.com/eerimoq/moblin/commit/06d1618f11ba8513e7b78272d54eeb62bdac74a7) Use safer nested withUnsafeBytes pattern for H.264 format description creation - [`42b5fc4`](https://github.com/eerimoq/moblin/commit/42b5fc4c1bcea1427b35a1af20ff75103c982181) Change WHIP HTTP endpoint path from /whip to /whip/ ### 📊 Changes **8 files changed** (+962 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `Common/Various/CommonUtils.swift` (+9 -0) ➕ `Moblin/Media/HaishinKit/Whip/WhipServer.swift` (+150 -0) ➕ `Moblin/Media/HaishinKit/Whip/WhipServerClient.swift` (+531 -0) 📝 `Moblin/Various/Model/Model.swift` (+3 -0) ➕ `Moblin/Various/Model/ModelWhipServer.swift` (+135 -0) 📝 `Moblin/Various/Network/HttpServer.swift` (+46 -7) 📝 `Moblin/Various/Settings/Settings.swift` (+4 -0) 📝 `Moblin/Various/Settings/SettingsIngests.swift` (+84 -0) </details> ### 📄 Description - [x] Explore repository and understand architecture - [x] Modify `HttpServer.swift` to support parsing HTTP request bodies (Content-Length), custom response headers/content-types, and prefix-based route matching - [x] Create `WhipServerClient.swift` - WebRTC peer connection that receives media (H.264 video + Opus audio) using libdatachannel, depacketizes RTP into CMSampleBuffers - [x] Create `WhipServer.swift` - WHIP server using HttpServer, handling POST /whip/ (SDP offer→answer) and DELETE /whip/{id} endpoints - [x] Add `SettingsWhipServer` and `SettingsWhipServerStream` classes in `SettingsIngests.swift` - [x] Add `whipServer` property to `Database` class in `Settings.swift` with encode/decode - [x] Add `whip` property to `Ingests` class in `Model.swift` - [x] Create `ModelWhipServer.swift` - Model extension with reload/stop/delegate methods - [x] Add `whipCamera()` and `isWhipCameraOrMic()` helpers in `CommonUtils.swift` - [x] Call `reloadWhipServer()` in `Model.swift` initialization and settings reload - [x] Code review and security checks complete <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/eerimoq/moblin/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem closed this issue 2026-03-02 04:00:52 +03:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/moblin#236
No description provided.