move units into dedicated package (#2245)

needed by #2244
This commit is contained in:
Alessandro Ros 2023-08-25 18:11:02 +02:00 committed by GitHub
parent 23ddaac481
commit e0fb11040e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 390 additions and 318 deletions

View file

@ -1,32 +0,0 @@
package formatprocessor
import (
"time"
"github.com/pion/rtp"
)
// BaseUnit contains fields shared across all units.
type BaseUnit struct {
RTPPackets []*rtp.Packet
NTP time.Time
}
// GetRTPPackets implements Unit.
func (u *BaseUnit) GetRTPPackets() []*rtp.Packet {
return u.RTPPackets
}
// GetNTP implements Unit.
func (u *BaseUnit) GetNTP() time.Time {
return u.NTP
}
// Unit is the elementary data unit routed across the server.
type Unit interface {
// returns RTP packets contained into the unit.
GetRTPPackets() []*rtp.Packet
// returns the NTP timestamp of the unit.
GetNTP() time.Time
}