summaryrefslogtreecommitdiff
path: root/vendor/github.com/pion/webrtc/v3/icecomponent.go
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2021-11-29 01:46:27 +0100
committerkali kaneko (leap communications) <kali@leap.se>2021-11-29 18:14:16 +0100
commit18f52af5be3a9a0c73811706108f790d65ee9c67 (patch)
treee13cbacb47d56919caa9c44a2b45dec1497a7860 /vendor/github.com/pion/webrtc/v3/icecomponent.go
parentebcef0d57b6ecb5a40c6579f6be07182dd3033ba (diff)
[pkg] update vendor
Diffstat (limited to 'vendor/github.com/pion/webrtc/v3/icecomponent.go')
-rw-r--r--vendor/github.com/pion/webrtc/v3/icecomponent.go47
1 files changed, 47 insertions, 0 deletions
diff --git a/vendor/github.com/pion/webrtc/v3/icecomponent.go b/vendor/github.com/pion/webrtc/v3/icecomponent.go
new file mode 100644
index 0000000..1f03ec5
--- /dev/null
+++ b/vendor/github.com/pion/webrtc/v3/icecomponent.go
@@ -0,0 +1,47 @@
+package webrtc
+
+// ICEComponent describes if the ice transport is used for RTP
+// (or RTCP multiplexing).
+type ICEComponent int
+
+const (
+ // ICEComponentRTP indicates that the ICE Transport is used for RTP (or
+ // RTCP multiplexing), as defined in
+ // https://tools.ietf.org/html/rfc5245#section-4.1.1.1. Protocols
+ // multiplexed with RTP (e.g. data channel) share its component ID. This
+ // represents the component-id value 1 when encoded in candidate-attribute.
+ ICEComponentRTP ICEComponent = iota + 1
+
+ // ICEComponentRTCP indicates that the ICE Transport is used for RTCP as
+ // defined by https://tools.ietf.org/html/rfc5245#section-4.1.1.1. This
+ // represents the component-id value 2 when encoded in candidate-attribute.
+ ICEComponentRTCP
+)
+
+// This is done this way because of a linter.
+const (
+ iceComponentRTPStr = "rtp"
+ iceComponentRTCPStr = "rtcp"
+)
+
+func newICEComponent(raw string) ICEComponent {
+ switch raw {
+ case iceComponentRTPStr:
+ return ICEComponentRTP
+ case iceComponentRTCPStr:
+ return ICEComponentRTCP
+ default:
+ return ICEComponent(Unknown)
+ }
+}
+
+func (t ICEComponent) String() string {
+ switch t {
+ case ICEComponentRTP:
+ return iceComponentRTPStr
+ case ICEComponentRTCP:
+ return iceComponentRTCPStr
+ default:
+ return ErrUnknownType.Error()
+ }
+}