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
56226a29
Commit
56226a29
authored
Aug 03, 2021
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Export the max requested rate in track statistics.
parent
200c0dd6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
44 deletions
+48
-44
rtpconn/rtpconn.go
rtpconn/rtpconn.go
+44
-41
rtpconn/rtpstats.go
rtpconn/rtpstats.go
+4
-3
No files found.
rtpconn/rtpconn.go
View file @
56226a29
...
@@ -853,6 +853,49 @@ func rtcpUpListener(track *rtpUpTrack) {
...
@@ -853,6 +853,49 @@ func rtcpUpListener(track *rtpUpTrack) {
}
}
}
}
func
maxUpBitrate
(
t
*
rtpUpTrack
)
uint64
{
minrate
:=
^
uint64
(
0
)
maxrate
:=
uint64
(
group
.
MinBitrate
)
maxsid
:=
0
maxtid
:=
0
local
:=
t
.
getLocal
()
for
_
,
down
:=
range
local
{
r
,
sid
,
tid
:=
down
.
GetMaxBitrate
()
if
maxsid
<
sid
{
maxsid
=
sid
}
if
maxtid
<
tid
{
maxtid
=
tid
}
if
r
<
group
.
MinBitrate
{
r
=
group
.
MinBitrate
}
if
minrate
>
r
{
minrate
=
r
}
if
maxrate
<
r
{
maxrate
=
r
}
}
// assume that lower spatial layers take up 1/5 of
// the throughput
if
maxsid
>
0
{
maxrate
=
maxrate
*
5
/
4
}
// assume that each layer takes two times less
// throughput than the higher one. Then we've
// got enough slack for a factor of 2^(layers-1).
for
i
:=
0
;
i
<
maxtid
;
i
++
{
if
minrate
<
^
uint64
(
0
)
/
2
{
minrate
*=
2
}
}
if
minrate
<
maxrate
{
return
minrate
}
return
maxrate
}
func
sendUpRTCP
(
up
*
rtpUpConnection
)
error
{
func
sendUpRTCP
(
up
*
rtpUpConnection
)
error
{
tracks
:=
up
.
getTracks
()
tracks
:=
up
.
getTracks
()
...
@@ -923,47 +966,7 @@ func sendUpRTCP(up *rtpUpConnection) error {
...
@@ -923,47 +966,7 @@ func sendUpRTCP(up *rtpUpConnection) error {
}
else
if
t
.
Label
()
==
"l"
{
}
else
if
t
.
Label
()
==
"l"
{
rate
+=
group
.
LowBitrate
rate
+=
group
.
LowBitrate
}
else
{
}
else
{
minrate
:=
^
uint64
(
0
)
rate
+=
maxUpBitrate
(
t
)
maxrate
:=
uint64
(
group
.
MinBitrate
)
maxsid
:=
0
maxtid
:=
0
local
:=
t
.
getLocal
()
for
_
,
down
:=
range
local
{
r
,
sid
,
tid
:=
down
.
GetMaxBitrate
()
if
maxsid
<
sid
{
maxsid
=
sid
}
if
maxtid
<
tid
{
maxtid
=
tid
}
if
r
<
group
.
MinBitrate
{
r
=
group
.
MinBitrate
}
if
minrate
>
r
{
minrate
=
r
}
if
maxrate
<
r
{
maxrate
=
r
}
}
// assume that lower spatial layers take up 1/5 of
// the throughput
if
maxsid
>
0
{
maxrate
=
maxrate
*
5
/
4
}
// assume that each layer takes two times less
// throughput than the higher one. Then we've
// got enough slack for a factor of 2^(layers-1).
for
i
:=
0
;
i
<
maxtid
;
i
++
{
if
minrate
<
^
uint64
(
0
)
/
2
{
minrate
*=
2
}
}
if
minrate
<
maxrate
{
rate
+=
minrate
}
else
{
rate
+=
maxrate
}
}
}
}
}
...
...
rtpconn/rtpstats.go
View file @
56226a29
...
@@ -33,6 +33,7 @@ func (c *webClient) GetStats() *stats.Client {
...
@@ -33,6 +33,7 @@ func (c *webClient) GetStats() *stats.Client {
rate
,
_
:=
t
.
rate
.
Estimate
()
rate
,
_
:=
t
.
rate
.
Estimate
()
conns
.
Tracks
=
append
(
conns
.
Tracks
,
stats
.
Track
{
conns
.
Tracks
=
append
(
conns
.
Tracks
,
stats
.
Track
{
Bitrate
:
uint64
(
rate
)
*
8
,
Bitrate
:
uint64
(
rate
)
*
8
,
MaxBitrate
:
maxUpBitrate
(
t
),
Loss
:
loss
,
Loss
:
loss
,
Jitter
:
stats
.
Duration
(
jitter
),
Jitter
:
stats
.
Duration
(
jitter
),
})
})
...
...
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