package sdp
import (
"strconv"
)
type TimeDescription struct {
Timing Timing
RepeatTimes []RepeatTime
}
type Timing struct {
StartTime uint64
StopTime uint64
}
func (t Timing ) String () string {
return stringFromMarshal (t .marshalInto , t .marshalSize )
}
func (t Timing ) marshalInto (b []byte ) []byte {
b = append (strconv .AppendUint (b , t .StartTime , 10 ), ' ' )
return strconv .AppendUint (b , t .StopTime , 10 )
}
func (t Timing ) marshalSize () (size int ) {
return lenUint (t .StartTime ) + 1 + lenUint (t .StopTime )
}
type RepeatTime struct {
Interval int64
Duration int64
Offsets []int64
}
func (r RepeatTime ) String () string {
return stringFromMarshal (r .marshalInto , r .marshalSize )
}
func (r RepeatTime ) marshalInto (b []byte ) []byte {
b = strconv .AppendInt (b , r .Interval , 10 )
b = append (b , ' ' )
b = strconv .AppendInt (b , r .Duration , 10 )
for _ , value := range r .Offsets {
b = append (b , ' ' )
b = strconv .AppendInt (b , value , 10 )
}
return b
}
func (r RepeatTime ) marshalSize () (size int ) {
size = lenInt (r .Interval )
size += 1 + lenInt (r .Duration )
for _ , o := range r .Offsets {
size += 1 + lenInt (o )
}
return
}
The pages are generated with Golds v0.8.2 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds .