mirror of https://bitbucket.org/ausocean/av.git
protocol/rtcp: changed Timestamp func so that it returns msw and lsw
This commit is contained in:
parent
757564a2ed
commit
5fa0969530
|
@ -147,13 +147,9 @@ func (c *client) send() {
|
|||
// parse will read important statistics from sender reports.
|
||||
func (c *client) parse(buf []byte) {
|
||||
c.received()
|
||||
msw, err := TimestampMSW(buf)
|
||||
msw, lsw, err := Timestamp(buf)
|
||||
if err != nil {
|
||||
c.ErrChan <- errors.New(fmt.Sprintf("could not get timestamp msw from sender report, failed with error: %v", err))
|
||||
}
|
||||
lsw, err := TimestampLSW(buf)
|
||||
if err != nil {
|
||||
c.ErrChan <- errors.New(fmt.Sprintf("could not get timestamp lsw from sender report, failed with error: %v", err))
|
||||
c.ErrChan <- errors.New(fmt.Sprintf("could not get timestamp from sender report, failed with error: %v", err))
|
||||
}
|
||||
c.setSenderTs(msw, lsw)
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import (
|
|||
|
||||
// RTCP packet types.
|
||||
const (
|
||||
typeSenderReport = 200
|
||||
typeReceiverReport = 201
|
||||
typeSourceDescription = 202
|
||||
)
|
||||
|
@ -60,6 +61,16 @@ func (r *ReceiverReport) Bytes() []byte {
|
|||
return buf
|
||||
}
|
||||
|
||||
type ReportBlock struct {
|
||||
SSRC uint32 // Source identifier.
|
||||
FractionLost uint8 // Fraction of packets lost.
|
||||
PacketsLost uint32 // Cumulative number of packets lost.
|
||||
HighestSequence uint32 // Extended highest sequence number received.
|
||||
Jitter uint32 // Interarrival jitter.
|
||||
LSR uint32 // Last sender report timestamp.
|
||||
DLSR uint32 // Delay since last sender report.
|
||||
}
|
||||
|
||||
type SourceDescription struct {
|
||||
Header
|
||||
|
||||
|
@ -106,16 +117,6 @@ type Header struct {
|
|||
Type uint8 // Type of RTCP packet.
|
||||
}
|
||||
|
||||
type ReportBlock struct {
|
||||
SSRC uint32 // Source identifier.
|
||||
FractionLost uint8 // Fraction of packets lost.
|
||||
PacketsLost uint32 // Cumulative number of packets lost.
|
||||
HighestSequence uint32 // Extended highest sequence number received.
|
||||
Jitter uint32 // Interarrival jitter.
|
||||
LSR uint32 // Last sender report timestamp.
|
||||
DLSR uint32 // Delay since last sender report.
|
||||
}
|
||||
|
||||
type SDESItem struct {
|
||||
Type uint8
|
||||
Text []byte
|
||||
|
@ -146,11 +147,3 @@ func asByte(b bool) byte {
|
|||
}
|
||||
return 0x00
|
||||
}
|
||||
|
||||
func TimestampMSW(buf []byte) (uint32, error) {
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
func TimestampLSW(buf []byte) (uint32, error) {
|
||||
return 0, nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue