Source File
sdpsemantics.go
Belonging Package
github.com/pion/webrtc/v4
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MITpackage webrtcimport ()// SDPSemantics determines which style of SDP offers and answers// can be used.type SDPSemantics intconst (// SDPSemanticsUnifiedPlan uses unified-plan offers and answers// (the default in Chrome since M72)// https://tools.ietf.org/html/draft-roach-mmusic-unified-plan-00SDPSemanticsUnifiedPlan SDPSemantics = iota// SDPSemanticsPlanB uses plan-b offers and answers// NB: This format should be considered deprecated// https://tools.ietf.org/html/draft-uberti-rtcweb-plan-00SDPSemanticsPlanB// SDPSemanticsUnifiedPlanWithFallback prefers unified-plan// offers and answers, but will respond to a plan-b offer// with a plan-b answer.SDPSemanticsUnifiedPlanWithFallback)const (sdpSemanticsUnifiedPlanWithFallback = "unified-plan-with-fallback"sdpSemanticsUnifiedPlan = "unified-plan"sdpSemanticsPlanB = "plan-b")func newSDPSemantics( string) SDPSemantics {switch {case sdpSemanticsPlanB:return SDPSemanticsPlanBcase sdpSemanticsUnifiedPlanWithFallback:return SDPSemanticsUnifiedPlanWithFallbackdefault:return SDPSemanticsUnifiedPlan}}func ( SDPSemantics) () string {switch {case SDPSemanticsUnifiedPlanWithFallback:return sdpSemanticsUnifiedPlanWithFallbackcase SDPSemanticsUnifiedPlan:return sdpSemanticsUnifiedPlancase SDPSemanticsPlanB:return sdpSemanticsPlanBdefault:return ErrUnknownType.Error()}}// UnmarshalJSON parses the JSON-encoded data and stores the result.func ( *SDPSemantics) ( []byte) error {var stringif := json.Unmarshal(, &); != nil {return}* = newSDPSemantics()return nil}// MarshalJSON returns the JSON encoding.func ( SDPSemantics) () ([]byte, error) {return json.Marshal(.String())}
![]() |
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. |