diff --git a/pkg/rfc8888/interceptor.go b/pkg/ccfb/interceptor.go similarity index 96% rename from pkg/rfc8888/interceptor.go rename to pkg/ccfb/interceptor.go index 344ec1be..b4273ace 100644 --- a/pkg/rfc8888/interceptor.go +++ b/pkg/ccfb/interceptor.go @@ -1,9 +1,9 @@ // SPDX-FileCopyrightText: 2023 The Pion community // SPDX-License-Identifier: MIT -// Package rfc8888 provides an interceptor that generates congestion control +// Package ccfb provides an interceptor that generates congestion control // feedback reports as defined by RFC 8888. -package rfc8888 +package ccfb import ( "sync" @@ -26,7 +26,7 @@ type SenderInterceptorFactory struct { func (s *SenderInterceptorFactory) NewInterceptor(_ string) (interceptor.Interceptor, error) { senderInterceptor := &SenderInterceptor{ NoOp: interceptor.NoOp{}, - log: logging.NewDefaultLoggerFactory().NewLogger("rfc8888_interceptor"), + log: logging.NewDefaultLoggerFactory().NewLogger("ccfb_interceptor"), lock: sync.Mutex{}, wg: sync.WaitGroup{}, recorder: NewRecorder(), diff --git a/pkg/rfc8888/interceptor_test.go b/pkg/ccfb/interceptor_test.go similarity index 99% rename from pkg/rfc8888/interceptor_test.go rename to pkg/ccfb/interceptor_test.go index fa35afe9..481de3ec 100644 --- a/pkg/rfc8888/interceptor_test.go +++ b/pkg/ccfb/interceptor_test.go @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2023 The Pion community // SPDX-License-Identifier: MIT -package rfc8888 +package ccfb import ( "testing" diff --git a/pkg/rfc8888/option.go b/pkg/ccfb/option.go similarity index 98% rename from pkg/rfc8888/option.go rename to pkg/ccfb/option.go index 236073b5..12084af0 100644 --- a/pkg/rfc8888/option.go +++ b/pkg/ccfb/option.go @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2023 The Pion community // SPDX-License-Identifier: MIT -package rfc8888 +package ccfb import "time" diff --git a/pkg/rfc8888/recorder.go b/pkg/ccfb/recorder.go similarity index 98% rename from pkg/rfc8888/recorder.go rename to pkg/ccfb/recorder.go index c5e81d46..653e72dd 100644 --- a/pkg/rfc8888/recorder.go +++ b/pkg/ccfb/recorder.go @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2023 The Pion community // SPDX-License-Identifier: MIT -package rfc8888 +package ccfb import ( "time" diff --git a/pkg/rfc8888/recorder_test.go b/pkg/ccfb/recorder_test.go similarity index 99% rename from pkg/rfc8888/recorder_test.go rename to pkg/ccfb/recorder_test.go index 3f8714b2..fafb184e 100644 --- a/pkg/rfc8888/recorder_test.go +++ b/pkg/ccfb/recorder_test.go @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2023 The Pion community // SPDX-License-Identifier: MIT -package rfc8888 +package ccfb import ( "math/rand" diff --git a/pkg/rfc8888/stream_log.go b/pkg/ccfb/stream_log.go similarity index 99% rename from pkg/rfc8888/stream_log.go rename to pkg/ccfb/stream_log.go index ed41f952..c8c5e6a4 100644 --- a/pkg/rfc8888/stream_log.go +++ b/pkg/ccfb/stream_log.go @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2023 The Pion community // SPDX-License-Identifier: MIT -package rfc8888 +package ccfb import ( "time" diff --git a/pkg/rfc8888/stream_log_test.go b/pkg/ccfb/stream_log_test.go similarity index 99% rename from pkg/rfc8888/stream_log_test.go rename to pkg/ccfb/stream_log_test.go index d5ac2c95..6a5456e3 100644 --- a/pkg/rfc8888/stream_log_test.go +++ b/pkg/ccfb/stream_log_test.go @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2023 The Pion community // SPDX-License-Identifier: MIT -package rfc8888 +package ccfb import ( "testing" diff --git a/pkg/rfc8888/ticker.go b/pkg/ccfb/ticker.go similarity index 94% rename from pkg/rfc8888/ticker.go rename to pkg/ccfb/ticker.go index 571b28e0..fdb182fc 100644 --- a/pkg/rfc8888/ticker.go +++ b/pkg/ccfb/ticker.go @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2023 The Pion community // SPDX-License-Identifier: MIT -package rfc8888 +package ccfb import "time" diff --git a/pkg/rfc8888/rfc8888.go b/pkg/rfc8888/rfc8888.go new file mode 100644 index 00000000..85913e52 --- /dev/null +++ b/pkg/rfc8888/rfc8888.go @@ -0,0 +1,65 @@ +// SPDX-FileCopyrightText: 2025 The Pion community +// SPDX-License-Identifier: MIT + +// Package rfc8888 is deprecated. Use ccfb instead. +package rfc8888 + +import ( + "time" + + "github.com/pion/interceptor/pkg/ccfb" +) + +// TickerFactory is a factory to create new tickers. +// +// Deprecated: moved to pkg/ccfb. +type TickerFactory = ccfb.TickerFactory + +// SenderInterceptorFactory is a interceptor.Factory for a SenderInterceptor. +// +// Deprecated: moved to pkg/ccfb. +type SenderInterceptorFactory = ccfb.SenderInterceptorFactory + +// Deprecated: moved to pkg/ccfb. +func NewSenderInterceptor(opts ...Option) (*SenderInterceptorFactory, error) { + oo := []ccfb.Option{} + oo = append(oo, opts...) + + return ccfb.NewSenderInterceptor(oo...) +} + +// SenderInterceptor sends congestion control feedback as specified in RFC 8888. +// +// Deprecated: moved to pkg/ccfb. +type SenderInterceptor = ccfb.SenderInterceptor + +// An Option is a function that can be used to configure a SenderInterceptor. +// +// Deprecated: moved to pkg/ccfb. +type Option = ccfb.Option + +// Deprecated: moved to pkg/ccfb. +func SenderTicker(f TickerFactory) Option { + return ccfb.SenderTicker(f) +} + +// Deprecated: moved to pkg/ccfb. +func SenderNow(f func() time.Time) Option { + return ccfb.SenderNow(f) +} + +// Deprecated: moved to pkg/ccfb. +func SendInterval(interval time.Duration) Option { + return ccfb.SendInterval(interval) +} + +// Recorder records incoming RTP packets and their arrival times. Recorder can +// be used to create feedback reports as defined by RFC 8888. +// +// Deprecated: moved to pkg/ccfb. +type Recorder = ccfb.Recorder + +// Deprecated: moved to pkg/ccfb. +func NewRecorder() *Recorder { + return ccfb.NewRecorder() +}