whep

package
v0.0.19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bridge

type Bridge struct {
	// contains filtered or unexported fields
}

Bridge manages a single RTSP source and fans out RTP packets to multiple WebRTC PeerConnections via a shared TrackLocalStaticRTP.

func (*Bridge) AddPeer

func (b *Bridge) AddPeer(offerSDP string) (string, error)

AddPeer creates a new WebRTC PeerConnection, adds the shared video track, performs SDP negotiation, and returns the SDP answer.

type BridgeManager

type BridgeManager struct {
	// contains filtered or unexported fields
}

BridgeManager is the registry of active bridges keyed by "entityId/cameraIndex".

func NewBridgeManager

func NewBridgeManager() *BridgeManager

func (*BridgeManager) GetOrCreate

func (bm *BridgeManager) GetOrCreate(key, rtspURL string) (*Bridge, error)

GetOrCreate returns an existing bridge or creates a new one for the given RTSP URL.

type EntityLookup

type EntityLookup interface {
	GetHead(id string) *pb.Entity
}

EntityLookup provides entity access without importing the engine package.

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler is the HTTP handler for WHEP requests.

func NewHandler

func NewHandler(lookup EntityLookup) *Handler

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ImageProxyHandler

type ImageProxyHandler struct {
	// contains filtered or unexported fields
}

ImageProxyHandler serves camera images by proxying the entity's image stream URL.

func NewImageProxyHandler

func NewImageProxyHandler(lookup EntityLookup) *ImageProxyHandler

func (*ImageProxyHandler) ServeHTTP

func (h *ImageProxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Peer

type Peer struct {
	// contains filtered or unexported fields
}

Peer represents a single WHEP viewer connected to a Bridge.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL