Skip to content

Commit

Permalink
Add intervalpli Factory
Browse files Browse the repository at this point in the history
Don't expect users to provide this
  • Loading branch information
Sean-Der committed Apr 26, 2023
1 parent 81c3c2a commit 71346d6
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pkg/intervalpli/generator_interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@ import (
"github.com/pion/rtcp"
)

// ReceiverInterceptorFactory is a interceptor.Factory for a ReceiverInterceptor
type ReceiverInterceptorFactory struct {
opts []GeneratorOption
}

// NewReceiverInterceptor returns a new ReceiverInterceptor
func NewReceiverInterceptor(opts ...GeneratorOption) (*ReceiverInterceptorFactory, error) {
return &ReceiverInterceptorFactory{
opts: opts,
}, nil
}

// NewInterceptor returns a new ReceiverInterceptor interceptor.
func (r *ReceiverInterceptorFactory) NewInterceptor(string) (interceptor.Interceptor, error) {
return NewGeneratorInterceptor(r.opts...)
}

// GeneratorInterceptor interceptor sends PLI packets.
// Implements PLI in a naive way: sends a PLI for each new track that support PLI, periodically.
type GeneratorInterceptor struct {
Expand Down

0 comments on commit 71346d6

Please sign in to comment.