forked from pion/webrtc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rtcrtptranceiver.go
36 lines (31 loc) · 970 Bytes
/
rtcrtptranceiver.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package webrtc
import (
"github.com/pkg/errors"
)
// RTCRtpTransceiver represents a combination of an RTCRtpSender and an RTCRtpReceiver that share a common mid.
type RTCRtpTransceiver struct {
Mid string
Sender *RTCRtpSender
Receiver *RTCRtpReceiver
Direction RTCRtpTransceiverDirection
// currentDirection RTCRtpTransceiverDirection
// firedDirection RTCRtpTransceiverDirection
// receptive bool
stopped bool
}
func (t *RTCRtpTransceiver) setSendingTrack(track *RTCTrack) error {
t.Sender.Track = track
switch t.Direction {
case RTCRtpTransceiverDirectionRecvonly:
t.Direction = RTCRtpTransceiverDirectionSendrecv
case RTCRtpTransceiverDirectionInactive:
t.Direction = RTCRtpTransceiverDirectionSendonly
default:
return errors.Errorf("Invalid state change in RTCRtpTransceiver.setSending")
}
return nil
}
// Stop irreversibly stops the RTCRtpTransceiver
func (t *RTCRtpTransceiver) Stop() error {
return errors.Errorf("TODO")
}