1 Star 0 Fork 0

liuzh0324/webrtc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
rtptransceiverdirection.go 2.03 KB
一键复制 编辑 原始数据 按行查看 历史
Max Hawkins 提交于 2019-02-15 13:47 . Remove rtc prefix from filenames
package webrtc
// RTPTransceiverDirection indicates the direction of the RTPTransceiver.
type RTPTransceiverDirection int
const (
// RTPTransceiverDirectionSendrecv indicates the RTPSender will offer
// to send RTP and RTPReceiver the will offer to receive RTP.
RTPTransceiverDirectionSendrecv RTPTransceiverDirection = iota + 1
// RTPTransceiverDirectionSendonly indicates the RTPSender will offer
// to send RTP.
RTPTransceiverDirectionSendonly
// RTPTransceiverDirectionRecvonly indicates the RTPReceiver the will
// offer to receive RTP.
RTPTransceiverDirectionRecvonly
// RTPTransceiverDirectionInactive indicates the RTPSender won't offer
// to send RTP and RTPReceiver the won't offer to receive RTP.
RTPTransceiverDirectionInactive
)
// This is done this way because of a linter.
const (
rtpTransceiverDirectionSendrecvStr = "sendrecv"
rtpTransceiverDirectionSendonlyStr = "sendonly"
rtpTransceiverDirectionRecvonlyStr = "recvonly"
rtpTransceiverDirectionInactiveStr = "inactive"
)
// NewRTPTransceiverDirection defines a procedure for creating a new
// RTPTransceiverDirection from a raw string naming the transceiver direction.
func NewRTPTransceiverDirection(raw string) RTPTransceiverDirection {
switch raw {
case rtpTransceiverDirectionSendrecvStr:
return RTPTransceiverDirectionSendrecv
case rtpTransceiverDirectionSendonlyStr:
return RTPTransceiverDirectionSendonly
case rtpTransceiverDirectionRecvonlyStr:
return RTPTransceiverDirectionRecvonly
case rtpTransceiverDirectionInactiveStr:
return RTPTransceiverDirectionInactive
default:
return RTPTransceiverDirection(Unknown)
}
}
func (t RTPTransceiverDirection) String() string {
switch t {
case RTPTransceiverDirectionSendrecv:
return rtpTransceiverDirectionSendrecvStr
case RTPTransceiverDirectionSendonly:
return rtpTransceiverDirectionSendonlyStr
case RTPTransceiverDirectionRecvonly:
return rtpTransceiverDirectionRecvonlyStr
case RTPTransceiverDirectionInactive:
return rtpTransceiverDirectionInactiveStr
default:
return ErrUnknownType.Error()
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/natoverload/webrtc.git
git@gitee.com:natoverload/webrtc.git
natoverload
webrtc
webrtc
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385