Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused ClockRate parameter #160

Merged
merged 1 commit into from
Dec 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Hugo Arregui <hugo@decentraland.org>
John Bradley <jrb@turrettech.com>
Juliusz Chroboczek <jch@irif.fr>
Kazuyuki Honda <hakobera@gmail.com>
Kevin Wang <kevmo314@gmail.com>
Luke Curley <kixelated@gmail.com>
lxb <xiangbing.li@uama.com.cn>
Michael MacDonald <github@macdonald.cx>
Expand Down
4 changes: 1 addition & 3 deletions packetizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,21 @@ type packetizer struct {
Payloader Payloader
Sequencer Sequencer
Timestamp uint32
ClockRate uint32
extensionNumbers struct { // put extension numbers in here. If they're 0, the extension is disabled (0 is not a legal extension number)
AbsSendTime int // http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
}
timegen func() time.Time
}

// NewPacketizer returns a new instance of a Packetizer for a specific payloader
func NewPacketizer(mtu uint16, pt uint8, ssrc uint32, payloader Payloader, sequencer Sequencer, clockRate uint32) Packetizer {
func NewPacketizer(mtu uint16, pt uint8, ssrc uint32, payloader Payloader, sequencer Sequencer) Packetizer {
return &packetizer{
MTU: mtu,
PayloadType: pt,
SSRC: ssrc,
Payloader: payloader,
Sequencer: sequencer,
Timestamp: globalMathRandomGenerator.Uint32(),
ClockRate: clockRate,
timegen: time.Now,
}
}
Expand Down
4 changes: 2 additions & 2 deletions packetizer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
func TestPacketizer(t *testing.T) {
multiplepayload := make([]byte, 128)
// use the G722 payloader here, because it's very simple and all 0s is valid G722 data.
packetizer := NewPacketizer(100, 98, 0x1234ABCD, &codecs.G722Payloader{}, NewRandomSequencer(), 90000)
packetizer := NewPacketizer(100, 98, 0x1234ABCD, &codecs.G722Payloader{}, NewRandomSequencer())
packets := packetizer.Packetize(multiplepayload, 2000)

if len(packets) != 2 {
Expand All @@ -26,7 +26,7 @@ func TestPacketizer(t *testing.T) {

func TestPacketizer_AbsSendTime(t *testing.T) {
// use the G722 payloader here, because it's very simple and all 0s is valid G722 data.
pktizer := NewPacketizer(100, 98, 0x1234ABCD, &codecs.G722Payloader{}, NewFixedSequencer(1234), 90000)
pktizer := NewPacketizer(100, 98, 0x1234ABCD, &codecs.G722Payloader{}, NewFixedSequencer(1234))
pktizer.(*packetizer).Timestamp = 45678
pktizer.(*packetizer).timegen = func() time.Time {
return time.Date(1985, time.June, 23, 4, 0, 0, 0, time.FixedZone("UTC-5", -5*60*60))
Expand Down