headers: rename RTPInfo's RTPTime into Timestamp

This commit is contained in:
aler9
2021-03-18 13:46:36 +01:00
parent c2de28c185
commit 82aed5cc6c
2 changed files with 7 additions and 7 deletions

View File

@@ -12,7 +12,7 @@ import (
type RTPInfoEntry struct {
URL *base.URL
SequenceNumber uint16
RTPTime uint32
Timestamp uint32
}
// RTPInfo is a RTP-Info header.
@@ -60,7 +60,7 @@ func ReadRTPInfo(v base.HeaderValue) (*RTPInfo, error) {
if err != nil {
return nil, err
}
e.RTPTime = uint32(vi)
e.Timestamp = uint32(vi)
default:
return nil, fmt.Errorf("invalid key: %v", k)
@@ -80,7 +80,7 @@ func (h RTPInfo) Clone() *RTPInfo {
*nh = append(*nh, &RTPInfoEntry{
URL: e.URL,
SequenceNumber: e.SequenceNumber,
RTPTime: e.RTPTime,
Timestamp: e.Timestamp,
})
}
return nh
@@ -93,7 +93,7 @@ func (h RTPInfo) Write() base.HeaderValue {
for _, e := range h {
rets = append(rets, "url="+e.URL.String()+
";seq="+strconv.FormatUint(uint64(e.SequenceNumber), 10)+
";rtptime="+strconv.FormatUint(uint64(e.RTPTime), 10))
";rtptime="+strconv.FormatUint(uint64(e.Timestamp), 10))
}
return base.HeaderValue{strings.Join(rets, ",")}

View File

@@ -22,7 +22,7 @@ var casesRTPInfo = []struct {
{
URL: base.MustParseURL("rtsp://127.0.0.1/test.mkv/track1"),
SequenceNumber: 35243,
RTPTime: 717574556,
Timestamp: 717574556,
},
},
},
@@ -34,12 +34,12 @@ var casesRTPInfo = []struct {
{
URL: base.MustParseURL("rtsp://127.0.0.1/test.mkv/track1"),
SequenceNumber: 35243,
RTPTime: 717574556,
Timestamp: 717574556,
},
{
URL: base.MustParseURL("rtsp://127.0.0.1/test.mkv/track2"),
SequenceNumber: 13655,
RTPTime: 2848846950,
Timestamp: 2848846950,
},
},
},