Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
galene
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
nexedi
galene
Commits
3083b89d
Commit
3083b89d
authored
Oct 01, 2020
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reuse single buffer in RTCP listeners.
parent
0a49dc45
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
6 deletions
+21
-6
rtpconn/rtpconn.go
rtpconn/rtpconn.go
+21
-6
No files found.
rtpconn/rtpconn.go
View file @
3083b89d
...
...
@@ -622,17 +622,24 @@ func sendRecovery(p *rtcp.TransportLayerNack, track *rtpDownTrack) {
}
func
rtcpUpListener
(
conn
*
rtpUpConnection
,
track
*
rtpUpTrack
,
r
*
webrtc
.
RTPReceiver
)
{
buf
:=
make
([]
byte
,
1500
)
for
{
firstSR
:=
false
ps
,
err
:=
r
.
ReadRTCP
(
)
n
,
err
:=
r
.
Read
(
buf
)
if
err
!=
nil
{
if
err
!=
io
.
EOF
{
log
.
Printf
(
"ReadRTCP: %v"
,
err
)
log
.
Printf
(
"Read
RTCP: %v"
,
err
)
}
return
}
ps
,
err
:=
rtcp
.
Unmarshal
(
buf
[
:
n
])
if
err
!=
nil
{
log
.
Printf
(
"Unmarshal RTCP: %v"
,
err
)
continue
}
now
:=
rtptime
.
Jiffies
()
jiffies
:=
rtptime
.
Jiffies
()
for
_
,
p
:=
range
ps
{
local
:=
track
.
getLocal
()
...
...
@@ -642,7 +649,7 @@ func rtcpUpListener(conn *rtpUpConnection, track *rtpUpTrack, r *webrtc.RTPRecei
if
track
.
srTime
==
0
{
firstSR
=
true
}
track
.
srTime
=
now
track
.
srTime
=
jiffies
track
.
srNTPTime
=
p
.
NTPTime
track
.
srRTPTime
=
p
.
RTPTime
track
.
mu
.
Unlock
()
...
...
@@ -904,14 +911,22 @@ func rtcpDownListener(conn *rtpDownConnection, track *rtpDownTrack, s *webrtc.RT
var
gotFir
bool
lastFirSeqno
:=
uint8
(
0
)
buf
:=
make
([]
byte
,
1500
)
for
{
ps
,
err
:=
s
.
ReadRTCP
(
)
n
,
err
:=
s
.
Read
(
buf
)
if
err
!=
nil
{
if
err
!=
io
.
EOF
{
log
.
Printf
(
"ReadRTCP: %v"
,
err
)
log
.
Printf
(
"Read
RTCP: %v"
,
err
)
}
return
}
ps
,
err
:=
rtcp
.
Unmarshal
(
buf
[
:
n
])
if
err
!=
nil
{
log
.
Printf
(
"Unmarshal RTCP: %v"
,
err
)
continue
}
jiffies
:=
rtptime
.
Jiffies
()
for
_
,
p
:=
range
ps
{
...
...
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