直播:后台 JWT 推流、前台画中画;WebRTC 服务与 Nginx WebSocket 代理
Made-with: Cursor
This commit is contained in:
32
server/vendor/github.com/pion/webrtc/v3/icecandidatepair.go
generated
vendored
Normal file
32
server/vendor/github.com/pion/webrtc/v3/icecandidatepair.go
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package webrtc
|
||||
|
||||
import "fmt"
|
||||
|
||||
// ICECandidatePair represents an ICE Candidate pair
|
||||
type ICECandidatePair struct {
|
||||
statsID string
|
||||
Local *ICECandidate
|
||||
Remote *ICECandidate
|
||||
}
|
||||
|
||||
func newICECandidatePairStatsID(localID, remoteID string) string {
|
||||
return fmt.Sprintf("%s-%s", localID, remoteID)
|
||||
}
|
||||
|
||||
func (p *ICECandidatePair) String() string {
|
||||
return fmt.Sprintf("(local) %s <-> (remote) %s", p.Local, p.Remote)
|
||||
}
|
||||
|
||||
// NewICECandidatePair returns an initialized *ICECandidatePair
|
||||
// for the given pair of ICECandidate instances
|
||||
func NewICECandidatePair(local, remote *ICECandidate) *ICECandidatePair {
|
||||
statsID := newICECandidatePairStatsID(local.statsID, remote.statsID)
|
||||
return &ICECandidatePair{
|
||||
statsID: statsID,
|
||||
Local: local,
|
||||
Remote: remote,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user