snapshot of https://github.com/pion/webrtc.git (main, 2026-09-15; blobs > 131072B omitted)
Some checks failed
REUSE Compliance Check / lint (push) Failing after 0s
Browser E2E / Test (push) Failing after 3s
Test / test (1.24) (push) Failing after 0s
Test / test-i386 (1.25) (push) Failing after 0s
Test / test-i386 (1.24) (push) Failing after 0s
Test / test-windows (1.25) (push) Failing after 0s
Test / test-windows (1.24) (push) Failing after 0s
Test / test (1.25) (push) Failing after 0s
Examples Tests / Test (push) Failing after 3s
Test / test-macos (1.25) (push) Failing after 0s
Test / test-macos (1.24) (push) Failing after 0s
Go mod tidy / tidy (push) Failing after 0s
Test / test-wasm (push) Failing after 0s
CodeQL / analyze (push) Failing after 1s
Fuzz / fuzz (push) Failing after 0s
Some checks failed
REUSE Compliance Check / lint (push) Failing after 0s
Browser E2E / Test (push) Failing after 3s
Test / test (1.24) (push) Failing after 0s
Test / test-i386 (1.25) (push) Failing after 0s
Test / test-i386 (1.24) (push) Failing after 0s
Test / test-windows (1.25) (push) Failing after 0s
Test / test-windows (1.24) (push) Failing after 0s
Test / test (1.25) (push) Failing after 0s
Examples Tests / Test (push) Failing after 3s
Test / test-macos (1.25) (push) Failing after 0s
Test / test-macos (1.24) (push) Failing after 0s
Go mod tidy / tidy (push) Failing after 0s
Test / test-wasm (push) Failing after 0s
CodeQL / analyze (push) Failing after 1s
Fuzz / fuzz (push) Failing after 0s
This commit is contained in:
54
icegathererstate.go
Normal file
54
icegathererstate.go
Normal file
@@ -0,0 +1,54 @@
|
||||
// SPDX-FileCopyrightText: 2026 The Pion community <https://pion.ly>
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package webrtc
|
||||
|
||||
import (
|
||||
"sync/atomic"
|
||||
)
|
||||
|
||||
// ICEGathererState represents the current state of the ICE gatherer.
|
||||
type ICEGathererState uint32
|
||||
|
||||
const (
|
||||
// ICEGathererStateUnknown is the enum's zero-value.
|
||||
ICEGathererStateUnknown ICEGathererState = iota
|
||||
|
||||
// ICEGathererStateNew indicates object has been created but
|
||||
// gather() has not been called.
|
||||
ICEGathererStateNew
|
||||
|
||||
// ICEGathererStateGathering indicates gather() has been called,
|
||||
// and the ICEGatherer is in the process of gathering candidates.
|
||||
ICEGathererStateGathering
|
||||
|
||||
// ICEGathererStateComplete indicates the ICEGatherer has completed gathering.
|
||||
ICEGathererStateComplete
|
||||
|
||||
// ICEGathererStateClosed indicates the closed state can only be entered
|
||||
// when the ICEGatherer has been closed intentionally by calling close().
|
||||
ICEGathererStateClosed
|
||||
)
|
||||
|
||||
func (s ICEGathererState) String() string {
|
||||
switch s {
|
||||
case ICEGathererStateNew:
|
||||
return "new"
|
||||
case ICEGathererStateGathering:
|
||||
return "gathering"
|
||||
case ICEGathererStateComplete:
|
||||
return "complete"
|
||||
case ICEGathererStateClosed:
|
||||
return "closed"
|
||||
default:
|
||||
return ErrUnknownType.Error()
|
||||
}
|
||||
}
|
||||
|
||||
func atomicStoreICEGathererState(state *ICEGathererState, newState ICEGathererState) {
|
||||
atomic.StoreUint32((*uint32)(state), uint32(newState))
|
||||
}
|
||||
|
||||
func atomicLoadICEGathererState(state *ICEGathererState) ICEGathererState {
|
||||
return ICEGathererState(atomic.LoadUint32((*uint32)(state)))
|
||||
}
|
||||
Reference in New Issue
Block a user