mirror of
https://github.com/aler9/rtsp-simple-server
synced 2025-10-04 07:16:43 +08:00
rename Data into Unit (#1556)
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user