Source File
rtptransceiverdirection.go
Belonging Package
github.com/pion/webrtc/v4
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MITpackage webrtc// RTPTransceiverDirection indicates the direction of the RTPTransceiver.type RTPTransceiverDirection intconst (// RTPTransceiverDirectionUnknown is the enum's zero-value.RTPTransceiverDirectionUnknown RTPTransceiverDirection = iota// RTPTransceiverDirectionSendrecv indicates the RTPSender will offer// to send RTP and the RTPReceiver will offer to receive RTP.RTPTransceiverDirectionSendrecv// RTPTransceiverDirectionSendonly indicates the RTPSender will offer// to send RTP.RTPTransceiverDirectionSendonly// RTPTransceiverDirectionRecvonly indicates the RTPReceiver will// offer to receive RTP.RTPTransceiverDirectionRecvonly// RTPTransceiverDirectionInactive indicates the RTPSender won't offer// to send RTP and the RTPReceiver 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 ( string) RTPTransceiverDirection {switch {case rtpTransceiverDirectionSendrecvStr:return RTPTransceiverDirectionSendrecvcase rtpTransceiverDirectionSendonlyStr:return RTPTransceiverDirectionSendonlycase rtpTransceiverDirectionRecvonlyStr:return RTPTransceiverDirectionRecvonlycase rtpTransceiverDirectionInactiveStr:return RTPTransceiverDirectionInactivedefault:return RTPTransceiverDirectionUnknown}}func ( RTPTransceiverDirection) () string {switch {case RTPTransceiverDirectionSendrecv:return rtpTransceiverDirectionSendrecvStrcase RTPTransceiverDirectionSendonly:return rtpTransceiverDirectionSendonlyStrcase RTPTransceiverDirectionRecvonly:return rtpTransceiverDirectionRecvonlyStrcase RTPTransceiverDirectionInactive:return rtpTransceiverDirectionInactiveStrdefault:return ErrUnknownType.Error()}}// Revers indicate the opposite direction.func ( RTPTransceiverDirection) () RTPTransceiverDirection {switch {case RTPTransceiverDirectionSendonly:return RTPTransceiverDirectionRecvonlycase RTPTransceiverDirectionRecvonly:return RTPTransceiverDirectionSendonlydefault:return}}func haveRTPTransceiverDirectionIntersection([]RTPTransceiverDirection,[]RTPTransceiverDirection,) bool {for , := range {for , := range {if == {return true}}}return false}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |