2023-08-25 16:11:02 +00:00
|
|
|
package unit
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/pion/rtp"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Base contains fields shared across all units.
|
|
|
|
type Base struct {
|
|
|
|
RTPPackets []*rtp.Packet
|
|
|
|
NTP time.Time
|
2023-08-26 16:54:28 +00:00
|
|
|
PTS time.Duration
|
2023-08-25 16:11:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// GetRTPPackets implements Unit.
|
|
|
|
func (u *Base) GetRTPPackets() []*rtp.Packet {
|
|
|
|
return u.RTPPackets
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetNTP implements Unit.
|
|
|
|
func (u *Base) GetNTP() time.Time {
|
|
|
|
return u.NTP
|
|
|
|
}
|
2023-08-26 16:54:28 +00:00
|
|
|
|
|
|
|
// GetPTS implements Unit.
|
|
|
|
func (u *Base) GetPTS() time.Duration {
|
|
|
|
return u.PTS
|
|
|
|
}
|