rename Data into Unit (#1556)

This commit is contained in:
Alessandro Ros
2023-03-10 12:44:59 +01:00
committed by GitHub
parent 25dc252342
commit e8bdad8a1e
23 changed files with 240 additions and 237 deletions

View File

@@ -13,19 +13,19 @@ const (
maxPacketSize = 1472
)
// DataGeneric is a generic data unit.
type DataGeneric struct {
// UnitGeneric is a generic data unit.
type UnitGeneric struct {
RTPPackets []*rtp.Packet
NTP time.Time
}
// GetRTPPackets implements Data.
func (d *DataGeneric) GetRTPPackets() []*rtp.Packet {
// GetRTPPackets implements Unit.
func (d *UnitGeneric) GetRTPPackets() []*rtp.Packet {
return d.RTPPackets
}
// GetNTP implements Data.
func (d *DataGeneric) GetNTP() time.Time {
// GetNTP implements Unit.
func (d *UnitGeneric) GetNTP() time.Time {
return d.NTP
}
@@ -39,10 +39,10 @@ func newGeneric(forma format.Format, generateRTPPackets bool) (*formatProcessorG
return &formatProcessorGeneric{}, nil
}
func (t *formatProcessorGeneric) Process(dat Data, hasNonRTSPReaders bool) error {
tdata := dat.(*DataGeneric)
func (t *formatProcessorGeneric) Process(unit Unit, hasNonRTSPReaders bool) error {
tunit := unit.(*UnitGeneric)
pkt := tdata.RTPPackets[0]
pkt := tunit.RTPPackets[0]
// remove padding
pkt.Header.Padding = false