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
e5dae16d
Commit
e5dae16d
authored
Apr 28, 2020
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rate-limit PLI.
parent
bfeeeb4b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
client.go
client.go
+11
-1
group.go
group.go
+1
-0
No files found.
client.go
View file @
e5dae16d
...
...
@@ -511,7 +511,7 @@ func rtcpListener(g *group, conn *downConnection, track *downTrack, s *webrtc.RT
for
_
,
p
:=
range
ps
{
switch
p
:=
p
.
(
type
)
{
case
*
rtcp
.
PictureLossIndication
:
err
:=
sendPLI
(
conn
.
remote
.
pc
,
p
.
MediaSSRC
)
err
:=
conn
.
remote
.
sendPLI
(
track
.
remote
)
if
err
!=
nil
{
log
.
Printf
(
"sendPLI: %v"
,
err
)
}
...
...
@@ -585,6 +585,16 @@ func updateUpBitrate(up *upConnection) {
}
}
func
(
up
*
upConnection
)
sendPLI
(
track
*
upTrack
)
error
{
last
:=
atomic
.
LoadUint64
(
&
track
.
lastPLI
)
now
:=
msSinceEpoch
()
if
now
>=
last
&&
now
-
last
<
200
{
return
nil
}
atomic
.
StoreUint64
(
&
track
.
lastPLI
,
now
)
return
sendPLI
(
up
.
pc
,
track
.
track
.
SSRC
())
}
func
sendPLI
(
pc
*
webrtc
.
PeerConnection
,
ssrc
uint32
)
error
{
return
pc
.
WriteRTCP
([]
rtcp
.
Packet
{
&
rtcp
.
PictureLossIndication
{
MediaSSRC
:
ssrc
},
...
...
group.go
View file @
e5dae16d
...
...
@@ -24,6 +24,7 @@ type upTrack struct {
track
*
webrtc
.
Track
list
*
packetlist
.
List
maxBitrate
uint64
lastPLI
uint64
mu
sync
.
Mutex
local
[]
*
downTrack
...
...
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