tangled
alpha
login
or
join now
stream.place
/
streamplace
Live video on the AT Protocol
74
fork
atom
overview
issues
1
pulls
pipelines
rtcrec: rename files
Eli Mallon
8 months ago
10a83d26
173508fb
-82
3 changed files
expand all
collapse all
unified
split
pkg
rtcrec
rtcrec.go
wrapped.go
wrapped_peerconnection.go
-4
pkg/rtcrec/peerproxy.go
pkg/rtcrec/rtcrec.go
···
37
37
}
38
38
39
39
func GatheringCompletePromise(pc PeerConnection) <-chan struct{} {
40
40
-
wrapped, ok := pc.(*WrappedPeerConnection)
41
41
-
if ok {
42
42
-
return webrtc.GatheringCompletePromise(wrapped.pionpc)
43
43
-
}
44
40
recorder, ok := pc.(*RecorderPeerConnection)
45
41
if ok {
46
42
return webrtc.GatheringCompletePromise(recorder.pionpc)
pkg/rtcrec/recorder.go
pkg/rtcrec/wrapped_peerconnection.go
-78
pkg/rtcrec/wrapped.go
···
1
1
-
package rtcrec
2
2
-
3
3
-
import (
4
4
-
"github.com/pion/rtcp"
5
5
-
"github.com/pion/webrtc/v4"
6
6
-
)
7
7
-
8
8
-
type WrappedPeerConnection struct {
9
9
-
pionpc *webrtc.PeerConnection
10
10
-
}
11
11
-
12
12
-
func NewWrappedPC(pionpc *webrtc.PeerConnection) PeerConnection {
13
13
-
return &WrappedPeerConnection{
14
14
-
pionpc: pionpc,
15
15
-
}
16
16
-
}
17
17
-
18
18
-
func (pc *WrappedPeerConnection) Close() error {
19
19
-
return pc.pionpc.Close()
20
20
-
}
21
21
-
22
22
-
func (pc *WrappedPeerConnection) CreateAnswer(options *webrtc.AnswerOptions) (webrtc.SessionDescription, error) {
23
23
-
return pc.pionpc.CreateAnswer(options)
24
24
-
}
25
25
-
26
26
-
func (pc *WrappedPeerConnection) CreateOffer(options *webrtc.OfferOptions) (webrtc.SessionDescription, error) {
27
27
-
return pc.pionpc.CreateOffer(options)
28
28
-
}
29
29
-
30
30
-
func (pc *WrappedPeerConnection) SetLocalDescription(desc webrtc.SessionDescription) error {
31
31
-
return pc.pionpc.SetLocalDescription(desc)
32
32
-
}
33
33
-
34
34
-
func (pc *WrappedPeerConnection) SetRemoteDescription(desc webrtc.SessionDescription) error {
35
35
-
return pc.pionpc.SetRemoteDescription(desc)
36
36
-
}
37
37
-
38
38
-
func (pc *WrappedPeerConnection) LocalDescription() *webrtc.SessionDescription {
39
39
-
return pc.pionpc.LocalDescription()
40
40
-
}
41
41
-
42
42
-
func (pc *WrappedPeerConnection) RemoteDescription() *webrtc.SessionDescription {
43
43
-
return pc.pionpc.RemoteDescription()
44
44
-
}
45
45
-
46
46
-
func (pc *WrappedPeerConnection) OnICEConnectionStateChange(f func(webrtc.ICEConnectionState)) {
47
47
-
pc.pionpc.OnICEConnectionStateChange(f)
48
48
-
}
49
49
-
50
50
-
func (pc *WrappedPeerConnection) OnConnectionStateChange(f func(webrtc.PeerConnectionState)) {
51
51
-
pc.pionpc.OnConnectionStateChange(f)
52
52
-
}
53
53
-
54
54
-
func (pc *WrappedPeerConnection) OnTrack(f func(TrackRemote, RTPReceiver)) {
55
55
-
pc.pionpc.OnTrack(func(track *webrtc.TrackRemote, receiver *webrtc.RTPReceiver) {
56
56
-
f(track, receiver)
57
57
-
})
58
58
-
}
59
59
-
60
60
-
func (pc *WrappedPeerConnection) WriteRTCP(pkts []rtcp.Packet) error {
61
61
-
return pc.pionpc.WriteRTCP(pkts)
62
62
-
}
63
63
-
64
64
-
func (pc *WrappedPeerConnection) AddTransceiverFromKind(kind webrtc.RTPCodecType, init ...webrtc.RTPTransceiverInit) (RTPTransceiver, error) {
65
65
-
return pc.pionpc.AddTransceiverFromKind(kind, init...)
66
66
-
}
67
67
-
68
68
-
func (pc *WrappedPeerConnection) ICEGatheringState() webrtc.ICEGatheringState {
69
69
-
return pc.pionpc.ICEGatheringState()
70
70
-
}
71
71
-
72
72
-
func (pc *WrappedPeerConnection) OnDataChannel(f func(*webrtc.DataChannel)) {
73
73
-
pc.pionpc.OnDataChannel(f)
74
74
-
}
75
75
-
76
76
-
func (pc *WrappedPeerConnection) OnNegotiationNeeded(f func()) {
77
77
-
pc.pionpc.OnNegotiationNeeded(f)
78
78
-
}