mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-24 02:27:32 +00:00
Remove unused ReTime Pion interceptor
This commit is contained in:
parent
339750a978
commit
17bec2e987
1 changed files with 0 additions and 30 deletions
|
|
@ -1,30 +0,0 @@
|
|||
package webrtc
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/pion/interceptor"
|
||||
"github.com/pion/rtp"
|
||||
)
|
||||
|
||||
// ReTimeInterceptor replaces timestamps of all outgoing video packets.
|
||||
type ReTimeInterceptor struct {
|
||||
interceptor.NoOp
|
||||
timestamp *uint32
|
||||
}
|
||||
|
||||
func (i *ReTimeInterceptor) NewInterceptor(_ string) (interceptor.Interceptor, error) { return i, nil }
|
||||
|
||||
// BindLocalStream modifies any outgoing RTP packets.
|
||||
func (i *ReTimeInterceptor) BindLocalStream(info *interceptor.StreamInfo, writer interceptor.RTPWriter) interceptor.RTPWriter {
|
||||
// use with video packets only
|
||||
if !strings.HasPrefix(info.MimeType, "video/") {
|
||||
return writer
|
||||
}
|
||||
return interceptor.RTPWriterFunc(func(header *rtp.Header, payload []byte, attributes interceptor.Attributes) (int, error) {
|
||||
h := *header
|
||||
h.Timestamp = atomic.LoadUint32(i.timestamp)
|
||||
return writer.Write(&h, payload, attributes)
|
||||
})
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue