Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sfu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alain Takoudjou
sfu
Commits
88fbce26
Commit
88fbce26
authored
May 21, 2020
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement sendFIR.
parent
49195ef9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
0 deletions
+38
-0
client.go
client.go
+35
-0
conn.go
conn.go
+2
-0
group.go
group.go
+1
-0
No files found.
client.go
View file @
88fbce26
...
@@ -908,6 +908,41 @@ func sendPLI(pc *webrtc.PeerConnection, ssrc uint32) error {
...
@@ -908,6 +908,41 @@ func sendPLI(pc *webrtc.PeerConnection, ssrc uint32) error {
})
})
}
}
func
(
up
*
upConnection
)
sendFIR
(
track
*
upTrack
,
increment
bool
)
error
{
// we need to reliably increment the seqno, even if we are going
// to drop the packet due to rate limiting.
var
seqno
uint8
if
increment
{
seqno
=
uint8
(
atomic
.
AddUint32
(
&
track
.
firSeqno
,
1
)
&
0xFF
)
}
else
{
seqno
=
uint8
(
atomic
.
LoadUint32
(
&
track
.
firSeqno
)
&
0xFF
)
}
if
!
track
.
hasRtcpFb
(
"ccm"
,
"fir"
)
{
return
ErrUnsupportedFeedback
}
last
:=
atomic
.
LoadUint64
(
&
track
.
lastFIR
)
now
:=
mono
.
Microseconds
()
if
now
>=
last
&&
now
-
last
<
200000
{
return
ErrRateLimited
}
atomic
.
StoreUint64
(
&
track
.
lastFIR
,
now
)
return
sendFIR
(
up
.
pc
,
track
.
track
.
SSRC
(),
seqno
)
}
func
sendFIR
(
pc
*
webrtc
.
PeerConnection
,
ssrc
uint32
,
seqno
uint8
)
error
{
return
pc
.
WriteRTCP
([]
rtcp
.
Packet
{
&
rtcp
.
FullIntraRequest
{
FIR
:
[]
rtcp
.
FIREntry
{
rtcp
.
FIREntry
{
SSRC
:
ssrc
,
SequenceNumber
:
seqno
,
},
},
},
})
}
func
sendREMB
(
pc
*
webrtc
.
PeerConnection
,
ssrc
uint32
,
bitrate
uint64
)
error
{
func
sendREMB
(
pc
*
webrtc
.
PeerConnection
,
ssrc
uint32
,
bitrate
uint64
)
error
{
return
pc
.
WriteRTCP
([]
rtcp
.
Packet
{
return
pc
.
WriteRTCP
([]
rtcp
.
Packet
{
&
rtcp
.
ReceiverEstimatedMaximumBitrate
{
&
rtcp
.
ReceiverEstimatedMaximumBitrate
{
...
...
conn.go
View file @
88fbce26
...
@@ -31,6 +31,8 @@ type upTrack struct {
...
@@ -31,6 +31,8 @@ type upTrack struct {
jitter
*
jitter
.
Estimator
jitter
*
jitter
.
Estimator
maxBitrate
uint64
maxBitrate
uint64
lastPLI
uint64
lastPLI
uint64
lastFIR
uint64
firSeqno
uint32
lastSenderReport
uint32
lastSenderReport
uint32
lastSenderReportTime
uint32
lastSenderReportTime
uint32
...
...
group.go
View file @
88fbce26
...
@@ -112,6 +112,7 @@ func addGroup(name string, desc *groupDescription) (*group, error) {
...
@@ -112,6 +112,7 @@ func addGroup(name string, desc *groupDescription) (*group, error) {
{
"goog-remb"
,
""
},
{
"goog-remb"
,
""
},
{
"nack"
,
""
},
{
"nack"
,
""
},
{
"nack"
,
"pli"
},
{
"nack"
,
"pli"
},
{
"ccm"
,
"fir"
},
},
},
""
,
""
,
))
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment